From: Zoltan Varga Date: Sun, 30 Nov 2014 14:11:03 +0000 (+0100) Subject: Merge pull request #1412 from esdrubal/stackframe X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=33861cf32b8df64ed2d01d2581a7982a096485c6;hp=8cdb1c959eb82c79c4068a933f7c0cdd8d2f530c;p=mono.git Merge pull request #1412 from esdrubal/stackframe Release sequence points and Symbolicate tool --- diff --git a/.gitignore b/.gitignore index ea48a9e7fb9..55a955ec624 100644 --- a/.gitignore +++ b/.gitignore @@ -69,6 +69,7 @@ config.status config.sub configure configure.scan +cygconfig.h depcomp install-sh libtool diff --git a/.gitmodules b/.gitmodules index 4dbffc0de07..f81b6c6dc71 100644 --- a/.gitmodules +++ b/.gitmodules @@ -25,3 +25,6 @@ [submodule "external/ikdasm"] path = external/ikdasm url = git://github.com/mono/ikdasm.git +[submodule "external/referencesource"] + path = external/referencesource + url = git://github.com/mono/referencesource diff --git a/README.md b/README.md index b061956eee2..bb5b98a76c7 100644 --- a/README.md +++ b/README.md @@ -1,161 +1,148 @@ Mono is a software platform designed to allow developers to easily create cross platform applications. -Mono is an open source implementation of Microsoft's .NET Framework based on the ECMA standards for C# and the Common Language Runtime. +It is an open source implementation of Microsoft's .NET Framework based on the ECMA standards for C# and the Common Language Runtime. -[![Build Status](http://jenkins.mono-project.com/job/test-mono-mainline/badge/icon/)](http://jenkins.mono-project.com/job/test-mono-mainline/) - -1. [Installation](#compilation-and-installation) +1. [Compilation and Installation](#compilation-and-installation) 2. [Using Mono](#using-mono) 3. [Directory Roadmap](#directory-roadmap) -4. [Contributing to Mono] (#contributing-to-mono) -5. [Git submodules maintenance](#git-submodules-maintenance) -6. [Reporting bugs](#reporting-bugs) +4. [Contributing to Mono](#contributing-to-mono) +5. [Reporting bugs](#reporting-bugs) +6. [Configuration Options](#configuration-options) + +**Build Status** + +| debian-amd64 | debian-i386 | centos-s390x | windows-amd64 | +|:------------:|:-----------:|:------------:|:-------------:| +| [![debian-amd64](http://jenkins.mono-project.com/job/test-mono-mainline/label=debian-amd64/badge/icon)](http://jenkins.mono-project.com/job/test-mono-mainline/label=debian-amd64/) | [![debian-i386](http://jenkins.mono-project.com/job/test-mono-mainline/label=debian-i386/badge/icon)](http://jenkins.mono-project.com/job/test-mono-mainline/label=debian-i386/) | [![centos-s390x](http://jenkins.mono-project.com/job/test-mono-mainline/label=centos-s390x/badge/icon)](http://jenkins.mono-project.com/job/test-mono-mainline/label=centos-s390x/) | [![windows-amd64](https://ci.appveyor.com/api/projects/status/1e61ebdfpbiei58v/branch/master?svg=true)](https://ci.appveyor.com/project/ajlennon/mono-817/branch/master) | Compilation and Installation ============================ -a. Build Requirements +Building the Software --------------------- -* On Itanium, you must obtain libunwind: http://www.hpl.hp.com/research/linux/libunwind/download.php4 - -* On Solaris - - 1. Make sure that you used GNU tar to unpack this package, as - Solaris tar will not unpack this correctly, and you will get strange errors. +Please see our guides for building Mono on +[Mac OS X](http://www.mono-project.com/docs/compiling-mono/mac/), +[Linux](http://www.mono-project.com/docs/compiling-mono/linux/) and +[Windows](http://www.mono-project.com/docs/compiling-mono/windows/). - 2. Make sure that you use the GNU toolchain to build the software. +Note that building from Git assumes that you already have Mono installed, +so please download and [install the latest Mono release](http://www.mono-project.com/download/) +before trying to build from Git. This is required because the Mono build +relies on a working Mono C# compiler to compile itself +(also known as [bootstrapping](http://en.wikipedia.org/wiki/Bootstrapping_(compilers))). - 3. Optional dependencies +If you don't have a working Mono installation +--------------------------------------------- - * libgdiplus - Required for System.Drawing. This library in turn requires glib and pkg-config +If you don't have a working Mono installation, you can try a slightly +more risky approach: getting the latest version of the 'monolite' distribution, +which contains just enough to run the 'mcs' compiler. You do this with: - * pkg-config - Available at: http://www.freedesktop.org/Software/pkgconfig + # Run the following line after ./autogen.sh + make get-monolite-latest - * glib 2.4 - Available at: http://www.gtk.org/ +This will download and place the files appropriately so that you can then +just run: - * libzlib - This library and the development headers are required for compression -file support in the 2.0 profile. + make EXTERNAL_MCS=${PWD}/mcs/class/lib/monolite/basic.exe - 4. Mono is required to build Mono. Use a system package or monolite (explained further below) - - 5. If you have a system Mono (not monolite), you will need to read this: http://mono-project.com/Parallel_Mono_Environments#Setting_up_a_Build_Environment +The build will then use the files downloaded by `make get-monolite-latest`. -b. Building the Software +Testing and Installation ------------------------ -If you obtained this package as an officially released tarball, -this is very simple, use configure and make: +You can run the mono and mcs test suites with the command: `make check`. -`./configure --prefix=/usr/local ; make ; make install` +Expect to find a few test suite failures. As a sanity check, you +can compare the failures you got with [https://wrench.mono-project.com/Wrench/](https://wrench.mono-project.com/Wrench/) +and [http://jenkins.mono-project.com/](http://jenkins.mono-project.com/). -Mono supports a JIT engine on x86, SPARC, SPARCv9, S/390, -S/390x, AMD64, ARM and PowerPC systems. +You can now install mono with: `make install` -If you obtained this as a snapshot, you will need an existing -Mono installation. To upgrade your installation, unpack both -mono and mcs: +You can verify your installation by using the mono-test-install +script, it can diagnose some common problems with Mono's install. +Failure to follow these steps may result in a broken installation. - tar xzf mcs-XXXX.tar.gz - tar xzf mono-XXXX.tar.gz - mv mono-XXX mono - mv mcs-XXX mcs - cd mono - ./autogen.sh --prefix=/usr/local - make +Using Mono +========== -The Mono build system is silent for most compilation commands. -To enable a more verbose compile (for example, to pinpoint -problems in your makefiles or your system) pass the V=1 flag to make, like this: +Once you have installed the software, you can run a few programs: -` make V=1` +* `mono program.exe` runtime engine +* `mcs program.cs` C# compiler -c. Building the software from GIT ---------------------------------- +* `monodis program.exe` CIL Disassembler -If you are building the software from GIT, make sure that you -have up-to-date mcs and mono sources: +See the man pages for mono(1), mcs(1) and monodis(1) for further details. - * If you are an anonymous user: `git clone git://github.com/mono/mono.git` +Directory Roadmap +================= - * If you are a Mono contributor with read/write privileges: `git clone git@github.com:mono/mono.git` +* `data/` - Configuration files installed as part of the Mono runtime. -Then, go into the mono directory, and configure: +* `docs/` - Technical documents about the Mono runtime. - cd mono - ./autogen.sh --prefix=/usr/local - make +* `external/` - Git submodules for external libraries (Newtonsoft.Json, ikvm, etc). -For people with non-standard installations of the auto* utils and of -pkg-config (common on misconfigured OSX and windows boxes), you could get -an error like this: +* `man/` - Manual pages for the various Mono commands and programs. - ./configure: line 19176: syntax error near unexpected token 'PKG_CHECK_MODULES(BASE_DEPENDENCIES,' ... +* `mcs/` - The class libraries, compiler and tools -This means that you need to set the ACLOCAL_FLAGS environment variable -when invoking autogen.sh, like this: + * `class/` - The class libraries (like System.*, Microsoft.Build, etc.) - ACLOCAL_FLAGS="-I $acprefix/share/aclocal" ./autogen.sh --prefix=/usr/local + * `mcs/` - The Mono C# compiler written in C# -where $acprefix is the prefix where aclocal has been installed. -This will automatically go into the mcs/ tree and build the -binaries there. + * `tools/` - Tools like gacutil, ikdasm, mdoc, etc. -This assumes that you have a working mono installation, and that -there's a C# compiler named 'mcs', and a corresponding IL -runtime called 'mono'. You can use two make variables -EXTERNAL_MCS and EXTERNAL_RUNTIME to override these. e.g., you -can say: +* `mono/` - The core of the Mono Runtime. - make EXTERNAL_MCS=/foo/bar/mcs EXTERNAL_RUNTIME=/somewhere/else/mono + * `arch/` - Architecture specific portions. -If you don't have a working Mono installation ---------------------------------------------- + * `cil/` - Common Intermediate Representation, XML +definition of the CIL bytecodes. -If you don't have a working Mono installation, an obvious choice -is to install the latest released packages of 'mono' for your -distribution and running `autogen.sh; make; make install` in the -mono module directory. + * `dis/` - CIL executable Disassembler -You can also try a slightly more risky approach: this may not work, -so start from the released tarball as detailed above. + * `io-layer/` - The I/O layer and system abstraction for +emulating the .NET IO model. -This works by first getting the latest version of the 'monolite' -distribution, which contains just enough to run the 'mcs' -compiler. You do this with: + * `metadata/` - The object system and metadata reader. - # Run the following line after ./autogen.sh - make get-monolite-latest + * `mini/` - The Just in Time Compiler. -This will download and automatically gunzip and untar the -tarball, and place the files appropriately so that you can then -just run: `make EXTERNAL_MCS=${PWD}/mcs/class/lib/monolite/gmcs.exe` +* `runtime/` - A directory that contains the Makefiles that link the +mono/ and mcs/ build systems. -That will use the files downloaded by 'make get-monolite-latest. +* `samples/` -Some simple sample programs on uses of the Mono +runtime as an embedded library. -Testing and Installation ------------------------- +* `scripts/` - Scripts used to invoke Mono and the corresponding program. -You can run *(part of)* the mono and mcs test suites with the command: `make check`. -All tests should pass. +* `../olive/` - Incubation code from [Olive](https://github.com/mono/olive). -If you want more *extensive* tests, including those that test the -class libraries, you need to re-run 'configure' with the -'--enable-nunit-tests' flag, and try: `make -k check` + * If the directory ../olive is present (as an +independent checkout) from the Mono module, that +directory is automatically configured to share the +same prefix than this module gets. -Expect to find a few test suite failures. As a sanity check, you -can compare the failures you got with +Contributing to Mono +==================== - https://wrench.mono-project.com/Wrench/ +Before submitting changes to Mono, please review the [contribution guidelines](http://www.mono-project.com/community/contributing/). +Please pay particular attention to the [Important Rules](http://www.mono-project.com/community/contributing/#important-rules) section. -You can now install mono with: `make install` +Reporting bugs +============== -You can verify your installation by using the mono-test-install -script, it can diagnose some common problems with Mono's install. -Failure to follow these steps may result in a broken installation. +To submit bug reports, please use [Xamarin's Bugzilla](https://bugzilla.xamarin.com/) -d. Configuration Options ------------------------- +Please use the search facility to ensure the same bug hasn't already +been submitted and follow our [guidelines](http://www.mono-project.com/community/bugs/make-a-good-bug-report/) +on how to make a good bug report. + +Configuration Options +===================== The following are the configuration options that someone building Mono might want to use: @@ -164,17 +151,16 @@ building Mono might want to use: compilation of a Mono runtime with the SGen garbage collector. * On platforms that support it, after building Mono, you will have -both a mono binary and a mono-sgen binary. Mono uses Boehm, while -mono-sgen uses the Simple Generational GC. +both a `mono` binary and a `mono-sgen` binary. `mono` uses Boehm, while +`mono-sgen` uses the Simple Generational GC. -* `--with-gc=[boehm, included, sgen, none]` - Selects the default Boehm garbage +* `--with-gc=[included, boehm, none]` - Selects the default Boehm garbage collector engine to use. * *included*: (*slighty modified Boehm GC*) -This is the default value, and its -the most feature complete, it will allow Mono -to use typed allocations and support the -debugger. +This is the default value for the Boehm GC, and it's +the most feature complete, it will allow Mono +to use typed allocations and support the debugger. * *boehm*: This is used to use a system-install Boehm GC, @@ -267,30 +253,6 @@ and runtime. * This defaults to `yes`. -* `--with-moonlight=yes,no` - - * Whether you want to generate the Silverlight/Moonlight -libraries and toolchain in addition to the default -(1.1 and 2.0 APIs). - - * This will produce the `smcs` compiler which will reference -the Silverlight modified assemblies (mscorlib.dll, -System.dll, System.Code.dll and System.Xml.Core.dll) and turn -on the LINQ extensions for the compiler. - -* `--with-moon-gc=boehm,sgen` - Select the GC to use for Moonlight. - - * *boehm*: -Selects the Boehm Garbage Collector, with the same flags -as the regular Mono build. This is the default. - - * *sgen*: -Selects the new SGen Garbage Collector, which provides -Generational GC support, using the same flags as the -mono-sgen build. - - * This defaults to `boehm`. - * `--with-libgdiplus=installed,sibling,` - Configure where Mono searches for libgdiplus when running System.Drawing tests. @@ -298,7 +260,7 @@ searches for libgdiplus when running System.Drawing tests. library is available to Mono through the regular system setup. - * `sibling' can be used to specify that a libgdiplus + * `sibling` can be used to specify that a libgdiplus that resides as a sibling of this directory (mono) should be used. @@ -405,13 +367,13 @@ for Mono. The LLVM code generator and optimizer will be used instead of Mono's built-in code generator for both Just in Time and Ahead of Time compilations. - * See the http://www.mono-project.com/Mono_LLVM for the + * See http://www.mono-project.com/docs/advanced/mono-llvm/ for the full details and up-to-date information on this feature. * You will need to have an LLVM built that Mono can link against. - * The --enable-loadedllvm variant will make the LLVM backend + * The `--enable-loadedllvm` variant will make the LLVM backend into a runtime-loadable module instead of linking it directly into the main mono binary. @@ -445,7 +407,6 @@ not done much testing with Mono. runtime that contains DTrace probes and can participate in the system profiling using DTrace. - * `--disable-dev-random` * Mono uses /dev/random to obtain good random data for @@ -464,85 +425,3 @@ http://code.google.com/p/nativeclient/ * Currently this is used with Mono's AOT engine as Native Client does not support JIT engines yet. - -Using Mono -========== - -Once you have installed the software, you can run a few programs: - -* `mono program.exe` runtime engine - -* `mcs program.cs` C# compiler - -* `monodis program.exe` CIL Disassembler - -See the man pages for mono(1), mint(1), monodis(1) and mcs(2) -for further details. - -Directory Roadmap -================= - -* `docs/` - Technical documents about the Mono runtime. - -* `data/` - Configuration files installed as part of the Mono runtime. - -* `mono/` - The core of the Mono Runtime. - - * `metadata/` - The object system and metadata reader. - - * `mini/` - The Just in Time Compiler. - - * `dis/` - CIL executable Disassembler - - * `io-layer/` - The I/O layer and system abstraction for -emulating the .NET IO model. - - * `cil/` - Common Intermediate Representation, XML -definition of the CIL bytecodes. - - * `arch/` - Architecture specific portions. - -* `man/` - Manual pages for the various Mono commands and programs. - -* `samples/` -Some simple sample programs on uses of the Mono -runtime as an embedded library. - -* `scripts/` - Scripts used to invoke Mono and the corresponding program. - -* `runtime/` - A directory that contains the Makefiles that link the -mono/ and mcs/ build systems. - -* `../olive/` - - * If the directory ../olive is present (as an -independent checkout) from the Mono module, that -directory is automatically configured to share the -same prefix than this module gets. - -Contributing to Mono -==================== -Before submitting changes to Mono, please review the contribution guidelines at http://mono-project.com/Contributing. Please pay particular attention to the [Important Rules](http://mono-project.com/Contributing#Important_Rules) section. - - -Git submodules maintenance -========================== - -Read documentation at http://mono-project.com/Git_Submodule_Maintenance - -Maintainer -========== - -Mono is maintained by miguel@xamarin.com - -Reporting bugs -============== - -To submit bug reports, please use Xamarin's Bugzilla: - -https://bugzilla.xamarin.com/ - -Please use the search facility to ensure the same bug hasn't already -been submitted and follow our guidelines on how to make a good bug -report: - -http://mono-project.com/Bugs#How_to_make_a_good_bug_report diff --git a/configure.ac b/configure.ac index 2bc3c0d08f5..2e3078be9a4 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ # Process this file with autoconf to produce a configure script. #AC_PREREQ([2.62]) -AC_INIT(mono, [3.12.1], +AC_INIT(mono, [3.99.0], [http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono]) AC_CONFIG_SRCDIR([README.md]) @@ -2299,9 +2299,6 @@ fi AC_ARG_ENABLE(bcl-opt, [ --disable-bcl-opt BCL is compiled with no optimizations (allows accurate BCL debugging)], test_bcl_opt=$enableval, test_bcl_opt=yes) -AC_ARG_ENABLE(nunit-tests, [ --enable-nunit-tests Run the nunit tests of the class library on 'make check']) -AM_CONDITIONAL(ENABLE_NUNIT_TESTS, [test x$enable_nunit_tests = xyes]) - AC_MSG_CHECKING([if big-arrays are to be enabled]) AC_ARG_ENABLE(big-arrays, [ --enable-big-arrays Enable the allocation and indexing of arrays greater than Int32.MaxValue], enable_big_arrays=$enableval, enable_big_arrays=no) if test "x$enable_big_arrays" = "xyes" ; then @@ -2799,7 +2796,18 @@ if test "x$host" != "x$target"; then # in mono-compiler.h with_tls=pthread target_mach=no - ;; + ;; + aarch64*-linux-*) + TARGET=ARM64; + arch_target=arm64; + AC_DEFINE(TARGET_ARM64, 1, [...]) + AC_DEFINE(TARGET_ANDROID, 1, [...]) + CPPFLAGS="$CPPFLAGS" + # Can't use tls, since it depends on the runtime detection of tls offsets + # in mono-compiler.h + with_tls=pthread + target_mach=no + ;; aarch64-*) TARGET=ARM64 ;; @@ -3199,7 +3207,7 @@ case "x$libgc" in ;; esac -AC_ARG_WITH(profile2, [ --with-profile2=yes,no If you want to install the 2.0/3.5 FX (defaults to yes)], [], [with_profile2=yes]) +AC_ARG_WITH(profile2, [ --with-profile2=yes,no If you want to install the 2.0/3.5 FX (defaults to yes)], [], [with_profile2=no]) AC_ARG_WITH(profile4, [ --with-profile4=yes,no If you want to install the 4.0 FX (defaults to yes)], [], [with_profile4=yes]) AC_ARG_WITH(profile4_5,[ --with-profile4_5=yes,no If you want to install the 4.5 FX (defaults to yes)], [], [with_profile4_5=yes]) AC_ARG_WITH(monodroid, [ --with-monodroid=yes,no If you want to build the MonoDroid assemblies (defaults to no)], [], [with_monodroid=no]) @@ -3275,7 +3283,6 @@ dnl Consistency settings dnl if test x$cross_compiling = xyes -o x$enable_mcs_build = xno; then DISABLE_MCS_DOCS=yes - with_profile2=no with_profile4=no with_profile4_5=no with_monodroid=no @@ -3299,7 +3306,6 @@ AC_SUBST(OPROFILE_LIBS) libmono_ldflags="$libmono_ldflags $LIBS" -AM_CONDITIONAL(INSTALL_2_0, [test "x$with_profile2" = xyes]) AM_CONDITIONAL(INSTALL_4_0, [test "x$with_profile4" = xyes]) AM_CONDITIONAL(INSTALL_4_5, [test "x$with_profile4_5" = xyes]) AM_CONDITIONAL(INSTALL_MONODROID, [test "x$with_monodroid" != "xno"]) @@ -3744,7 +3750,6 @@ echo " LLVM Back End: $enable_llvm (dynamically loaded: $enable_loadedllvm) Libraries: - .NET 2.0/3.5: $with_profile2 .NET 4.0: $with_profile4 .NET 4.5: $with_profile4_5 MonoDroid: $with_monodroid diff --git a/eglib/configure.ac b/eglib/configure.ac index 1ff6c42ff28..5281419c00b 100644 --- a/eglib/configure.ac +++ b/eglib/configure.ac @@ -135,6 +135,7 @@ AC_CHECK_SIZEOF(void *) AC_CHECK_SIZEOF(long) AC_CHECK_SIZEOF(long long) AC_CHECK_FUNCS(strlcpy stpcpy strtok_r rewinddir vasprintf) +AC_CHECK_FUNCS(getrlimit) # # Mono currently supports 10.6, but strndup is not available prior to 10.7; avoiding @@ -179,7 +180,7 @@ if test "x$have_iso_varargs" = "xyes"; then fi AC_SUBST(G_HAVE_ISO_VARARGS) -AC_CHECK_HEADERS(getopt.h sys/select.h sys/time.h sys/wait.h pwd.h langinfo.h iconv.h localcharset.h sys/types.h) +AC_CHECK_HEADERS(getopt.h sys/select.h sys/time.h sys/wait.h pwd.h langinfo.h iconv.h localcharset.h sys/types.h sys/resource.h) AC_CHECK_HEADER(alloca.h, [HAVE_ALLOCA_H=1], [HAVE_ALLOCA_H=0]) AC_SUBST(HAVE_ALLOCA_H) diff --git a/eglib/src/glib.h b/eglib/src/glib.h index 533c84116c3..d23e32a534c 100644 --- a/eglib/src/glib.h +++ b/eglib/src/glib.h @@ -176,7 +176,6 @@ typedef struct _GMemChunk GMemChunk; /* * Misc. */ -#define g_atexit(func) ((void) atexit (func)) const gchar * g_getenv(const gchar *variable); gboolean g_setenv(const gchar *variable, const gchar *value, gboolean overwrite); diff --git a/eglib/src/gspawn.c b/eglib/src/gspawn.c index 836e6f2aa9c..449a724be9d 100644 --- a/eglib/src/gspawn.c +++ b/eglib/src/gspawn.c @@ -53,6 +53,10 @@ #include #endif +#ifdef HAVE_SYS_RESOURCE_H +# include +#endif + #ifdef G_OS_WIN32 #include #include @@ -213,6 +217,23 @@ write_all (int fd, const void *vbuf, size_t n) return nwritten; } +#ifndef G_OS_WIN32 +static int +g_getdtablesize (void) +{ +#ifdef HAVE_GETRLIMIT + struct rlimit limit; + int res; + + res = getrlimit (RLIMIT_NOFILE, &limit); + g_assert (res == 0); + return limit.rlim_cur; +#else + return getdtablesize (); +#endif +} +#endif + gboolean g_spawn_command_line_sync (const gchar *command_line, gchar **standard_output, @@ -256,7 +277,7 @@ g_spawn_command_line_sync (const gchar *command_line, close (stderr_pipe [0]); dup2 (stderr_pipe [1], STDERR_FILENO); } - for (i = getdtablesize () - 1; i >= 3; i--) + for (i = g_getdtablesize () - 1; i >= 3; i--) close (i); /* G_SPAWN_SEARCH_PATH is always enabled for g_spawn_command_line_sync */ @@ -417,7 +438,7 @@ g_spawn_async_with_pipes (const gchar *working_directory, } if ((flags & G_SPAWN_LEAVE_DESCRIPTORS_OPEN) != 0) { - for (i = getdtablesize () - 1; i >= 3; i--) + for (i = g_getdtablesize () - 1; i >= 3; i--) close (i); } diff --git a/eglib/winconfig.h b/eglib/winconfig.h index fdab3ddae63..04e8d4075ce 100755 --- a/eglib/winconfig.h +++ b/eglib/winconfig.h @@ -1,6 +1,10 @@ /* config.h. Generated by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ +#ifndef _MSC_VER +#include "cygconfig.h" +#else + /* Define to 1 if you have the header file. */ #define HAVE_DLFCN_H 1 @@ -74,3 +78,4 @@ #define VERSION "0.1" #define HAVE_STRTOK_R 1 +#endif diff --git a/external/referencesource b/external/referencesource new file mode 160000 index 00000000000..b5edab1e7af --- /dev/null +++ b/external/referencesource @@ -0,0 +1 @@ +Subproject commit b5edab1e7af2a54758bc184899d2ca24a7954cee diff --git a/mcs/Makefile b/mcs/Makefile index 49423b4a15f..4f8d588c34c 100644 --- a/mcs/Makefile +++ b/mcs/Makefile @@ -6,14 +6,12 @@ SUBDIRS := build jay mcs class nunit24 ilasm tools tests errors docs basic_SUBDIRS := build jay mcs class build_SUBDIRS := build class mcs class/aot-compiler tools -net_2_0_SUBDIRS := build class nunit24 ilasm tools tests errors docs monodroid_SUBDIRS := build class monotouch_SUBDIRS := build class monotouch_runtime_SUBDIRS := build class xammac_SUBDIRS := build class mobile_SUBDIRS := build class mobile_static_SUBDIRS := build class -net_3_5_SUBDIRS := build class tools/xbuild net_4_0_SUBDIRS := build class net_4_5_SUBDIRS := build mcs class nunit24 ilasm tools tests errors docs xbuild_12_SUBDIRS := build class tools/xbuild @@ -88,7 +86,7 @@ dir-check: # fun specialty targets -PROFILES = net_2_0 net_3_5 net_4_0 net_4_5 xbuild_12 xbuild_14 +PROFILES = net_3_5 net_4_0 net_4_5 xbuild_12 xbuild_14 .PHONY: all-profiles $(STD_TARGETS:=-profiles) all-profiles $(STD_TARGETS:=-profiles): %-profiles: profiles-do--% @@ -111,14 +109,12 @@ $(_boot_:%=profile-do--xbuild_14--%): profile-do--xbuild_14--%: $(_boot_:%=profile-do--xbuild_12--%): profile-do--xbuild_12--%: profile-do--net_4_5--% $(_boot_:%=profile-do--net_4_5--%): profile-do--net_4_5--%: profile-do--build--% $(_boot_:%=profile-do--net_4_0--%): profile-do--net_4_0--%: profile-do--build--% -$(_boot_:%=profile-do--net_3_5--%): profile-do--net_3_5--%: profile-do--net_2_0--% $(_boot_:%=profile-do--monodroid--%): profile-do--monodroid--%: profile-do--build--% $(_boot_:%=profile-do--monotouch--%): profile-do--monotouch--%: profile-do--build--% $(_boot_:%=profile-do--monotouch_runtime--%): profile-do--monotouch_runtime--%: profile-do--build--% $(_boot_:%=profile-do--xammac--%): profile-do--xammac--%: profile-do--build--% $(_boot_:%=profile-do--mobile--%): profile-do--mobile--%: profile-do--build--% $(_boot_:%=profile-do--mobile_static--%): profile-do--mobile_static--%: profile-do--build--% -$(_boot_:%=profile-do--net_2_0--%): profile-do--net_2_0--%: profile-do--build--% $(_boot_:%=profile-do--build--%): profile-do--build--%: profile-do--basic--% testcorlib: diff --git a/mcs/build/Makefile b/mcs/build/Makefile index 34d857a65f5..fbb173f8625 100644 --- a/mcs/build/Makefile +++ b/mcs/build/Makefile @@ -18,8 +18,6 @@ PLATFORMS = darwin linux win32 PROFILES = \ basic \ build \ - net_2_0 \ - net_3_5 \ net_4_0 \ net_4_5 \ xbuild_12 \ @@ -29,7 +27,8 @@ COMMON_SRCS = \ Consts.cs.in \ Locale.cs \ MonoTODOAttribute.cs \ - basic-profile-check.cs + basic-profile-check.cs \ + SR.cs DISTFILES = \ README.makefiles \ diff --git a/mcs/build/common/SR.cs b/mcs/build/common/SR.cs new file mode 100644 index 00000000000..18c58b3cf1a --- /dev/null +++ b/mcs/build/common/SR.cs @@ -0,0 +1,38 @@ +using System.Globalization; + +internal sealed class AssemblyRef +{ + // FIXME + internal const string SystemConfiguration = "System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, ProcessorArchitecture=MSIL"; + internal const string System = "System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, ProcessorArchitecture=MSIL"; + internal const string SystemWeb = "System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"; +} + +static partial class SR +{ + internal static string GetString(string name, params object[] args) + { + return GetString (CultureInfo.InvariantCulture, name, args); + } + + internal static string GetString(CultureInfo culture, string name, params object[] args) + { + return string.Format (culture, name, args); + } + + internal static string GetString(string name) + { + return name; + } + + internal static string GetString(CultureInfo culture, string name) + { + return name; + } +} + +namespace System.Runtime.CompilerServices +{ + class FriendAccessAllowed : Attribute + { } +} diff --git a/mcs/build/profiles/basic.make b/mcs/build/profiles/basic.make index 12f6c82cff2..9fa24ccb47b 100644 --- a/mcs/build/profiles/basic.make +++ b/mcs/build/profiles/basic.make @@ -18,7 +18,7 @@ endif MCS = $(with_mono_path) $(INTERNAL_GMCS) -PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:BOOTSTRAP_BASIC -nowarn:1699 +PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:BOOTSTRAP_BASIC -nowarn:1699 -d:MONO -d:DISABLE_CAS_USE NO_SIGN_ASSEMBLY = yes NO_TEST = yes NO_INSTALL = yes diff --git a/mcs/build/profiles/build.make b/mcs/build/profiles/build.make index b09a441a03f..850d17e8a8f 100644 --- a/mcs/build/profiles/build.make +++ b/mcs/build/profiles/build.make @@ -13,7 +13,7 @@ profile-check: @: DEFAULT_REFERENCES = -r:mscorlib.dll -PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_3_0 -d:NET_3_5 -d:NET_4_0 -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) +PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_3_0 -d:NET_3_5 -d:NET_4_0 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) NO_SIGN_ASSEMBLY = yes NO_TEST = yes diff --git a/mcs/build/profiles/mobile.make b/mcs/build/profiles/mobile.make index 117ac605151..75611d8cda4 100644 --- a/mcs/build/profiles/mobile.make +++ b/mcs/build/profiles/mobile.make @@ -22,6 +22,8 @@ PROFILE_MCS_FLAGS = \ -d:NET_3_5 \ -d:NET_4_0 \ -d:NET_4_5 \ + -d:MONO \ + -d:DISABLE_CAS_USE \ -nowarn:1699 \ -nostdlib \ -lib:$(topdir)/class/lib/$(PROFILE) \ diff --git a/mcs/build/profiles/mobile_static.make b/mcs/build/profiles/mobile_static.make index b7898235194..2fef29aa96f 100644 --- a/mcs/build/profiles/mobile_static.make +++ b/mcs/build/profiles/mobile_static.make @@ -20,6 +20,8 @@ PROFILE_MCS_FLAGS = \ -d:NET_3_5 \ -d:NET_4_0 \ -d:NET_4_5 \ + -d:MONO \ + -d:DISABLE_CAS_USE \ -d:MOBILE \ -d:FULL_AOT_RUNTIME \ -d:DISABLE_REMOTING \ diff --git a/mcs/build/profiles/monodroid.make b/mcs/build/profiles/monodroid.make index c14f61c6087..28698ca63d6 100644 --- a/mcs/build/profiles/monodroid.make +++ b/mcs/build/profiles/monodroid.make @@ -20,6 +20,8 @@ PROFILE_MCS_FLAGS = \ -d:NET_3_5 \ -d:NET_4_0 \ -d:NET_4_5 \ + -d:MONO \ + -d:DISABLE_CAS_USE \ -d:MOBILE \ -d:MOBILE_DYNAMIC \ -d:MONODROID \ diff --git a/mcs/build/profiles/monotouch.make b/mcs/build/profiles/monotouch.make index 706463d748c..c60d9398ffa 100644 --- a/mcs/build/profiles/monotouch.make +++ b/mcs/build/profiles/monotouch.make @@ -21,6 +21,8 @@ PROFILE_MCS_FLAGS = \ -d:NET_4_0 \ -d:NET_4_5 \ -d:MOBILE \ + -d:MONO \ + -d:DISABLE_CAS_USE \ -d:MONOTOUCH \ -d:DISABLE_REMOTING \ -d:DISABLE_COM \ diff --git a/mcs/build/profiles/monotouch_runtime.make b/mcs/build/profiles/monotouch_runtime.make index f438e805f0d..59c7df4c31c 100644 --- a/mcs/build/profiles/monotouch_runtime.make +++ b/mcs/build/profiles/monotouch_runtime.make @@ -14,7 +14,7 @@ profile-check: @: DEFAULT_REFERENCES = -r:mscorlib.dll -PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE -d:MONOTOUCH -D:DISABLE_REMOTING -d:DISABLE_COM -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS) +PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:DISABLE_CAS_USE -d:MOBILE -d:MONOTOUCH -D:DISABLE_REMOTING -d:DISABLE_COM -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS) FRAMEWORK_VERSION = 2.1 diff --git a/mcs/build/profiles/net_2_0.make b/mcs/build/profiles/net_2_0.make deleted file mode 100644 index e3be2c83438..00000000000 --- a/mcs/build/profiles/net_2_0.make +++ /dev/null @@ -1,16 +0,0 @@ -# -*- makefile -*- - -BOOTSTRAP_PROFILE = build -BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS) -MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS) - -# nuttzing! - -profile-check: - @: - -DEFAULT_REFERENCES = -r:mscorlib.dll -PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS) - -FRAMEWORK_VERSION = 2.0 -XBUILD_VERSION = 2.0 diff --git a/mcs/build/profiles/net_3_5.make b/mcs/build/profiles/net_3_5.make deleted file mode 100644 index 97176892a4a..00000000000 --- a/mcs/build/profiles/net_3_5.make +++ /dev/null @@ -1,20 +0,0 @@ -# -*- makefile -*- - -BOOTSTRAP_PROFILE = build - -MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS) - -# nuttzing! - -profile-check: - @: - -DEFAULT_REFERENCES = -r:mscorlib.dll -PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_3_5 -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) -lib:$(topdir)/class/lib/net_2_0 $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS) - -FRAMEWORK_VERSION = 3.5 -XBUILD_VERSION = 3.5 - -TEST_HARNESS = $(topdir)/class/lib/net_2_0/nunit-console.exe -TEST_MONO_PATH = $(topdir)/class/lib/net_2_0 - diff --git a/mcs/build/profiles/net_4_0.make b/mcs/build/profiles/net_4_0.make index 99782bd526a..7081318194a 100644 --- a/mcs/build/profiles/net_4_0.make +++ b/mcs/build/profiles/net_4_0.make @@ -11,7 +11,7 @@ profile-check: @: DEFAULT_REFERENCES = -r:mscorlib.dll -PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_3_0 -d:NET_3_5 -d:NET_4_0 -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) +PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_3_0 -d:NET_3_5 -d:NET_4_0 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) FRAMEWORK_VERSION = 4.0 XBUILD_VERSION = 4.0 diff --git a/mcs/build/profiles/net_4_5.make b/mcs/build/profiles/net_4_5.make index ad921e705ea..7c37b2c89d6 100644 --- a/mcs/build/profiles/net_4_5.make +++ b/mcs/build/profiles/net_4_5.make @@ -11,7 +11,7 @@ profile-check: @: DEFAULT_REFERENCES = -r:mscorlib.dll -PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_3_0 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS) +PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_3_0 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MONO -d:DISABLE_CAS_USE -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS) FRAMEWORK_VERSION = 4.5 XBUILD_VERSION = 4.0 diff --git a/mcs/build/profiles/xammac.make b/mcs/build/profiles/xammac.make index d463a0fe943..3a91b7620e2 100644 --- a/mcs/build/profiles/xammac.make +++ b/mcs/build/profiles/xammac.make @@ -18,6 +18,8 @@ PROFILE_MCS_FLAGS = \ -d:NET_3_5 \ -d:NET_4_0 \ -d:NET_4_5 \ + -d:MONO \ + -d:DISABLE_CAS_USE \ -d:MOBILE \ -d:MOBILE_DYNAMIC \ -d:XAMMAC \ diff --git a/mcs/build/profiles/xbuild_12.make b/mcs/build/profiles/xbuild_12.make index d3aff7e92e6..4e0f9940dfe 100644 --- a/mcs/build/profiles/xbuild_12.make +++ b/mcs/build/profiles/xbuild_12.make @@ -2,6 +2,6 @@ include $(topdir)/build/profiles/net_4_5.make -PROFILE_MCS_FLAGS := $(PROFILE_MCS_FLAGS) -d:XBUILD_12 -lib:$(topdir)/class/lib/net_4_5 +PROFILE_MCS_FLAGS := $(PROFILE_MCS_FLAGS) -d:XBUILD_12 -d:MONO -d:DISABLE_CAS_USE -lib:$(topdir)/class/lib/net_4_5 XBUILD_VERSION = 12.0 diff --git a/mcs/build/profiles/xbuild_14.make b/mcs/build/profiles/xbuild_14.make index cc55a1ded3b..eeff4082678 100644 --- a/mcs/build/profiles/xbuild_14.make +++ b/mcs/build/profiles/xbuild_14.make @@ -2,6 +2,6 @@ include $(topdir)/build/profiles/net_4_5.make -PROFILE_MCS_FLAGS := $(PROFILE_MCS_FLAGS) -d:XBUILD_12 -d:XBUILD_14 -lib:$(topdir)/class/lib/net_4_5 +PROFILE_MCS_FLAGS := $(PROFILE_MCS_FLAGS) -d:XBUILD_12 -d:XBUILD_14 -d:MONO -d:DISABLE_CAS_USE -lib:$(topdir)/class/lib/net_4_5 XBUILD_VERSION = 14.0 diff --git a/mcs/class/Accessibility/Accessibility-net_2_0.csproj b/mcs/class/Accessibility/Accessibility-net_2_0.csproj deleted file mode 100644 index af67d345b4f..00000000000 --- a/mcs/class/Accessibility/Accessibility-net_2_0.csproj +++ /dev/null @@ -1,79 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {43A23ADA-35D9-4A48-BCE5-C21C081C6676} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Accessibility - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - - - - - diff --git a/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng-net_2_0.csproj b/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng-net_2_0.csproj deleted file mode 100644 index 7c109325edf..00000000000 --- a/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng-net_2_0.csproj +++ /dev/null @@ -1,128 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2B2412A6-4397-4DA7-94A6-D1AFEBCFA563} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Commons.Xml.Relaxng - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - - relaxng.rng - - - - diff --git a/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng-tests-net_2_0.csproj b/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng-tests-net_2_0.csproj deleted file mode 100644 index 726cbf61cac..00000000000 --- a/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng-tests-net_2_0.csproj +++ /dev/null @@ -1,101 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {0CCD9F77-53C4-4E1A-92C5-0A237C034C00} - Library - 1699,618,219,169 - bin\Debug\Commons.Xml.Relaxng-tests-net_2_0 - True - False - - Properties - - - Commons.Xml.Relaxng_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618,219,169 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {2B2412A6-4397-4DA7-94A6-D1AFEBCFA563} - Commons.Xml.Relaxng\Commons.Xml.Relaxng-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - - relaxng.rng - - - - diff --git a/mcs/class/Compat.ICSharpCode.SharpZipLib/Compat.ICSharpCode.SharpZipLib-net_2_0.csproj b/mcs/class/Compat.ICSharpCode.SharpZipLib/Compat.ICSharpCode.SharpZipLib-net_2_0.csproj deleted file mode 100644 index 14e8e98dde1..00000000000 --- a/mcs/class/Compat.ICSharpCode.SharpZipLib/Compat.ICSharpCode.SharpZipLib-net_2_0.csproj +++ /dev/null @@ -1,121 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {8F572B12-CBD2-48F8-8234-41A876C57364} - Library - 1699 - ./../../class/compat/net_2_0 - True - True - - Properties - - - ICSharpCode.SharpZipLib - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - diff --git a/mcs/class/Cscompmgd/Cscompmgd-net_2_0.csproj b/mcs/class/Cscompmgd/Cscompmgd-net_2_0.csproj deleted file mode 100644 index c82899356fa..00000000000 --- a/mcs/class/Cscompmgd/Cscompmgd-net_2_0.csproj +++ /dev/null @@ -1,86 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {C010783F-1EAC-480C-B1D4-A289426D3F8F} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - cscompmgd - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - - - - - diff --git a/mcs/class/Cscompmgd/Cscompmgd-tests-net_2_0.csproj b/mcs/class/Cscompmgd/Cscompmgd-tests-net_2_0.csproj deleted file mode 100644 index 2ecba673b44..00000000000 --- a/mcs/class/Cscompmgd/Cscompmgd-tests-net_2_0.csproj +++ /dev/null @@ -1,85 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {B3E7EE0C-3AB6-4578-844E-FF72C5807953} - Library - 1699,618,219,169 - bin\Debug\Cscompmgd-tests-net_2_0 - True - False - - Properties - - - Cscompmgd_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618,219,169 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {C010783F-1EAC-480C-B1D4-A289426D3F8F} - Cscompmgd\Cscompmgd-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - - - - - diff --git a/mcs/class/CustomMarshalers/CustomMarshalers-net_2_0.csproj b/mcs/class/CustomMarshalers/CustomMarshalers-net_2_0.csproj deleted file mode 100644 index 367270e3577..00000000000 --- a/mcs/class/CustomMarshalers/CustomMarshalers-net_2_0.csproj +++ /dev/null @@ -1,87 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {81062FC0-B86A-4707-9BC3-F67FDFB47AF4} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - CustomMarshalers - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - - - - - diff --git a/mcs/class/I18N/CJK/I18N.CJK-net_2_0.csproj b/mcs/class/I18N/CJK/I18N.CJK-net_2_0.csproj deleted file mode 100644 index 73a2654ab7b..00000000000 --- a/mcs/class/I18N/CJK/I18N.CJK-net_2_0.csproj +++ /dev/null @@ -1,110 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {9C753AD5-56C6-46F8-976E-3AD3A4481626} - Library - 1699 - ./../../../class/lib/net_2_0 - True - True - true - Properties - - - I18N.CJK - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;DISABLE_UNSAFE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - DISABLE_UNSAFE;NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {90D1493C-4092-4A53-BBC1-5E79DFEF9AD1} - Common\I18N-net_2_0 - - - - - - - - big5.table - - - gb2312.table - - - jis.table - - - ks.table - - - gb18030.table - - - - diff --git a/mcs/class/I18N/CJK/I18N.CJK-tests-net_2_0.csproj b/mcs/class/I18N/CJK/I18N.CJK-tests-net_2_0.csproj deleted file mode 100644 index 2f53e5834cb..00000000000 --- a/mcs/class/I18N/CJK/I18N.CJK-tests-net_2_0.csproj +++ /dev/null @@ -1,102 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {53F4354D-AEFA-4AB8-AF76-89012BB8FEB3} - Library - 1699 - bin\Debug\I18N.CJK-tests-net_2_0 - True - False - true - Properties - - - I18N.CJK_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;DISABLE_UNSAFE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - DISABLE_UNSAFE;NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {90D1493C-4092-4A53-BBC1-5E79DFEF9AD1} - Common\I18N-net_2_0 - - - {9C753AD5-56C6-46F8-976E-3AD3A4481626} - CJK\I18N.CJK-net_2_0 - - - - - - - - big5.table - - - gb2312.table - - - jis.table - - - ks.table - - - gb18030.table - - - - diff --git a/mcs/class/I18N/Common/I18N-net_2_0.csproj b/mcs/class/I18N/Common/I18N-net_2_0.csproj deleted file mode 100644 index 4c71f897245..00000000000 --- a/mcs/class/I18N/Common/I18N-net_2_0.csproj +++ /dev/null @@ -1,84 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {90D1493C-4092-4A53-BBC1-5E79DFEF9AD1} - Library - 1699 - ./../../../class/lib/net_2_0 - True - True - true - Properties - - - I18N - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;DISABLE_UNSAFE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - DISABLE_UNSAFE;NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - - - - - diff --git a/mcs/class/I18N/MidEast/I18N.MidEast-net_2_0.csproj b/mcs/class/I18N/MidEast/I18N.MidEast-net_2_0.csproj deleted file mode 100644 index f02ffb331dc..00000000000 --- a/mcs/class/I18N/MidEast/I18N.MidEast-net_2_0.csproj +++ /dev/null @@ -1,88 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {81E84AE7-FF9C-499B-9CA1-02E438C233C6} - Library - 1699 - ./../../../class/lib/net_2_0 - True - True - true - Properties - - - I18N.MidEast - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {90D1493C-4092-4A53-BBC1-5E79DFEF9AD1} - Common\I18N-net_2_0 - - - - - - - diff --git a/mcs/class/I18N/MidEast/I18N.MidEast-tests-net_2_0.csproj b/mcs/class/I18N/MidEast/I18N.MidEast-tests-net_2_0.csproj deleted file mode 100644 index 1a204a27cd1..00000000000 --- a/mcs/class/I18N/MidEast/I18N.MidEast-tests-net_2_0.csproj +++ /dev/null @@ -1,85 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {6BC73CD0-ADAF-461D-B190-F1458D439314} - Library - 1699 - bin\Debug\I18N.MidEast-tests-net_2_0 - True - False - true - Properties - - - I18N.MidEast_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {90D1493C-4092-4A53-BBC1-5E79DFEF9AD1} - Common\I18N-net_2_0 - - - {81E84AE7-FF9C-499B-9CA1-02E438C233C6} - MidEast\I18N.MidEast-net_2_0 - - - - - - - diff --git a/mcs/class/I18N/Other/I18N.Other-net_2_0.csproj b/mcs/class/I18N/Other/I18N.Other-net_2_0.csproj deleted file mode 100644 index 1886f5c00be..00000000000 --- a/mcs/class/I18N/Other/I18N.Other-net_2_0.csproj +++ /dev/null @@ -1,90 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F77F18AA-4F63-456F-8FC4-6A2DFD8F9D54} - Library - 1699 - ./../../../class/lib/net_2_0 - True - True - true - Properties - - - I18N.Other - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {90D1493C-4092-4A53-BBC1-5E79DFEF9AD1} - Common\I18N-net_2_0 - - - - - - - diff --git a/mcs/class/I18N/Rare/I18N.Rare-net_2_0.csproj b/mcs/class/I18N/Rare/I18N.Rare-net_2_0.csproj deleted file mode 100644 index 0ba3a612cba..00000000000 --- a/mcs/class/I18N/Rare/I18N.Rare-net_2_0.csproj +++ /dev/null @@ -1,118 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {83015125-AD39-4160-B723-677CB4F1EF3D} - Library - 1699 - ./../../../class/lib/net_2_0 - True - True - true - Properties - - - I18N.Rare - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {90D1493C-4092-4A53-BBC1-5E79DFEF9AD1} - Common\I18N-net_2_0 - - - - - - - diff --git a/mcs/class/I18N/West/I18N.West-net_2_0.csproj b/mcs/class/I18N/West/I18N.West-net_2_0.csproj deleted file mode 100644 index f877f6d8cfa..00000000000 --- a/mcs/class/I18N/West/I18N.West-net_2_0.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {AA988ADC-FBBB-4168-B8E4-83B6C6D543EC} - Library - 1699 - ./../../../class/lib/net_2_0 - True - True - true - Properties - - - I18N.West - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {90D1493C-4092-4A53-BBC1-5E79DFEF9AD1} - Common\I18N-net_2_0 - - - - - - - diff --git a/mcs/class/I18N/West/I18N.West-tests-net_2_0.csproj b/mcs/class/I18N/West/I18N.West-tests-net_2_0.csproj deleted file mode 100644 index d0558bc6788..00000000000 --- a/mcs/class/I18N/West/I18N.West-tests-net_2_0.csproj +++ /dev/null @@ -1,85 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {C1E0F01D-878A-4343-A283-8864D7D8956E} - Library - 1699 - bin\Debug\I18N.West-tests-net_2_0 - True - False - true - Properties - - - I18N.West_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {90D1493C-4092-4A53-BBC1-5E79DFEF9AD1} - Common\I18N-net_2_0 - - - {AA988ADC-FBBB-4168-B8E4-83B6C6D543EC} - West\I18N.West-net_2_0 - - - - - - - diff --git a/mcs/class/IBM.Data.DB2/IBM.Data.DB2-net_2_0.csproj b/mcs/class/IBM.Data.DB2/IBM.Data.DB2-net_2_0.csproj deleted file mode 100644 index ee2f07a91dc..00000000000 --- a/mcs/class/IBM.Data.DB2/IBM.Data.DB2-net_2_0.csproj +++ /dev/null @@ -1,112 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {47BD9179-658F-4881-85D3-4883B11BCE12} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - true - Properties - - - IBM.Data.DB2 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - - - - - diff --git a/mcs/class/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib-net_2_0.csproj b/mcs/class/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib-net_2_0.csproj deleted file mode 100644 index bd79d3c5b47..00000000000 --- a/mcs/class/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib-net_2_0.csproj +++ /dev/null @@ -1,133 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {9E123979-3457-435B-A081-8432EEBA134A} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - ICSharpCode.SharpZipLib - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - diff --git a/mcs/class/Makefile b/mcs/class/Makefile index 33a7dd8ae7b..fc0d9dad963 100644 --- a/mcs/class/Makefile +++ b/mcs/class/Makefile @@ -231,14 +231,12 @@ xbuild_4_0_dirs := \ $(xbuild_2_0_dirs) \ Microsoft.Build -net_2_0_SUBDIRS := $(net_2_0_dirs) $(net_2_0_only_dirs) $(xbuild_2_0_dirs) aot-compiler monodroid_SUBDIRS := $(monodroid_dirs) monotouch_SUBDIRS := $(monotouch_dirs) monotouch_runtime_SUBDIRS := $(monotouch_runtime_dirs) mobile_static_SUBDIRS := $(mobile_static_dirs) mobile_SUBDIRS := $(mobile_dynamic_dirs) xammac_SUBDIRS := $(xammac_dirs) -net_3_5_SUBDIRS := $(xbuild_2_0_dirs) net_4_0_SUBDIRS := $(net_2_0_dirs) $(net_4_0_dirs) $(net_4_0_only_dirs) $(xbuild_4_0_dirs) net_4_5_SUBDIRS := $(net_2_0_dirs) $(net_4_0_dirs) $(net_4_5_dirs) $(xbuild_4_0_dirs) aot-compiler xbuild_12_SUBDIRS := $(xbuild_4_0_dirs) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms-net_2_0.csproj b/mcs/class/Managed.Windows.Forms/System.Windows.Forms-net_2_0.csproj deleted file mode 100644 index 2144ea57633..00000000000 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms-net_2_0.csproj +++ /dev/null @@ -1,1193 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {EC4EB1AA-1E23-4F9A-832A-FED2E5EA9630} - Library - 1699,618,612,809 - ./../../class/lib/net_2_0 - True - True - true - Properties - - - System.Windows.Forms - v2.0 - 512 - - - true - full - 1699,618,612,809 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618,612,809 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - {43A23ADA-35D9-4A48-BCE5-C21C081C6676} - Accessibility\Accessibility-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {2F9C802E-F1DA-4779-80B2-5AACE033D398} - Mono.Posix\Mono.Posix-net_2_0 - - - {F46C8C89-6CD0-432D-8BEF-C962DB694CDB} - Mono.WebBrowser\Mono.WebBrowser-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - {8313B5D9-A1BE-4E62-90E7-FA002548D650} - System.Runtime.Serialization.Formatters.Soap\System.Runtime.Serialization.Formatters.Soap-net_2_0 - - - - - - - - System.Windows.Forms.SplitterNS.cur - - - System.Windows.Forms.SplitterWE.cur - - - System.Windows.Forms.NESW.cur - - - System.Windows.Forms.NWSE.cur - - - System.Windows.Forms.DnDNo.cur - - - System.Windows.Forms.DnDCopy.cur - - - System.Windows.Forms.DnDLink.cur - - - System.Windows.Forms.DnDMove.cur - - - keyboards.resources - - - 16_computer.png - - - 32_computer.png - - - computer.png - - - 16_document-open.png - - - 32_document-open.png - - - document-open.png - - - 16_folder.png - - - folder-new.png - - - folder.png - - - 16_folder-remote.png - - - 32_folder-remote.png - - - folder-remote.png - - - go-previous.png - - - go-top.png - - - 22_page-magnifier.png - - - preferences-system-windows.png - - - 16_printer.png - - - 32_printer.png - - - text-x-generic.png - - - 16_user-desktop.png - - - 32_user-desktop.png - - - user-desktop.png - - - 16_user-home.png - - - 32_user-home.png - - - user-home.png - - - 16_dialog-error.png - - - 16_dialog-information.png - - - 16_dialog-warning.png - - - 1-up.png - - - 2-up.png - - - 3-up.png - - - 4-up.png - - - 6-up.png - - - nav_delete.png - - - nav_end.png - - - nav_first.png - - - nav_next.png - - - nav_plus.png - - - nav_previous.png - - - image-missing.png - - - image-x-generic.png - - - System.Windows.Forms.propertygrid-alphabetical.png - - - System.Windows.Forms.propertygrid-categorized.png - - - System.Windows.Forms.propertygrid-propertypages.png - - - System.Windows.Forms.Design.EventsTab.bmp - - - System.Windows.Forms.PropertyGridInternal.PropertiesTab.bmp - - - mono.ico - - - errorProvider.ico - - - - diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms-tests-net_2_0.csproj b/mcs/class/Managed.Windows.Forms/System.Windows.Forms-tests-net_2_0.csproj deleted file mode 100644 index e55d9615487..00000000000 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms-tests-net_2_0.csproj +++ /dev/null @@ -1,312 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {4A3A8DC3-F8A2-47E9-96F5-1C8F7E4C3D77} - Library - 1699,618,612 - bin\Debug\System.Windows.Forms-tests-net_2_0 - True - False - - Properties - - - System.Windows.Forms_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,618,612 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618,612 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {EC4EB1AA-1E23-4F9A-832A-FED2E5EA9630} - Managed.Windows.Forms\System.Windows.Forms-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - {43A23ADA-35D9-4A48-BCE5-C21C081C6676} - Accessibility\Accessibility-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {8313B5D9-A1BE-4E62-90E7-FA002548D650} - System.Runtime.Serialization.Formatters.Soap\System.Runtime.Serialization.Formatters.Soap-net_2_0 - - - - - - - - a.cur - - - 32x32.ico - - - - diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs index 393d5cba9ae..3ce4ab7b574 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridView.cs @@ -5133,7 +5133,17 @@ namespace System.Windows.Forms { SetSelectedRowCore (rowIndex, false); } - if (Rows.Count - e.RowCount <= 0) { + int RowsLeft = Rows.Count - e.RowCount; + if (RowsLeft < 0) + RowsLeft = 0; + + if (first_row_index > RowsLeft - 1) + first_row_index = RowsLeft - 1; + + if (first_row_index < 0) + first_row_index = 0; + + if (RowsLeft == 0) { MoveCurrentCell (-1, -1, true, false, false, true); hover_cell = null; } else if (Columns.Count == 0) { @@ -5141,8 +5151,8 @@ namespace System.Windows.Forms { hover_cell = null; } else if (currentCell != null && currentCell.RowIndex == e.RowIndex) { int nextRowIndex = e.RowIndex; - if (nextRowIndex >= Rows.Count - e.RowCount) - nextRowIndex = Rows.Count - 1 - e.RowCount; + if (nextRowIndex >= RowsLeft) + nextRowIndex = RowsLeft - 1; MoveCurrentCell (currentCell != null ? currentCell.ColumnIndex : 0, nextRowIndex, true, false, false, true); if (hover_cell != null && hover_cell.RowIndex >= e.RowIndex) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewRowCollection.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewRowCollection.cs index 8261f1f8756..24aa28797ba 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewRowCollection.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewRowCollection.cs @@ -261,14 +261,14 @@ namespace System.Windows.Forms for (int i = 0; i < total; i++) { DataGridViewRow row = (DataGridViewRow)list[0]; - + row.SetIndex(0); + // We can exit because the NewRow is always last if (row.IsNewRow) break; row.SetDataGridView (null); list.Remove (row); - ReIndex (); } DataGridView.OnRowsPostRemovedInternal (new DataGridViewRowsRemovedEventArgs (0, total)); diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs index 3af4684710a..d46cfb22718 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListView.cs @@ -1031,6 +1031,7 @@ namespace System.Windows.Forms virtual_list_size = value; if (virtual_mode) { + focused_item_index = -1; selected_indices.Reset (); Redraw (true); } diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs index d6214c5e93b..26edaf80995 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ThemeWin32Classic.cs @@ -369,7 +369,7 @@ namespace System.Windows.Forms Image image = button.Image; string text = button.Text; Rectangle content_rect = button.PaddingClientRectangle; - Size text_size = TextRenderer.MeasureTextInternal (g, text, button.Font, content_rect.Size, button.TextFormatFlags | TextFormatFlags.NoPadding, button.UseCompatibleTextRendering); + Size text_size = TextRenderer.MeasureTextInternal (g, text, button.Font, content_rect.Size, button.TextFormatFlags, button.UseCompatibleTextRendering); Size image_size = image == null ? Size.Empty : image.Size; textRectangle = Rectangle.Inflate (content_rect, -4, -4); diff --git a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataGridViewTest.cs b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataGridViewTest.cs index 666bd7a6fec..e973b2b9232 100644 --- a/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataGridViewTest.cs +++ b/mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/DataGridViewTest.cs @@ -2569,6 +2569,42 @@ namespace MonoTests.System.Windows.Forms Assert.AreEqual (30, dgv.Rows [0].MinimumHeight); } } + + [Test] // Xamarin bug #24372 + public void Bug24372_first_row_index () + { + Form form = new Form (); + DataGridView24372 dgv = new DataGridView24372 (); + dgv.Parent = form; + dgv.ColumnCount = 1; + dgv.RowCount = 100; + dgv.CurrentCell = dgv[0,50]; + dgv.Focus (); + form.Show (); + + dgv.Rows.Clear (); + form.Refresh (); + Application.DoEvents (); + + if (dgv.HasException) + Assert.Fail("#A1"); + + form.Dispose (); + } + + class DataGridView24372 : DataGridView + { + public bool HasException { get; private set; } + protected override void OnPaint (PaintEventArgs e) + { + HasException = false; + try { + base.OnPaint(e); + } catch (ArgumentOutOfRangeException ex) { + HasException = true; + } + } + } } [TestFixture] diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Engine.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Engine.cs index ec3ddd731b0..ea0d322b3a6 100644 --- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Engine.cs +++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/Engine.cs @@ -561,7 +561,12 @@ namespace Microsoft.Build.BuildEngine { // This is used as the fall back version if the // project can't find a version to use return String.IsNullOrEmpty (defaultToolsVersion) - ? "4.0" + ? +#if NET_4_0 + "4.0" +#else + "2.0" +#endif : defaultToolsVersion; } set { diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine-net_2_0.csproj b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine-net_2_0.csproj deleted file mode 100644 index c0b32ab9202..00000000000 --- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine-net_2_0.csproj +++ /dev/null @@ -1,169 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {6A56A8BD-4228-4865-8112-9D31C6829638} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Microsoft.Build.Engine - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {9F21C5DF-2ED4-43F7-8716-192B1C2EC185} - Microsoft.Build.Framework\Microsoft.Build.Framework-net_2_0 - - - {A777C6B7-7DAA-48DC-BAEF-FD21967A3384} - Microsoft.Build.Utilities\Microsoft.Build.Utilities-net_2_0 - - - - - - - diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine-tests-net_2_0.csproj b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine-tests-net_2_0.csproj deleted file mode 100644 index d08f9a6e6d9..00000000000 --- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.Engine-tests-net_2_0.csproj +++ /dev/null @@ -1,122 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {750EAC81-53A4-41F4-9713-16B07578B170} - Library - 1699 - bin\Debug\Microsoft.Build.Engine-tests-net_2_0 - True - False - - Properties - - - Microsoft.Build.Engine_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {6A56A8BD-4228-4865-8112-9D31C6829638} - Microsoft.Build.Engine\Microsoft.Build.Engine-net_2_0 - - - {9F21C5DF-2ED4-43F7-8716-192B1C2EC185} - Microsoft.Build.Framework\Microsoft.Build.Framework-net_2_0 - - - {A777C6B7-7DAA-48DC-BAEF-FD21967A3384} - Microsoft.Build.Utilities\Microsoft.Build.Utilities-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework-net_2_0.csproj b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework-net_2_0.csproj deleted file mode 100644 index 1dfa4fa99e6..00000000000 --- a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework-net_2_0.csproj +++ /dev/null @@ -1,141 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {9F21C5DF-2ED4-43F7-8716-192B1C2EC185} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Microsoft.Build.Framework - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - - - - - diff --git a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework-tests-net_2_0.csproj b/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework-tests-net_2_0.csproj deleted file mode 100644 index a3322ae3c5b..00000000000 --- a/mcs/class/Microsoft.Build.Framework/Microsoft.Build.Framework-tests-net_2_0.csproj +++ /dev/null @@ -1,97 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F8559E0C-7D86-40C4-B481-5B71DC1DBE8F} - Library - 1699 - bin\Debug\Microsoft.Build.Framework-tests-net_2_0 - True - False - - Properties - - - Microsoft.Build.Framework_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {9F21C5DF-2ED4-43F7-8716-192B1C2EC185} - Microsoft.Build.Framework\Microsoft.Build.Framework-net_2_0 - - - - - - - diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-net_2_0.csproj b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-net_2_0.csproj deleted file mode 100644 index 9bee01e65f4..00000000000 --- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-net_2_0.csproj +++ /dev/null @@ -1,225 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {9EF938FF-4761-414A-B1BA-0A9645CAA14A} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Microsoft.Build.Tasks - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {EC4EB1AA-1E23-4F9A-832A-FED2E5EA9630} - Managed.Windows.Forms\System.Windows.Forms-net_2_0 - - - {A777C6B7-7DAA-48DC-BAEF-FD21967A3384} - Microsoft.Build.Utilities\Microsoft.Build.Utilities-net_2_0 - - - {9F21C5DF-2ED4-43F7-8716-192B1C2EC185} - Microsoft.Build.Framework\Microsoft.Build.Framework-net_2_0 - - - {6A56A8BD-4228-4865-8112-9D31C6829638} - Microsoft.Build.Engine\Microsoft.Build.Engine-net_2_0 - - - {8C54606D-305D-45B0-9932-380FE021BEFE} - Mono.XBuild.Tasks\Mono.XBuild.Tasks-net_2_0 - - - - - - - diff --git a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-tests-net_2_0.csproj b/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-tests-net_2_0.csproj deleted file mode 100644 index dd207b0066f..00000000000 --- a/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks-tests-net_2_0.csproj +++ /dev/null @@ -1,129 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {DEC22ED1-001B-4849-8F68-105493B5CBE3} - Library - 1699 - bin\Debug\Microsoft.Build.Tasks-tests-net_2_0 - True - False - - Properties - - - Microsoft.Build.Tasks_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {9EF938FF-4761-414A-B1BA-0A9645CAA14A} - Microsoft.Build.Tasks\Microsoft.Build.Tasks-net_2_0 - - - {6A56A8BD-4228-4865-8112-9D31C6829638} - Microsoft.Build.Engine\Microsoft.Build.Engine-net_2_0 - - - {9F21C5DF-2ED4-43F7-8716-192B1C2EC185} - Microsoft.Build.Framework\Microsoft.Build.Framework-net_2_0 - - - {8C54606D-305D-45B0-9932-380FE021BEFE} - Mono.XBuild.Tasks\Mono.XBuild.Tasks-net_2_0 - - - {A777C6B7-7DAA-48DC-BAEF-FD21967A3384} - Microsoft.Build.Utilities\Microsoft.Build.Utilities-net_2_0 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - - - - - diff --git a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CopyTest.cs b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CopyTest.cs index 272a6f0056a..6e969a0d766 100644 --- a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CopyTest.cs +++ b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/CopyTest.cs @@ -319,7 +319,7 @@ namespace MonoTests.Microsoft.Build.Tasks { Assert.AreEqual (FileAttributes.ReadOnly, File.GetAttributes (target_file), "A1"); string documentString = @" - + " + target_file + @" 1 diff --git a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities-net_2_0.csproj b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities-net_2_0.csproj deleted file mode 100644 index 27ff84c2244..00000000000 --- a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities-net_2_0.csproj +++ /dev/null @@ -1,105 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {A777C6B7-7DAA-48DC-BAEF-FD21967A3384} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Microsoft.Build.Utilities - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {9F21C5DF-2ED4-43F7-8716-192B1C2EC185} - Microsoft.Build.Framework\Microsoft.Build.Framework-net_2_0 - - - - - - - diff --git a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities-tests-net_2_0.csproj b/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities-tests-net_2_0.csproj deleted file mode 100644 index 0b497e46ad5..00000000000 --- a/mcs/class/Microsoft.Build.Utilities/Microsoft.Build.Utilities-tests-net_2_0.csproj +++ /dev/null @@ -1,102 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {C6AD8AA6-5A1A-4430-99E0-CAB47FB7844B} - Library - 1699 - bin\Debug\Microsoft.Build.Utilities-tests-net_2_0 - True - False - - Properties - - - Microsoft.Build.Utilities_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {A777C6B7-7DAA-48DC-BAEF-FD21967A3384} - Microsoft.Build.Utilities\Microsoft.Build.Utilities-net_2_0 - - - False - ./../../class/lib/net_2_0/Microsoft.Build.Engine.dll - False - - - {9F21C5DF-2ED4-43F7-8716-192B1C2EC185} - Microsoft.Build.Framework\Microsoft.Build.Framework-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - - - - - diff --git a/mcs/class/Microsoft.VisualC/Microsoft.VisualC-net_2_0.csproj b/mcs/class/Microsoft.VisualC/Microsoft.VisualC-net_2_0.csproj deleted file mode 100644 index f9a2afac551..00000000000 --- a/mcs/class/Microsoft.VisualC/Microsoft.VisualC-net_2_0.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {9BFFAB87-980B-4074-963C-1542F2E0F2FE} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Microsoft.VisualC - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - - - - - diff --git a/mcs/class/Mono.C5/Mono.C5-net_2_0.csproj b/mcs/class/Mono.C5/Mono.C5-net_2_0.csproj deleted file mode 100644 index d25fc4a0778..00000000000 --- a/mcs/class/Mono.C5/Mono.C5-net_2_0.csproj +++ /dev/null @@ -1,112 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {C54C9EFB-5E3B-43D6-94C9-DD3A66EDA8DA} - Library - 1699,169,219,414,1030,3001,3005,3006 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Mono.C5 - v2.0 - 512 - - - true - full - 1699,169,219,414,1030,3001,3005,3006 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,169,219,414,1030,3001,3005,3006 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - - - - - diff --git a/mcs/class/Mono.C5/Mono.C5-tests-net_2_0.csproj b/mcs/class/Mono.C5/Mono.C5-tests-net_2_0.csproj deleted file mode 100644 index 49f9f7b491c..00000000000 --- a/mcs/class/Mono.C5/Mono.C5-tests-net_2_0.csproj +++ /dev/null @@ -1,108 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E698BCE2-5238-4E29-A859-406C99A83E28} - Library - 1699,169,219,414,1030,3001,3005,3006,618,219,169 - bin\Debug\Mono.C5-tests-net_2_0 - True - False - - Properties - - - Mono.C5_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,169,219,414,1030,3001,3005,3006,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,169,219,414,1030,3001,3005,3006,618,219,169 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {C54C9EFB-5E3B-43D6-94C9-DD3A66EDA8DA} - Mono.C5\Mono.C5-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - - - - - diff --git a/mcs/class/Mono.CSharp/Mono.CSharp-net_2_0.csproj b/mcs/class/Mono.CSharp/Mono.CSharp-net_2_0.csproj deleted file mode 100644 index ed18eec2f09..00000000000 --- a/mcs/class/Mono.CSharp/Mono.CSharp-net_2_0.csproj +++ /dev/null @@ -1,145 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {CA9B3BCC-D6B6-4FE5-B90E-106D88030B7D} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Mono.CSharp - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - - - - - diff --git a/mcs/class/Mono.CSharp/Mono.CSharp-tests-net_2_0.csproj b/mcs/class/Mono.CSharp/Mono.CSharp-tests-net_2_0.csproj deleted file mode 100644 index 769eaaab44a..00000000000 --- a/mcs/class/Mono.CSharp/Mono.CSharp-tests-net_2_0.csproj +++ /dev/null @@ -1,91 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {02C4293A-4B99-4E94-9C69-09207A6A457D} - Library - 1699 - bin\Debug\Mono.CSharp-tests-net_2_0 - True - False - - Properties - - - Mono.CSharp_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {CA9B3BCC-D6B6-4FE5-B90E-106D88030B7D} - Mono.CSharp\Mono.CSharp-net_2_0 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.CSharp/Test/Evaluator/ExpressionsTest.cs b/mcs/class/Mono.CSharp/Test/Evaluator/ExpressionsTest.cs index feb4294647f..3eef06b3b15 100644 --- a/mcs/class/Mono.CSharp/Test/Evaluator/ExpressionsTest.cs +++ b/mcs/class/Mono.CSharp/Test/Evaluator/ExpressionsTest.cs @@ -146,6 +146,15 @@ namespace MonoTests.EvaluatorTest Assert.IsTrue (Evaluator.Run ("x();"), "#2"); } + [Test] + public void CapturedLocalVariable () + { + Evaluator.Run ("using System;"); + + var res = Evaluator.Evaluate("var x = 123; Action a = () => x++; a(); x;"); + Assert.AreEqual (124, res); + } + #if NET_4_0 [Test] public void DynamicStatement () diff --git a/mcs/class/Mono.Cairo/Mono.Cairo-net_2_0.csproj b/mcs/class/Mono.Cairo/Mono.Cairo-net_2_0.csproj deleted file mode 100644 index f408f459132..00000000000 --- a/mcs/class/Mono.Cairo/Mono.Cairo-net_2_0.csproj +++ /dev/null @@ -1,131 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {07DF935D-130B-4185-9DE2-027042BA1E35} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Mono.Cairo - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.Cecil.Mdb/Mono.Cecil.Mdb-net_2_0.csproj b/mcs/class/Mono.Cecil.Mdb/Mono.Cecil.Mdb-net_2_0.csproj deleted file mode 100644 index 955d4593154..00000000000 --- a/mcs/class/Mono.Cecil.Mdb/Mono.Cecil.Mdb-net_2_0.csproj +++ /dev/null @@ -1,86 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {7230E9AE-C6D4-402A-91CF-C164148CDD21} - Library - 1699 - bin\Debug\Mono.Cecil.Mdb-net_2_0 - True - True - - Properties - - - Mono.Cecil.Mdb - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;CECIL - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;CECIL - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - xcopy $(TargetName).* $(ProjectDir)..\lib\net_2_0\ /Y /R /D - - - - - {EB7444A6-C3E6-4224-BDB0-63CA3B4F2B87} - corlib\corlib-net_2_0 - - - {79F25FD7-0D76-4526-AF39-1A648649A827} - System\System-net_2_0-2 - - - {2F1D61B7-0586-4587-8ECE-926A065F6276} - Mono.Cecil\Mono.Cecil-net_2_0 - - - - - - diff --git a/mcs/class/Mono.Cecil/Mono.Cecil-net_2_0.csproj b/mcs/class/Mono.Cecil/Mono.Cecil-net_2_0.csproj deleted file mode 100644 index b0331b65be5..00000000000 --- a/mcs/class/Mono.Cecil/Mono.Cecil-net_2_0.csproj +++ /dev/null @@ -1,206 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {EED155FA-9877-4A62-889B-365D5DED03DB} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Mono.Cecil - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.CompilerServices.SymbolWriter/Mono.CompilerServices.SymbolWriter-net_2_0.csproj b/mcs/class/Mono.CompilerServices.SymbolWriter/Mono.CompilerServices.SymbolWriter-net_2_0.csproj deleted file mode 100644 index 981bb193907..00000000000 --- a/mcs/class/Mono.CompilerServices.SymbolWriter/Mono.CompilerServices.SymbolWriter-net_2_0.csproj +++ /dev/null @@ -1,87 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D59758D7-08DC-4645-A96A-0EBE93F281A6} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Mono.CompilerServices.SymbolWriter - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {5A346705-1044-48F2-987D-CAE22A255427} - System\System-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite-net_2_0.csproj b/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite-net_2_0.csproj deleted file mode 100644 index 789777acdc6..00000000000 --- a/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite-net_2_0.csproj +++ /dev/null @@ -1,137 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {7B3F5668-ED1F-48EB-9897-E6BE6A1C8CB3} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - true - Properties - - - Mono.Data.Sqlite - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;SQLITE_STANDARD - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;SQLITE_STANDARD - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {BBC5CD06-50EB-439E-9DBB-2B5D644BE6C3} - System.Transactions\System.Transactions-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - - SR.resources - - - SQLiteCommand.bmp - - - SQLiteConnection.bmp - - - SQLiteDataAdapter.bmp - - - - diff --git a/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite-tests-net_2_0.csproj b/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite-tests-net_2_0.csproj deleted file mode 100644 index 3c937737692..00000000000 --- a/mcs/class/Mono.Data.Sqlite/Mono.Data.Sqlite-tests-net_2_0.csproj +++ /dev/null @@ -1,117 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {082EFA10-D1AE-41EA-8CDD-7D881109D97A} - Library - 1699,618 - bin\Debug\Mono.Data.Sqlite-tests-net_2_0 - True - False - true - Properties - - - Mono.Data.Sqlite_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0;SQLITE_STANDARD - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0;SQLITE_STANDARD - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {7B3F5668-ED1F-48EB-9897-E6BE6A1C8CB3} - Mono.Data.Sqlite\Mono.Data.Sqlite-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {BBC5CD06-50EB-439E-9DBB-2B5D644BE6C3} - System.Transactions\System.Transactions-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - - SR.resources - - - SQLiteCommand.bmp - - - SQLiteConnection.bmp - - - SQLiteDataAdapter.bmp - - - - diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds-net_2_0.csproj b/mcs/class/Mono.Data.Tds/Mono.Data.Tds-net_2_0.csproj deleted file mode 100644 index b092598503a..00000000000 --- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds-net_2_0.csproj +++ /dev/null @@ -1,125 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {C21CB6AB-7059-4FA5-A23C-84EA0B854BB7} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Mono.Data.Tds - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {57CFE851-81AC-4269-B24A-965A53D87248} - Mono.Security\Mono.Security-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds-tests-net_2_0.csproj b/mcs/class/Mono.Data.Tds/Mono.Data.Tds-tests-net_2_0.csproj deleted file mode 100644 index afd72be7002..00000000000 --- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds-tests-net_2_0.csproj +++ /dev/null @@ -1,91 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {B248ADC8-9309-4844-90C0-6377AC3467D4} - Library - 1699 - bin\Debug\Mono.Data.Tds-tests-net_2_0 - True - False - - Properties - - - Mono.Data.Tds_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {C21CB6AB-7059-4FA5-A23C-84EA0B854BB7} - Mono.Data.Tds\Mono.Data.Tds-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - False - System.Net.dll - False - - - - - - - diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft-net_2_0.csproj b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft-net_2_0.csproj deleted file mode 100644 index c53b28ec198..00000000000 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft-net_2_0.csproj +++ /dev/null @@ -1,163 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {08AD7FD1-889B-4ADC-8AAA-05459828C75F} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - true - Properties - - - Mono.Debugger.Soft - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;MONO_DATACONVERTER_STATIC_METHODS - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;MONO_DATACONVERTER_STATIC_METHODS - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {EED155FA-9877-4A62-889B-365D5DED03DB} - Mono.Cecil\Mono.Cecil-net_2_0 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft-tests-net_2_0.csproj b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft-tests-net_2_0.csproj deleted file mode 100644 index de8b73ff4f9..00000000000 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft-tests-net_2_0.csproj +++ /dev/null @@ -1,93 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {3C5E6859-9346-4FE8-AD24-2D00753DEDE4} - Library - 1699 - bin\Debug\Mono.Debugger.Soft-tests-net_2_0 - True - False - - Properties - - - Mono.Debugger.Soft_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {08AD7FD1-889B-4ADC-8AAA-05459828C75F} - Mono.Debugger.Soft\Mono.Debugger.Soft-net_2_0 - - - {EED155FA-9877-4A62-889B-365D5DED03DB} - Mono.Cecil\Mono.Cecil-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs index a54315f175e..753f3910f83 100644 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs +++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/Connection.cs @@ -417,7 +417,7 @@ namespace Mono.Debugger.Soft * with newer runtimes, and vice versa. */ internal const int MAJOR_VERSION = 2; - internal const int MINOR_VERSION = 37; + internal const int MINOR_VERSION = 38; enum WPSuspendPolicy { NONE = 0, @@ -585,7 +585,8 @@ namespace Mono.Debugger.Soft enum CmdStackFrame { GET_VALUES = 1, GET_THIS = 2, - SET_VALUES = 3 + SET_VALUES = 3, + GET_DOMAIN = 4, } enum CmdArrayRef { @@ -2378,6 +2379,10 @@ namespace Mono.Debugger.Soft SendReceive (CommandSet.STACK_FRAME, (int)CmdStackFrame.SET_VALUES, new PacketWriter ().WriteId (thread_id).WriteId (id).WriteInt (len).WriteInts (pos).WriteValues (values)); } + internal long StackFrame_GetDomain (long thread_id, long id) { + return SendReceive (CommandSet.STACK_FRAME, (int)CmdStackFrame.GET_DOMAIN, new PacketWriter ().WriteId (thread_id).WriteId (id)).ReadId (); + } + /* * ARRAYS */ diff --git a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/StackFrame.cs b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/StackFrame.cs index 7a6a34fa539..8549a93700a 100644 --- a/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/StackFrame.cs +++ b/mcs/class/Mono.Debugger.Soft/Mono.Debugger.Soft/StackFrame.cs @@ -7,6 +7,7 @@ namespace Mono.Debugger.Soft public class StackFrame : Mirror { ThreadMirror thread; + AppDomainMirror domain; MethodMirror method; int il_offset; Location location; @@ -32,6 +33,16 @@ namespace Mono.Debugger.Soft } } + public AppDomainMirror Domain { + get { + vm.CheckProtocolVersion (2, 38); + if (domain == null) + domain = vm.GetDomain (vm.conn.StackFrame_GetDomain (thread.Id, Id)); + + return domain; + } + } + public MethodMirror Method { get { return method; diff --git a/mcs/class/Mono.Debugger.Soft/Test/dtest.cs b/mcs/class/Mono.Debugger.Soft/Test/dtest.cs index df4fbcc6648..d7aaacd3383 100644 --- a/mcs/class/Mono.Debugger.Soft/Test/dtest.cs +++ b/mcs/class/Mono.Debugger.Soft/Test/dtest.cs @@ -2869,8 +2869,10 @@ public class DebuggerTests var frames = e.Thread.GetFrames (); Assert.AreEqual ("invoke_in_domain", frames [0].Method.Name); + Assert.AreEqual (domain, frames [0].Domain); Assert.AreEqual ("invoke", frames [1].Method.Name); Assert.AreEqual ("domains", frames [2].Method.Name); + Assert.AreEqual (vm.RootDomain, frames [2].Domain); // Test breakpoints on already JITted methods in other domains m = entry_point.DeclaringType.GetMethod ("invoke_in_domain_2"); diff --git a/mcs/class/Mono.Http/Mono.Http-net_2_0.csproj b/mcs/class/Mono.Http/Mono.Http-net_2_0.csproj deleted file mode 100644 index 40fcb94da50..00000000000 --- a/mcs/class/Mono.Http/Mono.Http-net_2_0.csproj +++ /dev/null @@ -1,108 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {7323A289-ABB8-4556-A9D5-8994223523B5} - Library - 1699,618 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Mono.Http - v2.0 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {B8F7FDF0-07C7-4AFC-9854-F591BF307939} - System.Web\System.Web-net_2_0-1 - - - {9E123979-3457-435B-A081-8432EEBA134A} - ICSharpCode.SharpZipLib\ICSharpCode.SharpZipLib-net_2_0 - - - {57CFE851-81AC-4269-B24A-965A53D87248} - Mono.Security\Mono.Security-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.Management/Mono.Management-net_2_0.csproj b/mcs/class/Mono.Management/Mono.Management-net_2_0.csproj deleted file mode 100644 index f1c6fe2f1e4..00000000000 --- a/mcs/class/Mono.Management/Mono.Management-net_2_0.csproj +++ /dev/null @@ -1,87 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {BF4F4B81-6779-40D0-85B9-2FD9ED8DFF63} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Mono.Management - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {2F9C802E-F1DA-4779-80B2-5AACE033D398} - Mono.Posix\Mono.Posix-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ-net_2_0.csproj b/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ-net_2_0.csproj deleted file mode 100644 index 827b2ebcbc1..00000000000 --- a/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ-net_2_0.csproj +++ /dev/null @@ -1,102 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D7F14FD3-CE00-4000-813C-9D34D42FE887} - Library - 1699,618 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Mono.Messaging.RabbitMQ - v2.0 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {DB0FD42E-2BF8-4E67-B707-901AC35FCB9A} - System.Messaging\System.Messaging-net_2_0 - - - {2220FC2B-F933-49D2-B1A4-A6241F486B88} - Mono.Messaging\Mono.Messaging-net_2_0 - - - {962E924C-777A-42E1-B7AC-823BFA34D22C} - client\RabbitMQ.Client-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ-tests-net_2_0.csproj b/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ-tests-net_2_0.csproj deleted file mode 100644 index b90bc4f6a7e..00000000000 --- a/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ-tests-net_2_0.csproj +++ /dev/null @@ -1,110 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {CC2D1BF7-1070-41B3-B316-85EA0B2E7E9E} - Library - 1699,618,618,219,169 - bin\Debug\Mono.Messaging.RabbitMQ-tests-net_2_0 - True - False - - Properties - - - Mono.Messaging.RabbitMQ_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,618,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618,618,219,169 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {D7F14FD3-CE00-4000-813C-9D34D42FE887} - Mono.Messaging.RabbitMQ\Mono.Messaging.RabbitMQ-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {DB0FD42E-2BF8-4E67-B707-901AC35FCB9A} - System.Messaging\System.Messaging-net_2_0 - - - {2220FC2B-F933-49D2-B1A4-A6241F486B88} - Mono.Messaging\Mono.Messaging-net_2_0 - - - {962E924C-777A-42E1-B7AC-823BFA34D22C} - client\RabbitMQ.Client-net_2_0 - - - False - nunit.mocks.dll - False - - - - - - - diff --git a/mcs/class/Mono.Messaging/Mono.Messaging-net_2_0.csproj b/mcs/class/Mono.Messaging/Mono.Messaging-net_2_0.csproj deleted file mode 100644 index b27257ce567..00000000000 --- a/mcs/class/Mono.Messaging/Mono.Messaging-net_2_0.csproj +++ /dev/null @@ -1,111 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2220FC2B-F933-49D2-B1A4-A6241F486B88} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Mono.Messaging - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.Messaging/Mono.Messaging-tests-net_2_0.csproj b/mcs/class/Mono.Messaging/Mono.Messaging-tests-net_2_0.csproj deleted file mode 100644 index 80c2a9eace0..00000000000 --- a/mcs/class/Mono.Messaging/Mono.Messaging-tests-net_2_0.csproj +++ /dev/null @@ -1,100 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {62E7C77F-D5EF-4761-8C20-571CC01C8202} - Library - 1699,618,219,169 - bin\Debug\Mono.Messaging-tests-net_2_0 - True - False - - Properties - - - Mono.Messaging_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618,219,169 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {2220FC2B-F933-49D2-B1A4-A6241F486B88} - Mono.Messaging\Mono.Messaging-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - False - System.Messaging.dll - False - - - False - nunit.mocks.dll - False - - - - - - - diff --git a/mcs/class/Mono.Options/Mono.Options-net_2_0.csproj b/mcs/class/Mono.Options/Mono.Options-net_2_0.csproj deleted file mode 100644 index b1d91902ed5..00000000000 --- a/mcs/class/Mono.Options/Mono.Options-net_2_0.csproj +++ /dev/null @@ -1,83 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {91B954C8-077B-49DD-BA35-AD8BAE7A79CD} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Mono.Options - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - - - - - diff --git a/mcs/class/Mono.Options/Mono.Options-tests-net_2_0.csproj b/mcs/class/Mono.Options/Mono.Options-tests-net_2_0.csproj deleted file mode 100644 index 4e7699dc2a4..00000000000 --- a/mcs/class/Mono.Options/Mono.Options-tests-net_2_0.csproj +++ /dev/null @@ -1,99 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E1915F81-F06D-4A4F-AA38-BB1BA8200B91} - Library - 1699 - bin\Debug\Mono.Options-tests-net_2_0 - True - False - - Properties - - - Mono.Options_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {91B954C8-077B-49DD-BA35-AD8BAE7A79CD} - Mono.Options\Mono.Options-net_2_0 - - - {2F9C802E-F1DA-4779-80B2-5AACE033D398} - Mono.Posix\Mono.Posix-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.Posix/Mono.Posix-net_2_0.csproj b/mcs/class/Mono.Posix/Mono.Posix-net_2_0.csproj deleted file mode 100644 index fb08807aa50..00000000000 --- a/mcs/class/Mono.Posix/Mono.Posix-net_2_0.csproj +++ /dev/null @@ -1,136 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2F9C802E-F1DA-4779-80B2-5AACE033D398} - Library - 1699,618,612 - ./../../class/lib/net_2_0 - True - True - true - Properties - - - Mono.Posix - v2.0 - 512 - - - true - full - 1699,618,612 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618,612 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {5A346705-1044-48F2-987D-CAE22A255427} - System\System-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.Posix/Mono.Posix-tests-net_2_0.csproj b/mcs/class/Mono.Posix/Mono.Posix-tests-net_2_0.csproj deleted file mode 100644 index ccbe2bef1e8..00000000000 --- a/mcs/class/Mono.Posix/Mono.Posix-tests-net_2_0.csproj +++ /dev/null @@ -1,98 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {CC6C32E1-55ED-469E-82B1-C60DA038FBE6} - Library - 1699,219,618 - bin\Debug\Mono.Posix-tests-net_2_0 - True - False - - Properties - - - Mono.Posix_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,219,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,219,618 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {2F9C802E-F1DA-4779-80B2-5AACE033D398} - Mono.Posix\Mono.Posix-net_2_0 - - - {2F9C802E-F1DA-4779-80B2-5AACE033D398} - Mono.Posix\Mono.Posix-net_2_0 - - - {5A346705-1044-48F2-987D-CAE22A255427} - System\System-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.Security.Win32/Mono.Security.Win32-net_2_0.csproj b/mcs/class/Mono.Security.Win32/Mono.Security.Win32-net_2_0.csproj deleted file mode 100644 index 94ca7da27b1..00000000000 --- a/mcs/class/Mono.Security.Win32/Mono.Security.Win32-net_2_0.csproj +++ /dev/null @@ -1,89 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {5A61BC1B-CF0D-450F-A114-02A4C863B71F} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - true - Properties - - - Mono.Security.Win32 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.Security/Mono.Security-net_2_0.csproj b/mcs/class/Mono.Security/Mono.Security-net_2_0.csproj deleted file mode 100644 index 935f3dc2a10..00000000000 --- a/mcs/class/Mono.Security/Mono.Security-net_2_0.csproj +++ /dev/null @@ -1,215 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {57CFE851-81AC-4269-B24A-965A53D87248} - Library - 1699,1030 - ./../../class/lib/net_2_0 - True - True - true - Properties - - - Mono.Security - v2.0 - 512 - - - true - full - 1699,1030 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,1030 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {5A346705-1044-48F2-987D-CAE22A255427} - System\System-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.Security/Mono.Security-tests-net_2_0.csproj b/mcs/class/Mono.Security/Mono.Security-tests-net_2_0.csproj deleted file mode 100644 index 3da8463338b..00000000000 --- a/mcs/class/Mono.Security/Mono.Security-tests-net_2_0.csproj +++ /dev/null @@ -1,129 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {1FE45C8C-1411-4C7E-BBF4-6C2F816239BE} - Library - 1699,1030,169,219,618,672 - bin\Debug\Mono.Security-tests-net_2_0 - True - False - true - Properties - - - Mono.Security_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,1030,169,219,618,672 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,1030,169,219,618,672 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {57CFE851-81AC-4269-B24A-965A53D87248} - Mono.Security\Mono.Security-net_2_0 - - - {5A346705-1044-48F2-987D-CAE22A255427} - System\System-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.Simd/Makefile b/mcs/class/Mono.Simd/Makefile index 3341fdabacd..04dc927a0f3 100644 --- a/mcs/class/Mono.Simd/Makefile +++ b/mcs/class/Mono.Simd/Makefile @@ -10,7 +10,7 @@ NO_TEST = yes # This is a .NET 2.0+ only assembly -VALID_PROFILE := $(filter net_2_0 net_4_0 net_4_5, $(PROFILE)) +VALID_PROFILE := $(filter net_4_0 net_4_5, $(PROFILE)) ifndef VALID_PROFILE LIBRARY_NAME = dummy-Mono.Simd.dll NO_INSTALL = yes diff --git a/mcs/class/Mono.Simd/Mono.Simd-net_2_0.csproj b/mcs/class/Mono.Simd/Mono.Simd-net_2_0.csproj deleted file mode 100644 index 87ddb676511..00000000000 --- a/mcs/class/Mono.Simd/Mono.Simd-net_2_0.csproj +++ /dev/null @@ -1,97 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2DE3C48F-6194-476B-99D9-B990C261EFF8} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - true - Properties - - - Mono.Simd - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.Tasklets/Mono.Tasklets-net_2_0.csproj b/mcs/class/Mono.Tasklets/Mono.Tasklets-net_2_0.csproj deleted file mode 100644 index c9c156076c2..00000000000 --- a/mcs/class/Mono.Tasklets/Mono.Tasklets-net_2_0.csproj +++ /dev/null @@ -1,79 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D329F40E-D458-4164-BAA4-196644F8E73C} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Mono.Tasklets - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - - - - - diff --git a/mcs/class/Mono.WebBrowser/Mono.WebBrowser-net_2_0.csproj b/mcs/class/Mono.WebBrowser/Mono.WebBrowser-net_2_0.csproj deleted file mode 100644 index 2611d1a2f8f..00000000000 --- a/mcs/class/Mono.WebBrowser/Mono.WebBrowser-net_2_0.csproj +++ /dev/null @@ -1,236 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F46C8C89-6CD0-432D-8BEF-C962DB694CDB} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Mono.WebBrowser - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - - - - - diff --git a/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks-net_2_0.csproj b/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks-net_2_0.csproj deleted file mode 100644 index 5678ab0b5e5..00000000000 --- a/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks-net_2_0.csproj +++ /dev/null @@ -1,89 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {8C54606D-305D-45B0-9932-380FE021BEFE} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Mono.XBuild.Tasks - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - diff --git a/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks-tests-net_2_0.csproj b/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks-tests-net_2_0.csproj deleted file mode 100644 index 91af433629b..00000000000 --- a/mcs/class/Mono.XBuild.Tasks/Mono.XBuild.Tasks-tests-net_2_0.csproj +++ /dev/null @@ -1,81 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {FBD61913-57C0-46E2-98D6-230F1953E28F} - Library - 1699 - bin\Debug\Mono.XBuild.Tasks-tests-net_2_0 - True - False - - Properties - - - Mono.XBuild.Tasks_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {8C54606D-305D-45B0-9932-380FE021BEFE} - Mono.XBuild.Tasks\Mono.XBuild.Tasks-net_2_0 - - - - - - - diff --git a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap-net_2_0.csproj b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap-net_2_0.csproj deleted file mode 100644 index c806cfcde22..00000000000 --- a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap-net_2_0.csproj +++ /dev/null @@ -1,304 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {30C57C43-3A84-4E9F-A889-53CAE3C634C4} - Library - 1699,612 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Novell.Directory.Ldap - v2.0 - 512 - - - true - full - 1699,612 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,612 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {57CFE851-81AC-4269-B24A-965A53D87248} - Mono.Security\Mono.Security-net_2_0 - - - - - - - - ResultCodeMessages.resources - - - - diff --git a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap-tests-net_2_0.csproj b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap-tests-net_2_0.csproj deleted file mode 100644 index 5cccc522787..00000000000 --- a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap-tests-net_2_0.csproj +++ /dev/null @@ -1,81 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {C0155A06-C828-42B0-96FC-A2F306B4CBD4} - Library - 1699 - bin\Debug\Novell.Directory.Ldap-tests-net_2_0 - True - False - - Properties - - - Novell.Directory.Ldap_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {30C57C43-3A84-4E9F-A889-53CAE3C634C4} - Novell.Directory.Ldap\Novell.Directory.Ldap-net_2_0 - - - - - - - diff --git a/mcs/class/Npgsql/Npgsql-net_2_0.csproj b/mcs/class/Npgsql/Npgsql-net_2_0.csproj deleted file mode 100644 index 831627755be..00000000000 --- a/mcs/class/Npgsql/Npgsql-net_2_0.csproj +++ /dev/null @@ -1,194 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {13268A15-2B77-416C-B815-B0AF1848580E} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - Npgsql - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {57CFE851-81AC-4269-B24A-965A53D87248} - Mono.Security\Mono.Security-net_2_0 - - - - - - - - Npgsql.NpgsqlState.resources - - - Npgsql.NpgsqlClosedState.resources - - - Npgsql.NpgsqlParameterCollection.resources - - - Npgsql.NpgsqlParameter.resources - - - Npgsql.NpgsqlCommand.resources - - - Npgsql.NpgsqlCommandBuilder.resources - - - Npgsql.NpgsqlConnectedState.resources - - - Npgsql.NpgsqlConnection.resources - - - Npgsql.NpgsqlReadyState.resources - - - Npgsql.NpgsqlTransaction.resources - - - Npgsql.NpgsqlEventLog.resources - - - Npgsql.NpgsqlException.resources - - - Npgsql.PGUtil.resources - - - Npgsql.NpgsqlConnectionString.resources - - - NpgsqlTypes.NpgsqlTypesHelper.resources - - - - diff --git a/mcs/class/Npgsql/Npgsql-tests-net_2_0.csproj b/mcs/class/Npgsql/Npgsql-tests-net_2_0.csproj deleted file mode 100644 index fbb242e28bd..00000000000 --- a/mcs/class/Npgsql/Npgsql-tests-net_2_0.csproj +++ /dev/null @@ -1,101 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2B752480-031B-4781-91D0-0250D4B9F372} - Library - 1699,618,219,169 - bin\Debug\Npgsql-tests-net_2_0 - True - False - - Properties - - - Npgsql_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618,219,169 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {13268A15-2B77-416C-B815-B0AF1848580E} - Npgsql\Npgsql-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {B8F7FDF0-07C7-4AFC-9854-F591BF307939} - System.Web\System.Web-net_2_0-1 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - - - - - diff --git a/mcs/class/PEAPI/PEAPI-net_2_0.csproj b/mcs/class/PEAPI/PEAPI-net_2_0.csproj deleted file mode 100644 index 22a4588502b..00000000000 --- a/mcs/class/PEAPI/PEAPI-net_2_0.csproj +++ /dev/null @@ -1,85 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {49C972D3-309D-4B4E-AEB7-01030E473870} - Library - 1699,414,618 - ./../../class/lib/net_2_0 - True - True - - Properties - - - PEAPI - v2.0 - 512 - - - true - full - 1699,414,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,414,618 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - - - - - diff --git a/mcs/class/RabbitMQ.Client/src/apigen/RabbitMQ.Client.Apigen-net_2_0.csproj b/mcs/class/RabbitMQ.Client/src/apigen/RabbitMQ.Client.Apigen-net_2_0.csproj deleted file mode 100644 index 002f0f56eb2..00000000000 --- a/mcs/class/RabbitMQ.Client/src/apigen/RabbitMQ.Client.Apigen-net_2_0.csproj +++ /dev/null @@ -1,103 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {B0FB491D-9EEC-47DC-B7D0-1D6B58F726AC} - Library - 1699 - ./../../../../class/lib/net_2_0 - True - True - - Properties - - - RabbitMQ.Client.Apigen - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - - - - - diff --git a/mcs/class/RabbitMQ.Client/src/client/RabbitMQ.Client-net_2_0.csproj b/mcs/class/RabbitMQ.Client/src/client/RabbitMQ.Client-net_2_0.csproj deleted file mode 100644 index 099fd1680e2..00000000000 --- a/mcs/class/RabbitMQ.Client/src/client/RabbitMQ.Client-net_2_0.csproj +++ /dev/null @@ -1,211 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {962E924C-777A-42E1-B7AC-823BFA34D22C} - Library - 1699,618 - ./../../../../class/lib/net_2_0 - True - True - - Properties - - - RabbitMQ.Client - v2.0 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - diff --git a/mcs/class/System.ComponentModel.DataAnnotations/DataAnnotationsResources.cs b/mcs/class/System.ComponentModel.DataAnnotations/DataAnnotationsResources.cs new file mode 100644 index 00000000000..5ff50e119df --- /dev/null +++ b/mcs/class/System.ComponentModel.DataAnnotations/DataAnnotationsResources.cs @@ -0,0 +1,59 @@ +namespace System.ComponentModel.DataAnnotations.Resources +{ +static class DataAnnotationsResources +{ + public const string ArgumentIsNullOrWhitespace = "ArgumentIsNullOrWhitespace"; + public const string AssociatedMetadataTypeTypeDescriptor_MetadataTypeContainsUnknownProperties = "AssociatedMetadataTypeTypeDescriptor_MetadataTypeContainsUnknownProperties"; + public const string AttributeStore_Unknown_Property = "AttributeStore_Unknown_Property"; + public const string Common_PropertyNotFound = "Common_PropertyNotFound"; + public const string CompareAttribute_MustMatch = "CompareAttribute_MustMatch"; + public const string CompareAttribute_UnknownProperty = "CompareAttribute_UnknownProperty"; + public const string CreditCardAttribute_Invalid = "CreditCardAttribute_Invalid"; + public const string CustomValidationAttribute_Method_Must_Return_ValidationResult = "CustomValidationAttribute_Method_Must_Return_ValidationResult"; + public const string CustomValidationAttribute_Method_Not_Found = "CustomValidationAttribute_Method_Not_Found"; + public const string CustomValidationAttribute_Method_Required = "CustomValidationAttribute_Method_Required"; + public const string CustomValidationAttribute_Method_Signature = "CustomValidationAttribute_Method_Signature"; + public const string CustomValidationAttribute_Type_Conversion_Failed = "CustomValidationAttribute_Type_Conversion_Failed"; + public const string CustomValidationAttribute_Type_Must_Be_Public = "CustomValidationAttribute_Type_Must_Be_Public"; + public const string CustomValidationAttribute_ValidationError = "{0} is not valid."; + public const string CustomValidationAttribute_ValidatorType_Required = "CustomValidationAttribute_ValidatorType_Required"; + public const string DataTypeAttribute_EmptyDataTypeString = "DataTypeAttribute_EmptyDataTypeString"; + public const string DisplayAttribute_PropertyNotSet = "The {0} property has not been set. Use the {1} method to get the value."; + public const string EmailAddressAttribute_Invalid = "EmailAddressAttribute_Invalid"; + public const string EnumDataTypeAttribute_TypeCannotBeNull = "EnumDataTypeAttribute_TypeCannotBeNull"; + public const string EnumDataTypeAttribute_TypeNeedsToBeAnEnum = "EnumDataTypeAttribute_TypeNeedsToBeAnEnum"; + public const string FileExtensionsAttribute_Invalid = "FileExtensionsAttribute_Invalid"; + public const string LocalizableString_LocalizationFailed = "Cannot retrieve property '{0}' because localization failed. Type '{1}' is not public or does not contain a public static string property with the name '{2}'."; + public const string MaxLengthAttribute_InvalidMaxLength = "MaxLengthAttribute_InvalidMaxLength"; + public const string MaxLengthAttribute_ValidationError = "MaxLengthAttribute_ValidationError"; + public const string MetadataTypeAttribute_TypeCannotBeNull = "MetadataTypeAttribute_TypeCannotBeNull"; + public const string MinLengthAttribute_InvalidMinLength = "MinLengthAttribute_InvalidMinLength"; + public const string MinLengthAttribute_ValidationError = "MinLengthAttribute_ValidationError"; + public const string PhoneAttribute_Invalid = "PhoneAttribute_Invalid"; + public const string RangeAttribute_ArbitraryTypeNotIComparable = "RangeAttribute_ArbitraryTypeNotIComparable"; + public const string RangeAttribute_MinGreaterThanMax = "RangeAttribute_MinGreaterThanMax"; + public const string RangeAttribute_Must_Set_Min_And_Max = "RangeAttribute_Must_Set_Min_And_Max"; + public const string RangeAttribute_Must_Set_Operand_Type = "RangeAttribute_Must_Set_Operand_Type"; + public const string RangeAttribute_ValidationError = "The field {0} must be between {1} and {2}."; + public const string RegexAttribute_ValidationError = "The field {0} must match the regular expression {1}."; + public const string RegularExpressionAttribute_Empty_Pattern = "The pattern must be set to a valid regular expression."; + public const string RequiredAttribute_ValidationError = "RequiredAttribute_ValidationError"; + public const string StringLengthAttribute_InvalidMaxLength = "StringLengthAttribute_InvalidMaxLength"; + public const string StringLengthAttribute_ValidationError = "The field {0} must be a string with a maximum length of {1}."; + public const string StringLengthAttribute_ValidationErrorIncludingMinimum = "StringLengthAttribute_ValidationErrorIncludingMinimum"; + public const string UIHintImplementation_ControlParameterKeyIsNotAString = "UIHintImplementation_ControlParameterKeyIsNotAString"; + public const string UIHintImplementation_ControlParameterKeyIsNull = "UIHintImplementation_ControlParameterKeyIsNull"; + public const string UIHintImplementation_ControlParameterKeyOccursMoreThanOnce = "UIHintImplementation_ControlParameterKeyOccursMoreThanOnce"; + public const string UIHintImplementation_NeedEvenNumberOfControlParameters = "UIHintImplementation_NeedEvenNumberOfControlParameters"; + public const string UrlAttribute_Invalid = "UrlAttribute_Invalid"; + public const string ValidationAttribute_Cannot_Set_ErrorMessage_And_Resource = "ValidationAttribute_Cannot_Set_ErrorMessage_And_Resource"; + public const string ValidationAttribute_IsValid_NotImplemented = "ValidationAttribute_IsValid_NotImplemented"; + public const string ValidationAttribute_NeedBothResourceTypeAndResourceName = "ValidationAttribute_NeedBothResourceTypeAndResourceName"; + public const string ValidationAttribute_ResourcePropertyNotStringType = "ValidationAttribute_ResourcePropertyNotStringType"; + public const string ValidationAttribute_ResourceTypeDoesNotHaveProperty = "ValidationAttribute_ResourceTypeDoesNotHaveProperty"; + public const string ValidationAttribute_ValidationError = "The field {0} is invalid."; + public const string ValidationContextServiceContainer_ItemAlreadyExists = "ValidationContextServiceContainer_ItemAlreadyExists"; + public const string Validator_InstanceMustMatchValidationContextInstance = "Validator_InstanceMustMatchValidationContextInstance"; + public const string Validator_Property_Value_Wrong_Type = "Validator_Property_Value_Wrong_Type"; +} +} \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations-net_2_0.csproj b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations-net_2_0.csproj deleted file mode 100644 index 004785cb1d9..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations-net_2_0.csproj +++ /dev/null @@ -1,120 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F3112064-6311-48A9-992B-A68DD3C62133} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.ComponentModel.DataAnnotations - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations-tests-net_2_0.csproj b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations-tests-net_2_0.csproj deleted file mode 100644 index 6d9dde4f654..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations-tests-net_2_0.csproj +++ /dev/null @@ -1,117 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {AE2FDFD3-791C-4B7F-AC47-46926705614B} - Library - 1699 - bin\Debug\System.ComponentModel.DataAnnotations-tests-net_2_0 - True - False - - Properties - - - System.ComponentModel.DataAnnotations_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {F3112064-6311-48A9-992B-A68DD3C62133} - System.ComponentModel.DataAnnotations\System.ComponentModel.DataAnnotations-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/ColumnAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/ColumnAttribute.cs deleted file mode 100644 index c015d65f165..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/ColumnAttribute.cs +++ /dev/null @@ -1,55 +0,0 @@ -// -// ColumnAttribute.cs -// -// Authors: -// Marek Safar -// -// Copyright (C) 2012 Xamarin Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_5 - -using System; - -namespace System.ComponentModel.DataAnnotations.Schema -{ - [AttributeUsageAttribute (AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)] - public class ColumnAttribute : Attribute - { - public ColumnAttribute () - { - } - - public ColumnAttribute (string name) - { - Name = name; - } - - public string Name { get; private set; } - - public int Order { get; set; } - - public string TypeName { get; set; } - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/ComplexTypeAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/ComplexTypeAttribute.cs deleted file mode 100644 index a3796e01b2e..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/ComplexTypeAttribute.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -// ComplexTypeAttribute.cs -// -// Authors: -// Marek Safar -// -// Copyright (C) 2012 Xamarin Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_5 - -using System; - -namespace System.ComponentModel.DataAnnotations.Schema -{ - [AttributeUsageAttribute (AttributeTargets.Class, AllowMultiple = false)] - public class ComplexTypeAttribute : Attribute - { - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/DatabaseGeneratedAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/DatabaseGeneratedAttribute.cs deleted file mode 100644 index ad3cdab1f5a..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/DatabaseGeneratedAttribute.cs +++ /dev/null @@ -1,47 +0,0 @@ -// -// DatabaseGeneratedAttribute.cs -// -// Authors: -// Marek Safar -// -// Copyright (C) 2012 Xamarin Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_5 - -using System; - -namespace System.ComponentModel.DataAnnotations.Schema -{ - [AttributeUsageAttribute (AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)] - public class DatabaseGeneratedAttribute : Attribute - { - public DatabaseGeneratedAttribute (DatabaseGeneratedOption databaseGeneratedOption) - { - DatabaseGeneratedOption = databaseGeneratedOption; - } - - public DatabaseGeneratedOption DatabaseGeneratedOption { get; private set; } - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/DatabaseGeneratedOption.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/DatabaseGeneratedOption.cs deleted file mode 100644 index 051c606d5ae..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/DatabaseGeneratedOption.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -// DatabaseGeneratedOption.cs -// -// Authors: -// Marek Safar -// -// Copyright (C) 2012 Xamarin Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_5 - -namespace System.ComponentModel.DataAnnotations.Schema -{ - public enum DatabaseGeneratedOption - { - None, - Identity, - Computed - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/ForeignKeyAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/ForeignKeyAttribute.cs deleted file mode 100644 index 9a3d0083bb4..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/ForeignKeyAttribute.cs +++ /dev/null @@ -1,47 +0,0 @@ -// -// ForeignKeyAttribute.cs -// -// Authors: -// Marek Safar -// -// Copyright (C) 2012 Xamarin Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_5 - -using System; - -namespace System.ComponentModel.DataAnnotations.Schema -{ - [AttributeUsageAttribute (AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)] - public class ForeignKeyAttribute : Attribute - { - public ForeignKeyAttribute (string name) - { - Name = name; - } - - public string Name { get; private set; } - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/InversePropertyAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/InversePropertyAttribute.cs deleted file mode 100644 index 155a3b900fa..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/InversePropertyAttribute.cs +++ /dev/null @@ -1,47 +0,0 @@ -// -// InversePropertyAttribute.cs -// -// Authors: -// Marek Safar -// -// Copyright (C) 2012 Xamarin Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_5 - -using System; - -namespace System.ComponentModel.DataAnnotations.Schema -{ - [AttributeUsageAttribute (AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)] - public class InversePropertyAttribute : Attribute - { - public InversePropertyAttribute (string property) - { - Property = property; - } - - public string Property { get; private set; } - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/NotMappedAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/NotMappedAttribute.cs deleted file mode 100644 index 5d66ccc4152..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/NotMappedAttribute.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -// NotMappedAttribute.cs -// -// Authors: -// Marek Safar -// -// Copyright (C) 2012 Xamarin Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_5 - -using System; - -namespace System.ComponentModel.DataAnnotations.Schema -{ - [AttributeUsageAttribute (AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)] - public class NotMappedAttribute : Attribute - { - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/TableAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/TableAttribute.cs deleted file mode 100644 index 65f7912a004..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.Schema/TableAttribute.cs +++ /dev/null @@ -1,49 +0,0 @@ -// -// TableAttribute.cs -// -// Authors: -// Marek Safar -// -// Copyright (C) 2012 Xamarin Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_5 - -using System; - -namespace System.ComponentModel.DataAnnotations.Schema -{ - [AttributeUsageAttribute(AttributeTargets.Class, AllowMultiple = false)] - public class TableAttribute : Attribute - { - public TableAttribute (string name) - { - Name = name; - } - - public string Name { get; private set; } - - public string Schema { get; set; } - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.dll.sources b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.dll.sources index 7fdb746ad04..df43b5ed4b0 100644 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.dll.sources +++ b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations.dll.sources @@ -2,29 +2,52 @@ ../../build/common/Locale.cs ../../build/common/MonoTODOAttribute.cs Assembly/AssemblyInfo.cs -System.ComponentModel.DataAnnotations/AssociatedMetadataTypePropertyDescriptor.cs -System.ComponentModel.DataAnnotations/AssociatedMetadataTypeTypeDescriptor.cs -System.ComponentModel.DataAnnotations/AssociatedMetadataTypeTypeDescriptionProvider.cs -System.ComponentModel.DataAnnotations/AssociationAttribute.cs -System.ComponentModel.DataAnnotations/ControlParameters.cs -System.ComponentModel.DataAnnotations/ConcurrencyCheckAttribute.cs -System.ComponentModel.DataAnnotations/CustomValidationAttribute.cs -System.ComponentModel.DataAnnotations/DataType.cs -System.ComponentModel.DataAnnotations/DataTypeAttribute.cs -System.ComponentModel.DataAnnotations/DisplayAttribute.cs -System.ComponentModel.DataAnnotations/DisplayColumnAttribute.cs -System.ComponentModel.DataAnnotations/DisplayFormatAttribute.cs -System.ComponentModel.DataAnnotations/EditableAttribute.cs -System.ComponentModel.DataAnnotations/EnumDataTypeAttribute.cs -System.ComponentModel.DataAnnotations/IValidatableObject.cs -System.ComponentModel.DataAnnotations/MetadataTypeAttribute.cs -System.ComponentModel.DataAnnotations/RangeAttribute.cs -System.ComponentModel.DataAnnotations/RegularExpressionAttribute.cs -System.ComponentModel.DataAnnotations/RequiredAttribute.cs -System.ComponentModel.DataAnnotations/ScaffoldColumnAttribute.cs -System.ComponentModel.DataAnnotations/ScaffoldTableAttribute.cs -System.ComponentModel.DataAnnotations/StringLengthAttribute.cs -System.ComponentModel.DataAnnotations/UIHintAttribute.cs -System.ComponentModel.DataAnnotations/UrlAttribute.cs -System.ComponentModel.DataAnnotations/ValidationAttribute.cs -System.ComponentModel.DataAnnotations/ValidationException.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/AssociatedMetadataTypeTypeDescriptionProvider.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/AssociatedMetadataTypeTypeDescriptor.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/AssociationAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/BindableTypeAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/CompareAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/ConcurrencyCheckAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/CreditCardAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/CustomValidationAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/DataType.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/DataTypeAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/DisplayAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/DisplayColumnAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/DisplayFormatAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/EditableAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/EmailAddressAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/EnumDataTypeAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/FileExtensionsAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/FilterUIHintAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/IValidatableObject.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/KeyAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/LocalizableString.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/MaxLengthAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/MetadataPropertyDescriptorWrapper.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/MetadataTypeAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/MinLengthAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/PhoneAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/RangeAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/RegularExpressionAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/RequiredAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/ScaffoldAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/Schema/ColumnAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/Schema/ComplexTypeAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/Schema/DatabaseGeneratedAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/Schema/DatabaseGeneratedOption.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/Schema/ForeignKeyAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/Schema/InversePropertyAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/Schema/NotMappedAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/Schema/TableAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/StringLengthAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/TimestampAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/UIHintAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/UrlAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/ValidationAttribute.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/ValidationAttributeStore.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/ValidationContext.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/ValidationException.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/ValidationResult.cs +../../../external/referencesource/System.ComponentModel.DataAnnotations/DataAnnotations/Validator.cs +DataAnnotationsResources.cs diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/AssociatedMetadataTypePropertyDescriptor.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/AssociatedMetadataTypePropertyDescriptor.cs deleted file mode 100644 index 2c1b013d3cd..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/AssociatedMetadataTypePropertyDescriptor.cs +++ /dev/null @@ -1,69 +0,0 @@ -// -// AssociatedMetadataTypeTypeDescriptionProvider.cs -// -// Author: -// Marek Habersack -// -// Copyright (C) 2009 Novell Inc. http://novell.com -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -#if !MOBILE -using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel; -using System.Reflection; - -namespace System.ComponentModel.DataAnnotations -{ - class AssociatedMetadataTypePropertyDescriptor : ReflectionPropertyDescriptor - { - MemberInfo metaTypeMember; - - public AssociatedMetadataTypePropertyDescriptor (PropertyInfo typeProperty, MemberInfo metaTypeMember) - : base (typeProperty) - { - this.metaTypeMember = metaTypeMember; - } - - protected override void FillAttributes (IList attributeList) - { - base.FillAttributes (attributeList); - if (metaTypeMember == null) - return; - - object[] attributes = metaTypeMember.GetCustomAttributes (false); - if (attributes == null || attributes.Length == 0) - return; - - foreach (object o in attributes) { - var attr = o as Attribute; - if (attr == null) - continue; - - attributeList.Add (attr); - } - } - } -} -#endif diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/AssociatedMetadataTypeTypeDescriptionProvider.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/AssociatedMetadataTypeTypeDescriptionProvider.cs deleted file mode 100644 index 212999a5e35..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/AssociatedMetadataTypeTypeDescriptionProvider.cs +++ /dev/null @@ -1,66 +0,0 @@ -// -// AssociatedMetadataTypeTypeDescriptionProvider.cs -// -// Author: -// Atsushi Enomoto -// -// Copyright (C) 2008 Novell Inc. http://novell.com -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -#if !MOBILE -using System; -using System.ComponentModel; - -namespace System.ComponentModel.DataAnnotations -{ - public class AssociatedMetadataTypeTypeDescriptionProvider : TypeDescriptionProvider - { - Type type; - Type associatedMetadataType; - - public AssociatedMetadataTypeTypeDescriptionProvider (Type type) - { - if (type == null) - throw new ArgumentNullException ("type"); - - this.type = type; - } - - public AssociatedMetadataTypeTypeDescriptionProvider (Type type, Type associatedMetadataType) - { - if (type == null) - throw new ArgumentNullException ("type"); - if (associatedMetadataType == null) - throw new ArgumentNullException ("associatedMetadataType"); - - this.type = type; - this.associatedMetadataType = associatedMetadataType; - } - - public override ICustomTypeDescriptor GetTypeDescriptor (Type objectType, object instance) - { - return new AssociatedMetadataTypeTypeDescriptor (base.GetTypeDescriptor (objectType, instance), type, associatedMetadataType); - } - } -} -#endif diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/AssociatedMetadataTypeTypeDescriptor.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/AssociatedMetadataTypeTypeDescriptor.cs deleted file mode 100644 index 12307ff4b3b..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/AssociatedMetadataTypeTypeDescriptor.cs +++ /dev/null @@ -1,170 +0,0 @@ -// -// AssociatedMetadataTypeTypeDescriptionProvider.cs -// -// Author: -// Marek Habersack -// -// Copyright (C) 2009 Novell Inc. http://novell.com -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -#if !MOBILE -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Reflection; - -namespace System.ComponentModel.DataAnnotations -{ - class AssociatedMetadataTypeTypeDescriptor : CustomTypeDescriptor - { - Type type; - Type associatedMetadataType; - bool associatedMetadataTypeChecked; - PropertyDescriptorCollection properties; - - Type AssociatedMetadataType { - get { - if (!associatedMetadataTypeChecked && associatedMetadataType == null) - associatedMetadataType = FindMetadataType (); - - return associatedMetadataType; - } - } - - public AssociatedMetadataTypeTypeDescriptor (ICustomTypeDescriptor parent, Type type) - : this (parent, type, null) - { - } - - public AssociatedMetadataTypeTypeDescriptor (ICustomTypeDescriptor parent, Type type, Type associatedMetadataType) - : base (parent) - { - this.type = type; - this.associatedMetadataType = associatedMetadataType; - } - - void CopyAttributes (object[] from, List to) - { - foreach (object o in from) { - Attribute a = o as Attribute; - if (a == null) - continue; - - to.Add (a); - } - } - - public override AttributeCollection GetAttributes () - { - var attributes = new List (); - CopyAttributes (type.GetCustomAttributes (true), attributes); - - Type metaType = AssociatedMetadataType; - if (metaType != null) - CopyAttributes (metaType.GetCustomAttributes (true), attributes); - - return new AttributeCollection (attributes.ToArray ()); - } - - public override PropertyDescriptorCollection GetProperties () - { - // Code partially copied from TypeDescriptor.TypeInfo.GetProperties - if (properties != null) - return properties; - - Dictionary metaMembers = null; - var propertiesHash = new Dictionary (); // name - null - var propertiesList = new List (); - Type currentType = type; - Type metaType = AssociatedMetadataType; - - if (metaType != null) { - metaMembers = new Dictionary (); - MemberInfo[] members = metaType.GetMembers (BindingFlags.Static | BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly); - - foreach (MemberInfo member in members) { - switch (member.MemberType) { - case MemberTypes.Field: - case MemberTypes.Property: - break; - - default: - continue; - } - - string name = member.Name; - if (metaMembers.ContainsKey (name)) - continue; - - metaMembers.Add (name, member); - } - } - - // Getting properties type by type, because in the case of a property in the child type, where - // the "new" keyword is used and also the return type is changed Type.GetProperties returns - // also the parent property. - // - // Note that we also have to preserve the properties order here. - // - while (currentType != null && currentType != typeof (object)) { - PropertyInfo[] props = currentType.GetProperties (BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly); - foreach (PropertyInfo property in props) { - string propName = property.Name; - - if (property.GetIndexParameters ().Length == 0 && property.CanRead && !propertiesHash.ContainsKey (propName)) { - MemberInfo metaMember; - - if (metaMembers != null) - metaMembers.TryGetValue (propName, out metaMember); - else - metaMember = null; - propertiesList.Add (new AssociatedMetadataTypePropertyDescriptor (property, metaMember)); - propertiesHash.Add (propName, true); - } - } - currentType = currentType.BaseType; - } - - properties = new PropertyDescriptorCollection ((PropertyDescriptor[]) propertiesList.ToArray (), true); - return properties; - } - - Type FindMetadataType () - { - associatedMetadataTypeChecked = true; - if (type == null) - return null; - - object[] attrs = type.GetCustomAttributes (typeof (MetadataTypeAttribute), true); - if (attrs == null || attrs.Length == 0) - return null; - - var attr = attrs [0] as MetadataTypeAttribute; - if (attr == null) - return null; - - return attr.MetadataClassType; - } - } -} -#endif diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/AssociationAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/AssociationAttribute.cs deleted file mode 100644 index 7624c6090b9..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/AssociationAttribute.cs +++ /dev/null @@ -1,89 +0,0 @@ -// -// AssociationAttribute.cs -// -// Authors: -// Marek Habersack -// -// Copyright (C) 2010 Novell Inc. (http://novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -#if NET_4_0 -using System; -using System.Collections.Generic; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsage (AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = true)] - public sealed class AssociationAttribute : Attribute - { - static readonly char[] keySplitChars = { ',' }; - - IEnumerable otherKeyMembers; - IEnumerable thisKeyMembers; - - public bool IsForeignKey { get; set; } - public string Name { get; private set; } - public string OtherKey { get; private set; } - - public IEnumerable OtherKeyMembers { - get { - if (otherKeyMembers == null) - otherKeyMembers = GetKeyMembers (OtherKey); - - return otherKeyMembers; - } - } - - public string ThisKey { get; private set; } - - public IEnumerable ThisKeyMembers { - get { - if (thisKeyMembers == null) - thisKeyMembers = GetKeyMembers (ThisKey); - - return thisKeyMembers; - } - } - - public AssociationAttribute (string name, string thisKey, string otherKey) - { - this.Name = name; - this.ThisKey = thisKey; - this.OtherKey = otherKey; - } - - IEnumerable GetKeyMembers (string key) - { - // .NET emulation - if (key == null) - throw new NullReferenceException (".NET emulation"); - - string nows = key.Replace (" ", String.Empty); - if (nows.Length == 0) - return new string[] { String.Empty }; - - return nows.Split (keySplitChars); - } - } -} -#endif diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ChangeLog b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ChangeLog deleted file mode 100644 index 1bfd423525f..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ChangeLog +++ /dev/null @@ -1,64 +0,0 @@ -2010-05-26 Marek Habersack - - * ValidationAttribute.cs: cope with null/empty ErrorMessageString - in FormatErrorMessage - -2010-05-12 Marek Habersack - - * ValidationException.cs: partially implemented - - * ValidationAttribute.cs: implemented - - * RequiredAttribute.cs: implemented. Fixes bug #604100 - - * AssociationAttribute.cs, ConcurrencyCheckAttribute.cs, - CustomValidationAttribute.cs, EditableAttribute.cs, - EnumDataTypeAttribute.cs, IValidatableObject.cs, - ValidationContext.cs, ValidationResult.cs: added - -2009-09-15 Marek Habersack - - * DataTypeAttribute.cs: implemented GetDataTypeName - -2009-06-23 Marek Habersack - - * ValidationAttribute.cs: error message must not ever be empty. - - * UIHintAttribute.cs: do not throw NIEX from the constructor. - - * DataTypeAttribute.cs: implemented correct DisplayFormat - intialization for DataType.Time. - - * AssociatedMetadataTypeTypeDescriptor.cs: implemented retrieving - attributes of the associated metadata type, as well as merging of - attribute collections between metadata and main type properties. - - * AssociatedMetadataTypePropertyDescriptor.cs: added. Helper class - which merges attributes from the metadata type (if any) with those - associated with property from the "main" type. - -2009-04-23 Marek Habersack - - * AssociatedMetadataTypeTypeDescriptor.cs: added - doesn't add any - real functionality yet. - - * AssociatedMetadataTypeTypeDescriptionProvider.cs: implemented - all the methods. - -2008-10-14 Atsushi Enomoto - - * AssociatedMetadataTypeTypeDescriptionProvider.cs - DataType.cs - DataTypeAttribute.cs - DisplayColumnAttribute.cs - DisplayFormatAttribute.cs - MetadataTypeAttribute.cs - RangeAttribute.cs - RegularExpressionAttribute.cs - RequiredAttribute.cs - ScaffoldColumnAttribute.cs - ScaffoldTableAttribute.cs - StringLengthAttribute.cs - UIHintAttribute.cs - ValidationAttribute.cs - ValidationException.cs: initial checkin. mostly stubs. diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/CompareAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/CompareAttribute.cs deleted file mode 100644 index afec3c9a089..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/CompareAttribute.cs +++ /dev/null @@ -1,118 +0,0 @@ -// -// CompareAttribute.cs -// -// Authors: -// Pablo Ruiz García -// -// Copyright (C) 2012 Xamarin Inc (http://www.xamarin.com) -// Copyright (C) 2013 Pablo Ruiz García -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_5 - -using System; -using System.Linq; -using System.Globalization; -using System.ComponentModel; -using System.Collections.Generic; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsageAttribute (AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)] - public class CompareAttribute : ValidationAttribute - { - private const string DefaultErrorMessage = "'{0}' and '{1}' do not match."; - private const string NonExistingPropertyErrorMessage = "Could not find a property named {0}."; - private string _otherProperty; - private string _otherPropertyDisplayName; - - public CompareAttribute (string otherProperty) - : base (() => DefaultErrorMessage) - { - if (string.IsNullOrEmpty (otherProperty)) - throw new ArgumentNullException ("otherProperty"); - - _otherProperty = otherProperty; - } - - public string OtherProperty { get { return _otherProperty; } } - public string OtherPropertyDisplayName { get { return _otherPropertyDisplayName; } } - public override bool RequiresValidationContext { get { return true; } } - - private IEnumerable GetPropertyAttributes (Type type, string propertyName) - { -#if MOBILE - return TypeDescriptor.GetProperties (type).Find (propertyName, false).Attributes.OfType (); -#else - // Using AMTTDP seems the way to go to be able to relay on attributes declared - // by means of associated classes not directly decorating the property. - // See: http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.associatedmetadatatypetypedescriptionprovider.aspx - return new AssociatedMetadataTypeTypeDescriptionProvider (type) - .GetTypeDescriptor (type) - .GetProperties () - .Find (propertyName, false) - .Attributes.OfType (); -#endif - } - - private void ResolveOtherPropertyDisplayName (ValidationContext context) - { - if (_otherPropertyDisplayName == null) - { - // NOTE: From my own tests, it seems MS.NET looksup displayName from various sources, what follows - // is a best guess from my on tests, however, I am probably missing some corner cases. (pruiz) - var attributes = GetPropertyAttributes (context.ObjectType, _otherProperty); - var displayAttr = attributes.FirstOrDefault (x => x is DisplayAttribute) as DisplayAttribute; - var displayNameAttr = attributes.FirstOrDefault (x => x is DisplayNameAttribute) as DisplayNameAttribute; - - if (displayAttr != null) _otherPropertyDisplayName = displayAttr.GetName (); - else if (displayNameAttr != null) _otherPropertyDisplayName = displayNameAttr.DisplayName; - _otherPropertyDisplayName = _otherProperty; - } - } - - public override string FormatErrorMessage (string name) - { - var oname = string.IsNullOrEmpty (_otherPropertyDisplayName) ? _otherProperty : _otherPropertyDisplayName; - return string.Format (ErrorMessageString, name, oname); - } - - protected override ValidationResult IsValid(object value, ValidationContext context) - { - var property = context.ObjectType.GetProperty (_otherProperty); - - if (property == null) { - string message = string.Format (NonExistingPropertyErrorMessage, _otherProperty); - return new ValidationResult (message); - } - - // XXX: Could not find a better place to call this, as this is - // the only place we have access to a ValidationContext. (pruiz) - ResolveOtherPropertyDisplayName (context); - - return object.Equals (property.GetValue (context.ObjectInstance, null), value) ? null - : new ValidationResult (FormatErrorMessage (context.DisplayName)); - } - } -} - -#endif diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ConcurrencyCheckAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ConcurrencyCheckAttribute.cs deleted file mode 100644 index 6d5cdc72435..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ConcurrencyCheckAttribute.cs +++ /dev/null @@ -1,44 +0,0 @@ -// -// ConcurrencyCheckAttribute.cs -// -// Authors: -// Marek Habersack -// -// Copyright (C) 2010 Novell Inc. (http://novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -#if NET_4_0 -using System; -using System.Collections.Generic; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsage (AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = true)] - public sealed class ConcurrencyCheckAttribute : Attribute - { - public ConcurrencyCheckAttribute () - { - } - } -} -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ControlParameters.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ControlParameters.cs deleted file mode 100644 index 98f7c5a81dc..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ControlParameters.cs +++ /dev/null @@ -1,92 +0,0 @@ -// -// ControlParameters.cs -// -// Authors: -// Marek Safar -// -// Copyright (C) 2013 Xamarin Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -using System.Collections; -using System.Collections.Generic; -using System.Linq; - -namespace System.ComponentModel.DataAnnotations -{ - sealed class ControlParameters : IEquatable - { - Dictionary dictionary; - readonly object[] parameters; - - public ControlParameters (object[] parameters) - { - this.parameters = parameters; - } - - public Dictionary Dictionary { - get { - return dictionary ?? (dictionary = CreateDictionary ()); - } - } - - public bool Equals (ControlParameters other) - { - if (parameters == null || other.parameters == null) - return ReferenceEquals (parameters, other.parameters); - - if (parameters.Length != other.parameters.Length) - return false; - - try { - return Dictionary.OrderBy (l => l.Key).SequenceEqual (other.Dictionary.OrderBy (l => l.Key)); - } catch (InvalidOperationException) { - return false; - } - } - - Dictionary CreateDictionary () - { - if (parameters == null || parameters.Length == 0) { - return new Dictionary (0); - } - - if (parameters.Length % 2 != 0) - throw new InvalidOperationException (); - - var dict = new Dictionary (); - for (int i = 0; i < parameters.Length; ) { - var key = parameters [i++] as string; - if (key == null) - throw new InvalidOperationException (); - - try { - dict.Add (key, parameters[i++]); - } catch (System.ArgumentException) { - throw new InvalidOperationException (); - } - } - - return dict; - } - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/CreditCardAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/CreditCardAttribute.cs deleted file mode 100644 index 66fdc90759c..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/CreditCardAttribute.cs +++ /dev/null @@ -1,75 +0,0 @@ -// -// CreditCardAttribute.cs -// -// Authors: -// Marek Safar -// Pablo Ruiz García -// -// Copyright (C) 2013 Xamarin Inc (http://www.xamarin.com) -// Copyright (C) 2013 Pablo Ruiz García -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_5 - -using System; -using System.Linq; -using System.Globalization; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsageAttribute (AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)] - public class CreditCardAttribute : DataTypeAttribute - { - private const string DefaultErrorMessage = "The {0} field is not a valid credit card number."; - - public CreditCardAttribute () - : base(DataType.CreditCard) - { - // XXX: There is no .ctor accepting Func on DataTypeAttribute.. :? - base.ErrorMessage = DefaultErrorMessage; - } - - public override bool IsValid(object value) - { - if (value == null) - return true; - - if (string.IsNullOrEmpty(value as string)) - return false; - - // Remove any invalid characters.. - var creditCardNumber = (value as string).Replace("-", "").Replace(" ", ""); - - if (creditCardNumber.Any (x => !Char.IsDigit (x))) - return false; - - // Performan a Luhn-based check against credit card number. - // - // See: http://en.wikipedia.org/wiki/Luhn_algorithm - // See: http://rosettacode.org/wiki/Luhn_test_of_credit_card_numbers - - return true; - } - } -} - -#endif diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/CustomValidationAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/CustomValidationAttribute.cs deleted file mode 100644 index 618dd881891..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/CustomValidationAttribute.cs +++ /dev/null @@ -1,141 +0,0 @@ -// -// CustomValidationAttribute.cs -// -// Authors: -// Marek Habersack -// -// Copyright (C) 2010-2011 Novell Inc. (http://novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -#if NET_4_0 -using System; -using System.Collections.Generic; -using System.Reflection; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsage (AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = true)] - public sealed class CustomValidationAttribute : ValidationAttribute - { - Tuple typeId; - MethodInfo validationMethod; - bool validationMethodChecked; - bool validationMethodSignatureValid; - int validationMethodParamCount; - - public string Method { get; private set; } - - public override object TypeId { - get { return typeId; } - } - - public Type ValidatorType { get; private set; } - - public CustomValidationAttribute (Type validatorType, string method) - { - this.ValidatorType = validatorType; - this.Method = method; - this.typeId = new Tuple (method, validatorType); - } - - public override string FormatErrorMessage (string name) - { - ThrowIfAttributeNotWellFormed (); - return String.Format ("{0} is not valid.", name); - } - - // LAMESPEC: MSDN doesn't document it at all, but corcompare shows it in the type - protected override ValidationResult IsValid (object value, ValidationContext validationContext) - { - ThrowIfAttributeNotWellFormed (); - object[] p; - - if (validationMethodParamCount == 2) - p = new object [] {value, validationContext}; - else - p = new object [] {value}; - try { - return validationMethod.Invoke (null, p) as ValidationResult; - } catch (TargetInvocationException ex) { - if (ex.InnerException != null) - throw ex.InnerException; - throw; - } - } - - void ThrowIfAttributeNotWellFormed () - { - Type type = ValidatorType; - if (type == null) - throw new InvalidOperationException ("The CustomValidationAttribute.ValidatorType was not specified."); - - if (type.IsNotPublic) - throw new InvalidOperationException (String.Format ("The custom validation type '{0}' must be public.", type.Name)); - - string method = Method; - if (String.IsNullOrEmpty (method)) - throw new InvalidOperationException ("The CustomValidationAttribute.Method was not specified."); - - if (validationMethod == null) { - if (!validationMethodChecked) { - validationMethod = type.GetMethod (method, BindingFlags.Public | BindingFlags.Static); - validationMethodChecked = true; - } - - if (validationMethod == null) - throw new InvalidOperationException ( - String.Format ("The CustomValidationAttribute method '{0}' does not exist in type '{1}' or is not public and static.", - method, type.Name)); - - if (!typeof (ValidationResult).IsAssignableFrom (validationMethod.ReturnType)) - throw new InvalidOperationException (String.Format ("The CustomValidationAttribute method '{0}' in type '{1}' must return System.ComponentModel.DataAnnotations.ValidationResult. Use System.ComponentModel.DataAnnotations.ValidationResult.Success to represent success.", method, type.Name)); - - validationMethodSignatureValid = true; - ParameterInfo[] parameters = validationMethod.GetParameters (); - if (parameters == null) - validationMethodSignatureValid = false; - else { - validationMethodParamCount = parameters.Length; - switch (validationMethodParamCount) { - case 1: - break; - - case 2: - if (parameters [1].ParameterType != typeof (ValidationContext)) - validationMethodSignatureValid = false; - break; - - default: - validationMethodSignatureValid = false; - break; - } - } - } - - if (!validationMethodSignatureValid) - throw new InvalidOperationException (String.Format ("The CustomValidationAttribute method '{0}' in type '{1}' must match the expected signature: public static ValidationResult MethodTwo(object value, ValidationContext context). The value can be strongly typed. The ValidationContext parameter is optional.", method, type.Name)); - - } - } -} -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/DataType.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/DataType.cs deleted file mode 100644 index 5ad56e74984..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/DataType.cs +++ /dev/null @@ -1,57 +0,0 @@ -// -// DataType.cs -// -// Author: -// Atsushi Enomoto -// -// Copyright (C) 2008-2011 Novell Inc. http://novell.com -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.ComponentModel.DataAnnotations -{ - public enum DataType - { - Custom, - DateTime, - Date, - Time, - Duration, - PhoneNumber, - Currency, - Text, - Html, - MultilineText, - EmailAddress, - Password, - Url, -#if NET_4_0 - ImageUrl, -#endif -#if NET_4_5 - CreditCard, - PostalCode, - Upload -#endif - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/DataTypeAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/DataTypeAttribute.cs deleted file mode 100644 index 3a373db8545..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/DataTypeAttribute.cs +++ /dev/null @@ -1,109 +0,0 @@ -// -// DataTypeAttribute.cs -// -// Author: -// Atsushi Enomoto -// Pablo Ruiz García -// -// Copyright (C) 2008 Novell Inc. http://novell.com -// Copyright (C) 2013 Pablo Ruiz García -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System; -using System.ComponentModel; - -namespace System.ComponentModel.DataAnnotations -{ -#if NET_4_0 - [AttributeUsage (AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = false)] -#else - [AttributeUsage (AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false)] -#endif - public class DataTypeAttribute : ValidationAttribute - { - public DataTypeAttribute (DataType dataType) - { - DataType = dataType; - - DisplayFormatAttribute displayFormat; - switch (dataType) { - case DataType.Time: - displayFormat = new DisplayFormatAttribute (); - displayFormat.ApplyFormatInEditMode = true; - displayFormat.ConvertEmptyStringToNull = true; - displayFormat.DataFormatString = "{0:t}"; -#if NET_4_0 - displayFormat.HtmlEncode = true; -#endif - break; - case DataType.Date: - displayFormat = new DisplayFormatAttribute (); - displayFormat.ApplyFormatInEditMode = true; - displayFormat.ConvertEmptyStringToNull = true; - displayFormat.DataFormatString = "{0:d}"; -#if NET_4_0 - displayFormat.HtmlEncode = true; -#endif - break; - case DataType.Currency: - displayFormat = new DisplayFormatAttribute (); - displayFormat.ApplyFormatInEditMode = false; - displayFormat.ConvertEmptyStringToNull = true; - displayFormat.DataFormatString = "{0:C}"; -#if NET_4_0 - displayFormat.HtmlEncode = true; -#endif - break; - - default: - displayFormat = null; - break; - } - - DisplayFormat = displayFormat; - } - - public DataTypeAttribute (string customDataType) - { - CustomDataType = customDataType; - } - - public string CustomDataType { get; private set; } - public DataType DataType { get; private set; } - public DisplayFormatAttribute DisplayFormat { get; protected set; } - - public virtual string GetDataTypeName () - { - DataType dt = DataType; - if (dt == DataType.Custom) - return CustomDataType; - - return dt.ToString (); - } - - public override bool IsValid (object value) - { - // Returns alwasy true - // See: http://msdn.microsoft.com/en-us/library/cc679235.aspx - return true; - } - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/DisplayAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/DisplayAttribute.cs deleted file mode 100644 index ffdd5bdad7f..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/DisplayAttribute.cs +++ /dev/null @@ -1,160 +0,0 @@ -// -// DisplayAttribute.cs -// -// Author: -// David Stone -// -// Copyright (C) 2010 David Stone -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System; -using System.ComponentModel; - -namespace System.ComponentModel.DataAnnotations -{ -#if NET_4_0 - [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Method, AllowMultiple = false)] - public sealed class DisplayAttribute : Attribute - { - public Type ResourceType { get; set; } - - public string Description { get; set; } - public string GroupName { get; set; } - public string Name { get; set; } - public string ShortName { get; set; } - public string Prompt { get; set; } - - const string property_not_set_message = "The {0} property has not been set. Use the Get{0} method to get the value."; - const string localization_failed_message = "Cannot retrieve property '{0}' because localization failed. Type '{1} is not public or does not contain a public static string property with the name '{2}'."; - - bool? _autoGenerateField; - public bool AutoGenerateField { - get { - if (!_autoGenerateField.HasValue) { - throw new InvalidOperationException (string.Format (property_not_set_message, "AutoGenerateField")); - } - - return _autoGenerateField.Value; - } - set { _autoGenerateField = value; } - } - - bool? _autoGenerateFilter; - public bool AutoGenerateFilter { - get { - if (_autoGenerateFilter == null) { - throw new InvalidOperationException (string.Format (property_not_set_message, "AutoGenerateFilter")); - } - - return _autoGenerateFilter.Value; - } - set { _autoGenerateFilter = value; } - } - - int? _order; - public int Order { - get { - if (_order == null) - throw new InvalidOperationException (string.Format (property_not_set_message, "Order")); - - return _order.Value; - } - set { _order = value; } - } - - private string GetLocalizedString (string propertyName, string key) - { - // If we don't have a resource or a key, go ahead and fall back on the key - if (ResourceType == null || key == null) - return key; - - var property = ResourceType.GetProperty (key); - - // Strings are only valid if they are public static strings - var isValid = false; - if (ResourceType.IsVisible && property != null && property.PropertyType == typeof(string)) { - var getter = property.GetGetMethod (); - - // Gotta have a public static getter on the property - if (getter != null && getter.IsStatic && getter.IsPublic) { - isValid = true; - } - } - - // If it's not valid, go ahead and throw an InvalidOperationException - if (!isValid) { - var message = string.Format (localization_failed_message, propertyName, ResourceType.ToString (), key); - throw new InvalidOperationException (message); - } - - return (string)property.GetValue (null, null); - - } - - #region Consumer Methods - public bool? GetAutoGenerateField () - { - return _autoGenerateField; - } - - public bool? GetAutoGenerateFilter () - { - return _autoGenerateFilter; - } - - public int? GetOrder () - { - return _order; - } - - public string GetName () - { - return GetLocalizedString ("Name", Name); - } - - public string GetShortName () - { - // Short name falls back on Name if the short name isn't set - return GetLocalizedString ("ShortName", ShortName) ?? GetName (); - } - - public string GetDescription () - { - return GetLocalizedString ("Description", Description); - } - - public string GetPrompt () - { - return GetLocalizedString ("Prompt", Prompt); - } - - public string GetGroupName () - { - return GetLocalizedString ("GroupName", GroupName); - } - - #endregion - - } -#endif -} - diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/DisplayColumnAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/DisplayColumnAttribute.cs deleted file mode 100644 index 301ee94cd18..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/DisplayColumnAttribute.cs +++ /dev/null @@ -1,59 +0,0 @@ -// -// DisplayColumnAttribute.cs -// -// Author: -// Atsushi Enomoto -// -// Copyright (C) 2008 Novell Inc. http://novell.com -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System; -using System.ComponentModel; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsage (AttributeTargets.Class, Inherited = true, AllowMultiple = false)] - public class DisplayColumnAttribute : Attribute - { - public DisplayColumnAttribute (string displayColumn) - : this (displayColumn, null) - { - } - - public DisplayColumnAttribute (string displayColumn, string sortColumn) - : this (displayColumn, sortColumn, false) - { - } - - public DisplayColumnAttribute (string displayColumn, string sortColumn, bool sortDescending) - { - DisplayColumn = displayColumn; - SortColumn = sortColumn; - SortDescending = sortDescending; - } - - public string DisplayColumn { get; private set; } - public string SortColumn { get; private set; } - public bool SortDescending { get; private set; } - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/DisplayFormatAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/DisplayFormatAttribute.cs deleted file mode 100644 index 4c48a83d2f0..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/DisplayFormatAttribute.cs +++ /dev/null @@ -1,46 +0,0 @@ -// -// DisplayFormatAttribute.cs -// -// Author: -// Atsushi Enomoto -// -// Copyright (C) 2008 Novell Inc. http://novell.com -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System; -using System.ComponentModel; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsage (AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false)] - public class DisplayFormatAttribute : Attribute - { - public bool ApplyFormatInEditMode { get; set; } - public bool ConvertEmptyStringToNull { get; set; } - public string DataFormatString { get; set; } - public string NullDisplayText { get; set; } -#if NET_4_0 - public bool HtmlEncode { get; set; } -#endif - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/EditableAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/EditableAttribute.cs deleted file mode 100644 index abfba998c24..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/EditableAttribute.cs +++ /dev/null @@ -1,48 +0,0 @@ -// -// EditableAttribute.cs -// -// Authors: -// Marek Habersack -// -// Copyright (C) 2010 Novell Inc. (http://novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -#if NET_4_0 -using System; -using System.Collections.Generic; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsage (AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = true)] - public sealed class EditableAttribute : Attribute - { - public bool AllowEdit { get; private set; } - public bool AllowInitialValue { get; set; } - - public EditableAttribute (bool allowEdit) - { - this.AllowEdit = allowEdit; - } - } -} -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/EmailAddressAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/EmailAddressAttribute.cs deleted file mode 100644 index 5d79b926c19..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/EmailAddressAttribute.cs +++ /dev/null @@ -1,313 +0,0 @@ -// -// EmailAddressAttribute.cs -// -// Authors: -// Marek Safar -// Pablo Ruiz García -// -// Copyright (C) 2013 Xamarin Inc (http://www.xamarin.com) -// Copyright (C) 2013 Pablo Ruiz García -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_5 - -using System; -using System.Globalization; -using System.Text.RegularExpressions; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsageAttribute (AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)] - public class EmailAddressAttribute : DataTypeAttribute - { - private const string DefaultErrorMessage = "The {0} field is not a valid e-mail address."; - const string AtomCharacters = "!#$%&'*+-/=?^_`{|}~"; - - static bool IsLetterOrDigit (char c) - { - return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9'); - } - - static bool IsAtom (char c) - { - return IsLetterOrDigit (c) || AtomCharacters.IndexOf (c) != -1; - } - - static bool IsDomain (char c) - { - return IsLetterOrDigit (c) || c == '-'; - } - - static bool SkipAtom (string text, ref int index) - { - int startIndex = index; - - while (index < text.Length && IsAtom (text[index])) - index++; - - return index > startIndex; - } - - static bool SkipSubDomain (string text, ref int index) - { - if (!IsDomain (text[index]) || text[index] == '-') - return false; - - index++; - - while (index < text.Length && IsDomain (text[index])) - index++; - - return true; - } - - static bool SkipDomain (string text, ref int index) - { - if (!SkipSubDomain (text, ref index)) - return false; - - while (index < text.Length && text[index] == '.') { - index++; - - if (index == text.Length) - return false; - - if (!SkipSubDomain (text, ref index)) - return false; - } - - return true; - } - - static bool SkipQuoted (string text, ref int index) - { - bool escaped = false; - - // skip over leading '"' - index++; - - while (index < text.Length) { - if (text[index] == (byte) '\\') { - escaped = !escaped; - } else if (!escaped) { - if (text[index] == (byte) '"') - break; - } else { - escaped = false; - } - - index++; - } - - if (index >= text.Length || text[index] != (byte) '"') - return false; - - index++; - - return true; - } - - static bool SkipWord (string text, ref int index) - { - if (text[index] == (byte) '"') - return SkipQuoted (text, ref index); - - return SkipAtom (text, ref index); - } - - static bool SkipIPv4Literal (string text, ref int index) - { - int groups = 0; - - while (index < text.Length && groups < 4) { - int startIndex = index; - int value = 0; - - while (index < text.Length && text[index] >= '0' && text[index] <= '9') { - value = (value * 10) + (text[index] - '0'); - index++; - } - - if (index == startIndex || index - startIndex > 3 || value > 255) - return false; - - groups++; - - if (groups < 4 && index < text.Length && text[index] == '.') - index++; - } - - return groups == 4; - } - - static bool IsHexDigit (char c) - { - return (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f') || (c >= '0' && c <= '9'); - } - - // This needs to handle the following forms: - // - // IPv6-addr = IPv6-full / IPv6-comp / IPv6v4-full / IPv6v4-comp - // IPv6-hex = 1*4HEXDIG - // IPv6-full = IPv6-hex 7(":" IPv6-hex) - // IPv6-comp = [IPv6-hex *5(":" IPv6-hex)] "::" [IPv6-hex *5(":" IPv6-hex)] - // ; The "::" represents at least 2 16-bit groups of zeros - // ; No more than 6 groups in addition to the "::" may be - // ; present - // IPv6v4-full = IPv6-hex 5(":" IPv6-hex) ":" IPv4-address-literal - // IPv6v4-comp = [IPv6-hex *3(":" IPv6-hex)] "::" - // [IPv6-hex *3(":" IPv6-hex) ":"] IPv4-address-literal - // ; The "::" represents at least 2 16-bit groups of zeros - // ; No more than 4 groups in addition to the "::" and - // ; IPv4-address-literal may be present - static bool SkipIPv6Literal (string text, ref int index) - { - bool compact = false; - int colons = 0; - - while (index < text.Length) { - int startIndex = index; - - while (index < text.Length && IsHexDigit (text[index])) - index++; - - if (index >= text.Length) - break; - - if (index > startIndex && colons > 2 && text[index] == '.') { - // IPv6v4 - index = startIndex; - - if (!SkipIPv4Literal (text, ref index)) - return false; - - break; - } - - int count = index - startIndex; - if (count > 4) - return false; - - if (text[index] != ':') - break; - - startIndex = index; - while (index < text.Length && text[index] == ':') - index++; - - count = index - startIndex; - if (count > 2) - return false; - - if (count == 2) { - if (compact) - return false; - - compact = true; - colons += 2; - } else { - colons++; - } - } - - if (colons < 2) - return false; - - if (compact) - return colons < 6; - - return colons < 7; - } - - static bool Validate (string email) - { - int index = 0; - - if (email.Length == 0) - return false; - - if (!SkipWord (email, ref index) || index >= email.Length) - return false; - - while (index < email.Length && email[index] == '.') { - index++; - - if (!SkipWord (email, ref index) || index >= email.Length) - return false; - } - - if (index + 1 >= email.Length || email[index++] != '@') - return false; - - if (email[index] != '[') { - // domain - if (!SkipDomain (email, ref index)) - return false; - - return index == email.Length; - } - - // address literal - index++; - - // we need at least 8 more characters - if (index + 8 >= email.Length) - return false; - - var ipv6 = email.Substring (index, 5); - if (ipv6.ToLowerInvariant () == "ipv6:") { - index += "IPv6:".Length; - if (!SkipIPv6Literal (email, ref index)) - return false; - } else { - if (!SkipIPv4Literal (email, ref index)) - return false; - } - - if (index >= email.Length || email[index++] != ']') - return false; - - return index == email.Length; - } - - public EmailAddressAttribute () - : base(DataType.EmailAddress) - { - // XXX: There is no .ctor accepting Func on DataTypeAttribute.. :? - base.ErrorMessage = DefaultErrorMessage; - } - - public override bool IsValid(object value) - { - if (value == null) - return true; - - string email = value as string; - if (email == null) - return false; - - return Validate (email); - } - } -} - -#endif diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/EnumDataTypeAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/EnumDataTypeAttribute.cs deleted file mode 100644 index a0efa1e846d..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/EnumDataTypeAttribute.cs +++ /dev/null @@ -1,117 +0,0 @@ -// -// EnumDataTypeAttribute.cs -// -// Authors: -// Marek Habersack -// -// Copyright (C) 2010 Novell Inc. (http://novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -#if NET_4_0 -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Globalization; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsage (AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)] - public sealed class EnumDataTypeAttribute : DataTypeAttribute - { - public Type EnumType { get; private set; } - - public EnumDataTypeAttribute (Type enumType) - : base (DataType.Custom) - { - this.EnumType = enumType; - } - - public override bool IsValid (object value) - { - Type type = EnumType; - - if (!type.IsEnum) - throw new InvalidOperationException ( - String.Format ("The type '{0}' needs to represent an enumeration type.", type.FullName) - ); - - if (value == null) - return true; - - Type valueType = value.GetType (); - if (valueType.IsEnum && valueType != type) - return false; - - string s = value as string; - if (s != null && s.Length == 0) - return true; - - if (s != null && (valueType == typeof (bool) || valueType == typeof (char) || valueType == typeof (float))) - return false; - - object o; - - if (s != null) { - try { - o = Enum.Parse (type, s); - } catch { - return false; - } - } else if (valueType.IsEnum) - o = value; - else { - try { - o = Enum.ToObject (type, value); - } catch { - return false; - } - } - - object[] attrs = type.GetCustomAttributes (typeof (FlagsAttribute), true); - if (attrs != null && attrs.Length > 0) { - string sval = Convert.ChangeType (o, Enum.GetUnderlyingType (type), CultureInfo.InvariantCulture).ToString (); - - // This looks weird, but what happens here is that if we have a - // mismatch, the above type change will make sval equal o.ToString - // () and if we have a match, then sval will be string - // representation of the enum member's value. So, if we have an - // enum: - // - // [Flags] - // enum Test - // { - // One = 1, - // Two = 2 - // } - // - // And the passed value was 3, then o.ToString () == "One, Two" and - // sval == "3". If the passed value was 33, though, o.ToString () == - // "33" and sval == "33" - thus we DON'T have a match. - return !sval.Equals (o.ToString ()); - } - - return Enum.IsDefined (type, o); - } - } -} -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/FileExtensionsAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/FileExtensionsAttribute.cs deleted file mode 100644 index de9c384d64a..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/FileExtensionsAttribute.cs +++ /dev/null @@ -1,92 +0,0 @@ -// -// FileExtensionAttribute.cs -// -// Authors: -// Marek Safar -// Pablo Ruiz García -// -// Copyright (C) 2013 Xamarin Inc (http://www.xamarin.com) -// Copyright (C) 2013 Pablo Ruiz García -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_5 - -using System; -using System.Linq; -using System.Globalization; -using System.Text.RegularExpressions; - -namespace System.ComponentModel.DataAnnotations -{ - // See: http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.fileextensionsattribute.aspx - - [AttributeUsageAttribute (AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)] - public class FileExtensionsAttribute : DataTypeAttribute - { - private const string DefaultErrorMessage = "The {0} field only accepts files with the following extensions: {1}."; - private const string DefaultExtensions = "png,jpg,jpeg,gif"; - - public FileExtensionsAttribute () - : base (DataType.Upload) - { - // XXX: There is no .ctor accepting Func on DataTypeAttribute.. :? - base.ErrorMessage = DefaultErrorMessage; - this.Extensions = DefaultExtensions; - } - - public string Extensions { get; set; } - - private string[] GetExtensionList () - { - return (Extensions ?? "").Split (','); - } - - private string GetExtension (string filename) - { - var parts = filename.Split ('.'); - return parts.Length > 0 ? parts [parts.Length - 1] : ""; - } - - public override string FormatErrorMessage (string name) - { - var extensions = GetExtensionList().Aggregate ((cur, next) => cur + ", " + next); - return string.Format (ErrorMessageString, name, extensions); - } - - public override bool IsValid(object value) - { - if (value == null) - return true; - - if (value is string) - { - var str = value as string; - var ext = GetExtension (str); - return GetExtensionList ().Any (x => string.Equals (x, ext, StringComparison.InvariantCultureIgnoreCase)); - } - - return false; - } - } -} - -#endif diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/FilterUIHintAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/FilterUIHintAttribute.cs deleted file mode 100644 index 870e4092d86..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/FilterUIHintAttribute.cs +++ /dev/null @@ -1,93 +0,0 @@ -// -// FilterUIHintAttribute.cs -// -// Authors: -// Marek Safar -// -// Copyright (C) 2013 Xamarin Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_0 - -using System.Runtime.CompilerServices; -using System.Collections.Generic; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsageAttribute (AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)] - public sealed class FilterUIHintAttribute : Attribute - { - readonly ControlParameters controlParameters; - - public FilterUIHintAttribute (string filterUIHint) - : this (filterUIHint, null, null) - { - } - - public FilterUIHintAttribute (string filterUIHint, string presentationLayer) - : this (filterUIHint, presentationLayer, null) - { - } - - public FilterUIHintAttribute (string filterUIHint, string presentationLayer, params object[] controlParameters) - { - FilterUIHint = filterUIHint; - PresentationLayer = presentationLayer; - this.controlParameters = new ControlParameters (controlParameters); - } - - public IDictionary ControlParameters { - get { - return controlParameters.Dictionary; - } - } - - public string FilterUIHint { get; private set; } - - public string PresentationLayer { get; private set; } - - public override object TypeId { - get { - return this; - } - } - - public override int GetHashCode () - { - return RuntimeHelpers.GetHashCode (FilterUIHint) ^ - RuntimeHelpers.GetHashCode (PresentationLayer); - } - - public override bool Equals (object obj) - { - var fha = obj as FilterUIHintAttribute; - if (fha == null) - return false; - - return fha.FilterUIHint == FilterUIHint && - fha.PresentationLayer == PresentationLayer && - fha.controlParameters.Equals (controlParameters); - } - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/IValidatableObject.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/IValidatableObject.cs deleted file mode 100644 index cf68fc3669c..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/IValidatableObject.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -// IValidatableObject.cs -// -// Authors: -// Marek Habersack -// -// Copyright (C) 2010 Novell Inc. (http://novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -#if NET_4_0 -using System; -using System.Collections.Generic; - -namespace System.ComponentModel.DataAnnotations -{ - public interface IValidatableObject - { - IEnumerable Validate (ValidationContext validationContext); - } -} -#endif diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/KeyAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/KeyAttribute.cs deleted file mode 100644 index 37cde191cc3..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/KeyAttribute.cs +++ /dev/null @@ -1,39 +0,0 @@ -// -// KeyAttribute.cs -// -// Authors: -// Marek Safar -// -// Copyright (C) 2012 Xamarin Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_0 - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsageAttribute (AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false, Inherited = true)] - public sealed class KeyAttribute : Attribute - { - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/MaxLengthAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/MaxLengthAttribute.cs deleted file mode 100644 index 84fab2a3a63..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/MaxLengthAttribute.cs +++ /dev/null @@ -1,91 +0,0 @@ -// -// MaxLengthAttribute.cs -// -// Authors: -// Marek Safar -// Pablo Ruiz García -// -// Copyright (C) 2012 Xamarin Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_5 - -using System; -using System.Globalization; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsageAttribute (AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)] - public class MaxLengthAttribute : ValidationAttribute - { - private const string DefaultErrorMessage = "The field {0} must be a string or array type with a maximum length of '{1}'."; - private const string InvalidLengthErrorMessage = "MaxLengthAttribute must have a Length value that is greater than zero. " + - "Use MaxLength() without parameters to indicate that the string or array can have the maximum allowable length."; - private bool _maxLength = true; - - public MaxLengthAttribute () - : base (() => DefaultErrorMessage) - { - } - - public MaxLengthAttribute (int length) - : this () - { - Length = length; - _maxLength = false; - } - - public int Length { get; private set; } - - public override string FormatErrorMessage (string name) - { - return string.Format (ErrorMessageString, name, Length); - } - - public override bool IsValid (object value) - { - // See: http://msdn.microsoft.com/en-us/library/gg696614.aspx - - if (this.Length == 0 || this.Length < -1) - throw new InvalidOperationException (InvalidLengthErrorMessage); - - // Weird, but using 'MaxLength' with no length seems to be valid - // and we should be returning true, and not throwing. (pablo) - if (value != null && !_maxLength) { - - if (value is string) { - return (value as string).Length <= this.Length; - } - - if (value is Array) { - return (value as Array).Length <= this.Length; - } - - // NOTE: from my tests, MS.NET does not support IEnumerable as value. :( - } - - return true; - } - } -} - -#endif diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/MetadataTypeAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/MetadataTypeAttribute.cs deleted file mode 100644 index 4fdae6c4c2a..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/MetadataTypeAttribute.cs +++ /dev/null @@ -1,45 +0,0 @@ -// -// MetadataTypeAttribute.cs -// -// Author: -// Atsushi Enomoto -// -// Copyright (C) 2008 Novell Inc. http://novell.com -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System; -using System.ComponentModel; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsage (AttributeTargets.Class, AllowMultiple = false)] - public sealed class MetadataTypeAttribute : Attribute - { - public MetadataTypeAttribute (Type metadataClassType) - { - MetadataClassType = metadataClassType; - } - - public Type MetadataClassType { get; private set; } - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/MinLengthAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/MinLengthAttribute.cs deleted file mode 100644 index ff30f7646d3..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/MinLengthAttribute.cs +++ /dev/null @@ -1,82 +0,0 @@ -// -// MinLengthAttribute.cs -// -// Authors: -// Marek Safar -// Pablo Ruiz García -// -// Copyright (C) 2013 Xamarin Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_5 - -using System; -using System.Globalization; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsageAttribute (AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)] - public class MinLengthAttribute : ValidationAttribute - { - private const string DefaultErrorMessage = "The field {0} must be a string or array type with a minimum length of '{1}'."; - private const string InvalidLengthErrorMessage = "MinLengthAttribute must have a Length value that is zero or greater."; - - public MinLengthAttribute () - { - } - - public MinLengthAttribute (int length) - { - Length = length; - } - - public int Length { get; private set; } - - public override string FormatErrorMessage (string name) - { - return string.Format (ErrorMessageString, name, Length); - } - - public override bool IsValid (object value) - { - if (this.Length < 0) - throw new InvalidOperationException (InvalidLengthErrorMessage); - - if (value != null) { - - if (value is string) { - return (value as string).Length >= this.Length; - } - - if (value is Array) { - return (value as Array).Length >= this.Length; - } - - // NOTE: from my tests, MS.NET does not support IEnumerable as value. :( - } - - return true; - } - } -} - -#endif diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/PhoneAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/PhoneAttribute.cs deleted file mode 100644 index 58cec3b6a4c..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/PhoneAttribute.cs +++ /dev/null @@ -1,69 +0,0 @@ -// -// PhoneAttribute.cs -// -// Authors: -// Marek Safar -// Pablo Ruiz García -// -// Copyright (C) 2013 Xamarin Inc (http://www.xamarin.com) -// Copyright (C) 2013 Pablo Ruiz García -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_5 - -using System; -using System.Globalization; -using System.Text.RegularExpressions; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsageAttribute (AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)] - public class PhoneAttribute : DataTypeAttribute - { - private const string DefaultErrorMessage = "The {0} field is not a valid phone number."; - private const string _regexStr = @"^\+?(\d[\d-. ]+)?(\([\d-. ]+\))?[\d-. ]+\d$"; - private static Regex _regex = new Regex (_regexStr, RegexOptions.IgnoreCase | RegexOptions.Compiled); - - public PhoneAttribute () - : base(DataType.PhoneNumber) - { - // XXX: There is no .ctor accepting Func on DataTypeAttribute.. :? - base.ErrorMessage = DefaultErrorMessage; - } - - public override bool IsValid(object value) - { - if (value == null) - return true; - - if (value is string) - { - var str = value as string; - return !string.IsNullOrEmpty(str) ? _regex.IsMatch(str) : false; - } - - return false; - } - } -} - -#endif diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/RangeAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/RangeAttribute.cs deleted file mode 100644 index 9bf52669df9..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/RangeAttribute.cs +++ /dev/null @@ -1,191 +0,0 @@ -// -// RangeAttribute.cs -// -// Author: -// Atsushi Enomoto -// -// Copyright (C) 2008 Novell Inc. http://novell.com -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System; -using System.Globalization; -using System.ComponentModel; - -namespace System.ComponentModel.DataAnnotations -{ -#if NET_4_0 - [AttributeUsage (AttributeTargets.Parameter | AttributeTargets.Field | AttributeTargets.Property, AllowMultiple = false)] -#else - [AttributeUsage (AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false)] -#endif - public class RangeAttribute : ValidationAttribute - { - Func comparer; - TypeConverter cvt; - - public object Maximum { get; private set; } - public object Minimum { get; private set; } - public Type OperandType { get; private set; } - - IComparable MaximumComparable { - get { return Maximum as IComparable; } - } - - IComparable MinimumComparable { - get { return Minimum as IComparable; } - } - - RangeAttribute () - : base (GetDefaultErrorMessage) - { - } - - public RangeAttribute (double minimum, double maximum) : this () - { - Minimum = minimum; - Maximum = maximum; - OperandType = typeof (double); - } - - public RangeAttribute (int minimum, int maximum) : this () - { - Minimum = minimum; - Maximum = maximum; - OperandType = typeof (int); - } - - public RangeAttribute (Type type, string minimum, string maximum) : this () - { -#if !NET_4_0 - if (type == null) - throw new ArgumentNullException ("type"); -#endif - OperandType = type; - Minimum = minimum; - Maximum = maximum; -#if !NET_4_0 - comparer = SetupComparer (); -#endif - } - - static string GetDefaultErrorMessage () - { - return "The field {0} must be between {1} and {2}."; - } - - public override string FormatErrorMessage (string name) - { - if (comparer == null) - comparer = SetupComparer (); - - return String.Format (ErrorMessageString, name, Minimum, Maximum); - } - - // LAMESPEC: does not throw ValidationException when value is out of range - public override bool IsValid (object value) - { - if (comparer == null) - comparer = SetupComparer (); - - if (value == null) - return true; - - string s = value as string; - if (s != null && s.Length == 0) - return true; - - try { - if (comparer != null) - return comparer (value); - - return false; - } catch (FormatException) { - return false; - } catch (InvalidCastException) { - return false; - } - } - - Func SetupComparer () - { - Type ot = OperandType; - - object min = Minimum, max = Maximum; -#if NET_4_0 - if (min == null || max == null) - throw new InvalidOperationException ("The minimum and maximum values must be set."); -#endif - if (min is int) - return new Func (CompareInt); - - if (min is double) - return new Func (CompareDouble); - - if (ot == null) - throw new InvalidOperationException ("The OperandType must be set when strings are used for minimum and maximum values."); - - if (!typeof(IComparable).IsAssignableFrom (ot)) { -#if NET_4_0 - string message = String.Format ("The type {0} must implement System.IComparable", ot.FullName); - throw new InvalidOperationException (message); -#else - throw new ArgumentException ("object"); -#endif - } - - string smin = min as string, smax = max as string; - cvt = TypeDescriptor.GetConverter (ot); - Minimum = cvt.ConvertFromString (smin); - Maximum = cvt.ConvertFromString (smax); - - return new Func (CompareArbitrary); - } - - bool CompareInt (object value) - { - int cv = Convert.ToInt32 (value); - - return MinimumComparable.CompareTo (cv) <= 0 && MaximumComparable.CompareTo (cv) >= 0; - } - - bool CompareDouble (object value) - { - double cv = Convert.ToDouble (value); - - return MinimumComparable.CompareTo (cv) <= 0 && MaximumComparable.CompareTo (cv) >= 0; - } - - bool CompareArbitrary (object value) - { - object cv; - if (value != null && value.GetType () == OperandType) - cv = value; - else if (cvt != null) - cv = cvt.ConvertFrom (value); - else - cv = null; - - return MinimumComparable.CompareTo (cv) <= 0 && MaximumComparable.CompareTo (cv) >= 0; - } - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/RegularExpressionAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/RegularExpressionAttribute.cs deleted file mode 100644 index d4d304171f5..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/RegularExpressionAttribute.cs +++ /dev/null @@ -1,78 +0,0 @@ -// -// RegularExpressionAttribute.cs -// -// Author: -// Atsushi Enomoto -// Antoine Cailliau -// -// Copyright (C) 2008 Novell Inc. http://novell.com -// Copyright (C) 20011 Maximux Scris. http://maximux.net -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System; -using System.Globalization; -using System.ComponentModel; -using System.Text.RegularExpressions; - -namespace System.ComponentModel.DataAnnotations -{ - -#if NET_4_0 - [AttributeUsage (AttributeTargets.Property|AttributeTargets.Field|AttributeTargets.Parameter, AllowMultiple = false)] -#else - [AttributeUsage (AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false)] -#endif - public class RegularExpressionAttribute : ValidationAttribute - { - public RegularExpressionAttribute (string pattern) - : base(GetDefaultErrorMessage) - { - if (pattern == null) - throw new ArgumentNullException("pattern"); - Pattern = pattern; - } - - public string Pattern { get; private set; } - - static string GetDefaultErrorMessage () - { - return "The field {0} must match the regular expression {1}."; - } - - public override string FormatErrorMessage (string name) - { - return string.Format (ErrorMessageString, name, Pattern); - } - - // LAMESPEC: does not throw ValidationException when value does not match the regular expression - public override bool IsValid (object value) - { - if (value == null) - return true; - - string str = (string) value; - Regex regex = new Regex(Pattern); - return regex.IsMatch(str); - } - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/RequiredAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/RequiredAttribute.cs deleted file mode 100644 index da77782eb29..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/RequiredAttribute.cs +++ /dev/null @@ -1,62 +0,0 @@ -// -// RequiredAttribute.cs -// -// Author: -// Atsushi Enomoto -// -// Copyright (C) 2008-2010 Novell Inc. http://novell.com -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System; -using System.ComponentModel; - -namespace System.ComponentModel.DataAnnotations -{ -#if NET_4_0 - [AttributeUsage (AttributeTargets.Parameter|AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false)] -#else - [AttributeUsage (AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false)] -#endif - public class RequiredAttribute : ValidationAttribute - { -#if NET_4_0 - public bool AllowEmptyStrings { get; set; } -#endif - - public override bool IsValid (object value) - { - if (value == null) - return false; - - string s = value as string; - if (s != null -#if NET_4_0 - && !AllowEmptyStrings -#endif - ) - return s.Length > 0; - - return true; - } - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ScaffoldColumnAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ScaffoldColumnAttribute.cs deleted file mode 100644 index c893658625f..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ScaffoldColumnAttribute.cs +++ /dev/null @@ -1,46 +0,0 @@ -// -// RequiredAttribute.cs -// -// Author: -// Atsushi Enomoto -// -// Copyright (C) 2008 Novell Inc. http://novell.com -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System; -using System.ComponentModel; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsage (AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false)] - public class ScaffoldColumnAttribute : Attribute - { - public ScaffoldColumnAttribute (bool scaffold) - { - Scaffold = scaffold; - } - - [MonoTODO] - public bool Scaffold { get; private set; } - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ScaffoldTableAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ScaffoldTableAttribute.cs deleted file mode 100644 index 505f775ebdc..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ScaffoldTableAttribute.cs +++ /dev/null @@ -1,46 +0,0 @@ -// -// RequiredAttribute.cs -// -// Author: -// Atsushi Enomoto -// -// Copyright (C) 2008 Novell Inc. http://novell.com -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System; -using System.ComponentModel; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsage (AttributeTargets.Class, AllowMultiple = false)] - public class ScaffoldTableAttribute : Attribute - { - public ScaffoldTableAttribute (bool scaffold) - { - Scaffold = scaffold; - } - - [MonoTODO] - public bool Scaffold { get; private set; } - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/StringLengthAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/StringLengthAttribute.cs deleted file mode 100644 index 20a59e74abc..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/StringLengthAttribute.cs +++ /dev/null @@ -1,99 +0,0 @@ -// -// StringLengthAttribute.cs -// -// Author: -// Atsushi Enomoto -// Marek Habersack -// -// Copyright (C) 2008-2010 Novell Inc. http://novell.com -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System; -using System.Globalization; -using System.ComponentModel; - -namespace System.ComponentModel.DataAnnotations -{ -#if NET_4_0 - [AttributeUsage (AttributeTargets.Parameter|AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false)] -#else - [AttributeUsage (AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = false)] -#endif - public class StringLengthAttribute : ValidationAttribute - { - public int MaximumLength { get; private set; } -#if NET_4_0 - public int MinimumLength { get; set; } -#endif - public StringLengthAttribute (int maximumLength) - : base (GetDefaultErrorMessage) - { -#if !NET_4_0 - if (maximumLength < 0) - throw new ArgumentOutOfRangeException ("maximumLength", String.Format ("Actual value was {0}", maximumLength)); -#endif - MaximumLength = maximumLength; - } - - static string GetDefaultErrorMessage () - { - return "The field {0} must be a string with a maximum length of {1}."; - } - - public override string FormatErrorMessage (string name) - { -#if NET_4_0 - return String.Format (ErrorMessageString, name, MaximumLength, MinimumLength); -#else - return String.Format (ErrorMessageString, name, MaximumLength); -#endif - } - - public override bool IsValid (object value) - { - if (value == null) - return true; - - string str = (string)value; - int max = MaximumLength; -#if NET_4_0 - int min = MinimumLength; - - // LAMESPEC: documented to throw ArgumentOutOfRangeException - if (max < 0) - throw new InvalidOperationException ("The maximum length must be a nonnegative integer."); - - if (min > max) - throw new InvalidOperationException ( - String.Format ("The maximum value '{0}' must be greater than or equal to the minimum value '{1}'.", - max, min) - ); - - int len = str.Length; - return len <= max && len >= min; -#else - return str.Length <= max; -#endif - } - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/TimestampAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/TimestampAttribute.cs deleted file mode 100644 index 4d67b9c49b4..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/TimestampAttribute.cs +++ /dev/null @@ -1,43 +0,0 @@ -// -// TimestampAttribute.cs -// -// Authors: -// Marek Safar -// Pablo Ruiz García -// -// Copyright (C) 2013 Xamarin Inc (http://www.xamarin.com) -// Copyright (C) 2013 Pablo Ruiz García -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_0 - -using System; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsageAttribute (AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)] - public class TimestampAttribute : Attribute - { - } -} - -#endif diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/UIHintAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/UIHintAttribute.cs deleted file mode 100644 index ec6e1159277..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/UIHintAttribute.cs +++ /dev/null @@ -1,94 +0,0 @@ -// -// UIHintAttribute.cs -// -// Authors: -// Atsushi Enomoto -// Marek Safar -// -// Copyright (C) 2008 Novell Inc. http://novell.com -// Copyright (C) 2013 Xamarin Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Runtime.CompilerServices; - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsage (AttributeTargets.Property|AttributeTargets.Field, AllowMultiple = true)] - public class UIHintAttribute : Attribute - { - readonly ControlParameters controlParameters; - - public UIHintAttribute (string uiHint) - : this (uiHint, null) - { - } - - public UIHintAttribute (string uiHint, string presentationLayer) - : this (uiHint, presentationLayer, null) - { - } - - public UIHintAttribute (string uiHint, string presentationLayer, params object [] controlParameters) - { - UIHint = uiHint; - PresentationLayer = presentationLayer; - this.controlParameters = new ControlParameters (controlParameters); - } - - public IDictionary ControlParameters { - get { - return controlParameters.Dictionary; - } - } - - public string PresentationLayer { get; private set; } - - public string UIHint { get; private set; } - -#if NET_4_0 - public override object TypeId { - get { - return this; - } - } -#endif - - public override int GetHashCode () - { - return RuntimeHelpers.GetHashCode (UIHint) ^ - RuntimeHelpers.GetHashCode (PresentationLayer); - } - - public override bool Equals (object obj) - { - var ha = obj as UIHintAttribute; - if (ha == null) - return false; - - return ha.UIHint == UIHint && - ha.PresentationLayer == PresentationLayer && - ha.controlParameters.Equals (controlParameters); - } - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/UrlAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/UrlAttribute.cs deleted file mode 100644 index 4fa0dec8218..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/UrlAttribute.cs +++ /dev/null @@ -1,52 +0,0 @@ -// -// UrlAttribute.cs -// -// Authors: -// Marek Safar -// -// Copyright (C) 2014 Xamarin Inc (http://www.xamarin.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -#if NET_4_5 - -namespace System.ComponentModel.DataAnnotations -{ - [AttributeUsageAttribute (AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)] - public sealed class UrlAttribute : DataTypeAttribute - { - public UrlAttribute () - : base (DataType.Url) - { - } - - public override bool IsValid (object value) - { - if (value == null) - return true; - - var s = value as string; - return s != null && Uri.IsWellFormedUriString (s, UriKind.Absolute); - } - } -} - -#endif \ No newline at end of file diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ValidationAttribute.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ValidationAttribute.cs deleted file mode 100644 index d95ff90b3a5..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ValidationAttribute.cs +++ /dev/null @@ -1,270 +0,0 @@ -// -// ValidationAttribute.cs -// -// Authors: -// Atsushi Enomoto -// Marek Habersack -// -// Copyright (C) 2008-2010 Novell Inc. http://novell.com -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System; -using System.ComponentModel; -using System.Reflection; -using System.Globalization; - -namespace System.ComponentModel.DataAnnotations -{ - public abstract class ValidationAttribute : Attribute - { - const string DEFAULT_ERROR_MESSAGE = "The field {0} is invalid."; -#if NET_4_0 - object nestedCallLock = new object (); - bool nestedCall; -#else - string errorMessageResourceName; - string errorMessageString; - Type errorMessageResourceType; -#endif - string errorMessage; - string fallbackErrorMessage; - Func errorMessageAccessor; - - protected ValidationAttribute () - { - } - - protected ValidationAttribute (Func errorMessageAccessor) - { - this.errorMessageAccessor = errorMessageAccessor; - } - - protected ValidationAttribute (string errorMessage) - { - fallbackErrorMessage = errorMessage; - } - - public virtual string FormatErrorMessage (string name) - { - string format = ErrorMessageString; - if (String.IsNullOrEmpty (format)) - return String.Empty; - - return String.Format (ErrorMessageString, name); - } -#if NET_4_0 - public string ErrorMessage { - get { return errorMessage; } - set { - errorMessage = value; - if (errorMessage != null) - errorMessageAccessor = null; - } - } - public string ErrorMessageResourceName { get; set; } - public Type ErrorMessageResourceType { get; set; } -#else - public string ErrorMessage { - get { return errorMessage; } - - set { -#if !NET_4_0 - if (errorMessage != null) - throw new InvalidOperationException ("This property can be set only once."); -#endif - if (String.IsNullOrEmpty (value)) - throw new ArgumentException ("Value cannot be null or empty.", "value"); - - if (errorMessageResourceName != null || errorMessageResourceType != null) - throw new InvalidOperationException ("This property cannot be set because the attribute is already in the resource mode."); - - errorMessage = value; - } - } - - public string ErrorMessageResourceName { - get { return errorMessageResourceName; } - - set { - if (errorMessageResourceName != null) - throw new InvalidOperationException ("This property can be set only once."); - - if (String.IsNullOrEmpty (value)) - throw new ArgumentException ("Value cannot be null or empty.", "value"); - - errorMessageResourceName = value; - if (errorMessageResourceType != null) - errorMessageString = GetStringFromResourceAccessor (); - } - } - - public Type ErrorMessageResourceType { - get { return errorMessageResourceType; } - set { - errorMessageResourceType = value; - if (!String.IsNullOrEmpty (errorMessageResourceName)) - errorMessageString = GetStringFromResourceAccessor (); - } - } -#endif - protected string ErrorMessageString { - get { return GetStringFromResourceAccessor (); } - } - -#if NET_4_5 - // See: http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.validationattribute.requiresvalidationcontext.aspx - public virtual bool RequiresValidationContext { get { return false; } } -#endif - -#if NET_4_0 - NotImplementedException NestedNIEX () - { - return new NotImplementedException ("IsValid(object value) has not been implemented by this class. The preferred entry point is GetValidationResult() and classes should override IsValid(object value, ValidationContext context)."); - } - - // - // This is the weirdest (to be gentle) idea ever... The IsValid (object) overload - // throws the NIEX when it is called from the default IsValid (object, - // ValidationContext) overload, but not when directly. And the reverse situation is - // true as well. That means, the calls detect the "nested" calls and that we need to - // protect the nestedCall flag... ugh - // - public virtual bool IsValid (object value) - { - lock (nestedCallLock) { - if (nestedCall) - throw NestedNIEX (); - try { - nestedCall = true; - return IsValid (value, null) == ValidationResult.Success; - } finally { - nestedCall = false; - } - } - } - - protected virtual ValidationResult IsValid (object value, ValidationContext validationContext) - { - lock (nestedCallLock) { - if (nestedCall) - throw NestedNIEX (); - - try { - nestedCall = true; - if (!IsValid (value)) { - // .NET emulation - if (validationContext == null) - throw new NullReferenceException (".NET emulation."); - string memberName = validationContext.MemberName; - return new ValidationResult (FormatErrorMessage (validationContext.DisplayName), memberName != null ? new string[] { memberName } : new string[] {}); - } - } finally { - nestedCall = false; - } - } - - return ValidationResult.Success; - } -#else - public abstract bool IsValid (object value); -#endif - -#if NET_4_0 - public ValidationResult GetValidationResult (object value, ValidationContext validationContext) - { - if (validationContext == null) - throw new ArgumentNullException ("validationContext"); - - ValidationResult ret = IsValid (value, validationContext); - if (ret != null && String.IsNullOrEmpty (ret.ErrorMessage)) - ret.ErrorMessage = FormatErrorMessage (validationContext.DisplayName); - - return ret; - } -#endif - string GetStringFromResourceAccessor () - { - string resourceName = ErrorMessageResourceName; - Type resourceType = ErrorMessageResourceType; - string errorMessage = ErrorMessage; - - if (resourceName != null && errorMessage != null) - throw new InvalidOperationException ("Either ErrorMessage or ErrorMessageResourceName must be set, but not both."); - - if (resourceType == null ^ resourceName == null) - throw new InvalidOperationException ("Both ErrorMessageResourceType and ErrorMessageResourceName must be set on this attribute."); - - - - if (resourceType != null) { - PropertyInfo pi = resourceType.GetProperty (resourceName, BindingFlags.Public | BindingFlags.Static); - if (pi == null || !pi.CanRead) - throw new InvalidOperationException ( - String.Format ("Resource type '{0}' does not have an accessible static property named '{1}'.", - resourceType, resourceName) - ); - - if (pi.PropertyType != typeof (string)) - throw new InvalidOperationException ( - String.Format ("The property '{0}' on resource type '{1}' is not a string type.", - resourceName, resourceType) - ); - - return pi.GetValue (null, null) as string; - } - - if (errorMessage == null) { - if (errorMessageAccessor != null) - return errorMessageAccessor (); - - if (fallbackErrorMessage != null) - return fallbackErrorMessage; - else - return DEFAULT_ERROR_MESSAGE; - } - - return errorMessage; - } -#if NET_4_0 - public void Validate (object value, ValidationContext validationContext) - { - if (validationContext == null) - throw new ArgumentNullException ("validationContext"); - - ValidationResult result = IsValid (value, validationContext); - if (result != null) { - string message = result.ErrorMessage; - if (message == null) - message = FormatErrorMessage (validationContext.DisplayName); - - throw new ValidationException (message, this, value); - } - } -#endif - public void Validate (object value, string name) - { - if (!IsValid (value)) - throw new ValidationException (FormatErrorMessage (name), this, value); - } - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ValidationAttributeCollectionExtensions.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ValidationAttributeCollectionExtensions.cs deleted file mode 100644 index 9dec3195cb7..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ValidationAttributeCollectionExtensions.cs +++ /dev/null @@ -1,81 +0,0 @@ -// -// Authors: -// Marek Habersack -// -// Copyright (C) 2011 Novell Inc. http://novell.com -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Reflection; - -namespace System.ComponentModel.DataAnnotations -{ - static class ValidationAttributeCollectionExtensions - { - public static void Validate (this AttributeCollection attributes, object value, ValidationContext validationContext, - ICollection validationResults, ref bool valid) - where TAttribute: ValidationAttribute - { - if (attributes == null || attributes == AttributeCollection.Empty || attributes.Count <= 0) - return; - - ValidationResult result; - foreach (TAttribute attr in attributes.OfType ()) { - result = attr.GetValidationResult (value, validationContext); - if (result != ValidationResult.Success) { - valid = false; - if (validationResults != null) - validationResults.Add (result); - } - } - } - - public static void ValidateExcept (this AttributeCollection attributes, object value, ValidationContext validationContext, - ICollection validationResults, ref bool valid) - where TAttribute: ValidationAttribute - { - if (attributes == null || attributes == AttributeCollection.Empty || attributes.Count <= 0) - return; - - ValidationResult result; - ValidationAttribute vattr; - foreach (Attribute attr in attributes) { - if (attr is TAttribute) - continue; - vattr = attr as ValidationAttribute; - if (vattr == null) - continue; - - result = vattr.GetValidationResult (value, validationContext); - if (result != ValidationResult.Success) { - valid = false; - if (validationResults != null) - validationResults.Add (result); - } - } - } - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ValidationContext.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ValidationContext.cs deleted file mode 100644 index f39c4a42324..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ValidationContext.cs +++ /dev/null @@ -1,160 +0,0 @@ -// -// ValidationContext.cs -// -// Authors: -// Marek Habersack -// -// Copyright (C) 2010 Novell Inc. (http://novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System; -using System.Collections.Generic; -using System.ComponentModel.Design; - -namespace System.ComponentModel.DataAnnotations -{ - public sealed class ValidationContext : IServiceProvider - { - public string DisplayName { get; set; } - public IDictionary Items { get; private set; } - public string MemberName { get; set; } - public object ObjectInstance { get; private set; } - public Type ObjectType { get; private set; } - public IServiceContainer ServiceContainer { get; private set; } - - public ValidationContext (object instance, IServiceProvider serviceProvider, IDictionary items) - { - if (instance == null) - throw new ArgumentNullException ("instance"); - - ObjectInstance = instance; - ObjectType = instance.GetType (); - if (items != null) - Items = new Dictionary (items); - else - Items = new Dictionary (); - - DisplayName = instance.GetType ().Name; - - // LAMESPEC: MSDN says vc.ServiceContainer should be initialized with the passed container if it implements - // the IServiceContainer interface - not the case, though. - // - // IServiceContainer container = serviceProvider as IServiceContainer; - // if (container != null) - // ServiceContainer = container; - // else - ServiceContainer = new ValidationContextServiceContainer (); - } - -#if NET_4_5 - public ValidationContext (object instance) - : this (instance, null, null) - { - } - - public ValidationContext (object instance, IDictionary items) - : this (instance, null, items) - { - } - - // FIXME: According to MSDN, this should be defined in - // 4.5, Silverlight and PCL - [MonoTODO] - public void InitializeServiceProvider ( - Func serviceProvider) - { - throw new NotImplementedException (); - } -#endif - - public object GetService (Type serviceType) - { - return ServiceContainer.GetService (serviceType); - } - - sealed class ValidationContextServiceContainer : IServiceContainer - { - Dictionary services = new Dictionary (); - - public void AddService (Type serviceType, ServiceCreatorCallback callback, bool promote) - { - AddService (serviceType, (object)callback, promote); - } - - public void AddService (Type serviceType, ServiceCreatorCallback callback) - { - AddService (serviceType, callback, false); - } - - public void AddService (Type serviceType, object serviceInstance, bool promote) - { - if (serviceType == null) - throw new ArgumentNullException ("serviceType"); - - if (services.ContainsKey (serviceType)) - throw new ArgumentException ( - String.Format ("A service of type '{0}' already exists in the container.", serviceType) - ); - - services.Add (serviceType, serviceInstance); - } - - public void AddService (Type serviceType, object serviceInstance) - { - AddService (serviceType, serviceInstance, false); - } - - public void RemoveService (Type serviceType, bool promote) - { - if (serviceType == null) - throw new ArgumentNullException ("serviceType"); - - if (!services.ContainsKey (serviceType)) - return; - - services.Remove (serviceType); - } - - public void RemoveService (Type serviceType) - { - RemoveService (serviceType, false); - } - - public object GetService (Type serviceType) - { - if (serviceType == null) - throw new ArgumentNullException ("serviceType"); - - object o; - if (!services.TryGetValue (serviceType, out o)) - return null; - - var cb = o as ServiceCreatorCallback; - if (cb != null) - return cb (this, serviceType); - - return o; - } - } - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ValidationException.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ValidationException.cs deleted file mode 100644 index f12507a52a5..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ValidationException.cs +++ /dev/null @@ -1,84 +0,0 @@ -// -// ValidationException.cs -// -// Author: -// Atsushi Enomoto -// -// Copyright (C) 2008-2011 Novell Inc. http://novell.com -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System; -using System.ComponentModel; -using System.Runtime.Serialization; -using System.Security.Permissions; - -namespace System.ComponentModel.DataAnnotations -{ - [Serializable] - public class ValidationException : Exception - { - public ValidationException () - { - } - public ValidationException (string message) - : base (message) - { - } - public ValidationException (string message, Exception innerException) - : base (message, innerException) - { - } - - public ValidationException (string errorMessage, ValidationAttribute validatingAttribute, object value) - : base (errorMessage) - { - ValidationAttribute = validatingAttribute; - Value = value; - } - - protected ValidationException (SerializationInfo info, StreamingContext context) - : base (info, context) - { - throw new NotImplementedException (); - } -#if NET_4_0 - public ValidationException (ValidationResult validationResult, ValidationAttribute validatingAttribute, object value) - : this (validationResult != null ? validationResult.ErrorMessage : null, validatingAttribute, value) - { - this.ValidationResult = validationResult; - } - - public ValidationResult ValidationResult { get; private set; } -#endif - public ValidationAttribute ValidationAttribute { get; private set; } - public object Value { get; private set; } - -#if !NET_4_5 - [SecurityPermission (SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)] - public override void GetObjectData (SerializationInfo info, StreamingContext context) - { - throw new NotImplementedException (); - } -#endif - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ValidationResult.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ValidationResult.cs deleted file mode 100644 index 50afd2182c1..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/ValidationResult.cs +++ /dev/null @@ -1,72 +0,0 @@ -// -// ValidationResult.cs -// -// Authors: -// Marek Habersack -// -// Copyright (C) 2010 Novell Inc. (http://novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System; -using System.Collections.Generic; - -namespace System.ComponentModel.DataAnnotations -{ - public class ValidationResult - { - public static readonly ValidationResult Success = null; // it is supposed to be null - - public string ErrorMessage { get; set; } - public IEnumerable MemberNames { get; private set; } - - public ValidationResult (string errorMessage) - : this (errorMessage, new string[] {}) - - { - } - - protected ValidationResult (ValidationResult validationResult) - { - } - - public ValidationResult (string errorMessage, IEnumerable memberNames) - { - ErrorMessage = errorMessage; - if (memberNames != null) - MemberNames = memberNames; - else - MemberNames = new string[] {}; - } - -#if NET_4_5 - public override string ToString () - { - // See: http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.validationresult.tostring.aspx - if (!string.IsNullOrEmpty (ErrorMessage)) - return ErrorMessage; - - return base.ToString (); - } -#endif - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/Validator.cs b/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/Validator.cs deleted file mode 100644 index 18f98fe2bf7..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/System.ComponentModel.DataAnnotations/Validator.cs +++ /dev/null @@ -1,206 +0,0 @@ -// -// Authors: -// Marek Habersack -// -// Copyright (C) 2011 Novell Inc. http://novell.com -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Reflection; - -namespace System.ComponentModel.DataAnnotations -{ - // TODO: we could probably use some kind of type cache here - public static class Validator - { - public static bool TryValidateObject (object instance, ValidationContext validationContext, ICollection validationResults) - { - return TryValidateObject (instance, validationContext, validationResults, false); - } - - public static bool TryValidateObject (object instance, ValidationContext validationContext, ICollection validationResults, bool validateAllProperties) - { - if (instance == null) - throw new ArgumentNullException ("instance"); - - if (validationContext == null) - throw new ArgumentNullException ("validationContext"); - - if (!Object.ReferenceEquals (instance, validationContext.ObjectInstance)) - throw new ArgumentException ("The instance provided must match the ObjectInstance on the ValidationContext supplied.", "instance"); - - bool valid = true; - Type instanceType = instance.GetType (); - TypeDescriptor.GetAttributes (instanceType).Validate (instance, validationContext, validationResults, ref valid); - - PropertyDescriptorCollection properties = TypeDescriptor.GetProperties (instance); - if (properties != PropertyDescriptorCollection.Empty && properties.Count > 0) { - foreach (PropertyDescriptor pdesc in properties) { - object value = pdesc.GetValue (instance); - ValidateProperty (pdesc, value, validationContext, validationResults, validateAllProperties, ref valid); - } - } - - return valid; - } - - static void ValidateProperty (PropertyDescriptor pdesc, object value, ValidationContext validationContext, ICollection validationResults, - bool validateAll, ref bool valid) - { - AttributeCollection attributes = pdesc.Attributes; - attributes.Validate (value, validationContext, validationResults, ref valid); - if (validateAll) - attributes.ValidateExcept (value, validationContext, validationResults, ref valid); - } - - static PropertyDescriptor GetProperty (Type type, string propertyName, object value) - { - if (String.IsNullOrEmpty (propertyName)) - throw new ArgumentNullException ("propertyName"); - - PropertyDescriptorCollection properties = TypeDescriptor.GetProperties (type); - PropertyDescriptor pdesc = null; - if (properties != PropertyDescriptorCollection.Empty && properties.Count > 0) - pdesc = properties.Find (propertyName, false); - - if (pdesc == null) - throw new ArgumentException (String.Format ("The type '{0}' does not contain a public property named '{1}'.", type.Name, propertyName), "propertyName"); - - Type valueType = value == null ? null : value.GetType (); - Type propertyType = pdesc.PropertyType; - bool invalidType = false; - - if (valueType == null) - invalidType = (propertyType.IsValueType && Nullable.GetUnderlyingType(propertyType) == null); - else - invalidType = !propertyType.IsAssignableFrom(valueType); - - if (invalidType) - throw new ArgumentException (String.Format ("The value of property '{0}' must be of type '{1}'.", propertyName, propertyType.FullName), "propertyName"); - - return pdesc; - } - - public static bool TryValidateProperty (object value, ValidationContext validationContext, ICollection validationResults) - { - // LAMESPEC: value can be null, validationContext must not - if (validationContext == null) - throw new ArgumentNullException ("validationContext"); - - PropertyDescriptor pdesc = GetProperty (validationContext.ObjectType, validationContext.MemberName, value); - - bool valid = true; - ValidateProperty (pdesc, value, validationContext, validationResults, true, ref valid); - - return valid; - } - - public static bool TryValidateValue (object value, ValidationContext validationContext, ICollection validationResults, - IEnumerable validationAttributes) - { - if (validationContext == null) - throw new ArgumentNullException ("validationContext"); - - ValidationResult result; - - // It appears .NET makes this call before checking whether - // validationAttributes is null... - ValidationAttribute vattr = validationAttributes.FirstOrDefault (attr => attr is RequiredAttribute); - if (vattr != null) { - result = vattr.GetValidationResult (value, validationContext); - if (result != ValidationResult.Success) { - if (validationResults != null) - validationResults.Add (result); - return false; - } - } - - if (validationAttributes == null) - return true; - - bool valid = true; - foreach (ValidationAttribute attr in validationAttributes) { - if (attr == null || (attr is RequiredAttribute)) - continue; - - result = attr.GetValidationResult (value, validationContext); - if (result != ValidationResult.Success) { - valid = false; - if (validationResults != null) - validationResults.Add (result); - } - } - - return valid; - } - - public static void ValidateObject (object instance, ValidationContext validationContext) - { - ValidateObject (instance, validationContext, false); - } - - public static void ValidateObject (object instance, ValidationContext validationContext, bool validateAllProperties) - { - if (instance == null) - throw new ArgumentNullException ("instance"); - if (validationContext == null) - throw new ArgumentNullException ("validationContext"); - - var validationResults = new List (); - if (TryValidateObject (instance, validationContext, validationResults, validateAllProperties)) - return; - - ValidationResult result = validationResults.Count > 0 ? validationResults [0] : null; - throw new ValidationException (result, null, instance); - } - - public static void ValidateProperty (object value, ValidationContext validationContext) - { - if (validationContext == null) - throw new ArgumentNullException ("validationContext"); - - var validationResults = new List (); - if (TryValidateProperty (value, validationContext, validationResults)) - return; - - ValidationResult result = validationResults.Count > 0 ? validationResults [0] : null; - throw new ValidationException (result, null, value); - } - - public static void ValidateValue (object value, ValidationContext validationContext, IEnumerable validationAttributes) - { - if (validationContext == null) - throw new ArgumentNullException ("validationContext"); - - var validationResults = new List (); - if (TryValidateValue (value, validationContext, validationResults, validationAttributes)) - return; - - ValidationResult result = validationResults.Count > 0 ? validationResults [0] : null; - throw new ValidationException (result, null, value); - } - } -} diff --git a/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/CreditCardAttributeTest.cs b/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/CreditCardAttributeTest.cs index 67ed9dac283..846ee326176 100644 --- a/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/CreditCardAttributeTest.cs +++ b/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/CreditCardAttributeTest.cs @@ -46,14 +46,12 @@ namespace MonoTests.System.ComponentModel.DataAnnotations var sla = new CreditCardAttribute (); Assert.IsTrue (sla.IsValid (null), "#A1-1"); - Assert.IsFalse (sla.IsValid (String.Empty), "#A1-2"); + Assert.IsTrue (sla.IsValid (String.Empty), "#A1-2"); Assert.IsFalse (sla.IsValid ("string"), "#A1-3"); Assert.IsTrue (sla.IsValid ("378282246310005"), "#A1-4"); Assert.IsTrue (sla.IsValid ("3782-8224-6310-005"), "#A1-5"); Assert.IsTrue (sla.IsValid ("371449635398431"), "#A-6"); -#if false Assert.IsFalse (sla.IsValid ("371449635498431"), "#A-6b"); -#endif Assert.IsFalse (sla.IsValid (true), "#A1-7"); Assert.IsFalse (sla.IsValid (DateTime.Now), "#A1-8"); } diff --git a/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/DisplayAttributeTest.cs b/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/DisplayAttributeTest.cs index 0753fde5a69..3d54000c5dd 100644 --- a/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/DisplayAttributeTest.cs +++ b/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/DisplayAttributeTest.cs @@ -71,7 +71,7 @@ namespace MonoTests.System.ComponentModel.DataAnnotations public class DisplayAttributeTests { const string property_not_set_message = "The {0} property has not been set. Use the Get{0} method to get the value."; - const string localization_failed_message = "Cannot retrieve property '{0}' because localization failed. Type '{1} is not public or does not contain a public static string property with the name '{2}'."; + const string localization_failed_message = "Cannot retrieve property '{0}' because localization failed. Type '{1}' is not public or does not contain a public static string property with the name '{2}'."; [Test] public void StringProperties_ReturnLiteralValues_Success() diff --git a/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/EmailAddressAttributeTest.cs b/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/EmailAddressAttributeTest.cs index 09350cde8fd..552e3eae6a4 100644 --- a/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/EmailAddressAttributeTest.cs +++ b/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/EmailAddressAttributeTest.cs @@ -50,11 +50,6 @@ namespace MonoTests.System.ComponentModel.DataAnnotations "$A12345@example.com", "!def!xyz%abc@example.com", "_somename@example.com", - "valid.ipv4.addr@[123.1.72.10]", - "valid.ipv6.addr@[IPv6:0::1]", - "valid.ipv6.addr@[IPv6:2607:f0d0:1002:51::4]", - "valid.ipv6.addr@[IPv6:fe80::230:48ff:fe33:bc33]", - "valid.ipv6v4.addr@[IPv6:aaaa:aaaa:aaaa:aaaa:aaaa:aaaa:127.0.0.1]", }; static readonly object[] InvalidAddresses = new object[] { @@ -69,6 +64,12 @@ namespace MonoTests.System.ComponentModel.DataAnnotations "invalid@[127.0.0.1.]", "invalid@[127.0.0.1].", "invalid@[127.0.0.1]x", + + "valid.ipv4.addr@[123.1.72.10]", + "valid.ipv6.addr@[IPv6:0::1]", + "valid.ipv6.addr@[IPv6:2607:f0d0:1002:51::4]", + "valid.ipv6.addr@[IPv6:fe80::230:48ff:fe33:bc33]", + "valid.ipv6v4.addr@[IPv6:aaaa:aaaa:aaaa:aaaa:aaaa:aaaa:127.0.0.1]", }; [Test] diff --git a/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/RegularExpressionAttributeTest.cs b/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/RegularExpressionAttributeTest.cs index 65778396502..163e1a738b7 100644 --- a/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/RegularExpressionAttributeTest.cs +++ b/mcs/class/System.ComponentModel.DataAnnotations/Test/System.ComponentModel.DataAnnotations/RegularExpressionAttributeTest.cs @@ -90,26 +90,29 @@ namespace MonoTests.System.ComponentModel.DataAnnotations Assert.IsTrue (rea.IsValid (null), "Null does not match [A-Za-z]."); Assert.IsTrue (rea.IsValid ("A"), "'A' does not match [A-Za-z]."); Assert.IsTrue (rea.IsValid ("a"), "'a' does not match [A-Za-z]."); - Assert.IsTrue (rea.IsValid ("Bz"), "'Bz' does not match [A-Za-z]."); - Assert.IsTrue (rea.IsValid ("string"), "'string' does not match [A-Za-z]."); - Assert.IsFalse (rea.IsValid (String.Empty), "Empty string matches [A-Za-z]."); + Assert.IsFalse (rea.IsValid ("Bz"), "'Bz' does not match [A-Za-z]."); + Assert.IsFalse (rea.IsValid ("string"), "'string' does not match [A-Za-z]."); + Assert.IsTrue (rea.IsValid (String.Empty), "Empty string matches [A-Za-z]."); Assert.IsFalse (rea.IsValid ("0123456789"), "'0123456789' matches [A-Za-z]."); Assert.IsFalse (rea.IsValid ("0123456789"), "'0123456789A' matches [A-Za-z]."); - AssertExtensions.Throws (() => { - rea.IsValid (123); - }, "Casting does not fails"); - AssertExtensions.Throws (() => { - rea.IsValid (DateTime.Now); - }, "Casting does not fails"); + Assert.IsFalse (rea.IsValid (123), "Casting does not fails"); + Assert.IsFalse (rea.IsValid (DateTime.Now), "Casting does not fails"); rea = new RegularExpressionAttributePoker (""); - Assert.IsTrue (rea.IsValid (null), "null does not match empty pattern"); - Assert.IsTrue (rea.IsValid (String.Empty), "empty string does not match empty pattern"); - Assert.IsTrue (rea.IsValid ("string"), "'string' does not match empty pattern"); + + AssertExtensions.Throws (() => { + rea.IsValid (null); + }, "null does not match empty pattern"); + + AssertExtensions.Throws (() => { + rea.IsValid (String.Empty); + }, "empty string does not match empty pattern"); + + AssertExtensions.Throws (() => { + rea.IsValid ("string"); + }, "'string' does not match empty pattern"); - AssertExtensions.Throws (() => { - rea = new RegularExpressionAttributePoker (null); - }, "Null pattern allowed"); + rea = new RegularExpressionAttributePoker (null); } } } diff --git a/mcs/class/System.ComponentModel.DataAnnotations/mobile_System.ComponentModel.DataAnnotations.dll.sources b/mcs/class/System.ComponentModel.DataAnnotations/mobile_System.ComponentModel.DataAnnotations.dll.sources deleted file mode 100644 index 3de14f5e0a7..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/mobile_System.ComponentModel.DataAnnotations.dll.sources +++ /dev/null @@ -1 +0,0 @@ -#include net_4_5_System.ComponentModel.DataAnnotations.dll.sources diff --git a/mcs/class/System.ComponentModel.DataAnnotations/mobile_static_System.ComponentModel.DataAnnotations.dll.sources b/mcs/class/System.ComponentModel.DataAnnotations/mobile_static_System.ComponentModel.DataAnnotations.dll.sources deleted file mode 100644 index 3de14f5e0a7..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/mobile_static_System.ComponentModel.DataAnnotations.dll.sources +++ /dev/null @@ -1 +0,0 @@ -#include net_4_5_System.ComponentModel.DataAnnotations.dll.sources diff --git a/mcs/class/System.ComponentModel.DataAnnotations/monodroid_System.ComponentModel.DataAnnotations.dll.sources b/mcs/class/System.ComponentModel.DataAnnotations/monodroid_System.ComponentModel.DataAnnotations.dll.sources deleted file mode 100644 index 3de14f5e0a7..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/monodroid_System.ComponentModel.DataAnnotations.dll.sources +++ /dev/null @@ -1 +0,0 @@ -#include net_4_5_System.ComponentModel.DataAnnotations.dll.sources diff --git a/mcs/class/System.ComponentModel.DataAnnotations/monotouch_System.ComponentModel.DataAnnotations.dll.sources b/mcs/class/System.ComponentModel.DataAnnotations/monotouch_System.ComponentModel.DataAnnotations.dll.sources deleted file mode 100644 index 3de14f5e0a7..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/monotouch_System.ComponentModel.DataAnnotations.dll.sources +++ /dev/null @@ -1 +0,0 @@ -#include net_4_5_System.ComponentModel.DataAnnotations.dll.sources diff --git a/mcs/class/System.ComponentModel.DataAnnotations/net_4_0_System.ComponentModel.DataAnnotations.dll.sources b/mcs/class/System.ComponentModel.DataAnnotations/net_4_0_System.ComponentModel.DataAnnotations.dll.sources deleted file mode 100644 index a5a9a9d5359..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/net_4_0_System.ComponentModel.DataAnnotations.dll.sources +++ /dev/null @@ -1,9 +0,0 @@ -#include System.ComponentModel.DataAnnotations.dll.sources - -System.ComponentModel.DataAnnotations/FilterUIHintAttribute.cs -System.ComponentModel.DataAnnotations/KeyAttribute.cs -System.ComponentModel.DataAnnotations/TimestampAttribute.cs -System.ComponentModel.DataAnnotations/ValidationAttributeCollectionExtensions.cs -System.ComponentModel.DataAnnotations/ValidationContext.cs -System.ComponentModel.DataAnnotations/ValidationResult.cs -System.ComponentModel.DataAnnotations/Validator.cs diff --git a/mcs/class/System.ComponentModel.DataAnnotations/net_4_5_System.ComponentModel.DataAnnotations.dll.sources b/mcs/class/System.ComponentModel.DataAnnotations/net_4_5_System.ComponentModel.DataAnnotations.dll.sources deleted file mode 100644 index 49e068c167e..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/net_4_5_System.ComponentModel.DataAnnotations.dll.sources +++ /dev/null @@ -1,17 +0,0 @@ -#include net_4_0_System.ComponentModel.DataAnnotations.dll.sources - -System.ComponentModel.DataAnnotations/MinLengthAttribute.cs -System.ComponentModel.DataAnnotations/MaxLengthAttribute.cs -System.ComponentModel.DataAnnotations/CreditCardAttribute.cs -System.ComponentModel.DataAnnotations/EmailAddressAttribute.cs -System.ComponentModel.DataAnnotations/PhoneAttribute.cs -System.ComponentModel.DataAnnotations/FileExtensionsAttribute.cs -System.ComponentModel.DataAnnotations/CompareAttribute.cs -System.ComponentModel.DataAnnotations.Schema/ColumnAttribute.cs -System.ComponentModel.DataAnnotations.Schema/ComplexTypeAttribute.cs -System.ComponentModel.DataAnnotations.Schema/DatabaseGeneratedAttribute.cs -System.ComponentModel.DataAnnotations.Schema/DatabaseGeneratedOption.cs -System.ComponentModel.DataAnnotations.Schema/ForeignKeyAttribute.cs -System.ComponentModel.DataAnnotations.Schema/InversePropertyAttribute.cs -System.ComponentModel.DataAnnotations.Schema/NotMappedAttribute.cs -System.ComponentModel.DataAnnotations.Schema/TableAttribute.cs diff --git a/mcs/class/System.ComponentModel.DataAnnotations/xammac_System.ComponentModel.DataAnnotations.dll.sources b/mcs/class/System.ComponentModel.DataAnnotations/xammac_System.ComponentModel.DataAnnotations.dll.sources deleted file mode 100644 index 3de14f5e0a7..00000000000 --- a/mcs/class/System.ComponentModel.DataAnnotations/xammac_System.ComponentModel.DataAnnotations.dll.sources +++ /dev/null @@ -1 +0,0 @@ -#include net_4_5_System.ComponentModel.DataAnnotations.dll.sources diff --git a/mcs/class/System.Configuration.Install/System.Configuration.Install-net_2_0.csproj b/mcs/class/System.Configuration.Install/System.Configuration.Install-net_2_0.csproj deleted file mode 100644 index 2c42625131c..00000000000 --- a/mcs/class/System.Configuration.Install/System.Configuration.Install-net_2_0.csproj +++ /dev/null @@ -1,101 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {C8B650EA-042C-4352-8224-03F759A682C6} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Configuration.Install - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - diff --git a/mcs/class/System.Configuration/System.Configuration-net_2_0.csproj b/mcs/class/System.Configuration/System.Configuration-net_2_0.csproj deleted file mode 100644 index 6c2ede7d037..00000000000 --- a/mcs/class/System.Configuration/System.Configuration-net_2_0.csproj +++ /dev/null @@ -1,208 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2695A2F2-2271-423D-8E0D-553DAB84E917} - Library - 1699,618 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Configuration - v2.0 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {5A1ED72C-ADAB-4396-AB03-D0E26AA91E90} - System\System-net_2_0-1 - - - {E89F34AB-7AE2-41CA-B891-C8D1C9F02EB8} - System.XML\System.Xml-net_2_0 - - - {879EA17D-67A5-44ED-B912-1BE4883356FE} - System.Security\System.Security-net_2_0 - - - - - - - diff --git a/mcs/class/System.Configuration/System.Configuration-tests-net_2_0.csproj b/mcs/class/System.Configuration/System.Configuration-tests-net_2_0.csproj deleted file mode 100644 index 9ac1884d4a2..00000000000 --- a/mcs/class/System.Configuration/System.Configuration-tests-net_2_0.csproj +++ /dev/null @@ -1,130 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {5C13CE48-3692-4869-8205-730A86C0BE0F} - Library - 1699,618 - bin\Debug\System.Configuration-tests-net_2_0 - True - False - - Properties - - - System.Configuration_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - {5A1ED72C-ADAB-4396-AB03-D0E26AA91E90} - System\System-net_2_0-1 - - - {E89F34AB-7AE2-41CA-B891-C8D1C9F02EB8} - System.XML\System.Xml-net_2_0 - - - {879EA17D-67A5-44ED-B912-1BE4883356FE} - System.Security\System.Security-net_2_0 - - - - - - - diff --git a/mcs/class/System.Core/Makefile b/mcs/class/System.Core/Makefile index eeca6391a14..3480ca91098 100644 --- a/mcs/class/System.Core/Makefile +++ b/mcs/class/System.Core/Makefile @@ -4,7 +4,8 @@ include ../../build/rules.make LIBRARY = System.Core.dll -LIB_MCS_FLAGS = -d:INSIDE_SYSCORE -d:LIBC /r:System.dll -unsafe +REFERENCE_SOURCES_FLAGS = -d:FEATURE_PAL,PFX_LEGACY_3_5 +LIB_MCS_FLAGS = $(REFERENCE_SOURCES_FLAGS) -d:INSIDE_SYSCORE -d:LIBC /r:System.dll -unsafe ifneq (2.1, $(FRAMEWORK_VERSION)) LIB_MCS_FLAGS += -d:NET_3_5 -nowarn:1720 diff --git a/mcs/class/System.Core/ReferenceSources/SR.cs b/mcs/class/System.Core/ReferenceSources/SR.cs new file mode 100644 index 00000000000..ad05d3df70f --- /dev/null +++ b/mcs/class/System.Core/ReferenceSources/SR.cs @@ -0,0 +1,55 @@ +// +// SR.cs: Manually collected resource strings for ReferenceSources +// +// Authors: +// Marek Safar +// +// Copyright (C) 2014 Xamarin Inc (http://www.xamarin.com) +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +partial class SR +{ + public const string MoreThanOneMatch = "MoreThanOneMatch"; + public const string NoElements = "NoElements"; + public const string PLINQ_CommonEnumerator_Current_NotStarted = "PLINQ_CommonEnumerator_Current_NotStarted"; + public const string PLINQ_DisposeRequested = "PLINQ_DisposeRequested"; + public const string PLINQ_EnumerationPreviouslyFailed = "PLINQ_EnumerationPreviouslyFailed"; + public const string PLINQ_ExternalCancellationRequested = "PLINQ_ExternalCancellationRequested"; + public const string ParallelEnumerable_BinaryOpMustUseAsParallel = "ParallelEnumerable_BinaryOpMustUseAsParallel"; + public const string ParallelEnumerable_WithCancellation_TokenSourceDisposed = "ParallelEnumerable_WithCancellation_TokenSourceDisposed"; + public const string ParallelEnumerable_WithMergeOptions_InvalidOptions = "ParallelEnumerable_WithMergeOptions_InvalidOptions"; + public const string ParallelEnumerable_WithQueryExecutionMode_InvalidMode = "ParallelEnumerable_WithQueryExecutionMode_InvalidMode"; + public const string ParallelPartitionable_IncorretElementCount = "ParallelPartitionable_IncorretElementCount"; + public const string ParallelPartitionable_NullElement = "ParallelPartitionable_NullElement"; + public const string ParallelPartitionable_NullReturn = "ParallelPartitionable_NullReturn"; + public const string ParallelQuery_DuplicateDOP = "ParallelQuery_DuplicateDOP"; + public const string ParallelQuery_DuplicateExecutionMode = "The WithExecutionMode operator may be used at most once in a query."; + public const string ParallelQuery_DuplicateMergeOptions = "ParallelQuery_DuplicateMergeOptions"; + public const string ParallelQuery_DuplicateTaskScheduler = "ParallelQuery_DuplicateTaskScheduler"; + public const string ParallelQuery_DuplicateWithCancellation = "ParallelQuery_DuplicateWithCancellation"; + public const string ParallelQuery_InvalidAsOrderedCall = "AsOrdered may only be called on the result of AsParallel, ParallelEnumerable.Range, or ParallelEnumerable.Repeat."; + public const string ParallelQuery_InvalidNonGenericAsOrderedCall = "ParallelQuery_InvalidNonGenericAsOrderedCall"; + public const string ParallelQuery_PartitionerNotOrderable = "ParallelQuery_PartitionerNotOrderable"; + public const string PartitionerQueryOperator_NullPartition = "PartitionerQueryOperator_NullPartition"; + public const string PartitionerQueryOperator_NullPartitionList = "PartitionerQueryOperator_NullPartitionList"; + public const string PartitionerQueryOperator_WrongNumberOfPartitions = "PartitionerQueryOperator_WrongNumberOfPartitions"; +} diff --git a/mcs/class/System.Core/ReferenceSources/Set.cs b/mcs/class/System.Core/ReferenceSources/Set.cs new file mode 100644 index 00000000000..533a9140740 --- /dev/null +++ b/mcs/class/System.Core/ReferenceSources/Set.cs @@ -0,0 +1,113 @@ +// Extracted from ../../../external/referencesource/System.Core/System/Linq/Enumerable.cs + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Threading; + +namespace System.Linq +{ + internal class Set + { + int[] buckets; + Slot[] slots; + int count; + int freeList; + IEqualityComparer comparer; + + public Set() : this(null) { } + + public Set(IEqualityComparer comparer) { + if (comparer == null) comparer = EqualityComparer.Default; + this.comparer = comparer; + buckets = new int[7]; + slots = new Slot[7]; + freeList = -1; + } + + // If value is not in set, add it and return true; otherwise return false + public bool Add(TElement value) { + return !Find(value, true); + } + + // Check whether value is in set + public bool Contains(TElement value) { + return Find(value, false); + } + + // If value is in set, remove it and return true; otherwise return false + public bool Remove(TElement value) { + int hashCode = InternalGetHashCode(value); + int bucket = hashCode % buckets.Length; + int last = -1; + for (int i = buckets[bucket] - 1; i >= 0; last = i, i = slots[i].next) { + if (slots[i].hashCode == hashCode && comparer.Equals(slots[i].value, value)) { + if (last < 0) { + buckets[bucket] = slots[i].next + 1; + } + else { + slots[last].next = slots[i].next; + } + slots[i].hashCode = -1; + slots[i].value = default(TElement); + slots[i].next = freeList; + freeList = i; + return true; + } + } + return false; + } + + bool Find(TElement value, bool add) { + int hashCode = InternalGetHashCode(value); + for (int i = buckets[hashCode % buckets.Length] - 1; i >= 0; i = slots[i].next) { + if (slots[i].hashCode == hashCode && comparer.Equals(slots[i].value, value)) return true; + } + if (add) { + int index; + if (freeList >= 0) { + index = freeList; + freeList = slots[index].next; + } + else { + if (count == slots.Length) Resize(); + index = count; + count++; + } + int bucket = hashCode % buckets.Length; + slots[index].hashCode = hashCode; + slots[index].value = value; + slots[index].next = buckets[bucket] - 1; + buckets[bucket] = index + 1; + } + return false; + } + + void Resize() { + int newSize = checked(count * 2 + 1); + int[] newBuckets = new int[newSize]; + Slot[] newSlots = new Slot[newSize]; + Array.Copy(slots, 0, newSlots, 0, count); + for (int i = 0; i < count; i++) { + int bucket = newSlots[i].hashCode % newSize; + newSlots[i].next = newBuckets[bucket] - 1; + newBuckets[bucket] = i + 1; + } + buckets = newBuckets; + slots = newSlots; + } + + internal int InternalGetHashCode(TElement value) + { + //[....] DevDivBugs 171937. work around comparer implementations that throw when passed null + return (value == null) ? 0 : comparer.GetHashCode(value) & 0x7FFFFFFF; + } + + internal struct Slot + { + internal int hashCode; + internal TElement value; + internal int next; + } + } +} \ No newline at end of file diff --git a/mcs/class/System.Core/System.Core-net_2_0.csproj b/mcs/class/System.Core/System.Core-net_2_0.csproj deleted file mode 100644 index d4bcfd9b3fd..00000000000 --- a/mcs/class/System.Core/System.Core-net_2_0.csproj +++ /dev/null @@ -1,184 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - Library - 1699,1720 - ./../../class/lib/net_2_0 - True - True - true - Properties - - - System.Core - v2.0 - 512 - - - true - full - 1699,1720 - false - DEBUG;TRACE;NET_1_1;NET_2_0;INSIDE_SYSCORE;LIBC;NET_3_5 - prompt - 4 - - - pdbonly - 1699,1720 - true - NET_1_1;NET_2_0;INSIDE_SYSCORE;LIBC;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {5A346705-1044-48F2-987D-CAE22A255427} - System\System-net_2_0 - - - {2F9C802E-F1DA-4779-80B2-5AACE033D398} - Mono.Posix\Mono.Posix-net_2_0 - - - - - - - diff --git a/mcs/class/System.Core/System.Core-plaincore-net_2_0.csproj b/mcs/class/System.Core/System.Core-plaincore-net_2_0.csproj deleted file mode 100644 index 274b4fb0e97..00000000000 --- a/mcs/class/System.Core/System.Core-plaincore-net_2_0.csproj +++ /dev/null @@ -1,188 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F0743710-AB7C-4019-A13A-07AE79F514E4} - Library - 1699,1720 - ./../../class/lib/net_2_0/plaincore - True - True - true - Properties - - - System.Core - v2.0 - 512 - - - true - full - 1699,1720 - false - DEBUG;TRACE;NET_1_1;NET_2_0;INSIDE_SYSCORE;LIBC;NET_3_5 - prompt - 4 - - - pdbonly - 1699,1720 - true - NET_1_1;NET_2_0;INSIDE_SYSCORE;LIBC;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {AAA3F683-244C-40EF-8EF8-A95938862A44} - corlib\corlib-net_2_0 - - - {5459507F-DC25-401C-A2F4-D5ECAC3A34E6} - System\System-bare-net_2_0 - - - {2CA4E20E-76B6-4A2D-B121-39C558BB6E28} - Mono.Posix\Mono.Posix-net_2_0 - - - - - - - diff --git a/mcs/class/System.Core/System.Core-tests-net_2_0.csproj b/mcs/class/System.Core/System.Core-tests-net_2_0.csproj deleted file mode 100644 index 85d3407d20d..00000000000 --- a/mcs/class/System.Core/System.Core-tests-net_2_0.csproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {25672EF9-2390-404D-AD04-A009C8DFEBFB} - Library - 1699,1720 - bin\Debug\System.Core-tests-net_2_0 - True - False - true - Properties - - - System.Core_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,1720 - false - DEBUG;TRACE;NET_1_1;NET_2_0;INSIDE_SYSCORE;LIBC;NET_3_5 - prompt - 4 - - - pdbonly - 1699,1720 - true - NET_1_1;NET_2_0;INSIDE_SYSCORE;LIBC;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {5A346705-1044-48F2-987D-CAE22A255427} - System\System-net_2_0 - - - {2F9C802E-F1DA-4779-80B2-5AACE033D398} - Mono.Posix\Mono.Posix-net_2_0 - - - - - - - diff --git a/mcs/class/System.Core/System.Linq/Enumerable.cs b/mcs/class/System.Core/System.Linq/Enumerable.cs index 80b1e3fa336..157b53c8be3 100644 --- a/mcs/class/System.Core/System.Linq/Enumerable.cs +++ b/mcs/class/System.Core/System.Linq/Enumerable.cs @@ -2765,14 +2765,14 @@ namespace System.Linq { Check.Source (source); + if (count <= 0) + return EmptyOf.Instance; + return CreateTakeIterator (source, count); } static IEnumerable CreateTakeIterator (IEnumerable source, int count) { - if (count <= 0) - yield break; - int counter = 0; foreach (TSource element in source) { yield return element; diff --git a/mcs/class/System.Core/Test/System.Linq/EnumerableMoreTest.cs b/mcs/class/System.Core/Test/System.Linq/EnumerableMoreTest.cs index 1cf514c7aab..19bfe4856cd 100644 --- a/mcs/class/System.Core/Test/System.Linq/EnumerableMoreTest.cs +++ b/mcs/class/System.Core/Test/System.Linq/EnumerableMoreTest.cs @@ -627,7 +627,7 @@ namespace MonoTests.System.Linq { // Contains (TSource) Assert.IsTrue (data.Contains (2)); for (int i = 0; i < 50; ++i) - Console.WriteLine (icoll.Contains (0));//Console.WriteLine (data.Contains (0)); + icoll.Contains (i);//Console.WriteLine (data.Contains (0)); IsFalse (data.Contains (0), data); // Contains (TSource, IEqualityComparer) diff --git a/mcs/class/System.Core/Test/System.Linq/ParallelEnumerableTests.cs b/mcs/class/System.Core/Test/System.Linq/ParallelEnumerableTests.cs index 6629133fc3d..d9fac1818d3 100644 --- a/mcs/class/System.Core/Test/System.Linq/ParallelEnumerableTests.cs +++ b/mcs/class/System.Core/Test/System.Linq/ParallelEnumerableTests.cs @@ -313,7 +313,7 @@ namespace MonoTests.System.Linq int [] data = {0, 1, 2, 3, 4, 5}; int [] result = {3, 4, 5}; - AssertAreSame (result, data.AsReallyParallel ().AsOrdered ().Skip (3).ToArray ()); + AssertAreSame (result, data.AsParallel ().AsOrdered ().Skip (3).ToArray ()); } [Test] @@ -322,7 +322,7 @@ namespace MonoTests.System.Linq int [] data = {0, 1, 2, 3, 4, 5}; int [] result = {3, 4, 5}; - AssertAreSame (result, data.AsReallyParallel ().AsOrdered ().Skip (3)); + AssertAreSame (result, data.AsParallel ().AsOrdered ().Skip (3)); } [Test] @@ -331,7 +331,7 @@ namespace MonoTests.System.Linq int [] data = {0, 1, 2, 3, 4, 5}; int [] result = {3, 4, 5}; - AssertAreSame (result, data.AsReallyParallel ().AsOrdered ().SkipWhile (i => i < 3)); + AssertAreSame (result, data.AsParallel ().AsOrdered ().SkipWhile (i => i < 3)); } [Test] @@ -340,7 +340,7 @@ namespace MonoTests.System.Linq int [] data = {0, 1, 2, 3, 4, 5}; int [] result = {0, 1, 2}; - AssertAreSame (result, data.AsReallyParallel ().AsOrdered ().Take (3)); + AssertAreSame (result, data.AsParallel ().AsOrdered ().Take (3)); } [Test] @@ -349,7 +349,7 @@ namespace MonoTests.System.Linq int [] data = {0, 1, 2, 3, 4, 5}; int [] result = {0, 1, 2}; - AssertAreSame (result, data.AsReallyParallel ().AsOrdered ().TakeWhile (i => i < 3)); + AssertAreSame (result, data.AsParallel ().AsOrdered ().TakeWhile (i => i < 3)); } [Test] @@ -371,7 +371,7 @@ namespace MonoTests.System.Linq IEnumerable expected = initial.SelectMany ((i) => Enumerable.Range (1, i)); ParallelTestHelper.Repeat (() => { - var actual = initial.AsReallyParallel ().AsOrdered ().SelectMany ((i) => Enumerable.Range (1, i)); + var actual = initial.AsParallel ().AsOrdered ().SelectMany ((i) => Enumerable.Range (1, i)); AssertAreSame (expected, actual); }); } @@ -381,7 +381,7 @@ namespace MonoTests.System.Linq { int [] data = {1, 2, 3}; - Assert.AreEqual (3, data.AsReallyParallel ().AsOrdered ().Last ()); + Assert.AreEqual (3, data.AsParallel ().AsOrdered ().Last ()); } [Test] @@ -389,7 +389,7 @@ namespace MonoTests.System.Linq { int [] data = {}; - Assert.AreEqual (default (int), data.AsReallyParallel ().AsOrdered ().LastOrDefault ()); + Assert.AreEqual (default (int), data.AsParallel ().AsOrdered ().LastOrDefault ()); } [Test] @@ -397,7 +397,7 @@ namespace MonoTests.System.Linq { int [] data = {1, 2, 3}; - Assert.AreEqual (1, data.AsReallyParallel ().AsOrdered ().First ()); + Assert.AreEqual (1, data.AsParallel ().AsOrdered ().First ()); } [Test] @@ -405,7 +405,7 @@ namespace MonoTests.System.Linq { int [] data = {}; - Assert.AreEqual (default (int), data.AsReallyParallel ().AsOrdered ().FirstOrDefault ()); + Assert.AreEqual (default (int), data.AsParallel ().AsOrdered ().FirstOrDefault ()); } [Test] @@ -414,8 +414,8 @@ namespace MonoTests.System.Linq int [] data = {0, 1, 2, 3, 4}; int [] result = {4, 3, 2, 1, 0}; - AssertAreSame (result, ((IEnumerable)data).Select ((i) => i).AsReallyParallel ().AsOrdered ().Reverse ()); - AssertAreSame (result, ParallelEnumerable.Range (0, 5).AsReallyParallel ().AsOrdered ().Reverse ()); + AssertAreSame (result, ((IEnumerable)data).Select ((i) => i).AsParallel ().AsOrdered ().Reverse ()); + AssertAreSame (result, ParallelEnumerable.Range (0, 5).AsParallel ().AsOrdered ().Reverse ()); } [Test] @@ -561,9 +561,9 @@ namespace MonoTests.System.Linq public void ElementAtTestCase() { //ParallelTestHelper.Repeat (() => { - Assert.AreEqual(1, baseEnumerable.AsReallyParallel ().AsOrdered ().ElementAt(0), "#1"); - Assert.AreEqual(51, baseEnumerable.AsReallyParallel ().AsOrdered ().ElementAt(50), "#2"); - Assert.AreEqual(489, baseEnumerable.AsReallyParallel ().AsOrdered ().ElementAt(488), "#3"); + Assert.AreEqual(1, baseEnumerable.AsParallel ().AsOrdered ().ElementAt(0), "#1"); + Assert.AreEqual(51, baseEnumerable.AsParallel ().AsOrdered ().ElementAt(50), "#2"); + Assert.AreEqual(489, baseEnumerable.AsParallel ().AsOrdered ().ElementAt(488), "#3"); //}); } @@ -591,12 +591,11 @@ namespace MonoTests.System.Linq { var items = new [] { 1, 2, 3 }; var items2 = new [] { 1, 2, 3, 4 }; - var actual = items.AsReallyParallel ().Join (items2.AsReallyParallel (), i => i, i => i, (e1, e2) => e1 + e2); + var actual = items.AsReallyParallel ().Join (items2.AsParallel (), i => i, i => i, (e1, e2) => e1 + e2); AreEquivalent (new[] { 2, 4, 6 }, actual); } [Test] - [Category ("NotWorking")] // Deadlocks randomly public void TestGroupBy () { int num = 100; @@ -624,12 +623,12 @@ namespace MonoTests.System.Linq public void TakeTestCase() { ParallelTestHelper.Repeat (() => { - ParallelQuery async_res = baseEnumerable.AsReallyParallel ().AsOrdered ().Take(800); + ParallelQuery async_res = baseEnumerable.AsParallel ().AsOrdered ().Take(800); IEnumerable sync = baseEnumerable.Take(800); AreEquivalent(sync, async_res); - async_res = baseEnumerable.AsReallyParallel ().AsOrdered ().Take(100); + async_res = baseEnumerable.AsParallel ().AsOrdered ().Take(100); sync = baseEnumerable.Take(100); AreEquivalent(sync, async_res); @@ -656,7 +655,7 @@ namespace MonoTests.System.Linq public void SkipTestCase() { ParallelTestHelper.Repeat (() => { - ParallelQuery async_res = baseEnumerable.AsReallyParallel ().AsOrdered().Skip (800); + ParallelQuery async_res = baseEnumerable.AsParallel ().AsOrdered().Skip (800); IEnumerable sync = baseEnumerable.Skip (800); AreEquivalent (sync, async_res); @@ -778,14 +777,14 @@ namespace MonoTests.System.Linq int [] result = {0, 1, 2}; - var array = coll.AsReallyParallel ().AsOrdered().ToArray (); + var array = coll.AsParallel ().AsOrdered().ToArray (); AssertAreSame (result, array); AssertIsOrdered (array, result.Length); Assert.AreEqual (typeof (int []), array.GetType ()); - array = Enumerable.Range (1, 100).Select ((i) => i).AsReallyParallel ().AsOrdered().ToArray (); + array = Enumerable.Range (1, 100).Select ((i) => i).AsParallel ().AsOrdered().ToArray (); result = Enumerable.Range (1, 100).ToArray (); AssertAreSame (result, array); @@ -897,12 +896,12 @@ namespace MonoTests.System.Linq var data2 = new int[] { 1, 2, 4 }; var data3 = new int[] { 1, 2, 3, 4 }; - Assert.IsTrue (data1.AsReallyParallel ().SequenceEqual (data1.AsReallyParallel ())); - Assert.IsTrue (data2.AsReallyParallel ().SequenceEqual (data2.AsReallyParallel ())); - Assert.IsTrue (data3.AsReallyParallel ().SequenceEqual (data3.AsReallyParallel ())); - Assert.IsFalse (data1.AsReallyParallel ().SequenceEqual (data2.AsReallyParallel ())); - Assert.IsFalse (data1.AsReallyParallel ().SequenceEqual (data3.AsReallyParallel ())); - Assert.IsFalse (data2.AsReallyParallel ().SequenceEqual (data3.AsReallyParallel ())); + Assert.IsTrue (data1.AsParallel ().SequenceEqual (data1.AsParallel ())); + Assert.IsTrue (data2.AsParallel ().SequenceEqual (data2.AsParallel ())); + Assert.IsTrue (data3.AsParallel ().SequenceEqual (data3.AsParallel ())); + Assert.IsFalse (data1.AsParallel ().SequenceEqual (data2.AsParallel ())); + Assert.IsFalse (data1.AsParallel ().SequenceEqual (data3.AsParallel ())); + Assert.IsFalse (data2.AsParallel ().SequenceEqual (data3.AsParallel ())); } [Test] diff --git a/mcs/class/System.Core/Test/System.Threading/ReaderWriterLockSlimTest.cs b/mcs/class/System.Core/Test/System.Threading/ReaderWriterLockSlimTest.cs index aef9fffbb55..8e2c3174504 100644 --- a/mcs/class/System.Core/Test/System.Threading/ReaderWriterLockSlimTest.cs +++ b/mcs/class/System.Core/Test/System.Threading/ReaderWriterLockSlimTest.cs @@ -401,9 +401,14 @@ namespace MonoTests.System.Threading { var v = new ReaderWriterLockSlim (); int local = 10; + int ready_count = 0; + int entered_count = 0; + const int thread_count = 10; - var r = from i in Enumerable.Range (1, 10) select new Thread (() => { + var r = from i in Enumerable.Range (1, thread_count) select new Thread (() => { + Interlocked.Increment (ref ready_count); v.EnterReadLock (); + Interlocked.Increment (ref entered_count); Assert.AreEqual (11, local); }); @@ -415,12 +420,16 @@ namespace MonoTests.System.Threading t.Start (); } - Thread.Sleep (200); + while (ready_count != thread_count) + Thread.Sleep (10); + + /* Extra up to 2s of sleep to ensure all threads got the chance to enter the lock */ + for (int i = 0; i < 200 && v.WaitingReadCount != thread_count; ++i) + Thread.Sleep (10); local = 11; - // FIXME: Don't rely on Thread.Sleep (200) Assert.AreEqual (0, v.WaitingWriteCount, "in waiting write"); - Assert.AreEqual (10, v.WaitingReadCount, "in waiting read"); + Assert.AreEqual (thread_count, v.WaitingReadCount, "in waiting read"); Assert.AreEqual (0, v.WaitingUpgradeCount, "in waiting upgrade"); v.ExitWriteLock (); diff --git a/mcs/class/System.Core/mobile_common_System.Core.dll.sources b/mcs/class/System.Core/mobile_common_System.Core.dll.sources index 10e86231252..61ec3815c6a 100644 --- a/mcs/class/System.Core/mobile_common_System.Core.dll.sources +++ b/mcs/class/System.Core/mobile_common_System.Core.dll.sources @@ -40,56 +40,10 @@ System.Threading/LockRecursionPolicy.cs System.Threading/ReaderWriterLockSlim.cs System.Threading/ThreadLockState.cs System.Threading/ReaderWriterLockSlimExtensions.cs -System.Linq.Parallel.QueryNodes/QueryBaseNode.cs -System.Linq.Parallel.QueryNodes/QueryCastNode.cs -System.Linq.Parallel.QueryNodes/QueryChildNode.cs -System.Linq.Parallel.QueryNodes/QueryConcatNode.cs -System.Linq.Parallel.QueryNodes/QueryDefaultEmptyNode.cs -System.Linq.Parallel.QueryNodes/QueryGroupByNode.cs -System.Linq.Parallel.QueryNodes/QueryHeadWorkerNode.cs -System.Linq.Parallel.QueryNodes/QueryJoinNode.cs -System.Linq.Parallel.QueryNodes/QueryMuxNode.cs -System.Linq.Parallel.QueryNodes/QueryOptionNode.cs -System.Linq.Parallel.QueryNodes/QueryOrderByNode.cs -System.Linq.Parallel.QueryNodes/QueryOrderGuardNode.cs -System.Linq.Parallel.QueryNodes/QueryOrderedStreamNode.cs -System.Linq.Parallel.QueryNodes/QueryReverseNode.cs -System.Linq.Parallel.QueryNodes/QuerySelectManyNode.cs -System.Linq.Parallel.QueryNodes/QuerySelectNode.cs -System.Linq.Parallel.QueryNodes/QuerySetNode.cs -System.Linq.Parallel.QueryNodes/QueryStartNode.cs -System.Linq.Parallel.QueryNodes/QueryStreamNode.cs -System.Linq.Parallel.QueryNodes/QueryWhereNode.cs -System.Linq.Parallel.QueryNodes/QueryZipNode.cs -System.Linq.Parallel.QueryNodes/SetInclusion.cs -System.Linq.Parallel.QueryNodes/WrapHelper.cs -System.Linq.Parallel/AggregationList.cs -System.Linq.Parallel/ConcurrentGrouping.cs -System.Linq.Parallel/ConcurrentLookup.cs -System.Linq.Parallel/INodeVisitor.cs -System.Linq.Parallel/IVisitableNode.cs -System.Linq.Parallel/OrderingEnumerator.cs -System.Linq.Parallel/ParallelExecuter.cs -System.Linq.Parallel/ParallelPartitioner.cs -System.Linq.Parallel/ParallelQueryEnumerator.cs -System.Linq.Parallel/ParallelQuickSort.cs -System.Linq.Parallel/QueryCheckerVisitor.cs -System.Linq.Parallel/QueryIsOrderedVisitor.cs -System.Linq.Parallel/QueryOptions.cs -System.Linq.Parallel/RangeList.cs -System.Linq.Parallel/RepeatList.cs -System.Linq.Parallel/ReverseList.cs -System.Linq.Parallel/StripPartitioner.cs -System.Linq.Parallel/TemporaryArea.cs System.Linq/EnumerableExecutor.cs System.Linq/EnumerableExecutor_T.cs System.Linq/EnumerableQuery.cs System.Linq/EnumerableQuery_T.cs -System.Linq/OrderedParallelQuery.cs -System.Linq/ParallelEnumerable.cs -System.Linq/ParallelExecutionMode.cs -System.Linq/ParallelMergeOptions.cs -System.Linq/ParallelQuery.cs System.IO.MemoryMappedFiles/MemoryMappedFile.cs System.IO.MemoryMappedFiles/MemoryMappedFileAccess.cs System.IO.MemoryMappedFiles/MemoryMappedFileOptions.cs @@ -106,3 +60,142 @@ System.Linq.Expressions/ExpressionTransformer.cs ../dlr/Runtime/Microsoft.Scripting.Core/Ast/DynamicExpression.cs ../dlr/Runtime/Microsoft.Scripting.Core/Compiler/Closure.cs System.Linq.Expressions/DynamicExpressionVisitor.cs +../../../external/referencesource/System.Core/System/Linq/ParallelEnumerable.cs +../../../external/referencesource/System.Core/System/Linq/ParallelMergeOptions.cs +../../../external/referencesource/System.Core/System/Linq/ParallelExecutionMode.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Channels/AsynchronousChannel.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Channels/SynchronousChannel.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/AggregationMinMaxHelpers.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/EmptyEnumerable.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/EnumerableWrapperWeakToStrong.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/IParallelPartitionable.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/OrderedParallelQuery.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/ParallelEnumerableWrapper.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/ParallelQuery.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/QueryAggregationOptions.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/RangeEnumerable.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/RepeatEnumerable.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/ArrayMergeHelper.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/AsynchronousChannelMergeEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/DefaultMergeHelper.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/IMergeHelper.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/MergeEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/MergeExecutor.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/OrderPreservingMergeHelper.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/OrderPreservingPipeliningMergeHelper.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/SynchronousChannelMergeEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Partitioning/HashRepartitionEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Partitioning/HashRepartitionStream.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Partitioning/IPartitionedStreamRecipient.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Partitioning/OrderedHashRepartitionEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Partitioning/OrderedHashRepartitionStream.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Partitioning/PartitionedDataSource.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Partitioning/PartitionedStream.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Partitioning/UnorderedHashRepartitionStream.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/AssociativeAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/ExceptQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/GroupJoinQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/HashJoinQueryOperatorEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/IntersectQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/JoinQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/UnionQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/ZipQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/BinaryQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/CountAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/InlinedAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/InlinedAggregationOperatorEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongCountAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/ListQueryResults.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Options/OrderingQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Options/QueryExecutionOption.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/OrdinalIndexState.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/PartitionedStreamMerger.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/PartitionerQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOpeningEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOperatorEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryResults.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QuerySettings.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/ScanQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/AnyAllSearchOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ConcatQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ContainsSearchOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/DefaultIfEmptyQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/DistinctQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ElementAtQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/FirstQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ForAllOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/GroupByQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/IndexedSelectQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/IndexedWhereQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/LastQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ReverseQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SelectManyQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SelectQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SingleQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SortQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/TakeOrSkipQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/TakeOrSkipWhileQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/WhereQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/UnaryQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/CancellationState.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/OrderPreservingPipeliningSpoolingTask.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/OrderPreservingSpoolingTask.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryLifecycle.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryTask.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryTaskGroupState.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/Scheduling.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/SpoolingTask.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/SpoolingTaskBase.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/CancellableEnumerable.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/ExceptionAggregator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/ExchangeUtilities.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/FixedMaxHeap.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/GrowingArray.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/HashLookup.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/IntValueEvent.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/ListChunk.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/Lookup.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/Pair.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/PairComparer.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/ReverseComparer.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/Shared.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/Sorting.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/TraceHelpers.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/Util.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/Wrapper.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/WrapperEqualityComparer.cs + +ReferenceSources/Set.cs +ReferenceSources/SR.cs +../../build/common/SR.cs diff --git a/mcs/class/System.Core/net_4_0_System.Core.dll.sources b/mcs/class/System.Core/net_4_0_System.Core.dll.sources index ee0a10c7b1c..245d280ca08 100644 --- a/mcs/class/System.Core/net_4_0_System.Core.dll.sources +++ b/mcs/class/System.Core/net_4_0_System.Core.dll.sources @@ -1,4 +1,5 @@ #include dynamic_System.Core.dll.sources +../../build/common/SR.cs Assembly/AssemblyInfo.cs System/Actions.cs System/Funcs.cs @@ -90,49 +91,142 @@ System.IO.Pipes/PipeUnix.cs System.IO.Pipes/PipeWin32.cs System.IO/HandleInheritability.cs -System.Linq.Parallel/ParallelQueryEnumerator.cs -System.Linq/OrderedParallelQuery.cs -System.Linq/ParallelMergeOptions.cs -System.Linq/ParallelExecutionMode.cs -System.Linq/ParallelEnumerable.cs -System.Linq.Parallel/ParallelPartitioner.cs -System.Linq.Parallel/RangeList.cs -System.Linq.Parallel/StripPartitioner.cs -System.Linq.Parallel/RepeatList.cs -System.Linq.Parallel/ParallelQuickSort.cs -System.Linq.Parallel/OrderingEnumerator.cs -System.Linq.Parallel/AggregationList.cs -System.Linq.Parallel/ConcurrentLookup.cs -System.Linq.Parallel/ConcurrentGrouping.cs -System.Linq.Parallel/ReverseList.cs -System.Linq.Parallel/ParallelExecuter.cs -System.Linq.Parallel/TemporaryArea.cs -System.Linq/ParallelQuery.cs -System.Linq.Parallel.QueryNodes/QueryWhereNode.cs -System.Linq.Parallel.QueryNodes/QueryCastNode.cs -System.Linq.Parallel.QueryNodes/QueryConcatNode.cs -System.Linq.Parallel.QueryNodes/QueryDefaultEmptyNode.cs -System.Linq.Parallel.QueryNodes/QueryOptionNode.cs -System.Linq.Parallel.QueryNodes/QueryGroupByNode.cs -System.Linq.Parallel.QueryNodes/QuerySelectNode.cs -System.Linq.Parallel.QueryNodes/QuerySelectManyNode.cs -System.Linq.Parallel.QueryNodes/QueryStreamNode.cs -System.Linq.Parallel.QueryNodes/QueryOrderedStreamNode.cs -System.Linq.Parallel.QueryNodes/QueryStartNode.cs -System.Linq.Parallel.QueryNodes/QueryBaseNode.cs -System.Linq.Parallel.QueryNodes/QueryChildNode.cs -System.Linq.Parallel.QueryNodes/QueryOrderGuardNode.cs -System.Linq.Parallel.QueryNodes/QueryOrderByNode.cs -System.Linq.Parallel.QueryNodes/QueryMuxNode.cs -System.Linq.Parallel.QueryNodes/QueryZipNode.cs -System.Linq.Parallel.QueryNodes/QuerySetNode.cs -System.Linq.Parallel.QueryNodes/QueryReverseNode.cs -System.Linq.Parallel.QueryNodes/SetInclusion.cs -System.Linq.Parallel.QueryNodes/WrapHelper.cs -System.Linq.Parallel.QueryNodes/QueryHeadWorkerNode.cs -System.Linq.Parallel.QueryNodes/QueryJoinNode.cs -System.Linq.Parallel/INodeVisitor.cs -System.Linq.Parallel/IVisitableNode.cs -System.Linq.Parallel/QueryCheckerVisitor.cs -System.Linq.Parallel/QueryIsOrderedVisitor.cs -System.Linq.Parallel/QueryOptions.cs +#PLINQ +../../../external/referencesource/System.Core/System/Linq/ParallelEnumerable.cs +../../../external/referencesource/System.Core/System/Linq/ParallelMergeOptions.cs +../../../external/referencesource/System.Core/System/Linq/ParallelExecutionMode.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Channels/AsynchronousChannel.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Channels/SynchronousChannel.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/AggregationMinMaxHelpers.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/EmptyEnumerable.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/EnumerableWrapperWeakToStrong.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/IParallelPartitionable.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/OrderedParallelQuery.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/ParallelEnumerableWrapper.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/ParallelQuery.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/QueryAggregationOptions.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/RangeEnumerable.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Enumerables/RepeatEnumerable.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/ArrayMergeHelper.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/AsynchronousChannelMergeEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/DefaultMergeHelper.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/IMergeHelper.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/MergeEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/MergeExecutor.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/OrderPreservingMergeHelper.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/OrderPreservingPipeliningMergeHelper.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Merging/SynchronousChannelMergeEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Partitioning/HashRepartitionEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Partitioning/HashRepartitionStream.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Partitioning/IPartitionedStreamRecipient.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Partitioning/OrderedHashRepartitionEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Partitioning/OrderedHashRepartitionStream.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Partitioning/PartitionedDataSource.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Partitioning/PartitionedStream.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Partitioning/UnorderedHashRepartitionStream.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/AssociativeAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/ExceptQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/GroupJoinQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/HashJoinQueryOperatorEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/IntersectQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/JoinQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/UnionQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/ZipQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/BinaryQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/CountAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/InlinedAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/InlinedAggregationOperatorEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongCountAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongAverageAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongMinMaxAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongSumAggregationOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/ListQueryResults.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Options/OrderingQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Options/QueryExecutionOption.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/OrdinalIndexState.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/PartitionedStreamMerger.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/PartitionerQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOpeningEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOperatorEnumerator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryResults.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QuerySettings.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/ScanQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/AnyAllSearchOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ConcatQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ContainsSearchOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/DefaultIfEmptyQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/DistinctQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ElementAtQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/FirstQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ForAllOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/GroupByQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/IndexedSelectQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/IndexedWhereQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/LastQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ReverseQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SelectManyQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SelectQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SingleQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SortQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/TakeOrSkipQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/TakeOrSkipWhileQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/WhereQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/QueryOperators/UnaryQueryOperator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/CancellationState.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/OrderPreservingPipeliningSpoolingTask.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/OrderPreservingSpoolingTask.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryLifecycle.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryTask.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryTaskGroupState.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/Scheduling.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/SpoolingTask.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Scheduling/SpoolingTaskBase.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/CancellableEnumerable.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/ExceptionAggregator.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/ExchangeUtilities.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/FixedMaxHeap.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/GrowingArray.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/HashLookup.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/IntValueEvent.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/ListChunk.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/Lookup.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/Pair.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/PairComparer.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/ReverseComparer.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/Shared.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/Sorting.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/TraceHelpers.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/Util.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/Wrapper.cs +../../../external/referencesource/System.Core/System/Linq/Parallel/Utils/WrapperEqualityComparer.cs + +ReferenceSources/Set.cs +ReferenceSources/SR.cs diff --git a/mcs/class/System.Data.DataSetExtensions/System.Data.DataSetExtensions-net_2_0.csproj b/mcs/class/System.Data.DataSetExtensions/System.Data.DataSetExtensions-net_2_0.csproj deleted file mode 100644 index ad266ec02c1..00000000000 --- a/mcs/class/System.Data.DataSetExtensions/System.Data.DataSetExtensions-net_2_0.csproj +++ /dev/null @@ -1,110 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {BB9C24C9-41DC-4F08-BBCE-3698C695332B} - Library - 1699,1720 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Data.DataSetExtensions - v2.0 - 512 - - - true - full - 1699,1720 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - pdbonly - 1699,1720 - true - NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {B8F7FDF0-07C7-4AFC-9854-F591BF307939} - System.Web\System.Web-net_2_0-1 - - - - - - - diff --git a/mcs/class/System.Data.DataSetExtensions/System.Data.DataSetExtensions-tests-net_2_0.csproj b/mcs/class/System.Data.DataSetExtensions/System.Data.DataSetExtensions-tests-net_2_0.csproj deleted file mode 100644 index a8f9cc16a6c..00000000000 --- a/mcs/class/System.Data.DataSetExtensions/System.Data.DataSetExtensions-tests-net_2_0.csproj +++ /dev/null @@ -1,104 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {B9F3CFD2-99EE-49B0-986F-E6089E4E5CFA} - Library - 1699,1720,219,169 - bin\Debug\System.Data.DataSetExtensions-tests-net_2_0 - True - False - - Properties - - - System.Data.DataSetExtensions_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,1720,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - pdbonly - 1699,1720,219,169 - true - NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {BB9C24C9-41DC-4F08-BBCE-3698C695332B} - System.Data.DataSetExtensions\System.Data.DataSetExtensions-net_2_0 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {B8F7FDF0-07C7-4AFC-9854-F591BF307939} - System.Web\System.Web-net_2_0-1 - - - - - - - diff --git a/mcs/class/System.Data.Linq/Makefile b/mcs/class/System.Data.Linq/Makefile index ff9dd8fd02b..6a8469e3e30 100755 --- a/mcs/class/System.Data.Linq/Makefile +++ b/mcs/class/System.Data.Linq/Makefile @@ -12,17 +12,12 @@ LIB_MCS_FLAGS = \ /resource:./src/DbLinq/Schema/Dbml/DbmlSchema.xsd,DbLinq.Schema.Dbml.DbmlSchema.xsd \ /d:MONO_STRICT /d:MONO_DEPLOY -warn:1 -ifeq (2.0, $(FRAMEWORK_VERSION)) -# This is a .NET 3.5 only assembly, but built during the 2.0 build -LIB_MCS_FLAGS += -d:NET_3_5 -nowarn:1720 -endif - TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) EXTRA_DISTFILES = src/DbLinq/Schema/Dbml/DbmlSchema.xsd # This is a .NET 3.5+ assembly -VALID_PROFILE := $(filter net_2_0 net_4_0 net_4_5, $(PROFILE)) +VALID_PROFILE := $(filter net_4_0 net_4_5, $(PROFILE)) ifndef VALID_PROFILE LIBRARY_NAME = dummy-System.Data.Linq.dll NO_INSTALL = yes diff --git a/mcs/class/System.Data.Linq/System.Data.Linq-net_2_0.csproj b/mcs/class/System.Data.Linq/System.Data.Linq-net_2_0.csproj deleted file mode 100644 index 6893a2f0364..00000000000 --- a/mcs/class/System.Data.Linq/System.Data.Linq-net_2_0.csproj +++ /dev/null @@ -1,424 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {286ED1A3-6AE6-4147-A43B-B3421681CC84} - Library - 1699,1720 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Data.Linq - v2.0 - 512 - - - true - full - 1699,1720 - false - DEBUG;TRACE;NET_1_1;NET_2_0;MONO_STRICT;MONO_DEPLOY;NET_3_5 - prompt - 4 - - - pdbonly - 1699,1720 - true - NET_1_1;NET_2_0;MONO_STRICT;MONO_DEPLOY;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {01BE23DB-E426-45E7-B56C-CA1175232AA7} - System.Runtime.Serialization\System.Runtime.Serialization-net_2_0 - - - - - - - - DbLinq.Schema.Dbml.DbmlSchema.xsd - - - - diff --git a/mcs/class/System.Data.Linq/System.Data.Linq-tests-net_2_0.csproj b/mcs/class/System.Data.Linq/System.Data.Linq-tests-net_2_0.csproj deleted file mode 100644 index eee1f763d67..00000000000 --- a/mcs/class/System.Data.Linq/System.Data.Linq-tests-net_2_0.csproj +++ /dev/null @@ -1,114 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {50082F92-4608-4F6F-B2BB-338DC1B3B591} - Library - 1699,1720 - bin\Debug\System.Data.Linq-tests-net_2_0 - True - False - - Properties - - - System.Data.Linq_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,1720 - false - DEBUG;TRACE;NET_1_1;NET_2_0;MONO_STRICT;MONO_DEPLOY;NET_3_5 - prompt - 4 - - - pdbonly - 1699,1720 - true - NET_1_1;NET_2_0;MONO_STRICT;MONO_DEPLOY;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {286ED1A3-6AE6-4147-A43B-B3421681CC84} - System.Data.Linq\System.Data.Linq-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {01BE23DB-E426-45E7-B56C-CA1175232AA7} - System.Runtime.Serialization\System.Runtime.Serialization-net_2_0 - - - - - - - - DbLinq.Schema.Dbml.DbmlSchema.xsd - - - - diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient-net_2_0.csproj b/mcs/class/System.Data.OracleClient/System.Data.OracleClient-net_2_0.csproj deleted file mode 100644 index 68cb0f812a5..00000000000 --- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient-net_2_0.csproj +++ /dev/null @@ -1,165 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {FB31E958-0E46-4D09-80B2-EF1245FDDB87} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Data.OracleClient - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {94E27660-C3DF-43D1-958A-94D68EF3131F} - System.EnterpriseServices\System.EnterpriseServices-net_2_0 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - - - - - diff --git a/mcs/class/System.Data.OracleClient/System.Data.OracleClient-tests-net_2_0.csproj b/mcs/class/System.Data.OracleClient/System.Data.OracleClient-tests-net_2_0.csproj deleted file mode 100644 index dc651ac2322..00000000000 --- a/mcs/class/System.Data.OracleClient/System.Data.OracleClient-tests-net_2_0.csproj +++ /dev/null @@ -1,221 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F5A01B66-E44D-4901-9607-DB7BF2D6B572} - Library - 1699,618 - bin\Debug\System.Data.OracleClient-tests-net_2_0 - True - False - - Properties - - - System.Data.OracleClient_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {FB31E958-0E46-4D09-80B2-EF1245FDDB87} - System.Data.OracleClient\System.Data.OracleClient-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {94E27660-C3DF-43D1-958A-94D68EF3131F} - System.EnterpriseServices\System.EnterpriseServices-net_2_0 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - - - - - diff --git a/mcs/class/System.Data.Services.Client/System.Data.Services.Client-net_2_0.csproj b/mcs/class/System.Data.Services.Client/System.Data.Services.Client-net_2_0.csproj deleted file mode 100644 index 18b69588385..00000000000 --- a/mcs/class/System.Data.Services.Client/System.Data.Services.Client-net_2_0.csproj +++ /dev/null @@ -1,220 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2BD87584-B572-4E15-9941-93776CE3C901} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Data.Services.Client - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {80B8A117-6BB4-4646-8BE9-863A5C105437} - System.Xml.Linq\System.Xml.Linq-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {65F08514-3634-45C8-8EEB-6BAEA2EDC0C8} - WindowsBase\WindowsBase-net_2_0 - - - - - - - - System.Data.Services.Client.resources - - - - diff --git a/mcs/class/System.Data.Services/System.Data.Services-net_2_0.csproj b/mcs/class/System.Data.Services/System.Data.Services-net_2_0.csproj deleted file mode 100644 index c40c38d7c57..00000000000 --- a/mcs/class/System.Data.Services/System.Data.Services-net_2_0.csproj +++ /dev/null @@ -1,122 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {09A92F36-0617-4D47-95BB-17AAB6588793} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Data.Services - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {DA50E37C-63DE-4049-9BE0-141BF1104E20} - System.ServiceModel\System.ServiceModel-net_2_0 - - - {3C6EB10D-5929-4CB4-81F2-7984FCECCDAA} - System.ServiceModel.Web\System.ServiceModel.Web-net_2_0 - - - {2BD87584-B572-4E15-9941-93776CE3C901} - System.Data.Services.Client\System.Data.Services.Client-net_2_0 - - - - - - - diff --git a/mcs/class/System.Data.Services/System.Data.Services-tests-net_2_0.csproj b/mcs/class/System.Data.Services/System.Data.Services-tests-net_2_0.csproj deleted file mode 100644 index 4a2a04d3551..00000000000 --- a/mcs/class/System.Data.Services/System.Data.Services-tests-net_2_0.csproj +++ /dev/null @@ -1,100 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E5666F81-4D04-454B-A208-25A90186E92C} - Library - 1699 - bin\Debug\System.Data.Services-tests-net_2_0 - True - False - - Properties - - - System.Data.Services_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {09A92F36-0617-4D47-95BB-17AAB6588793} - System.Data.Services\System.Data.Services-net_2_0 - - - {DA50E37C-63DE-4049-9BE0-141BF1104E20} - System.ServiceModel\System.ServiceModel-net_2_0 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - - - - - diff --git a/mcs/class/System.Data/Makefile b/mcs/class/System.Data/Makefile index 2fb0b08ecd5..59772888b4d 100644 --- a/mcs/class/System.Data/Makefile +++ b/mcs/class/System.Data/Makefile @@ -2,27 +2,13 @@ thisdir = class/System.Data SUBDIRS = include ../../build/rules.make -# I have *no idea* why I need to do this. - -ifeq ($(PROFILE),atomic) -system = System.dll -else -system = $(topdir)/class/lib/$(PROFILE)/System.dll -endif - -ifneq (1, $(FRAMEWORK_VERSION_MAJOR)) -OTHER_LIB_MCS_FLAGS = -r:System.Configuration.dll \ - -r:System.Transactions.dll -endif - LIBRARY = System.Data.dll + LIB_MCS_FLAGS = \ -nowarn:649 \ -unsafe \ - -r:$(corlib) \ - -r:$(system) \ - -r:System.Xml.dll \ - + -r:System \ + -r:System.Xml.dll MOBILE := $(filter monotouch monodroid xammac mobile mobile_static, $(PROFILE)) ifdef MOBILE @@ -33,7 +19,8 @@ else LIB_MCS_FLAGS += \ -r:System.EnterpriseServices.dll \ -r:Mono.Data.Tds.dll \ - $(OTHER_LIB_MCS_FLAGS) + -r:System.Configuration.dll \ + -r:System.Transactions.dll endif TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -r:System.Core.dll -r:Mono.Data.Sqlite.dll -nowarn:618,169,612,219,168 diff --git a/mcs/class/System.Data/System.Data-net_2_0.csproj b/mcs/class/System.Data/System.Data-net_2_0.csproj deleted file mode 100644 index fc6d5c4bb65..00000000000 --- a/mcs/class/System.Data/System.Data-net_2_0.csproj +++ /dev/null @@ -1,439 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - Library - 1699,649 - ./../../class/lib/net_2_0 - True - True - true - Properties - - - System.Data - v2.0 - 512 - - - true - full - 1699,649 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,649 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {94E27660-C3DF-43D1-958A-94D68EF3131F} - System.EnterpriseServices\System.EnterpriseServices-net_2_0 - - - {C21CB6AB-7059-4FA5-A23C-84EA0B854BB7} - Mono.Data.Tds\Mono.Data.Tds-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - {BBC5CD06-50EB-439E-9DBB-2B5D644BE6C3} - System.Transactions\System.Transactions-net_2_0 - - - - - - - diff --git a/mcs/class/System.Data/System.Data-tests-net_2_0.csproj b/mcs/class/System.Data/System.Data-tests-net_2_0.csproj deleted file mode 100644 index cb4d133e21b..00000000000 --- a/mcs/class/System.Data/System.Data-tests-net_2_0.csproj +++ /dev/null @@ -1,239 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {98528310-9599-43E7-B342-C9686B861C6E} - Library - 1699,649,618,169,612,219,168 - bin\Debug\System.Data-tests-net_2_0 - True - False - true - Properties - - - System.Data_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,649,618,169,612,219,168 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,649,618,169,612,219,168 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {94E27660-C3DF-43D1-958A-94D68EF3131F} - System.EnterpriseServices\System.EnterpriseServices-net_2_0 - - - {C21CB6AB-7059-4FA5-A23C-84EA0B854BB7} - Mono.Data.Tds\Mono.Data.Tds-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - {BBC5CD06-50EB-439E-9DBB-2B5D644BE6C3} - System.Transactions\System.Transactions-net_2_0 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - False - Mono.Data.Sqlite.dll - False - - - - - - - diff --git a/mcs/class/System.Data/System.Data.Common/DbEnumerator.cs b/mcs/class/System.Data/System.Data.Common/DbEnumerator.cs index 2a6c0da4885..7cad139dc3d 100644 --- a/mcs/class/System.Data/System.Data.Common/DbEnumerator.cs +++ b/mcs/class/System.Data/System.Data.Common/DbEnumerator.cs @@ -43,7 +43,6 @@ namespace System.Data.Common { readonly IDataReader reader; readonly bool closeReader; readonly SchemaInfo [] schema; - readonly object [] values; #endregion // Fields @@ -58,7 +57,6 @@ namespace System.Data.Common { { this.reader = reader; this.closeReader = closeReader; - this.values = new object [reader.FieldCount]; this.schema = LoadSchema (reader); } @@ -67,8 +65,13 @@ namespace System.Data.Common { #region Properties public object Current { - get { + get { + // DbDataRecordImpl does not do copy of the array + // and MoveNext would overwrite any previously filled data + var values = new object [reader.FieldCount]; reader.GetValues (values); + + // TODO: Should not allocate on every property call return new DbDataRecordImpl (schema, values); } } diff --git a/mcs/class/System.Design/System.Design-net_2_0.csproj b/mcs/class/System.Design/System.Design-net_2_0.csproj deleted file mode 100644 index f146ad3bfe2..00000000000 --- a/mcs/class/System.Design/System.Design-net_2_0.csproj +++ /dev/null @@ -1,438 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D3F4E3E9-C9E8-43D4-9E6C-A4AD4433592C} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Design - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;DRAWING_DESIGN_DEP - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;DRAWING_DESIGN_DEP - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {B8F7FDF0-07C7-4AFC-9854-F591BF307939} - System.Web\System.Web-net_2_0-1 - - - {EC4EB1AA-1E23-4F9A-832A-FED2E5EA9630} - Managed.Windows.Forms\System.Windows.Forms-net_2_0 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - {43A23ADA-35D9-4A48-BCE5-C21C081C6676} - Accessibility\Accessibility-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - False - System.Drawing.Design.dll - False - - - - - - - diff --git a/mcs/class/System.Design/System.Design-tests-net_2_0.csproj b/mcs/class/System.Design/System.Design-tests-net_2_0.csproj deleted file mode 100644 index a60dee768ac..00000000000 --- a/mcs/class/System.Design/System.Design-tests-net_2_0.csproj +++ /dev/null @@ -1,104 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D963664C-F52A-43CB-987B-D5B9563FA779} - Library - 1699 - bin\Debug\System.Design-tests-net_2_0 - True - False - - Properties - - - System.Design_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {31BD6BF1-0C7A-4C0A-AB48-091F2EBB4AAC} - System.Design\System.Design-net_2_0-1 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - {EC4EB1AA-1E23-4F9A-832A-FED2E5EA9630} - Managed.Windows.Forms\System.Windows.Forms-net_2_0 - - - - - - - diff --git a/mcs/class/System.DirectoryServices.Protocols/System.DirectoryServices.Protocols-net_2_0.csproj b/mcs/class/System.DirectoryServices.Protocols/System.DirectoryServices.Protocols-net_2_0.csproj deleted file mode 100644 index 0af954ff7a4..00000000000 --- a/mcs/class/System.DirectoryServices.Protocols/System.DirectoryServices.Protocols-net_2_0.csproj +++ /dev/null @@ -1,189 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {38D88F62-36F7-4E60-BE74-09C0D2EFD4A0} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.DirectoryServices.Protocols - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {390BE0FB-F60C-4E2C-8C52-A221087F1355} - System.DirectoryServices\System.DirectoryServices-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices-net_2_0.csproj b/mcs/class/System.DirectoryServices/System.DirectoryServices-net_2_0.csproj deleted file mode 100644 index 7d203c9d9bb..00000000000 --- a/mcs/class/System.DirectoryServices/System.DirectoryServices-net_2_0.csproj +++ /dev/null @@ -1,217 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {390BE0FB-F60C-4E2C-8C52-A221087F1355} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.DirectoryServices - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {30C57C43-3A84-4E9F-A889-53CAE3C634C4} - Novell.Directory.Ldap\Novell.Directory.Ldap-net_2_0 - - - - - - - diff --git a/mcs/class/System.DirectoryServices/System.DirectoryServices-tests-net_2_0.csproj b/mcs/class/System.DirectoryServices/System.DirectoryServices-tests-net_2_0.csproj deleted file mode 100644 index ddbc31865cc..00000000000 --- a/mcs/class/System.DirectoryServices/System.DirectoryServices-tests-net_2_0.csproj +++ /dev/null @@ -1,94 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F179583B-C57D-4274-BCB0-CF8E90C639B0} - Library - 1699,618,219,169 - bin\Debug\System.DirectoryServices-tests-net_2_0 - True - False - - Properties - - - System.DirectoryServices_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618,219,169 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {390BE0FB-F60C-4E2C-8C52-A221087F1355} - System.DirectoryServices\System.DirectoryServices-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {30C57C43-3A84-4E9F-A889-53CAE3C634C4} - Novell.Directory.Ldap\Novell.Directory.Ldap-net_2_0 - - - - - - - diff --git a/mcs/class/System.Drawing.Design/System.Drawing.Design-net_2_0.csproj b/mcs/class/System.Drawing.Design/System.Drawing.Design-net_2_0.csproj deleted file mode 100644 index 9405ca727d3..00000000000 --- a/mcs/class/System.Drawing.Design/System.Drawing.Design-net_2_0.csproj +++ /dev/null @@ -1,103 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {1A2E7A4A-050C-4F3E-9776-79E7E44B48BE} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Drawing.Design - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - {EC4EB1AA-1E23-4F9A-832A-FED2E5EA9630} - Managed.Windows.Forms\System.Windows.Forms-net_2_0 - - - - - - - diff --git a/mcs/class/System.Drawing/System.Drawing-net_2_0.csproj b/mcs/class/System.Drawing/System.Drawing-net_2_0.csproj deleted file mode 100644 index c8950313682..00000000000 --- a/mcs/class/System.Drawing/System.Drawing-net_2_0.csproj +++ /dev/null @@ -1,291 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - true - Properties - - - System.Drawing - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - - - - - - Mono.ico - - - Information.ico - - - Error.ico - - - Warning.ico - - - Question.ico - - - Shield.ico - - - - diff --git a/mcs/class/System.Drawing/System.Drawing-tests-net_2_0.csproj b/mcs/class/System.Drawing/System.Drawing-tests-net_2_0.csproj deleted file mode 100644 index 27c97746fac..00000000000 --- a/mcs/class/System.Drawing/System.Drawing-tests-net_2_0.csproj +++ /dev/null @@ -1,209 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {34B64C48-9A07-4A68-8EE4-14471777CD34} - Library - 1699,618,219,169,1595 - bin\Debug\System.Drawing-tests-net_2_0 - True - False - true - Properties - - - System.Drawing_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,618,219,169,1595 - false - DEBUG;TRACE;NET_1_1;NET_2_0;TEST - prompt - 4 - - - pdbonly - 1699,618,219,169,1595 - true - NET_1_1;NET_2_0;TEST - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - False - System.Runtime.Serialization.Formatters.Soap.dll - False - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - - Mono.ico - - - Information.ico - - - Error.ico - - - Warning.ico - - - Question.ico - - - Shield.ico - - - indexed.png - - - - diff --git a/mcs/class/System.EnterpriseServices/System.EnterpriseServices-net_2_0.csproj b/mcs/class/System.EnterpriseServices/System.EnterpriseServices-net_2_0.csproj deleted file mode 100644 index 8a2c4a5cd54..00000000000 --- a/mcs/class/System.EnterpriseServices/System.EnterpriseServices-net_2_0.csproj +++ /dev/null @@ -1,192 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {94E27660-C3DF-43D1-958A-94D68EF3131F} - Library - 1699,168,162 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.EnterpriseServices - v2.0 - 512 - - - true - full - 1699,168,162 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,168,162 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {BBC5CD06-50EB-439E-9DBB-2B5D644BE6C3} - System.Transactions\System.Transactions-net_2_0 - - - - - - - diff --git a/mcs/class/System.IdentityModel.Selectors/Makefile b/mcs/class/System.IdentityModel.Selectors/Makefile index d88fb810c4c..f9243edf7db 100755 --- a/mcs/class/System.IdentityModel.Selectors/Makefile +++ b/mcs/class/System.IdentityModel.Selectors/Makefile @@ -15,7 +15,7 @@ TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) EXTRA_DISTFILES = -VALID_PROFILE := $(filter net_2_0 net_4_0 net_4_5, $(PROFILE)) +VALID_PROFILE := $(filter net_4_0 net_4_5, $(PROFILE)) ifndef VALID_PROFILE LIBRARY_NAME = dummy-System.IdentityModel.Selectors.dll NO_INSTALL = yes diff --git a/mcs/class/System.IdentityModel.Selectors/System.IdentityModel.Selectors-net_2_0.csproj b/mcs/class/System.IdentityModel.Selectors/System.IdentityModel.Selectors-net_2_0.csproj deleted file mode 100644 index a6cb6bf6314..00000000000 --- a/mcs/class/System.IdentityModel.Selectors/System.IdentityModel.Selectors-net_2_0.csproj +++ /dev/null @@ -1,110 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {7203476D-4107-4C91-9930-DEC5CCFE62C8} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.IdentityModel.Selectors - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {879EA17D-67A5-44ED-B912-1BE4883356FE} - System.Security\System.Security-net_2_0 - - - {01BE23DB-E426-45E7-B56C-CA1175232AA7} - System.Runtime.Serialization\System.Runtime.Serialization-net_2_0 - - - {737EBB38-BBFD-40D8-99F1-1FBBD49AF1B6} - System.IdentityModel\System.IdentityModel-net_2_0 - - - - - - - diff --git a/mcs/class/System.IdentityModel/Makefile b/mcs/class/System.IdentityModel/Makefile index 320f21c9dae..956c2a72ec3 100644 --- a/mcs/class/System.IdentityModel/Makefile +++ b/mcs/class/System.IdentityModel/Makefile @@ -26,7 +26,7 @@ EXTRA_DISTFILES = \ Test/Resources/test.pfx \ Test/Resources/test2.pfx -VALID_PROFILE := $(filter net_2_0 net_4_0 net_4_5, $(PROFILE)) +VALID_PROFILE := $(filter net_4_0 net_4_5, $(PROFILE)) ifndef VALID_PROFILE LIBRARY_NAME = dummy-System.IdentityModel.dll NO_INSTALL = yes diff --git a/mcs/class/System.IdentityModel/System.IdentityModel-net_2_0.csproj b/mcs/class/System.IdentityModel/System.IdentityModel-net_2_0.csproj deleted file mode 100644 index 798580c4688..00000000000 --- a/mcs/class/System.IdentityModel/System.IdentityModel-net_2_0.csproj +++ /dev/null @@ -1,196 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {737EBB38-BBFD-40D8-99F1-1FBBD49AF1B6} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.IdentityModel - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {879EA17D-67A5-44ED-B912-1BE4883356FE} - System.Security\System.Security-net_2_0 - - - {293D054F-361B-4083-A422-FA1AC9476FC9} - System.Web\System.Web-net_2_0-2 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - {57CFE851-81AC-4269-B24A-965A53D87248} - Mono.Security\Mono.Security-net_2_0 - - - {01BE23DB-E426-45E7-B56C-CA1175232AA7} - System.Runtime.Serialization\System.Runtime.Serialization-net_2_0 - - - - - - - diff --git a/mcs/class/System.IdentityModel/System.IdentityModel-tests-net_2_0.csproj b/mcs/class/System.IdentityModel/System.IdentityModel-tests-net_2_0.csproj deleted file mode 100644 index 169cbad47c0..00000000000 --- a/mcs/class/System.IdentityModel/System.IdentityModel-tests-net_2_0.csproj +++ /dev/null @@ -1,144 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {5E8EA9D3-4EBC-48D6-8B6F-EAF579539518} - Library - 1699 - bin\Debug\System.IdentityModel-tests-net_2_0 - True - False - - Properties - - - System.IdentityModel_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {737EBB38-BBFD-40D8-99F1-1FBBD49AF1B6} - System.IdentityModel\System.IdentityModel-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {879EA17D-67A5-44ED-B912-1BE4883356FE} - System.Security\System.Security-net_2_0 - - - {293D054F-361B-4083-A422-FA1AC9476FC9} - System.Web\System.Web-net_2_0-2 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - {57CFE851-81AC-4269-B24A-965A53D87248} - Mono.Security\Mono.Security-net_2_0 - - - {01BE23DB-E426-45E7-B56C-CA1175232AA7} - System.Runtime.Serialization\System.Runtime.Serialization-net_2_0 - - - - - - - diff --git a/mcs/class/System.Json/System.Json-net_2_0.csproj b/mcs/class/System.Json/System.Json-net_2_0.csproj deleted file mode 100644 index a822d6b6670..00000000000 --- a/mcs/class/System.Json/System.Json-net_2_0.csproj +++ /dev/null @@ -1,95 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {DB40BFDD-0EC2-4C14-B5F6-2D958099E8C6} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Json - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - - - - - diff --git a/mcs/class/System.Json/System.Json-tests-net_2_0.csproj b/mcs/class/System.Json/System.Json-tests-net_2_0.csproj deleted file mode 100644 index 91a9a67b7d6..00000000000 --- a/mcs/class/System.Json/System.Json-tests-net_2_0.csproj +++ /dev/null @@ -1,93 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D6326E54-3E22-4524-B506-4E9852235565} - Library - 1699 - bin\Debug\System.Json-tests-net_2_0 - True - False - - Properties - - - System.Json_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {DB40BFDD-0EC2-4C14-B5F6-2D958099E8C6} - System.Json\System.Json-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - - - - - diff --git a/mcs/class/System.Management/System.Management-net_2_0.csproj b/mcs/class/System.Management/System.Management-net_2_0.csproj deleted file mode 100644 index 8f1f7271c8a..00000000000 --- a/mcs/class/System.Management/System.Management-net_2_0.csproj +++ /dev/null @@ -1,154 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {47B40391-645F-42E1-AE88-206970D141D2} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Management - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {C8B650EA-042C-4352-8224-03F759A682C6} - System.Configuration.Install\System.Configuration.Install-net_2_0 - - - - - - - diff --git a/mcs/class/System.Messaging/System.Messaging-net_2_0.csproj b/mcs/class/System.Messaging/System.Messaging-net_2_0.csproj deleted file mode 100644 index 87b84c85dd3..00000000000 --- a/mcs/class/System.Messaging/System.Messaging-net_2_0.csproj +++ /dev/null @@ -1,158 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {DB0FD42E-2BF8-4E67-B707-901AC35FCB9A} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Messaging - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {C8B650EA-042C-4352-8224-03F759A682C6} - System.Configuration.Install\System.Configuration.Install-net_2_0 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - {EC4EB1AA-1E23-4F9A-832A-FED2E5EA9630} - Managed.Windows.Forms\System.Windows.Forms-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {2220FC2B-F933-49D2-B1A4-A6241F486B88} - Mono.Messaging\Mono.Messaging-net_2_0 - - - - - - - - MessageQueue.resx - - - - diff --git a/mcs/class/System.Messaging/System.Messaging-tests-net_2_0.csproj b/mcs/class/System.Messaging/System.Messaging-tests-net_2_0.csproj deleted file mode 100644 index 7b17d942109..00000000000 --- a/mcs/class/System.Messaging/System.Messaging-tests-net_2_0.csproj +++ /dev/null @@ -1,124 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {8D0EE23F-327F-4C6C-9DF3-6517D60F7EBB} - Library - 1699,618,219,169 - bin\Debug\System.Messaging-tests-net_2_0 - True - False - - Properties - - - System.Messaging_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618,219,169 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {DB0FD42E-2BF8-4E67-B707-901AC35FCB9A} - System.Messaging\System.Messaging-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {C8B650EA-042C-4352-8224-03F759A682C6} - System.Configuration.Install\System.Configuration.Install-net_2_0 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - {EC4EB1AA-1E23-4F9A-832A-FED2E5EA9630} - Managed.Windows.Forms\System.Windows.Forms-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {2220FC2B-F933-49D2-B1A4-A6241F486B88} - Mono.Messaging\Mono.Messaging-net_2_0 - - - False - nunit.mocks.dll - False - - - - - - - - MessageQueue.resx - - - - diff --git a/mcs/class/System.Net.Http/System.Net.Http.Headers/ContentDispositionHeaderValue.cs b/mcs/class/System.Net.Http/System.Net.Http.Headers/ContentDispositionHeaderValue.cs index 9329ac5796f..f80e50e4143 100644 --- a/mcs/class/System.Net.Http/System.Net.Http.Headers/ContentDispositionHeaderValue.cs +++ b/mcs/class/System.Net.Http/System.Net.Http.Headers/ContentDispositionHeaderValue.cs @@ -257,6 +257,11 @@ namespace System.Net.Http.Headers continue; } + if (!Lexer.IsValidCharacter (ch) || ch == '*' || ch == '?' || ch == '%') { + sb.Append (Uri.HexEscape (ch)); + continue; + } + sb.Append (ch); } diff --git a/mcs/class/System.Net.Http/System.Net.Http.Headers/Lexer.cs b/mcs/class/System.Net.Http/System.Net.Http.Headers/Lexer.cs index 622e36b0ec2..5bf97d0b96f 100644 --- a/mcs/class/System.Net.Http/System.Net.Http.Headers/Lexer.cs +++ b/mcs/class/System.Net.Http/System.Net.Http.Headers/Lexer.cs @@ -94,7 +94,7 @@ namespace System.Net.Http.Headers /*90*/ true, false, false, false, true, true, true, true, true, true, /*100*/ true, true, true, true, true, true, true, true, true, true, /*110*/ true, true, true, true, true, true, true, true, true, true, - /*120*/ true, true, true, false, true, false + /*120*/ true, true, true, false, true, false, true }; static readonly int last_token_char = token_chars.Length; @@ -193,13 +193,18 @@ namespace System.Net.Http.Headers // for (; i < input.Length; ++i) { char s = input[i]; - if (s > last_token_char || !token_chars[s]) + if (!IsValidCharacter (s)) return false; } return i > 0; } + public static bool IsValidCharacter (char input) + { + return input < last_token_char && token_chars[input]; + } + public void EatChar () { ++pos; @@ -292,18 +297,11 @@ namespace System.Net.Http.Headers // Quoted string start = pos - 1; while (pos < s.Length) { - ch = s[pos]; + ch = s [pos++]; if (ch == '"') { - ++pos; ttype = Token.Type.QuotedString; break; } - - // any OCTET except CTLs, but including LWS - if (ch < 32 || ch > 126) - break; - - ++pos; } break; @@ -312,13 +310,13 @@ namespace System.Net.Http.Headers ttype = Token.Type.OpenParens; break; default: - if (ch <= last_token_char && token_chars[ch]) { + if (ch < last_token_char && token_chars[ch]) { start = pos - 1; ttype = Token.Type.Token; while (pos < s.Length) { ch = s[pos]; - if (ch > last_token_char || !token_chars[ch]) { + if (ch >= last_token_char || !token_chars[ch]) { break; } diff --git a/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs b/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs index b4de2a029cf..026171a4f7a 100644 --- a/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs +++ b/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs @@ -314,38 +314,38 @@ namespace System.Net.Http Volatile.Write (ref sentRequest, true); var wrequest = CreateWebRequest (request); + HttpWebResponse wresponse = null; - if (request.Content != null) { - var headers = wrequest.Headers; - foreach (var header in request.Content.Headers) { - foreach (var value in header.Value) { - headers.AddValue (header.Key, value); + try { + using (cancellationToken.Register (l => ((HttpWebRequest)l).Abort (), wrequest)) { + if (request.Content != null) { + var headers = wrequest.Headers; + foreach (var header in request.Content.Headers) { + foreach (var value in header.Value) { + headers.AddValue (header.Key, value); + } + } + + var stream = await wrequest.GetRequestStreamAsync ().ConfigureAwait (false); + await request.Content.CopyToAsync (stream).ConfigureAwait (false); + } else if (HttpMethod.Post.Equals (request.Method) || HttpMethod.Put.Equals (request.Method) || HttpMethod.Delete.Equals (request.Method)) { + // Explicitly set this to make sure we're sending a "Content-Length: 0" header. + // This fixes the issue that's been reported on the forums: + // http://forums.xamarin.com/discussion/17770/length-required-error-in-http-post-since-latest-release + wrequest.ContentLength = 0; } - } - - var stream = await wrequest.GetRequestStreamAsync ().ConfigureAwait (false); - await request.Content.CopyToAsync (stream).ConfigureAwait (false); - } else if (HttpMethod.Post.Equals (request.Method) || HttpMethod.Put.Equals (request.Method) || HttpMethod.Delete.Equals (request.Method)) { - // Explicitly set this to make sure we're sending a "Content-Length: 0" header. - // This fixes the issue that's been reported on the forums: - // http://forums.xamarin.com/discussion/17770/length-required-error-in-http-post-since-latest-release - wrequest.ContentLength = 0; - } - HttpWebResponse wresponse = null; - using (cancellationToken.Register (l => ((HttpWebRequest) l).Abort (), wrequest)) { - try { - wresponse = (HttpWebResponse) await wrequest.GetResponseAsync ().ConfigureAwait (false); - } catch (WebException we) { - if (we.Status != WebExceptionStatus.RequestCanceled) - throw; + wresponse = (HttpWebResponse)await wrequest.GetResponseAsync ().ConfigureAwait (false); } + } catch (WebException we) { + if (we.Status != WebExceptionStatus.RequestCanceled) + throw; + } - if (cancellationToken.IsCancellationRequested) { - var cancelled = new TaskCompletionSource (); - cancelled.SetCanceled (); - return await cancelled.Task; - } + if (cancellationToken.IsCancellationRequested) { + var cancelled = new TaskCompletionSource (); + cancelled.SetCanceled (); + return await cancelled.Task; } return CreateResponseMessage (wresponse, request, cancellationToken); diff --git a/mcs/class/System.Net.Http/System.Net.Http/HttpRequestMessage.cs b/mcs/class/System.Net.Http/System.Net.Http/HttpRequestMessage.cs index 0bf3fba28ab..0823365d744 100644 --- a/mcs/class/System.Net.Http/System.Net.Http/HttpRequestMessage.cs +++ b/mcs/class/System.Net.Http/System.Net.Http/HttpRequestMessage.cs @@ -89,13 +89,25 @@ namespace System.Net.Http return uri; } set { - if (value != null && (value.IsAbsoluteUri && value.Scheme != Uri.UriSchemeHttp && value.Scheme != Uri.UriSchemeHttps)) + if (value != null && value.IsAbsoluteUri && !IsAllowedAbsoluteUri (value)) throw new ArgumentException ("Only http or https scheme is allowed"); uri = value; } } + static bool IsAllowedAbsoluteUri (Uri uri) + { + if (uri.Scheme == Uri.UriSchemeHttp || uri.Scheme == Uri.UriSchemeHttps) + return true; + + // Mono URI handling which does not distinguish between file and url absolute paths without scheme + if (uri.Scheme == Uri.UriSchemeFile && uri.OriginalString.StartsWith ("/", StringComparison.Ordinal)) + return true; + + return false; + } + public Version Version { get { return version ?? HttpVersion.Version11; diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/ContentDispositionHeaderValueTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/ContentDispositionHeaderValueTest.cs index e9a7ab8de0a..18d582b00b7 100644 --- a/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/ContentDispositionHeaderValueTest.cs +++ b/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/ContentDispositionHeaderValueTest.cs @@ -223,6 +223,14 @@ namespace MonoTests.System.Net.Http.Headers value.FileName = "\"quoted\""; Assert.AreEqual ("\"quoted\"", value.FileName, "#41"); Assert.AreEqual (new NameValueHeaderValue ("filename", "\"quoted\""), value.Parameters.First (), "#42"); + + value.FileName = "~"; + Assert.AreEqual ("~", value.FileName, "#51"); + Assert.AreEqual (new NameValueHeaderValue ("filename", "~"), value.Parameters.First (), "#52"); + + value.FileName = "\x7f"; + Assert.AreEqual ("\"\x7f\"", value.FileName, "#61"); + Assert.AreEqual (new NameValueHeaderValue ("filename", "\"\x7f\""), value.Parameters.First (), "#62"); } [Test] @@ -237,8 +245,11 @@ namespace MonoTests.System.Net.Http.Headers value.FileNameStar = "č"; Assert.AreEqual ("č", value.FileNameStar, "#11"); Assert.AreEqual (new NameValueHeaderValue ("filename*", "utf-8''%C4%8D"), value.Parameters.First (), "#12"); - } + value.FileNameStar = "@x*\\%?.txt"; + Assert.AreEqual ("@x*\\%?.txt", value.FileNameStar, "#21"); + Assert.AreEqual (new NameValueHeaderValue ("filename*", "utf-8''%40x%2A%5C%25%3F.txt"), value.Parameters.First (), "#22"); + } [Test] public void Properties_Name () diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/NameValueHeaderValueTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/NameValueHeaderValueTest.cs index 32cf785a0e9..7de0ccdb2ae 100644 --- a/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/NameValueHeaderValueTest.cs +++ b/mcs/class/System.Net.Http/Test/System.Net.Http.Headers/NameValueHeaderValueTest.cs @@ -51,6 +51,30 @@ namespace MonoTests.System.Net.Http.Headers Assert.Fail ("#2"); } catch (FormatException) { } + + try { + new NameValueHeaderValue ("\x7f", null); + Assert.Fail ("#3"); + } catch (FormatException) { + } + + try { + new NameValueHeaderValue ("arg", "\x7f"); + Assert.Fail ("#4"); + } catch (FormatException) { + } + } + + [Test] + public void Ctor_ValidArguments () + { + NameValueHeaderValue nvh; + + nvh = new NameValueHeaderValue ("arg", "~"); + Assert.AreEqual ("~", nvh.Value, "#1"); + + nvh = new NameValueHeaderValue ("arg", "\"\x7f\x80\""); + Assert.AreEqual ("\"\x7f\x80\"", nvh.Value, "#2"); } [Test] diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs index 4b07313aafd..eaeb6f6d23b 100644 --- a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs +++ b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpClientTest.cs @@ -170,6 +170,35 @@ namespace MonoTests.System.Net.Http client.SendAsync (request).Wait (WaitTimeout); } + + [Test] + public void CancelRequestViaProxy () + { + var handler = new HttpClientHandler { + Proxy = new WebProxy ("192.168.10.25:8888/"), // proxy that doesn't exist + UseProxy = true, + AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate + }; + + var httpClient = new HttpClient (handler) { + BaseAddress = new Uri ("https://google.com"), + Timeout = TimeSpan.FromSeconds (1) + }; + + try { + var restRequest = new HttpRequestMessage { + Method = HttpMethod.Post, + RequestUri = new Uri("foo", UriKind.Relative), + Content = new StringContent("", null, "application/json") + }; + + httpClient.PostAsync (restRequest.RequestUri, restRequest.Content).Wait (WaitTimeout); + Assert.Fail ("#1"); + } catch (AggregateException e) { + Assert.IsTrue (e.InnerException is TaskCanceledException, "#2"); + } + } + [Test] public void Properties () { diff --git a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpRequestMessageTest.cs b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpRequestMessageTest.cs index 8b4d6bf394e..eabc8a05c5d 100644 --- a/mcs/class/System.Net.Http/Test/System.Net.Http/HttpRequestMessageTest.cs +++ b/mcs/class/System.Net.Http/Test/System.Net.Http/HttpRequestMessageTest.cs @@ -99,6 +99,20 @@ namespace MonoTests.System.Net.Http Assert.AreEqual (req.RequestUri, uri); } + [Test] + public void Ctor_RelativeOrAbsoluteUri () + { + var uri = new Uri ("/", UriKind.RelativeOrAbsolute); + new HttpRequestMessage (HttpMethod.Get, uri); + + uri = new Uri ("file://", UriKind.RelativeOrAbsolute); + try { + new HttpRequestMessage (HttpMethod.Get, uri); + Assert.Fail ("#1"); + } catch (ArgumentException) { + } + } + [Test] public void Ctor_RelativeUriString () { @@ -109,6 +123,18 @@ namespace MonoTests.System.Net.Http Assert.IsFalse (req.RequestUri.IsAbsoluteUri); } + [Test] + public void Ctor_RelativeOrAbsoluteUriString () + { + new HttpRequestMessage (HttpMethod.Get, "/"); + + try { + new HttpRequestMessage (HttpMethod.Get, "file://"); + Assert.Fail ("#1"); + } catch (ArgumentException) { + } + } + [Test] public void Headers () { diff --git a/mcs/class/System.Net/System.Net-net_2_0.csproj b/mcs/class/System.Net/System.Net-net_2_0.csproj deleted file mode 100644 index bb2ce928ed8..00000000000 --- a/mcs/class/System.Net/System.Net-net_2_0.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {ED90CD4E-E958-4E14-B0E4-425CFA3BF661} - Library - 1699,1720 - ./../../class/lib/net_2_0 - True - True - true - Properties - - - System.Net - v2.0 - 512 - - - true - full - 1699,1720 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - pdbonly - 1699,1720 - true - NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting-net_2_0.csproj b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting-net_2_0.csproj deleted file mode 100644 index bcb638c18f7..00000000000 --- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting-net_2_0.csproj +++ /dev/null @@ -1,158 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {14C27158-5E50-403C-96D6-79FFF1F52889} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Runtime.Remoting - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {B8F7FDF0-07C7-4AFC-9854-F591BF307939} - System.Web\System.Web-net_2_0-1 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {8313B5D9-A1BE-4E62-90E7-FA002548D650} - System.Runtime.Serialization.Formatters.Soap\System.Runtime.Serialization.Formatters.Soap-net_2_0 - - - - - - - diff --git a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting-tests-net_2_0.csproj b/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting-tests-net_2_0.csproj deleted file mode 100644 index a7e43f60180..00000000000 --- a/mcs/class/System.Runtime.Remoting/System.Runtime.Remoting-tests-net_2_0.csproj +++ /dev/null @@ -1,120 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {A84DDEFD-D504-4F33-A353-8BB852CF778E} - Library - 1699,618 - bin\Debug\System.Runtime.Remoting-tests-net_2_0 - True - False - - Properties - - - System.Runtime.Remoting_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {14C27158-5E50-403C-96D6-79FFF1F52889} - System.Runtime.Remoting\System.Runtime.Remoting-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {B8F7FDF0-07C7-4AFC-9854-F591BF307939} - System.Web\System.Web-net_2_0-1 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {8313B5D9-A1BE-4E62-90E7-FA002548D650} - System.Runtime.Serialization.Formatters.Soap\System.Runtime.Serialization.Formatters.Soap-net_2_0 - - - {14C27158-5E50-403C-96D6-79FFF1F52889} - System.Runtime.Remoting\System.Runtime.Remoting-net_2_0 - - - - - - - diff --git a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap-net_2_0.csproj b/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap-net_2_0.csproj deleted file mode 100644 index f8a99aac80e..00000000000 --- a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap-net_2_0.csproj +++ /dev/null @@ -1,87 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {8313B5D9-A1BE-4E62-90E7-FA002548D650} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Runtime.Serialization.Formatters.Soap - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - diff --git a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap-tests-net_2_0.csproj b/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap-tests-net_2_0.csproj deleted file mode 100644 index 0aa1b8f79d2..00000000000 --- a/mcs/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap-tests-net_2_0.csproj +++ /dev/null @@ -1,89 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2F358FB0-9083-439D-B246-971F40EF4644} - Library - 1699,618,219,169 - bin\Debug\System.Runtime.Serialization.Formatters.Soap-tests-net_2_0 - True - False - - Properties - - - System.Runtime.Serialization.Formatters.Soap_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618,219,169 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {8313B5D9-A1BE-4E62-90E7-FA002548D650} - System.Runtime.Serialization.Formatters.Soap\System.Runtime.Serialization.Formatters.Soap-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization-net_2_0.csproj b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization-net_2_0.csproj deleted file mode 100644 index f27edaa1e46..00000000000 --- a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization-net_2_0.csproj +++ /dev/null @@ -1,167 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {01BE23DB-E426-45E7-B56C-CA1175232AA7} - Library - 1699,168,169,219,414 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Runtime.Serialization - v2.0 - 512 - - - true - full - 1699,168,169,219,414 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0 - prompt - 4 - - - pdbonly - 1699,168,169,219,414 - true - NET_1_1;NET_2_0;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - - - - - - mstypes.schema - - - - diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization-tests-net_2_0.csproj b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization-tests-net_2_0.csproj deleted file mode 100644 index 2f95199b068..00000000000 --- a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization-tests-net_2_0.csproj +++ /dev/null @@ -1,152 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2F43A5EC-AB47-4075-831F-D0681E7CA07B} - Library - 1699,168,169,219,414 - bin\Debug\System.Runtime.Serialization-tests-net_2_0 - True - False - - Properties - - - System.Runtime.Serialization_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,168,169,219,414 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0 - prompt - 4 - - - pdbonly - 1699,168,169,219,414 - true - NET_1_1;NET_2_0;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {01BE23DB-E426-45E7-B56C-CA1175232AA7} - System.Runtime.Serialization\System.Runtime.Serialization-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - False - System.ServiceModel.dll - False - - - {DA9F2EEC-4127-4B98-852E-78A0ED7A4A60} - System.Web.Services\System.Web.Services-net_2_0 - - - - - - - - mstypes.schema - - - collections.wsdl - - - custom-collections.wsdl - - - - diff --git a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/SerializationMap.cs b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/SerializationMap.cs index 8c0eb2c4d92..4b439f382ce 100644 --- a/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/SerializationMap.cs +++ b/mcs/class/System.Runtime.Serialization/System.Runtime.Serialization/SerializationMap.cs @@ -996,6 +996,10 @@ namespace System.Runtime.Serialization string s = null; foreach (EnumMemberInfo emi in enum_members) { long f = Convert.ToInt64 (emi.Value); + if (f == val) { + s = emi.XmlName; + break; + } if ((f & val) == f) s += (s != null ? " " : String.Empty) + emi.XmlName; } diff --git a/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/DataContractSerializerTest.cs b/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/DataContractSerializerTest.cs index 91fe958e0bf..ada461fe2b8 100644 --- a/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/DataContractSerializerTest.cs +++ b/mcs/class/System.Runtime.Serialization/Test/System.Runtime.Serialization/DataContractSerializerTest.cs @@ -92,6 +92,35 @@ namespace MonoTests.System.Runtime.Serialization var ser = new DataContractSerializer(typeof(MyObject)); ser.ReadObject (XmlReader.Create(new StringReader(s))); } - + + [Flags ()] + [Serializable] + public enum FlagsEnum + { + None = 0, + Flag1 = 0x10, + Flag2 = 0x20, + All = 0xffff, + }; + + [Serializable] + public class ClassWithFlagsEnum + { + public FlagsEnum Flags = FlagsEnum.All; + } + + // Bug #21072 + [Test] + public void FlagsEnumTest () + { + var ser = new DataContractSerializer (typeof (ClassWithFlagsEnum)); + + using (var m = new MemoryStream ()) { + ser.WriteObject (m, new ClassWithFlagsEnum ()); + var data = m.ToArray (); + var s = Encoding.UTF8.GetString (data, 0, (int) data.Length); + Assert.IsTrue (s.Contains ("All")); + } + } } } diff --git a/mcs/class/System.Security/Makefile b/mcs/class/System.Security/Makefile index c57de5341cc..752a5f3f82b 100644 --- a/mcs/class/System.Security/Makefile +++ b/mcs/class/System.Security/Makefile @@ -12,7 +12,7 @@ LOCAL_MCS_FLAGS = -lib:$(secxml_libdir) -lib:$(bare_libdir) TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -nowarn:168,169,183,219,414,1595 -VALID_PROFILE := $(filter net_1_1 net_2_0 moonlight_raw net_4_0 net_4_5, $(PROFILE)) +VALID_PROFILE := $(filter moonlight_raw net_4_0 net_4_5, $(PROFILE)) EXTRA_DISTFILES = \ Test/System.Security.Cryptography.Xml/sample.pfx \ diff --git a/mcs/class/System.Security/System.Security-net_2_0.csproj b/mcs/class/System.Security/System.Security-net_2_0.csproj deleted file mode 100644 index 7e31b44c653..00000000000 --- a/mcs/class/System.Security/System.Security-net_2_0.csproj +++ /dev/null @@ -1,183 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {879EA17D-67A5-44ED-B912-1BE4883356FE} - Library - 1699,618,414 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Security - v2.0 - 512 - - - true - full - 1699,618,414 - false - DEBUG;TRACE;NET_1_1;NET_2_0;SECURITY_DEP - prompt - 4 - - - pdbonly - 1699,618,414 - true - NET_1_1;NET_2_0;SECURITY_DEP - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {5A1ED72C-ADAB-4396-AB03-D0E26AA91E90} - System\System-net_2_0-1 - - - {E89F34AB-7AE2-41CA-B891-C8D1C9F02EB8} - System.XML\System.Xml-net_2_0 - - - {57CFE851-81AC-4269-B24A-965A53D87248} - Mono.Security\Mono.Security-net_2_0 - - - - - - - diff --git a/mcs/class/System.Security/System.Security-tests-net_2_0.csproj b/mcs/class/System.Security/System.Security-tests-net_2_0.csproj deleted file mode 100644 index e27eff03400..00000000000 --- a/mcs/class/System.Security/System.Security-tests-net_2_0.csproj +++ /dev/null @@ -1,151 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {9E4A512E-2ABA-477E-892D-FC0B58881339} - Library - 1699,618,414,169,219,1595,168,183,414 - bin\Debug\System.Security-tests-net_2_0 - True - False - - Properties - - - System.Security_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,618,414,169,219,1595,168,183,414 - false - DEBUG;TRACE;NET_1_1;NET_2_0;SECURITY_DEP - prompt - 4 - - - pdbonly - 1699,618,414,169,219,1595,168,183,414 - true - NET_1_1;NET_2_0;SECURITY_DEP - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {879EA17D-67A5-44ED-B912-1BE4883356FE} - System.Security\System.Security-net_2_0 - - - {5A1ED72C-ADAB-4396-AB03-D0E26AA91E90} - System\System-net_2_0-1 - - - {E89F34AB-7AE2-41CA-B891-C8D1C9F02EB8} - System.XML\System.Xml-net_2_0 - - - {57CFE851-81AC-4269-B24A-965A53D87248} - Mono.Security\Mono.Security-net_2_0 - - - - - - - diff --git a/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web-net_2_0.csproj b/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web-net_2_0.csproj deleted file mode 100644 index e7314da8380..00000000000 --- a/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web-net_2_0.csproj +++ /dev/null @@ -1,202 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {3C6EB10D-5929-4CB4-81F2-7984FCECCDAA} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.ServiceModel.Web - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5;NET_3_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_5;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {01BE23DB-E426-45E7-B56C-CA1175232AA7} - System.Runtime.Serialization\System.Runtime.Serialization-net_2_0 - - - {DA50E37C-63DE-4049-9BE0-141BF1104E20} - System.ServiceModel\System.ServiceModel-net_2_0 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - {5B5CA61A-0901-40B5-B56A-D0A6E67DDA66} - System.Web.Extensions_1.0\System.Web.Extensions_1.0-net_2_0 - - - - - - - diff --git a/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web-tests-net_2_0.csproj b/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web-tests-net_2_0.csproj deleted file mode 100644 index 7750796438a..00000000000 --- a/mcs/class/System.ServiceModel.Web/System.ServiceModel.Web-tests-net_2_0.csproj +++ /dev/null @@ -1,143 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {98478C8A-B3F8-4D4E-9561-BB75C34BABCA} - Library - 1699 - bin\Debug\System.ServiceModel.Web-tests-net_2_0 - True - False - - Properties - - - System.ServiceModel.Web_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5;NET_3_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_5;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {3C6EB10D-5929-4CB4-81F2-7984FCECCDAA} - System.ServiceModel.Web\System.ServiceModel.Web-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {01BE23DB-E426-45E7-B56C-CA1175232AA7} - System.Runtime.Serialization\System.Runtime.Serialization-net_2_0 - - - {DA50E37C-63DE-4049-9BE0-141BF1104E20} - System.ServiceModel\System.ServiceModel-net_2_0 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - {5B5CA61A-0901-40B5-B56A-D0A6E67DDA66} - System.Web.Extensions_1.0\System.Web.Extensions_1.0-net_2_0 - - - - - - - diff --git a/mcs/class/System.ServiceModel/System.ServiceModel-net_2_0.csproj b/mcs/class/System.ServiceModel/System.ServiceModel-net_2_0.csproj deleted file mode 100644 index f2cd38c33e0..00000000000 --- a/mcs/class/System.ServiceModel/System.ServiceModel-net_2_0.csproj +++ /dev/null @@ -1,1094 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {DA50E37C-63DE-4049-9BE0-141BF1104E20} - Library - 1699,414,169,67,3005,436,219,618 - ./../../class/lib/net_2_0 - True - True - true - Properties - - - System.ServiceModel - v2.0 - 512 - - - true - full - 1699,414,169,67,3005,436,219,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0;TRACE;NET_3_0 - prompt - 4 - - - pdbonly - 1699,414,169,67,3005,436,219,618 - true - NET_1_1;NET_2_0;TRACE;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {01BE23DB-E426-45E7-B56C-CA1175232AA7} - System.Runtime.Serialization\System.Runtime.Serialization-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {879EA17D-67A5-44ED-B912-1BE4883356FE} - System.Security\System.Security-net_2_0 - - - {737EBB38-BBFD-40D8-99F1-1FBBD49AF1B6} - System.IdentityModel\System.IdentityModel-net_2_0 - - - {7203476D-4107-4C91-9930-DEC5CCFE62C8} - System.IdentityModel.Selectors\System.IdentityModel.Selectors-net_2_0 - - - {BBC5CD06-50EB-439E-9DBB-2B5D644BE6C3} - System.Transactions\System.Transactions-net_2_0 - - - {DB0FD42E-2BF8-4E67-B707-901AC35FCB9A} - System.Messaging\System.Messaging-net_2_0 - - - {293D054F-361B-4083-A422-FA1AC9476FC9} - System.Web\System.Web-net_2_0-2 - - - {DA9F2EEC-4127-4B98-852E-78A0ED7A4A60} - System.Web.Services\System.Web.Services-net_2_0 - - - {57CFE851-81AC-4269-B24A-965A53D87248} - Mono.Security\Mono.Security-net_2_0 - - - - - - - - WS-Addressing.schema - - - ws-addr.xsd - - - - diff --git a/mcs/class/System.ServiceModel/System.ServiceModel-plainservice-net_2_0.csproj b/mcs/class/System.ServiceModel/System.ServiceModel-plainservice-net_2_0.csproj deleted file mode 100644 index b3f9f0c8d02..00000000000 --- a/mcs/class/System.ServiceModel/System.ServiceModel-plainservice-net_2_0.csproj +++ /dev/null @@ -1,1098 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {B7F6F3A3-349F-4F3F-BC96-F491DC9E90BE} - Library - 1699,414,169,67,3005,436,219,618 - ./../../class/lib/net_2_0/plainservice - True - True - true - Properties - - - System.ServiceModel - v2.0 - 512 - - - true - full - 1699,414,169,67,3005,436,219,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0;TRACE;NET_3_0 - prompt - 4 - - - pdbonly - 1699,414,169,67,3005,436,219,618 - true - NET_1_1;NET_2_0;TRACE;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {AAA3F683-244C-40EF-8EF8-A95938862A44} - corlib\corlib-net_2_0 - - - {5459507F-DC25-401C-A2F4-D5ECAC3A34E6} - System\System-bare-net_2_0 - - - {0E9DD462-944B-426E-BC1E-96EF270EF7E2} - System.XML\System.Xml-bare-net_2_0 - - - {F0743710-AB7C-4019-A13A-07AE79F514E4} - System.Core\System.Core-plaincore-net_2_0 - - - {CDFC3554-7C58-4C56-B862-9821EE91E2E2} - System.Runtime.Serialization\System.Runtime.Serialization-net_2_0 - - - {13AAE1FB-48CB-41ED-BF9B-F6F69CDE258F} - System.Configuration\System.Configuration-net_2_0 - - - {3D0435AD-4ACE-45BE-87DE-335BAD6D8EB1} - System.Data\System.Data-net_2_0 - - - {D3703145-8C5A-45B9-99A1-059D50BF3DFF} - System.Security\System.Security-net_2_0 - - - {79E05A44-5A8D-4409-8F84-5FFEF95CD7AD} - System.IdentityModel\System.IdentityModel-net_2_0 - - - {88EFC58B-C753-42BB-AC08-4D9AD59FE3E5} - System.IdentityModel.Selectors\System.IdentityModel.Selectors-net_2_0 - - - {CEB6068D-261E-4546-8013-0A279BE86B5A} - System.Transactions\System.Transactions-net_2_0 - - - {A15967D7-34EF-4D38-B25E-19AE6808A308} - System.Messaging\System.Messaging-net_2_0 - - - {97FD9F81-DC17-4CEC-992A-F2F17B6602D7} - System.Web\System.Web-plainweb-net_2_0 - - - {73D0EC8D-BC1E-4748-979B-68DDFF011AF4} - System.Web.Services\System.Web.Services-net_2_0 - - - {ECDB1158-526C-46EE-896E-9BFB6F85C0A3} - Mono.Security\Mono.Security-net_2_0 - - - - - - - - WS-Addressing.schema - - - ws-addr.xsd - - - - diff --git a/mcs/class/System.ServiceModel/System.ServiceModel-tests-net_2_0.csproj b/mcs/class/System.ServiceModel/System.ServiceModel-tests-net_2_0.csproj deleted file mode 100644 index 17e7560791b..00000000000 --- a/mcs/class/System.ServiceModel/System.ServiceModel-tests-net_2_0.csproj +++ /dev/null @@ -1,356 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {6E7270E1-B6F4-4244-B349-59208C772462} - Library - 1699,414,169,67,3005,436,219,618 - bin\Debug\System.ServiceModel-tests-net_2_0 - True - False - true - Properties - - - System.ServiceModel_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,414,169,67,3005,436,219,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0;TRACE;NET_3_0 - prompt - 4 - - - pdbonly - 1699,414,169,67,3005,436,219,618 - true - NET_1_1;NET_2_0;TRACE;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {DA50E37C-63DE-4049-9BE0-141BF1104E20} - System.ServiceModel\System.ServiceModel-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {01BE23DB-E426-45E7-B56C-CA1175232AA7} - System.Runtime.Serialization\System.Runtime.Serialization-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {879EA17D-67A5-44ED-B912-1BE4883356FE} - System.Security\System.Security-net_2_0 - - - {737EBB38-BBFD-40D8-99F1-1FBBD49AF1B6} - System.IdentityModel\System.IdentityModel-net_2_0 - - - {7203476D-4107-4C91-9930-DEC5CCFE62C8} - System.IdentityModel.Selectors\System.IdentityModel.Selectors-net_2_0 - - - {BBC5CD06-50EB-439E-9DBB-2B5D644BE6C3} - System.Transactions\System.Transactions-net_2_0 - - - {DB0FD42E-2BF8-4E67-B707-901AC35FCB9A} - System.Messaging\System.Messaging-net_2_0 - - - {293D054F-361B-4083-A422-FA1AC9476FC9} - System.Web\System.Web-net_2_0-2 - - - {DA9F2EEC-4127-4B98-852E-78A0ED7A4A60} - System.Web.Services\System.Web.Services-net_2_0 - - - {57CFE851-81AC-4269-B24A-965A53D87248} - Mono.Security\Mono.Security-net_2_0 - - - - - - - - WS-Addressing.schema - - - ws-addr.xsd - - - - diff --git a/mcs/class/System.ServiceProcess/System.ServiceProcess-net_2_0.csproj b/mcs/class/System.ServiceProcess/System.ServiceProcess-net_2_0.csproj deleted file mode 100644 index 93d4a7a3567..00000000000 --- a/mcs/class/System.ServiceProcess/System.ServiceProcess-net_2_0.csproj +++ /dev/null @@ -1,115 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E278AD54-C1F6-49BC-B788-6E412212D0EA} - Library - 1699,618 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.ServiceProcess - v2.0 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {C8B650EA-042C-4352-8224-03F759A682C6} - System.Configuration.Install\System.Configuration.Install-net_2_0 - - - {EC4EB1AA-1E23-4F9A-832A-FED2E5EA9630} - Managed.Windows.Forms\System.Windows.Forms-net_2_0 - - - - - - - diff --git a/mcs/class/System.ServiceProcess/System.ServiceProcess-tests-net_2_0.csproj b/mcs/class/System.ServiceProcess/System.ServiceProcess-tests-net_2_0.csproj deleted file mode 100644 index 88c736ac4ae..00000000000 --- a/mcs/class/System.ServiceProcess/System.ServiceProcess-tests-net_2_0.csproj +++ /dev/null @@ -1,96 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {8CFBFA75-E0ED-4F16-8251-8B55E960A7C2} - Library - 1699,618 - bin\Debug\System.ServiceProcess-tests-net_2_0 - True - False - - Properties - - - System.ServiceProcess_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {E278AD54-C1F6-49BC-B788-6E412212D0EA} - System.ServiceProcess\System.ServiceProcess-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {C8B650EA-042C-4352-8224-03F759A682C6} - System.Configuration.Install\System.Configuration.Install-net_2_0 - - - {EC4EB1AA-1E23-4F9A-832A-FED2E5EA9630} - Managed.Windows.Forms\System.Windows.Forms-net_2_0 - - - - - - - diff --git a/mcs/class/System.Transactions/System.Transactions-net_2_0.csproj b/mcs/class/System.Transactions/System.Transactions-net_2_0.csproj deleted file mode 100644 index dc3c0d65cfe..00000000000 --- a/mcs/class/System.Transactions/System.Transactions-net_2_0.csproj +++ /dev/null @@ -1,121 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {BBC5CD06-50EB-439E-9DBB-2B5D644BE6C3} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Transactions - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - - - - - diff --git a/mcs/class/System.Transactions/System.Transactions-tests-net_2_0.csproj b/mcs/class/System.Transactions/System.Transactions-tests-net_2_0.csproj deleted file mode 100644 index 03d36667a88..00000000000 --- a/mcs/class/System.Transactions/System.Transactions-tests-net_2_0.csproj +++ /dev/null @@ -1,92 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D8B6CB08-B1BB-464B-82E1-E3276B92B458} - Library - 1699,1595 - bin\Debug\System.Transactions-tests-net_2_0 - True - False - - Properties - - - System.Transactions_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,1595 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,1595 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {BBC5CD06-50EB-439E-9DBB-2B5D644BE6C3} - System.Transactions\System.Transactions-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - - - - - diff --git a/mcs/class/System.Web.Abstractions/Makefile b/mcs/class/System.Web.Abstractions/Makefile index 10afc10c162..991adbe5b4a 100644 --- a/mcs/class/System.Web.Abstractions/Makefile +++ b/mcs/class/System.Web.Abstractions/Makefile @@ -8,17 +8,12 @@ LIB_MCS_FLAGS = \ /r:System.Core.dll \ /r:System.Web.dll -ifeq (2.0, $(FRAMEWORK_VERSION)) -# This is a .NET 3.5 only assembly, but built during the 2.0 build -LIB_MCS_FLAGS += -d:NET_3_5 -endif - TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) EXTRA_DISTFILES = # This is a .NET 3.5+ assembly -VALID_PROFILE := $(filter net_2_0 net_4_0 net_4_5, $(PROFILE)) +VALID_PROFILE := $(filter net_4_0 net_4_5, $(PROFILE)) ifndef VALID_PROFILE LIBRARY_NAME = dummy-System.Web.Abstractions.dll NO_INSTALL = yes diff --git a/mcs/class/System.Web.Abstractions/System.Web.Abstractions-net_2_0.csproj b/mcs/class/System.Web.Abstractions/System.Web.Abstractions-net_2_0.csproj deleted file mode 100644 index 84fa3342867..00000000000 --- a/mcs/class/System.Web.Abstractions/System.Web.Abstractions-net_2_0.csproj +++ /dev/null @@ -1,112 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {1665130D-E9DA-4325-A4C6-78ECF7187D5B} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Web.Abstractions - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {293D054F-361B-4083-A422-FA1AC9476FC9} - System.Web\System.Web-net_2_0-2 - - - - - - - diff --git a/mcs/class/System.Web.Abstractions/System.Web.Abstractions-tests-net_2_0.csproj b/mcs/class/System.Web.Abstractions/System.Web.Abstractions-tests-net_2_0.csproj deleted file mode 100644 index 2ebb0295ec1..00000000000 --- a/mcs/class/System.Web.Abstractions/System.Web.Abstractions-tests-net_2_0.csproj +++ /dev/null @@ -1,95 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D2B91F5B-D914-4C6E-B41F-7DF9CADEB9A9} - Library - 1699 - bin\Debug\System.Web.Abstractions-tests-net_2_0 - True - False - - Properties - - - System.Web.Abstractions_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1665130D-E9DA-4325-A4C6-78ECF7187D5B} - System.Web.Abstractions\System.Web.Abstractions-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {293D054F-361B-4083-A422-FA1AC9476FC9} - System.Web\System.Web-net_2_0-2 - - - - - - - diff --git a/mcs/class/System.Web.ApplicationServices/System.Web.ApplicationServices-net_2_0.csproj b/mcs/class/System.Web.ApplicationServices/System.Web.ApplicationServices-net_2_0.csproj deleted file mode 100644 index d6390e32540..00000000000 --- a/mcs/class/System.Web.ApplicationServices/System.Web.ApplicationServices-net_2_0.csproj +++ /dev/null @@ -1,87 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {8E128532-4FB9-4D6D-BD07-63025433586B} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - dummy-System.Web.ApplicationServices - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;SYSTEM_WEB_APPLICATIONSERVICES - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;SYSTEM_WEB_APPLICATIONSERVICES - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - - - - - diff --git a/mcs/class/System.Web.DynamicData/Makefile b/mcs/class/System.Web.DynamicData/Makefile index 2bfe34c3b2c..7b50cd5e070 100644 --- a/mcs/class/System.Web.DynamicData/Makefile +++ b/mcs/class/System.Web.DynamicData/Makefile @@ -15,11 +15,6 @@ LIB_MCS_FLAGS = \ /r:System.Web.Abstractions.dll \ /r:System.Web.Routing.dll -ifeq (2.0, $(FRAMEWORK_VERSION)) -# This is a .NET 3.5 only assembly, but built during the 2.0 build -LIB_MCS_FLAGS += -d:NET_3_5 -endif - ifeq (4, $(FRAMEWORK_VERSION_MAJOR)) LIB_MCS_FLAGS += -r:System.Web.ApplicationServices.dll endif @@ -186,7 +181,7 @@ endif EXTRA_DISTFILES = $(foreach resource,$(TEST_RESOURCE_FILES), $(shell echo $(subst \`,\\\`,$(resource)) | cut -d ',' -f 1)) # This is a .NET 3.5+ assembly -VALID_PROFILE := $(filter net_2_0 net_4_0 net_4_5, $(PROFILE)) +VALID_PROFILE := $(filter net_4_0 net_4_5, $(PROFILE)) ifndef VALID_PROFILE LIBRARY_NAME = dummy-System.Web.DynamicData.dll NO_INSTALL = yes diff --git a/mcs/class/System.Web.DynamicData/System.Web.DynamicData-net_2_0.csproj b/mcs/class/System.Web.DynamicData/System.Web.DynamicData-net_2_0.csproj deleted file mode 100644 index b0e5944bd5e..00000000000 --- a/mcs/class/System.Web.DynamicData/System.Web.DynamicData-net_2_0.csproj +++ /dev/null @@ -1,155 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {413F9BD7-61AE-4F12-8EDE-A7404B2BEE9C} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Web.DynamicData - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {F3112064-6311-48A9-992B-A68DD3C62133} - System.ComponentModel.DataAnnotations\System.ComponentModel.DataAnnotations-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {286ED1A3-6AE6-4147-A43B-B3421681CC84} - System.Data.Linq\System.Data.Linq-net_2_0 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - {293D054F-361B-4083-A422-FA1AC9476FC9} - System.Web\System.Web-net_2_0-2 - - - {42527CAE-C932-4518-9CF7-F4ABB44510A5} - System.Web.Extensions\System.Web.Extensions-net_2_0 - - - {1665130D-E9DA-4325-A4C6-78ECF7187D5B} - System.Web.Abstractions\System.Web.Abstractions-net_2_0 - - - {A9B310AD-FF67-49ED-8AC8-AAF1E4B05249} - System.Web.Routing\System.Web.Routing-net_2_0 - - - - - - - diff --git a/mcs/class/System.Web.DynamicData/System.Web.DynamicData-tests-net_2_0.csproj b/mcs/class/System.Web.DynamicData/System.Web.DynamicData-tests-net_2_0.csproj deleted file mode 100644 index 51a5691f27c..00000000000 --- a/mcs/class/System.Web.DynamicData/System.Web.DynamicData-tests-net_2_0.csproj +++ /dev/null @@ -1,697 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {AD07E068-F605-4F24-A60B-74514641DDDC} - Library - 1699 - bin\Debug\System.Web.DynamicData-tests-net_2_0 - True - False - - Properties - - - System.Web.DynamicData_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {413F9BD7-61AE-4F12-8EDE-A7404B2BEE9C} - System.Web.DynamicData\System.Web.DynamicData-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {F3112064-6311-48A9-992B-A68DD3C62133} - System.ComponentModel.DataAnnotations\System.ComponentModel.DataAnnotations-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {286ED1A3-6AE6-4147-A43B-B3421681CC84} - System.Data.Linq\System.Data.Linq-net_2_0 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - {293D054F-361B-4083-A422-FA1AC9476FC9} - System.Web\System.Web-net_2_0-2 - - - {42527CAE-C932-4518-9CF7-F4ABB44510A5} - System.Web.Extensions\System.Web.Extensions-net_2_0 - - - {1665130D-E9DA-4325-A4C6-78ECF7187D5B} - System.Web.Abstractions\System.Web.Abstractions-net_2_0 - - - {A9B310AD-FF67-49ED-8AC8-AAF1E4B05249} - System.Web.Routing\System.Web.Routing-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - {328B62A2-55C4-420A-81C1-AEAB15A8F3A6} - SystemWebTestShim\SystemWebTestShim-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - - MonoTests.WebPages.DynamicData.Content.FilterUserControl.ascx - - - MonoTests.WebPages.DynamicData.Content.FilterUserControl.ascx.cs - - - MonoTests.WebPages.DynamicData.Content.GridViewPager.ascx - - - MonoTests.WebPages.DynamicData.Content.GridViewPager.ascx.cs - - - MonoTests.WebPages.DynamicData.Content.Images.Back.gif - - - MonoTests.WebPages.DynamicData.Content.Images.header_back.gif - - - MonoTests.WebPages.DynamicData.Content.Images.PgFirst.gif - - - MonoTests.WebPages.DynamicData.Content.Images.PgLast.gif - - - MonoTests.WebPages.DynamicData.Content.Images.PgNext.gif - - - MonoTests.WebPages.DynamicData.Content.Images.PgPrev.gif - - - MonoTests.WebPages.DynamicData.Content.Images.plus.gif - - - MonoTests.WebPages.DynamicData.FieldTemplates.Boolean.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.Boolean.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.Boolean_Edit.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.Boolean_Edit.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.Children.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.Children.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.CustomColor.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.CustomColor.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.CustomFieldTemplate.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.CustomFieldTemplate.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.DateTime.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.DateTime.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.DateTime_Edit.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.DateTime_Edit.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.Decimal_Edit.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.Decimal_Edit.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.ForeignKey.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.ForeignKey.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.ForeignKey_Edit.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.ForeignKey_Edit.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.Integer_Edit.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.Integer_Edit.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.MultilineText_Edit.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.MultilineText_Edit.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.MyCustomUIHintTemplate_Text.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.MyCustomUIHintTemplate_Text.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Boolean.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Boolean.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Byte.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Byte[].ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Byte.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Byte[].ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Char.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Char.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.FooEmpty.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.FooEmpty.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.ICollection.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.ICollection.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Int16.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Int16.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Int32.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Int32.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Int64.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Int64.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.MonoTests.Common.FooEmpty.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.MonoTests.Common.FooEmpty.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Object.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.Object.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.SByte.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.SByte.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.String.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.String.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Boolean.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Boolean.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Byte.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Byte[].ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Byte.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Byte[].ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Char.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Char.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Collections.Generic.List`1[System.String].ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Collections.Generic.List`1[System.String].ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Collections.ICollection.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Collections.ICollection.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Int16.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Int16.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Int32.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Int32.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Int64.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Int64.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Object.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.Object.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.SByte.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.SByte.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.String.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.String.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.UInt16.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.UInt16.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.UInt32.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.UInt32.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.UInt64.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.System.UInt64.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.UInt16.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.UInt16.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.UInt32.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.UInt32.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.UInt64.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates_NonDefault.UInt64.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.PlainControlTemplate.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.PlainControlTemplate.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.Text.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.Text.ascx.cs - - - MonoTests.WebPages.DynamicData.FieldTemplates.Text_Edit.ascx - - - MonoTests.WebPages.DynamicData.FieldTemplates.Text_Edit.ascx.cs - - - MonoTests.WebPages.DynamicData.PageTemplates.Details.aspx - - - MonoTests.WebPages.DynamicData.PageTemplates.Details.aspx.cs - - - MonoTests.WebPages.DynamicData.PageTemplates.Edit.aspx - - - MonoTests.WebPages.DynamicData.PageTemplates.Edit.aspx.cs - - - MonoTests.WebPages.DynamicData.PageTemplates.Insert.aspx - - - MonoTests.WebPages.DynamicData.PageTemplates.Insert.aspx.cs - - - MonoTests.WebPages.DynamicData.PageTemplates.List.aspx - - - MonoTests.WebPages.DynamicData.PageTemplates.List.aspx.cs - - - MonoTests.WebPages.DynamicData.PageTemplates.ListDetails.aspx - - - MonoTests.WebPages.DynamicData.PageTemplates.ListDetails.aspx.cs - - - MonoTests.WebPages.DynamicData.web.config - - - MonoTests.WebPages.Global.asax - - - MonoTests.WebPages.ListView_DynamicControl_01.aspx - - - MonoTests.WebPages.ListView_DynamicControl_01.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_02.aspx - - - MonoTests.WebPages.ListView_DynamicControl_02.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_03.aspx - - - MonoTests.WebPages.ListView_DynamicControl_03.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_04.aspx - - - MonoTests.WebPages.ListView_DynamicControl_04.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_05.aspx - - - MonoTests.WebPages.ListView_DynamicControl_05.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_06.aspx - - - MonoTests.WebPages.ListView_DynamicControl_06.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_07.aspx - - - MonoTests.WebPages.ListView_DynamicControl_07.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_08.aspx - - - MonoTests.WebPages.ListView_DynamicControl_08.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_09.aspx - - - MonoTests.WebPages.ListView_DynamicControl_09.aspx.cs - - - MonoTests.WebPages.ListView_DynamicControl_10.aspx - - - MonoTests.WebPages.ListView_DynamicControl_10.aspx.cs - - - MonoTests.WebPages.DynamicValidator_01.aspx - - - MonoTests.WebPages.DynamicValidator_01.aspx.cs - - - MonoTests.WebPages.DynamicValidator_02.aspx - - - MonoTests.WebPages.DynamicValidator_02.aspx.cs - - - MonoTests.WebPages.Site.css - - - MonoTests.WebPages.Site.master - - - MonoTests.WebPages.Site.master.cs - - - MonoTests.WebPages.web.config.2.0 - - - MonoTests.WebPages.web.config.4.0 - - - MonoTests.WebPages.web.config.4.5 - - - - diff --git a/mcs/class/System.Web.Extensions.Design/System.Web.Extensions.Design-net_2_0.csproj b/mcs/class/System.Web.Extensions.Design/System.Web.Extensions.Design-net_2_0.csproj deleted file mode 100644 index cd618541215..00000000000 --- a/mcs/class/System.Web.Extensions.Design/System.Web.Extensions.Design-net_2_0.csproj +++ /dev/null @@ -1,107 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {BC7F5750-D8B4-4D81-B5CE-F7923B3A5AEA} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Web.Extensions.Design - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {31BD6BF1-0C7A-4C0A-AB48-091F2EBB4AAC} - System.Design\System.Design-net_2_0-1 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - {EC4EB1AA-1E23-4F9A-832A-FED2E5EA9630} - Managed.Windows.Forms\System.Windows.Forms-net_2_0 - - - - - - - diff --git a/mcs/class/System.Web.Extensions.Design_1.0/System.Web.Extensions.Design_1.0-net_2_0.csproj b/mcs/class/System.Web.Extensions.Design_1.0/System.Web.Extensions.Design_1.0-net_2_0.csproj deleted file mode 100644 index 93c968c096c..00000000000 --- a/mcs/class/System.Web.Extensions.Design_1.0/System.Web.Extensions.Design_1.0-net_2_0.csproj +++ /dev/null @@ -1,107 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {A4D4C8B5-6C55-48C4-8C47-F394D5979079} - Library - 1699 - ./../../class/compat/net_2_0 - True - True - - Properties - - - System.Web.Extensions.Design - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {31BD6BF1-0C7A-4C0A-AB48-091F2EBB4AAC} - System.Design\System.Design-net_2_0-1 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - {EC4EB1AA-1E23-4F9A-832A-FED2E5EA9630} - Managed.Windows.Forms\System.Windows.Forms-net_2_0 - - - - - - - diff --git a/mcs/class/System.Web.Extensions/System.Web.Extensions-net_2_0.csproj b/mcs/class/System.Web.Extensions/System.Web.Extensions-net_2_0.csproj deleted file mode 100644 index 0da8da8dde0..00000000000 --- a/mcs/class/System.Web.Extensions/System.Web.Extensions-net_2_0.csproj +++ /dev/null @@ -1,283 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {42527CAE-C932-4518-9CF7-F4ABB44510A5} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - true - Properties - - - System.Web.Extensions - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5;SYSTEM_WEB_EXTENSIONS - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_5;SYSTEM_WEB_EXTENSIONS - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {286ED1A3-6AE6-4147-A43B-B3421681CC84} - System.Data.Linq\System.Data.Linq-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {293D054F-361B-4083-A422-FA1AC9476FC9} - System.Web\System.Web-net_2_0-2 - - - {DA9F2EEC-4127-4B98-852E-78A0ED7A4A60} - System.Web.Services\System.Web.Services-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - {94E27660-C3DF-43D1-958A-94D68EF3131F} - System.EnterpriseServices\System.EnterpriseServices-net_2_0 - - - {DA50E37C-63DE-4049-9BE0-141BF1104E20} - System.ServiceModel\System.ServiceModel-net_2_0 - - - - - - - - MicrosoftAjax.debug.js - - - MicrosoftAjax.js - - - MicrosoftAjaxTimer.debug.js - - - MicrosoftAjaxTimer.js - - - MicrosoftAjaxWebForms.debug.js - - - MicrosoftAjaxWebForms.js - - - - diff --git a/mcs/class/System.Web.Extensions/System.Web.Extensions-tests-net_2_0.csproj b/mcs/class/System.Web.Extensions/System.Web.Extensions-tests-net_2_0.csproj deleted file mode 100644 index e6db9f6af0a..00000000000 --- a/mcs/class/System.Web.Extensions/System.Web.Extensions-tests-net_2_0.csproj +++ /dev/null @@ -1,253 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {1F2F06C1-46F5-4297-B417-61C7648D9C1F} - Library - 1699,219,169,1591 - bin\Debug\System.Web.Extensions-tests-net_2_0 - True - False - true - Properties - - - System.Web.Extensions_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,219,169,1591 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5;SYSTEM_WEB_EXTENSIONS;SYSTEM_WEB_EXTENSIONS - prompt - 4 - - - pdbonly - 1699,219,169,1591 - true - NET_1_1;NET_2_0;NET_3_5;SYSTEM_WEB_EXTENSIONS;SYSTEM_WEB_EXTENSIONS - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {42527CAE-C932-4518-9CF7-F4ABB44510A5} - System.Web.Extensions\System.Web.Extensions-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {286ED1A3-6AE6-4147-A43B-B3421681CC84} - System.Data.Linq\System.Data.Linq-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {293D054F-361B-4083-A422-FA1AC9476FC9} - System.Web\System.Web-net_2_0-2 - - - {DA9F2EEC-4127-4B98-852E-78A0ED7A4A60} - System.Web.Services\System.Web.Services-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - {94E27660-C3DF-43D1-958A-94D68EF3131F} - System.EnterpriseServices\System.EnterpriseServices-net_2_0 - - - {DA50E37C-63DE-4049-9BE0-141BF1104E20} - System.ServiceModel\System.ServiceModel-net_2_0 - - - {328B62A2-55C4-420A-81C1-AEAB15A8F3A6} - SystemWebTestShim\SystemWebTestShim-net_2_0 - - - - - - - - MicrosoftAjax.debug.js - - - MicrosoftAjax.js - - - MicrosoftAjaxTimer.debug.js - - - MicrosoftAjaxTimer.js - - - MicrosoftAjaxWebForms.debug.js - - - MicrosoftAjaxWebForms.js - - - Web.mono.config - - - profile.config.4.5 - - - profile.config.4.0 - - - profile.config.2.0 - - - ListViewSort.aspx - - - ListViewTest.aspx - - - ListViewTotalRowCount_Bug535701_1.aspx - - - ListViewTotalRowCount_Bug535701_2.aspx - - - ListViewTotalRowCount_Bug604053.aspx - - - MyPage.aspx.cs - - - Global.asax - - - My.ashx - - - MyPage.aspx - - - MyPageWithDerivedMaster.aspx - - - MyPageWithMaster.aspx - - - MyPageWithMasterInvalidPlaceHolder.aspx - - - My.master - - - MyDerived.master - - - - diff --git a/mcs/class/System.Web.Extensions_1.0/System.Web.Extensions_1.0-net_2_0.csproj b/mcs/class/System.Web.Extensions_1.0/System.Web.Extensions_1.0-net_2_0.csproj deleted file mode 100644 index 84aae7336e9..00000000000 --- a/mcs/class/System.Web.Extensions_1.0/System.Web.Extensions_1.0-net_2_0.csproj +++ /dev/null @@ -1,253 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {5B5CA61A-0901-40B5-B56A-D0A6E67DDA66} - Library - 1699 - ./../../class/compat/net_2_0 - True - True - true - Properties - - - System.Web.Extensions - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;SYSTEM_WEB_EXTENSIONS - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;SYSTEM_WEB_EXTENSIONS - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {293D054F-361B-4083-A422-FA1AC9476FC9} - System.Web\System.Web-net_2_0-2 - - - {DA9F2EEC-4127-4B98-852E-78A0ED7A4A60} - System.Web.Services\System.Web.Services-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - {94E27660-C3DF-43D1-958A-94D68EF3131F} - System.EnterpriseServices\System.EnterpriseServices-net_2_0 - - - - - - - - MicrosoftAjax.debug.js - - - MicrosoftAjax.js - - - MicrosoftAjaxTimer.debug.js - - - MicrosoftAjaxTimer.js - - - MicrosoftAjaxWebForms.debug.js - - - MicrosoftAjaxWebForms.js - - - - diff --git a/mcs/class/System.Web.Mvc/System.Web.Mvc-net_2_0.csproj b/mcs/class/System.Web.Mvc/System.Web.Mvc-net_2_0.csproj deleted file mode 100644 index 2517e756412..00000000000 --- a/mcs/class/System.Web.Mvc/System.Web.Mvc-net_2_0.csproj +++ /dev/null @@ -1,272 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {268C75DA-7F8A-4402-B143-ABAF2A7D97C9} - Library - 1699 - ./../../class/compat/net_2_0 - True - True - - Properties - - - System.Web.Mvc - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5;MONO - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_5;MONO - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {293D054F-361B-4083-A422-FA1AC9476FC9} - System.Web\System.Web-net_2_0-2 - - - {1665130D-E9DA-4325-A4C6-78ECF7187D5B} - System.Web.Abstractions\System.Web.Abstractions-net_2_0 - - - {A9B310AD-FF67-49ED-8AC8-AAF1E4B05249} - System.Web.Routing\System.Web.Routing-net_2_0 - - - {5B5CA61A-0901-40B5-B56A-D0A6E67DDA66} - System.Web.Extensions_1.0\System.Web.Extensions_1.0-net_2_0 - - - - - - - - System.Web.Mvc.Resources.MvcResources.resources - - - - diff --git a/mcs/class/System.Web.Mvc2/System.Web.Mvc2-net_2_0.csproj b/mcs/class/System.Web.Mvc2/System.Web.Mvc2-net_2_0.csproj deleted file mode 100644 index 290c752d5cb..00000000000 --- a/mcs/class/System.Web.Mvc2/System.Web.Mvc2-net_2_0.csproj +++ /dev/null @@ -1,402 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E554A1B9-E387-4BEA-BF28-32455D018D07} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Web.Mvc - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5;MONO - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_5;MONO - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {293D054F-361B-4083-A422-FA1AC9476FC9} - System.Web\System.Web-net_2_0-2 - - - {1665130D-E9DA-4325-A4C6-78ECF7187D5B} - System.Web.Abstractions\System.Web.Abstractions-net_2_0 - - - {A9B310AD-FF67-49ED-8AC8-AAF1E4B05249} - System.Web.Routing\System.Web.Routing-net_2_0 - - - {42527CAE-C932-4518-9CF7-F4ABB44510A5} - System.Web.Extensions\System.Web.Extensions-net_2_0 - - - {F3112064-6311-48A9-992B-A68DD3C62133} - System.ComponentModel.DataAnnotations\System.ComponentModel.DataAnnotations-net_2_0 - - - {286ED1A3-6AE6-4147-A43B-B3421681CC84} - System.Data.Linq\System.Data.Linq-net_2_0 - - - - - - - - System.Web.Mvc.Resources.MvcResources.resources - - - - diff --git a/mcs/class/System.Web.Routing/Makefile b/mcs/class/System.Web.Routing/Makefile index 01389b60424..0e4e57ef46d 100644 --- a/mcs/class/System.Web.Routing/Makefile +++ b/mcs/class/System.Web.Routing/Makefile @@ -9,11 +9,6 @@ LIB_MCS_FLAGS = \ /r:System.Web.dll \ /r:System.Web.Abstractions.dll -ifeq (2.0, $(FRAMEWORK_VERSION)) -# This is a .NET 3.5 only assembly, but built during the 2.0 build -LIB_MCS_FLAGS += -d:NET_3_5 -d:SYSTEMCORE_DEP -endif - ifdef DEBUG LIB_MCS_FLAGS += -define:DEBUG endif @@ -23,7 +18,7 @@ TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) EXTRA_DISTFILES = # This is a .NET 3.5+ assembly -VALID_PROFILE := $(filter net_2_0 net_4_0 net_4_5, $(PROFILE)) +VALID_PROFILE := $(filter net_4_0 net_4_5, $(PROFILE)) ifndef VALID_PROFILE LIBRARY_NAME = dummy-System.Web.Routing.dll NO_INSTALL = yes diff --git a/mcs/class/System.Web.Routing/System.Web.Routing-net_2_0.csproj b/mcs/class/System.Web.Routing/System.Web.Routing-net_2_0.csproj deleted file mode 100644 index d2516c2f325..00000000000 --- a/mcs/class/System.Web.Routing/System.Web.Routing-net_2_0.csproj +++ /dev/null @@ -1,113 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {A9B310AD-FF67-49ED-8AC8-AAF1E4B05249} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Web.Routing - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5;SYSTEMCORE_DEP - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_5;SYSTEMCORE_DEP - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {293D054F-361B-4083-A422-FA1AC9476FC9} - System.Web\System.Web-net_2_0-2 - - - {1665130D-E9DA-4325-A4C6-78ECF7187D5B} - System.Web.Abstractions\System.Web.Abstractions-net_2_0 - - - - - - - diff --git a/mcs/class/System.Web.Routing/System.Web.Routing-tests-net_2_0.csproj b/mcs/class/System.Web.Routing/System.Web.Routing-tests-net_2_0.csproj deleted file mode 100644 index 8be24aa45fd..00000000000 --- a/mcs/class/System.Web.Routing/System.Web.Routing-tests-net_2_0.csproj +++ /dev/null @@ -1,111 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {6E3E9325-A838-4063-B095-7C93F9F562BF} - Library - 1699 - bin\Debug\System.Web.Routing-tests-net_2_0 - True - False - - Properties - - - System.Web.Routing_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5;SYSTEMCORE_DEP - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_5;SYSTEMCORE_DEP - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {A9B310AD-FF67-49ED-8AC8-AAF1E4B05249} - System.Web.Routing\System.Web.Routing-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {293D054F-361B-4083-A422-FA1AC9476FC9} - System.Web\System.Web-net_2_0-2 - - - {1665130D-E9DA-4325-A4C6-78ECF7187D5B} - System.Web.Abstractions\System.Web.Abstractions-net_2_0 - - - - - - - diff --git a/mcs/class/System.Web.Services/System.Web.Services-net_2_0.csproj b/mcs/class/System.Web.Services/System.Web.Services-net_2_0.csproj deleted file mode 100644 index 1f8dbee3a78..00000000000 --- a/mcs/class/System.Web.Services/System.Web.Services-net_2_0.csproj +++ /dev/null @@ -1,329 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {DA9F2EEC-4127-4B98-852E-78A0ED7A4A60} - Library - 1699,649,169 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Web.Services - v2.0 - 512 - - - true - full - 1699,649,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,649,169 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {94E27660-C3DF-43D1-958A-94D68EF3131F} - System.EnterpriseServices\System.EnterpriseServices-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {3AE1BF46-F9C5-4EC2-B95D-C9D9F21F4E08} - System.Web\System.Web-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - - - - - - wsdl-1.1.xsd - - - wsdl-1.1-soap.xsd - - - web-reference.xsd - - - - diff --git a/mcs/class/System.Web.Services/System.Web.Services-tests-net_2_0.csproj b/mcs/class/System.Web.Services/System.Web.Services-tests-net_2_0.csproj deleted file mode 100644 index f9b607ffb9c..00000000000 --- a/mcs/class/System.Web.Services/System.Web.Services-tests-net_2_0.csproj +++ /dev/null @@ -1,147 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {8844444A-6A2E-4E20-A4B1-4E0DCA02108E} - Library - 1699,649,169,618 - bin\Debug\System.Web.Services-tests-net_2_0 - True - False - - Properties - - - System.Web.Services_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,649,169,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,649,169,618 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {DA9F2EEC-4127-4B98-852E-78A0ED7A4A60} - System.Web.Services\System.Web.Services-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {94E27660-C3DF-43D1-958A-94D68EF3131F} - System.EnterpriseServices\System.EnterpriseServices-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {3AE1BF46-F9C5-4EC2-B95D-C9D9F21F4E08} - System.Web\System.Web-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - - - - - - wsdl-1.1.xsd - - - wsdl-1.1-soap.xsd - - - web-reference.xsd - - - - diff --git a/mcs/class/System.Web/Makefile b/mcs/class/System.Web/Makefile index bcde5188662..96933615aec 100644 --- a/mcs/class/System.Web/Makefile +++ b/mcs/class/System.Web/Makefile @@ -272,10 +272,6 @@ TEST_MCS_FLAGS = $(LIB_MCS_FLAGS) -doc:$(test_lib:.dll=.xml) -nowarn:219,169,159 $(foreach file,$(NUNIT_APP_CODE_FILES),$(shell echo $(file) | sed -e 's;\(.*\)/\(.*\);/resource:\1/\2,App_Code/\2 ;g')) \ $(foreach file,$(NUNIT_APP_GLOBALRESOURCES_FILES),$(shell echo $(file) | sed -e 's;\(.*\)/\(.*\);/resource:\1/\2,App_GlobalResources/\2 ;g')) -ifeq (net_2_0, $(PROFILE)) -TEST_MCS_FLAGS += -r:System.Web.Extensions.dll -d:TEST -endif - EXTRA_DISTFILES = \ $(RESOURCE_FILES_4) \ $(RESOURCE_FILES_2) \ diff --git a/mcs/class/System.Web/System.Web-net_2_0.csproj b/mcs/class/System.Web/System.Web-net_2_0.csproj deleted file mode 100644 index 56ba75923fa..00000000000 --- a/mcs/class/System.Web/System.Web-net_2_0.csproj +++ /dev/null @@ -1,1505 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {3AE1BF46-F9C5-4EC2-B95D-C9D9F21F4E08} - Library - 1699,612,618,618 - ./../../class/lib/net_2_0 - True - True - true - Properties - - - System.Web - v2.0 - 512 - - - true - full - 1699,612,618,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0;INSIDE_SYSTEM_WEB;WEBSERVICES_DEP;MONOWEB_DEP;SYSTEMCORE_DEP - prompt - 4 - - - pdbonly - 1699,612,618,618 - true - NET_1_1;NET_2_0;INSIDE_SYSTEM_WEB;WEBSERVICES_DEP;MONOWEB_DEP;SYSTEMCORE_DEP - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {94E27660-C3DF-43D1-958A-94D68EF3131F} - System.EnterpriseServices\System.EnterpriseServices-net_2_0 - - - {8313B5D9-A1BE-4E62-90E7-FA002548D650} - System.Runtime.Serialization.Formatters.Soap\System.Runtime.Serialization.Formatters.Soap-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - {7B3F5668-ED1F-48EB-9897-E6BE6A1C8CB3} - Mono.Data.Sqlite\Mono.Data.Sqlite-net_2_0 - - - False - System.Web.Services.dll - False - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - - - - - - TranslationResources.resources - - - WebUIValidation.js - - - folder.gif - - - file.gif - - - computer.gif - - - arrow_minus.gif - - - arrow_noexpand.gif - - - arrow_plus.gif - - - arrow_up.gif - - - arrow_down.gif - - - box_full.gif - - - box_empty.gif - - - box_minus.gif - - - box_noexpand.gif - - - box_plus.gif - - - contact.gif - - - dot_empty.gif - - - dot_full.gif - - - dots.gif - - - inbox.gif - - - star_empty.gif - - - star_full.gif - - - warning.gif - - - TreeView_noexpand.gif - - - TreeView_dash.gif - - - TreeView_dashminus.gif - - - TreeView_dashplus.gif - - - TreeView_i.gif - - - TreeView_l.gif - - - TreeView_lminus.gif - - - TreeView_lplus.gif - - - TreeView_minus.gif - - - TreeView_plus.gif - - - TreeView_r.gif - - - TreeView_rminus.gif - - - TreeView_rplus.gif - - - TreeView_t.gif - - - TreeView_tminus.gif - - - TreeView_tplus.gif - - - transparent.gif - - - webform.js - - - WebUIValidation_2.0.js - - - ErrorTemplateCommon_Top.html - - - DefaultErrorTemplate_CustomErrorDefault.html - - - ErrorTemplateCommon_Bottom.html - - - DefaultErrorTemplate_StandardPage.html - - - HtmlizedExceptionPage_Top.html - - - HtmlizedExceptionPage_FileLongSource.html - - - HtmlizedExceptionPage_FileShortSource.html - - - HtmlizedExceptionPage_CompilerOutput.html - - - GridView.js - - - DetailsView.js - - - TreeView.js - - - Menu.js - - - - diff --git a/mcs/class/System.Web/System.Web-plainweb-net_2_0.csproj b/mcs/class/System.Web/System.Web-plainweb-net_2_0.csproj deleted file mode 100644 index ff2009e8b23..00000000000 --- a/mcs/class/System.Web/System.Web-plainweb-net_2_0.csproj +++ /dev/null @@ -1,1504 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2F43657C-B73B-44FF-B548-6734C967AA94} - Library - 1699,612,618,618 - ./../../class/lib/net_2_0/plainweb - True - True - true - Properties - - - System.Web - v2.0 - 512 - - - true - full - 1699,612,618,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0;INSIDE_SYSTEM_WEB - prompt - 4 - - - pdbonly - 1699,612,618,618 - true - NET_1_1;NET_2_0;INSIDE_SYSTEM_WEB - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {AAA3F683-244C-40EF-8EF8-A95938862A44} - corlib\corlib-net_2_0 - - - {5459507F-DC25-401C-A2F4-D5ECAC3A34E6} - System\System-bare-net_2_0 - - - {F0743710-AB7C-4019-A13A-07AE79F514E4} - System.Core\System.Core-plaincore-net_2_0 - - - {50FE7D09-285C-480A-94F8-F42CB76A83CE} - System.Drawing\System.Drawing-net_2_0 - - - {3D0435AD-4ACE-45BE-87DE-335BAD6D8EB1} - System.Data\System.Data-net_2_0 - - - {0E9DD462-944B-426E-BC1E-96EF270EF7E2} - System.XML\System.Xml-bare-net_2_0 - - - {40E73340-6F24-460B-AC9D-77C9453B527B} - System.EnterpriseServices\System.EnterpriseServices-net_2_0 - - - {48B07F1A-16F4-44B0-863F-40D5CD6C3CB3} - System.Runtime.Serialization.Formatters.Soap\System.Runtime.Serialization.Formatters.Soap-net_2_0 - - - {13AAE1FB-48CB-41ED-BF9B-F6F69CDE258F} - System.Configuration\System.Configuration-net_2_0 - - - {CBE5E050-412D-4DE7-8937-0E8C4BD6762A} - Mono.Data.Sqlite\Mono.Data.Sqlite-net_2_0 - - - - - - - - TranslationResources.resources - - - WebUIValidation.js - - - folder.gif - - - file.gif - - - computer.gif - - - arrow_minus.gif - - - arrow_noexpand.gif - - - arrow_plus.gif - - - arrow_up.gif - - - arrow_down.gif - - - box_full.gif - - - box_empty.gif - - - box_minus.gif - - - box_noexpand.gif - - - box_plus.gif - - - contact.gif - - - dot_empty.gif - - - dot_full.gif - - - dots.gif - - - inbox.gif - - - star_empty.gif - - - star_full.gif - - - warning.gif - - - TreeView_noexpand.gif - - - TreeView_dash.gif - - - TreeView_dashminus.gif - - - TreeView_dashplus.gif - - - TreeView_i.gif - - - TreeView_l.gif - - - TreeView_lminus.gif - - - TreeView_lplus.gif - - - TreeView_minus.gif - - - TreeView_plus.gif - - - TreeView_r.gif - - - TreeView_rminus.gif - - - TreeView_rplus.gif - - - TreeView_t.gif - - - TreeView_tminus.gif - - - TreeView_tplus.gif - - - transparent.gif - - - webform.js - - - WebUIValidation_2.0.js - - - ErrorTemplateCommon_Top.html - - - DefaultErrorTemplate_CustomErrorDefault.html - - - ErrorTemplateCommon_Bottom.html - - - DefaultErrorTemplate_StandardPage.html - - - HtmlizedExceptionPage_Top.html - - - HtmlizedExceptionPage_FileLongSource.html - - - HtmlizedExceptionPage_FileShortSource.html - - - HtmlizedExceptionPage_CompilerOutput.html - - - GridView.js - - - DetailsView.js - - - TreeView.js - - - Menu.js - - - - diff --git a/mcs/class/System.Web/System.Web-tests-net_2_0.csproj b/mcs/class/System.Web/System.Web-tests-net_2_0.csproj deleted file mode 100644 index b558e299cc9..00000000000 --- a/mcs/class/System.Web/System.Web-tests-net_2_0.csproj +++ /dev/null @@ -1,1322 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D7874FFB-8F9F-4E48-9EEE-EB179D0AFAFF} - Library - 1699,612,618,618,219,169,1591 - bin\Debug\System.Web-tests-net_2_0 - True - False - true - Properties - - - System.Web_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,612,618,618,219,169,1591 - false - DEBUG;TRACE;NET_1_1;NET_2_0;INSIDE_SYSTEM_WEB;WEBSERVICES_DEP;MONOWEB_DEP;SYSTEMCORE_DEP;TEST - prompt - 4 - - - pdbonly - 1699,612,618,618,219,169,1591 - true - NET_1_1;NET_2_0;INSIDE_SYSTEM_WEB;WEBSERVICES_DEP;MONOWEB_DEP;SYSTEMCORE_DEP;TEST - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {293D054F-361B-4083-A422-FA1AC9476FC9} - System.Web\System.Web-net_2_0-2 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {458980DE-3D7C-4BBA-BA18-673EDC030AFE} - System.Drawing\System.Drawing-net_2_0 - - - {69458D09-40A2-48AD-8C0F-0E437CF5FE6D} - System.Data\System.Data-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {94E27660-C3DF-43D1-958A-94D68EF3131F} - System.EnterpriseServices\System.EnterpriseServices-net_2_0 - - - {8313B5D9-A1BE-4E62-90E7-FA002548D650} - System.Runtime.Serialization.Formatters.Soap\System.Runtime.Serialization.Formatters.Soap-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - {7B3F5668-ED1F-48EB-9897-E6BE6A1C8CB3} - Mono.Data.Sqlite\Mono.Data.Sqlite-net_2_0 - - - {DA9F2EEC-4127-4B98-852E-78A0ED7A4A60} - System.Web.Services\System.Web.Services-net_2_0 - - - {D02EAC8D-4C43-48F4-832A-7D9A3C2D07CF} - Mono.Web\Mono.Web-net_2_0 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {328B62A2-55C4-420A-81C1-AEAB15A8F3A6} - SystemWebTestShim\SystemWebTestShim-net_2_0 - - - False - System.Web.Extensions.dll - False - - - - - - - - TranslationResources.resources - - - WebUIValidation.js - - - folder.gif - - - file.gif - - - computer.gif - - - arrow_minus.gif - - - arrow_noexpand.gif - - - arrow_plus.gif - - - arrow_up.gif - - - arrow_down.gif - - - box_full.gif - - - box_empty.gif - - - box_minus.gif - - - box_noexpand.gif - - - box_plus.gif - - - contact.gif - - - dot_empty.gif - - - dot_full.gif - - - dots.gif - - - inbox.gif - - - star_empty.gif - - - star_full.gif - - - warning.gif - - - TreeView_noexpand.gif - - - TreeView_dash.gif - - - TreeView_dashminus.gif - - - TreeView_dashplus.gif - - - TreeView_i.gif - - - TreeView_l.gif - - - TreeView_lminus.gif - - - TreeView_lplus.gif - - - TreeView_minus.gif - - - TreeView_plus.gif - - - TreeView_r.gif - - - TreeView_rminus.gif - - - TreeView_rplus.gif - - - TreeView_t.gif - - - TreeView_tminus.gif - - - TreeView_tplus.gif - - - transparent.gif - - - webform.js - - - WebUIValidation_2.0.js - - - ErrorTemplateCommon_Top.html - - - DefaultErrorTemplate_CustomErrorDefault.html - - - ErrorTemplateCommon_Bottom.html - - - DefaultErrorTemplate_StandardPage.html - - - HtmlizedExceptionPage_Top.html - - - HtmlizedExceptionPage_FileLongSource.html - - - HtmlizedExceptionPage_FileShortSource.html - - - HtmlizedExceptionPage_CompilerOutput.html - - - GridView.js - - - DetailsView.js - - - TreeView.js - - - Menu.js - - - Global.asax - - - My.ashx - - - My.master - - - MyPage.aspx - - - MyPage.aspx.cs - - - MyPageWithMaster.aspx - - - Web.mono.config - - - Web.mono.config.4.0 - - - sub_map_01.sitemap - - - test_map_01.sitemap - - - test_map_02.sitemap - - - test_map_03.sitemap - - - test_map_04.sitemap - - - test_map_05.sitemap - - - test_map_06.sitemap - - - test_map_07.sitemap - - - test_map_08.sitemap - - - test_map_09.sitemap - - - menuclass.aspx - - - FormView.aspx - - - PostBackMenuTest.aspx - - - PageWithStyleSheet.aspx - - - PageWithTheme.aspx - - - ResolveUrl.ascx - - - ResolveUrl.aspx - - - RunTimeSetTheme.aspx - - - ReadOnlyPropertyBind.aspx - - - ReadOnlyPropertyControl.ascx - - - Theme1.skin - - - Theme2.skin - - - UrlProperty.aspx - - - UrlProperty.ascx - - - UrlProperty.ascx.cs - - - Web.sitemap - - - WizardTest.skin - - - FooterTemplateTest.aspx - - - DataGrid.aspx - - - DetailsViewTemplates.aspx - - - DetailsViewTemplates_2.aspx - - - DetailsViewTemplates_3.aspx - - - DetailsViewDataActions.aspx - - - DetailsViewProperties1.aspx - - - Bluehills.jpg - - - FormViewTest1.aspx - - - FormViewTest1_2.aspx - - - FormViewTest1_3.aspx - - - FormViewTest1_4.aspx - - - FormViewInsertEditDelete.aspx - - - GridViewUpdate.aspx - - - XMLDataSourceTest.xml - - - XMLDataSourceTest.xsl - - - XMLDataSourceTest1.aspx - - - XMLDataSourceTest2.aspx - - - XMLDataSourceTest3.aspx - - - XMLDataSourceTest4.aspx - - - LoginViewTest1.aspx - - - WebControl.config - - - WebLogin.config - - - CallbackTest1.aspx - - - CallbackTest2.aspx - - - EventValidationTest2.aspx - - - EventValidationTest1.aspx - - - ClientScript.js - - - EvalTest.aspx - - - TemplateUserControl.ascx - - - WebMapping.config - - - Mapping.aspx - - - Mapping1.aspx - - - CrossPagePosting1.aspx - - - CrossPagePosting2.aspx - - - MyDerived.master - - - MyPageWithDerivedMaster.aspx - - - MasterTypeTest1.aspx - - - MasterTypeTest2.aspx - - - PageLifecycleTest.aspx - - - PageValidationTest.aspx - - - AsyncPage.aspx - - - PageCultureTest.aspx - - - adapters.browser - - - NoEventValidation.aspx - - - ListControlPage.aspx - - - TextBoxTestlPage.aspx - - - ClearErrorOnError.aspx - - - RedirectOnError.aspx - - - TestCapability.browser - - - PageWithAdapter.aspx - - - InvalidPropertyBind1.aspx - - - InvalidPropertyBind2.aspx - - - InvalidPropertyBind3.aspx - - - InvalidPropertyBind4.aspx - - - ValidPropertyBind1.aspx - - - ValidPropertyBind2.aspx - - - ValidPropertyBind3.aspx - - - ValidPropertyBind4.aspx - - - ValidPropertyBind5.aspx - - - ReadWritePropertyControl.ascx - - - nunitweb_config.xml - - - TemplateControlParsingTest.aspx - - - ContentPlaceHolderInTemplate.aspx - - - ContentPlaceHolderInTemplate.master - - - MissingMasterFile.aspx - - - CustomSectionEmptyCollection.aspx - - - NoDoubleOnInitOnRemoveAdd.aspx - - - NoDoubleOnInitOnRemoveAdd.aspx.cs - - - LoginDisplayRememberMe.aspx - - - NoBindForMethodsWithBindInName.aspx - - - LinkInHeadWithEmbeddedExpression.aspx - - - ExpressionInListControl.aspx - - - ServerSideControlsInScriptBlock.aspx - - - ServerControlInClientSideComment.aspx - - - PreprocessorDirectivesInMarkup.aspx - - - UnquotedAngleBrackets.aspx - - - FullTagsInText.aspx - - - TagsExpressionsAndCommentsInText.aspx - - - NewlineInCodeExpression.aspx - - - DuplicateControlsInClientComment.aspx - - - TagsNestedInClientTag.aspx - - - ConditionalClientComments.aspx - - - OneLetterIdentifierInCodeRender.aspx - - - GlobalResourcesLocalization.aspx - - - TableSections_Bug551666.aspx - - - TableSections_Bug551666.aspx.cs - - - NestedParserFileText.aspx - - - StateFormatter_CorrectConverter.aspx - - - StateFormatter_CollectionConverter.aspx - - - StateFormatter_CollectionConverter.aspx.cs - - - ChangePasswordContainer_FindControl.aspx - - - TagWithExpressionWithinAttribute.aspx - - - CheckBoxList_Bug377703_1.aspx - - - CheckBoxList_Bug377703_2.aspx - - - CheckBoxList_Bug578770.aspx - - - EnumConverter_Bug578586.aspx - - - ButtonColor_Bug325489.aspx - - - SqlDataSource_OnInit_Bug572781.aspx - - - FormViewPagerVisibility.aspx - - - OverridenControlsPropertyAndPostBack_Bug594238.aspx - - - GlobalizationEncodingName.aspx - - - CheckBoxField_Bug595568_0.aspx - - - CheckBoxField_Bug595568_1.aspx - - - CheckBoxField_Bug595568_2.aspx - - - CheckBoxField_Bug595568_5.aspx - - - CheckBoxField_Bug595568_6.aspx - - - CheckBoxField_Bug595568_7.aspx - - - GridView_Bug595567.aspx - - - CheckBoxList_Bug600415.aspx - - - BoundField_Bug646505.aspx - - - BoundField_Bug646505.aspx.cs - - - HtmlTitleCodeRender_Bug662918.aspx - - - App_Code/EnumConverterControl.cs - - - App_Code/MyContainer.cs - - - App_Code/CustomCheckBoxColumn.cs - - - App_GlobalResources/Common.resx - - - App_GlobalResources/Common.fr-FR.resx - - - App_GlobalResources/Resource1.resx - - - - diff --git a/mcs/class/System.Web/UplevelHelperDefinitions.xml b/mcs/class/System.Web/UplevelHelperDefinitions.xml index 5476f9535a6..5add6d9d453 100644 --- a/mcs/class/System.Web/UplevelHelperDefinitions.xml +++ b/mcs/class/System.Web/UplevelHelperDefinitions.xml @@ -93,7 +93,11 @@ definition correctly. - + + + + + diff --git a/mcs/class/System.XML/System.Xml-bare-net_2_0.csproj b/mcs/class/System.XML/System.Xml-bare-net_2_0.csproj deleted file mode 100644 index 7da30e0c17e..00000000000 --- a/mcs/class/System.XML/System.Xml-bare-net_2_0.csproj +++ /dev/null @@ -1,486 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {0E9DD462-944B-426E-BC1E-96EF270EF7E2} - Library - 1699,618,612,642 - ./../../class/lib/net_2_0/bare - True - True - - Properties - - - System.Xml - v2.0 - 512 - - - true - full - 1699,618,612,642 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699,618,612,642 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -mono $(ProjectDir)\..\..\..\msvc\scripts\prepare.exe $(ProjectDir)..\.. xml -$(ProjectDir)\..\..\jay\jay -ct < $(ProjectDir)\..\..\jay\skeleton.cs $(ProjectDir)\System.Xml.XPath\Parser.jay > $(ProjectDir)\System.Xml.XPath\Parser.cs -echo "#define XSLT_PATTERN" > $(ProjectDir)\Mono.Xml.Xsl\PatternParser.cs -$(ProjectDir)\..\..\jay\jay -ct < $(ProjectDir)\..\..\jay\skeleton.cs $(ProjectDir)\Mono.Xml.Xsl\PatternParser.jay >> $(ProjectDir)\Mono.Xml.Xsl\PatternParser.cs -echo "#define XSLT_PATTERN" > $(ProjectDir)\Mono.Xml.Xsl\PatternTokenizer.cs -cat $(ProjectDir)\System.Xml.XPath\Tokenizer.cs >> $(ProjectDir)\Mono.Xml.Xsl\PatternTokenizer.cs - - - - $(ProjectDir)\..\..\..\msvc\scripts\prepare.exe $(ProjectDir)..\.. xml -$(ProjectDir)\..\..\jay\jay -ct < $(ProjectDir)\..\..\jay\skeleton.cs $(ProjectDir)\System.Xml.XPath\Parser.jay > $(ProjectDir)\System.Xml.XPath\Parser.cs -echo "#define XSLT_PATTERN" > $(ProjectDir)\Mono.Xml.Xsl\PatternParser.cs -$(ProjectDir)\..\..\jay\jay -ct < $(ProjectDir)\..\..\jay\skeleton.cs $(ProjectDir)\Mono.Xml.Xsl\PatternParser.jay >> $(ProjectDir)\Mono.Xml.Xsl\PatternParser.cs -echo "#define XSLT_PATTERN" > $(ProjectDir)\Mono.Xml.Xsl\PatternTokenizer.cs -type $(ProjectDir)\System.Xml.XPath\Tokenizer.cs >> $(ProjectDir)\Mono.Xml.Xsl\PatternTokenizer.cs - - - - - - - - - - - - - {AAA3F683-244C-40EF-8EF8-A95938862A44} - corlib\corlib-net_2_0 - - - {5459507F-DC25-401C-A2F4-D5ECAC3A34E6} - System\System-bare-net_2_0 - - - - - - - diff --git a/mcs/class/System.XML/System.Xml-net_2_0.csproj b/mcs/class/System.XML/System.Xml-net_2_0.csproj deleted file mode 100644 index 2321f8ca8ee..00000000000 --- a/mcs/class/System.XML/System.Xml-net_2_0.csproj +++ /dev/null @@ -1,481 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E89F34AB-7AE2-41CA-B891-C8D1C9F02EB8} - Library - 1699,618,612,642 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Xml - v2.0 - 512 - - - true - full - 1699,618,612,642 - false - DEBUG;TRACE;NET_1_1;NET_2_0;CONFIGURATION_DEP - prompt - 4 - - - pdbonly - 1699,618,612,642 - true - NET_1_1;NET_2_0;CONFIGURATION_DEP - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -$(ProjectDir)\..\..\..\mono\msvc\scripts\prepare.exe $(ProjectDir)..\.. xml -$(ProjectDir)\..\..\jay\jay.exe -ct < $(ProjectDir)\..\..\jay\skeleton.cs $(ProjectDir)\System.Xml.XPath\Parser.jay > $(ProjectDir)\System.Xml.XPath\Parser.cs -echo #define XSLT_PATTERN > $(ProjectDir)\Mono.Xml.Xsl\PatternParser.cs -$(ProjectDir)\..\..\jay\jay.exe -ct < $(ProjectDir)\..\..\jay\skeleton.cs $(ProjectDir)\Mono.Xml.Xsl\PatternParser.jay >> $(ProjectDir)\Mono.Xml.Xsl\PatternParser.cs -echo #define XSLT_PATTERN > $(ProjectDir)\Mono.Xml.Xsl\PatternTokenizer.cs -type $(ProjectDir)\System.Xml.XPath\Tokenizer.cs >> $(ProjectDir)\Mono.Xml.Xsl\PatternTokenizer.cs - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {5A346705-1044-48F2-987D-CAE22A255427} - System\System-net_2_0 - - - False - System.Configuration.dll - False - - - - - - - diff --git a/mcs/class/System.XML/System.Xml-tests-net_2_0.csproj b/mcs/class/System.XML/System.Xml-tests-net_2_0.csproj deleted file mode 100644 index 2b26f77b009..00000000000 --- a/mcs/class/System.XML/System.Xml-tests-net_2_0.csproj +++ /dev/null @@ -1,224 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {966262F1-0FE4-4474-A6D5-99B107E45248} - Library - 1699,618,612,642,618,219,169 - bin\Debug\System.Xml-tests-net_2_0 - True - False - - Properties - - - System.Xml_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,618,612,642,618,219,169 - false - DEBUG;TRACE;NET_1_1;NET_2_0;CONFIGURATION_DEP - prompt - 4 - - - pdbonly - 1699,618,612,642,618,219,169 - true - NET_1_1;NET_2_0;CONFIGURATION_DEP - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -$(ProjectDir)\..\..\..\mono\msvc\scripts\prepare.exe $(ProjectDir)..\.. xml -$(ProjectDir)\..\..\jay\jay.exe -ct < $(ProjectDir)\..\..\jay\skeleton.cs $(ProjectDir)\System.Xml.XPath\Parser.jay > $(ProjectDir)\System.Xml.XPath\Parser.cs -echo #define XSLT_PATTERN > $(ProjectDir)\Mono.Xml.Xsl\PatternParser.cs -$(ProjectDir)\..\..\jay\jay.exe -ct < $(ProjectDir)\..\..\jay\skeleton.cs $(ProjectDir)\Mono.Xml.Xsl\PatternParser.jay >> $(ProjectDir)\Mono.Xml.Xsl\PatternParser.cs -echo #define XSLT_PATTERN > $(ProjectDir)\Mono.Xml.Xsl\PatternTokenizer.cs -type $(ProjectDir)\System.Xml.XPath\Tokenizer.cs >> $(ProjectDir)\Mono.Xml.Xsl\PatternTokenizer.cs - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - False - System.Data.dll - False - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - - - - - diff --git a/mcs/class/System.Xml.Linq/System.Xml.Linq-net_2_0.csproj b/mcs/class/System.Xml.Linq/System.Xml.Linq-net_2_0.csproj deleted file mode 100644 index cf2f1fb6b88..00000000000 --- a/mcs/class/System.Xml.Linq/System.Xml.Linq-net_2_0.csproj +++ /dev/null @@ -1,121 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {80B8A117-6BB4-4646-8BE9-863A5C105437} - Library - 1699,1720 - ./../../class/lib/net_2_0 - True - True - - Properties - - - System.Xml.Linq - v2.0 - 512 - - - true - full - 1699,1720 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - pdbonly - 1699,1720 - true - NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - diff --git a/mcs/class/System.Xml.Linq/System.Xml.Linq-tests-net_2_0.csproj b/mcs/class/System.Xml.Linq/System.Xml.Linq-tests-net_2_0.csproj deleted file mode 100644 index 2de001c84e6..00000000000 --- a/mcs/class/System.Xml.Linq/System.Xml.Linq-tests-net_2_0.csproj +++ /dev/null @@ -1,112 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {612BE852-974E-423E-B974-74EDB0E28136} - Library - 1699,1720 - bin\Debug\System.Xml.Linq-tests-net_2_0 - True - False - - Properties - - - System.Xml.Linq_test_net_2_0 - v2.0 - 512 - - - true - full - 1699,1720 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - pdbonly - 1699,1720 - true - NET_1_1;NET_2_0;NET_3_5 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {80B8A117-6BB4-4646-8BE9-863A5C105437} - System.Xml.Linq\System.Xml.Linq-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - diff --git a/mcs/class/System/Makefile b/mcs/class/System/Makefile index cfa7564d4b6..ad962f07317 100644 --- a/mcs/class/System/Makefile +++ b/mcs/class/System/Makefile @@ -22,9 +22,10 @@ TEST_RESOURCES = \ TEST_MCS_FLAGS = -r:System.Drawing.dll -r:Mono.Security.dll -r:System.Data -r:System.Xml.dll -r:System.Core.dll -nowarn:618,672,219,67,169,612 \ $(foreach f, $(TEST_RESOURCES), -resource:$(f),$(notdir $(f))) -LIB_MCS_FLAGS = -nowarn:618 -d:CONFIGURATION_2_0 -unsafe $(RESOURCE_FILES:%=-resource:%) +REFERENCE_SOURCES_FLAGS = -d:FEATURE_PAL +LIB_MCS_FLAGS = -nowarn:618 -d:CONFIGURATION_2_0 $(REFERENCE_SOURCES_FLAGS) -unsafe $(RESOURCE_FILES:%=-resource:%) TEST_MCS_FLAGS += -r:System.Configuration -PROFILE_ANY_MOBILE := $(filter monotouch monotouch_runtime monodroid xammaci mobile mobile_static, $(PROFILE)) +PROFILE_ANY_MOBILE := $(filter monotouch monotouch_runtime monodroid xammac mobile mobile_static, $(PROFILE)) ifeq (2.1, $(FRAMEWORK_VERSION)) LIB_MCS_FLAGS += -d:INSIDE_SYSTEM @@ -55,7 +56,6 @@ LIB_MCS_FLAGS += -d:SECURITY_DEP -d:XML_DEP -r:PrebuiltSystem=$(secxml_libdir)/S endif EXTRA_DISTFILES = \ - System.Text.RegularExpressions/notes.txt \ System.ComponentModel.Design/Changelog \ Test/test-config-file \ Test/test-config-file-net-2.0 \ diff --git a/mcs/class/System/SR.cs b/mcs/class/System/SR.cs new file mode 100644 index 00000000000..cf3d98422ed --- /dev/null +++ b/mcs/class/System/SR.cs @@ -0,0 +1,84 @@ +// +// Resource strings referenced by the code. +// +// Copyright 2014 Xamarin Inc +// +partial class SR +{ + public const string UnexpectedOpcode = "UnexpectedOpcode"; + public const string BeginIndexNotNegative = "BeginIndexNotNegative"; + public const string CountTooSmall = "CountTooSmall"; + public const string ReplacementError = "ReplacementError"; + public const string BadClassInCharRange = "BadClassInCharRange"; + public const string TooManyAlternates = "TooManyAlternates"; + public const string MakeException = "MakeException"; + public const string IncompleteSlashP = "IncompleteSlashP"; + public const string MalformedSlashP = "MalformedSlashP"; + public const string CaptureGroupOutOfRange = "CaptureGroupOutOfRange"; + public const string InvalidGroupName = "InvalidGroupName"; + public const string UndefinedBackref = "UndefinedBackref"; + public const string UndefinedNameref = "UndefinedNameref"; + public const string UnrecognizedControl = "UnrecognizedControl"; + + public const string AlternationCantCapture = "AlternationCantCapture"; + public const string AlternationCantHaveComment = "AlternationCantHaveComment"; + public const string Arg_InvalidArrayType = "Arg_InvalidArrayType"; + public const string Arg_RankMultiDimNotSupported = "Arg_RankMultiDimNotSupported"; + public const string ArgumentNull_ArrayWithNullElements = "ArgumentNull_ArrayWithNullElements"; + public const string CapnumNotZero = "CapnumNotZero"; + public const string EnumNotStarted = "EnumNotStarted"; + public const string IllegalCondition = "IllegalCondition"; + public const string IllegalDefaultRegexMatchTimeoutInAppDomain = "IllegalDefaultRegexMatchTimeoutInAppDomain"; + public const string IllegalEndEscape = "IllegalEndEscape"; + public const string IllegalRange = "IllegalRange"; + public const string InvalidNullEmptyArgument = "Invalid empty argument {0}"; + public const string InternalError = "InternalError"; + public const string LengthNotNegative = "LengthNotNegative"; + public const string MalformedNameRef = "MalformedNameRef"; + public const string MalformedReference = "MalformedReference"; + public const string MissingControl = "MissingControl"; + public const string NestedQuantify = "NestedQuantify"; + public const string NoResultOnFailed = "NoResultOnFailed"; + public const string NotEnoughParens = "NotEnoughParens"; + public const string OnlyAllowedOnce = "OnlyAllowedOnce"; + public const string QuantifyAfterNothing = "QuantifyAfterNothing"; + public const string RegexMatchTimeoutException_Occurred = "RegexMatchTimeoutException_Occurred"; + public const string ReversedCharRange = "ReversedCharRange"; + public const string SubtractionMustBeLast = "SubtractionMustBeLast"; + public const string TooFewHex = "TooFewHex"; + public const string TooManyParens = "TooManyParens"; + public const string UndefinedNameRef = "UndefinedNameRef"; + public const string UndefinedReference = "UndefinedReference"; + public const string UnimplementedState = "UnimplementedState"; + public const string UnknownProperty = "UnknownProperty"; + public const string UnrecognizedEscape = "UnrecognizedEscape"; + public const string UnrecognizedGrouping = "UnrecognizedGrouping"; + public const string UnterminatedBracket = "UnterminatedBracket"; + public const string UnterminatedComment = "UnterminatedComment"; + + public const string BlockingCollection_Add_ConcurrentCompleteAdd = "BlockingCollection_Add_ConcurrentCompleteAdd"; + public const string BlockingCollection_Add_Failed = "BlockingCollection_Add_Failed"; + public const string BlockingCollection_CantAddAnyWhenCompleted = "BlockingCollection_CantAddAnyWhenCompleted"; + public const string BlockingCollection_CantTakeAnyWhenAllDone = "BlockingCollection_CantTakeAnyWhenAllDone"; + public const string BlockingCollection_CantTakeWhenDone = "BlockingCollection_CantTakeWhenDone"; + public const string BlockingCollection_Completed = "BlockingCollection_Completed"; + public const string BlockingCollection_CopyTo_IncorrectType = "BlockingCollection_CopyTo_IncorrectType"; + public const string BlockingCollection_CopyTo_MultiDim = "BlockingCollection_CopyTo_MultiDim"; + public const string BlockingCollection_CopyTo_NonNegative = "BlockingCollection_CopyTo_NonNegative"; + public const string BlockingCollection_CopyTo_TooManyElems = "BlockingCollection_CopyTo_TooManyElems"; + public const string BlockingCollection_Disposed = "BlockingCollection_Disposed"; + public const string BlockingCollection_Take_CollectionModified = "BlockingCollection_Take_CollectionModified"; + public const string BlockingCollection_TimeoutInvalid = "BlockingCollection_TimeoutInvalid"; + public const string BlockingCollection_ValidateCollectionsArray_DispElems = "BlockingCollection_ValidateCollectionsArray_DispElems"; + public const string BlockingCollection_ValidateCollectionsArray_LargeSize = "BlockingCollection_ValidateCollectionsArray_LargeSize"; + public const string BlockingCollection_ValidateCollectionsArray_NullElems = "BlockingCollection_ValidateCollectionsArray_NullElems"; + public const string BlockingCollection_ValidateCollectionsArray_ZeroSize = "BlockingCollection_ValidateCollectionsArray_ZeroSize"; + public const string BlockingCollection_ctor_BoundedCapacityRange = "BlockingCollection_ctor_BoundedCapacityRange"; + public const string BlockingCollection_ctor_CountMoreThanCapacity = "BlockingCollection_ctor_CountMoreThanCapacity"; + public const string Common_OperationCanceled = "Common_OperationCanceled"; + public const string ConcurrentBag_CopyTo_ArgumentNullException = "ConcurrentBag_CopyTo_ArgumentNullException"; + public const string ConcurrentBag_CopyTo_ArgumentOutOfRangeException = "ConcurrentBag_CopyTo_ArgumentOutOfRangeException"; + public const string ConcurrentBag_Ctor_ArgumentNullException = "ConcurrentBag_Ctor_ArgumentNullException"; + public const string ConcurrentCollection_SyncRoot_NotSupported = "ConcurrentCollection_SyncRoot_NotSupported"; + +} diff --git a/mcs/class/System/System-bare-net_2_0.csproj b/mcs/class/System/System-bare-net_2_0.csproj deleted file mode 100644 index 63b2c425033..00000000000 --- a/mcs/class/System/System-bare-net_2_0.csproj +++ /dev/null @@ -1,1183 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {5459507F-DC25-401C-A2F4-D5ECAC3A34E6} - Library - 1699,618 - ./../../class/lib/net_2_0/bare - True - True - true - Properties - - - System - v2.0 - 512 - - - true - full - 1699,618 - false - DEBUG;TRACE;NET_1_1;NET_2_0;CONFIGURATION_2_0 - prompt - 4 - - - pdbonly - 1699,618 - true - NET_1_1;NET_2_0;CONFIGURATION_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {AAA3F683-244C-40EF-8EF8-A95938862A44} - corlib\corlib-net_2_0 - - - - - - - - Asterisk.wav - - - Beep.wav - - - Exclamation.wav - - - Hand.wav - - - Question.wav - - - - diff --git a/mcs/class/System/System-bare-net_4_5.csproj b/mcs/class/System/System-bare-net_4_5.csproj index 8790db08575..14dca25b829 100644 --- a/mcs/class/System/System-bare-net_4_5.csproj +++ b/mcs/class/System/System-bare-net_4_5.csproj @@ -25,7 +25,7 @@ full 1699,618 false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;CONFIGURATION_2_0 + DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;CONFIGURATION_2_0;MONO;DISABLE_CAS_USE prompt 4 @@ -1060,35 +1060,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1131,7 +1102,35 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {F8FFA803-9D2E-465A-A87D-3F871AD497B6} - System.XML\System.Xml-build - - - False - System.Configuration.dll - False - - - {ACA4A790-62B2-4D59-B96C-CE17F8F6BE58} - System\System-build-1 - - - {B826C748-252D-4C0F-8A6C-C8DADE270C3F} - Mono.Security\Mono.Security-build - - - - - - - - Asterisk.wav - - - Beep.wav - - - Exclamation.wav - - - Hand.wav - - - Question.wav - - - - diff --git a/mcs/class/System/System-net_4_5.csproj b/mcs/class/System/System-net_4_5.csproj index d8abc97e11a..5df88568f80 100644 --- a/mcs/class/System/System-net_4_5.csproj +++ b/mcs/class/System/System-net_4_5.csproj @@ -25,7 +25,7 @@ full 1699,618 false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;CONFIGURATION_2_0;SECURITY_DEP;XML_DEP;CONFIGURATION_DEP + DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;CONFIGURATION_2_0;SECURITY_DEP;XML_DEP;CONFIGURATION_DEP;MONO;DISABLE_CAS_USE prompt 4 @@ -1060,35 +1060,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1131,7 +1102,35 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {68BBE0B0-9B07-4884-BDF2-6410566B5320} - corlib\corlib-net_2_0 - - - {8C65BF8D-256A-44B0-BF9A-8052C075DC31} - System.XML\System.Xml-bare-build - - - {CB8FF352-29A0-4181-8FA6-F912F0B62D34} - System\System-bare-net_2_0 - PrebuiltSystem - - {80E57C4A-0D18-489B-AE2E-E540CEBE0CEE} - Mono.Security\Mono.Security-build - MonoSecurity - - - - - - - Asterisk.wav - - - Beep.wav - - - Exclamation.wav - - - Hand.wav - - - Question.wav - - - - diff --git a/mcs/class/System/System-secxml-net_4_5.csproj b/mcs/class/System/System-secxml-net_4_5.csproj index b13fc18c245..bab7e335af1 100644 --- a/mcs/class/System/System-secxml-net_4_5.csproj +++ b/mcs/class/System/System-secxml-net_4_5.csproj @@ -25,7 +25,7 @@ full 1699,618 false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;CONFIGURATION_2_0;SECURITY_DEP;XML_DEP + DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0;NET_3_5;NET_4_0;NET_4_5;CONFIGURATION_2_0;SECURITY_DEP;XML_DEP;MONO;DISABLE_CAS_USE prompt 4 @@ -1060,35 +1060,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1131,7 +1102,35 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - False - System.Drawing.dll - False - - - {57CFE851-81AC-4269-B24A-965A53D87248} - Mono.Security\Mono.Security-net_2_0 - - - False - System.Data - False - - - {E89F34AB-7AE2-41CA-B891-C8D1C9F02EB8} - System.XML\System.Xml-net_2_0 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - {2695A2F2-2271-423D-8E0D-553DAB84E917} - System.Configuration\System.Configuration-net_2_0 - - - - - - - - test-uri-props.txt - - - test-uri-props-manual.txt - - - test-uri-relative-props.txt - - - - diff --git a/mcs/class/System/System.Diagnostics/Process.cs b/mcs/class/System/System.Diagnostics/Process.cs index 0cf197af1dc..a394dc4fa78 100644 --- a/mcs/class/System/System.Diagnostics/Process.cs +++ b/mcs/class/System/System.Diagnostics/Process.cs @@ -346,23 +346,21 @@ namespace System.Diagnostics { } } - [MonoTODO] [Obsolete ("Use PagedMemorySize64")] [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] [MonitoringDescription ("The number of bytes that are paged.")] public int PagedMemorySize { get { - return(0); + return(int)PagedMemorySize64; } } - [MonoTODO] [Obsolete ("Use PagedSystemMemorySize64")] [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] [MonitoringDescription ("The amount of paged system memory in bytes.")] public int PagedSystemMemorySize { get { - return(0); + return(int)PagedMemorySize64; } } @@ -406,23 +404,22 @@ namespace System.Diagnostics { } } - [MonoTODO] [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] [MonitoringDescription ("The number of bytes that are paged.")] [ComVisible (false)] public long PagedMemorySize64 { get { - return(0); + int error; + return GetProcessData (pid, 12, out error); } } - [MonoTODO] [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] [MonitoringDescription ("The amount of paged system memory in bytes.")] [ComVisible (false)] public long PagedSystemMemorySize64 { get { - return(0); + return PagedMemorySize64; } } @@ -1136,7 +1133,7 @@ namespace System.Diagnostics { // Note that ProcInfo.Password must be freed. private static void FillUserInfo (ProcessStartInfo startInfo, ref ProcInfo proc_info) { - if (startInfo.UserName != null) { + if (startInfo.UserName.Length != 0) { proc_info.UserName = startInfo.UserName; proc_info.Domain = startInfo.Domain; if (startInfo.Password != null) @@ -1150,7 +1147,7 @@ namespace System.Diagnostics { private static bool Start_common (ProcessStartInfo startInfo, Process process) { - if (startInfo.FileName == null || startInfo.FileName.Length == 0) + if (startInfo.FileName.Length == 0) throw new InvalidOperationException("File name has not been set"); if (startInfo.StandardErrorEncoding != null && !startInfo.RedirectStandardError) @@ -1159,7 +1156,7 @@ namespace System.Diagnostics { throw new InvalidOperationException ("StandardOutputEncoding is only supported when standard output is redirected"); if (startInfo.UseShellExecute) { - if (!String.IsNullOrEmpty (startInfo.UserName)) + if (startInfo.UserName.Length != 0) throw new InvalidOperationException ("UseShellExecute must be false if an explicit UserName is specified when starting a process"); return (Start_shell (startInfo, process)); } else { diff --git a/mcs/class/System/System.Diagnostics/ProcessStartInfo.cs b/mcs/class/System/System.Diagnostics/ProcessStartInfo.cs index 1586f613753..24aff2ca684 100644 --- a/mcs/class/System/System.Diagnostics/ProcessStartInfo.cs +++ b/mcs/class/System/System.Diagnostics/ProcessStartInfo.cs @@ -47,11 +47,11 @@ namespace System.Diagnostics public sealed class ProcessStartInfo { /* keep these fields in this order and in sync with metadata/process.h */ - private string arguments = ""; + private string arguments; private IntPtr error_dialog_parent_handle = (IntPtr)0; - private string filename = ""; - private string verb = ""; - private string working_directory = ""; + private string filename; + private string verb; + private string working_directory; private ProcessStringDictionary envVars; private bool create_no_window = false; private bool error_dialog = false; @@ -87,7 +87,7 @@ namespace System.Diagnostics [NotifyParentPropertyAttribute (true)] public string Arguments { get { - return(arguments); + return arguments ?? string.Empty; } set { arguments = value; @@ -155,7 +155,7 @@ namespace System.Diagnostics [NotifyParentPropertyAttribute (true)] public string FileName { get { - return(filename); + return filename ?? string.Empty; } set { filename = value; @@ -187,7 +187,7 @@ namespace System.Diagnostics } [DefaultValue (false)] - [MonitoringDescription ("Standart output of this process is redirected.")] + [MonitoringDescription ("Standard output of this process is redirected.")] [NotifyParentPropertyAttribute (true)] public bool RedirectStandardOutput { get { @@ -226,7 +226,7 @@ namespace System.Diagnostics [NotifyParentPropertyAttribute (true)] public string Verb { get { - return(verb); + return verb ?? string.Empty; } set { verb = value; @@ -238,21 +238,20 @@ namespace System.Diagnostics [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden), Browsable (false)] public string[] Verbs { get { - string ext = filename == null | filename.Length == 0 ? - null : Path.GetExtension (filename); - if (ext == null) - return empty; - #if MOBILE return empty; #else - switch (Environment.OSVersion.Platform) { case (PlatformID)4: case (PlatformID)6: case (PlatformID)128: return empty; // no verb on non-Windows default: + string ext = filename == null | filename.Length == 0 ? + null : Path.GetExtension (filename); + if (ext == null) + return empty; + RegistryKey rk = null, rk2 = null, rk3 = null; try { rk = Registry.ClassesRoot.OpenSubKey (ext); @@ -292,10 +291,10 @@ namespace System.Diagnostics [NotifyParentPropertyAttribute (true)] public string WorkingDirectory { get { - return(working_directory); + return working_directory ?? string.Empty; } set { - working_directory = value == null ? String.Empty : value; + working_directory = value; } } @@ -307,13 +306,13 @@ namespace System.Diagnostics [NotifyParentPropertyAttribute (true)] public string UserName { - get { return username; } + get { return username ?? string.Empty; } set { username = value; } } [NotifyParentPropertyAttribute (true)] public string Domain { - get { return domain; } + get { return domain ?? string.Empty; } set { domain = value; } } diff --git a/mcs/class/System/System.Net/WebClient.cs b/mcs/class/System/System.Net/WebClient.cs index 38415f05c5f..2bd9dee7507 100644 --- a/mcs/class/System/System.Net/WebClient.cs +++ b/mcs/class/System/System.Net/WebClient.cs @@ -315,10 +315,10 @@ namespace System.Net { WebRequest request = null; - using (FileStream f = new FileStream (fileName, FileMode.Create)) { - try { - request = SetupRequest (address); - WebResponse response = GetWebResponse (request); + try { + request = SetupRequest (address); + WebResponse response = GetWebResponse (request); + using (FileStream f = new FileStream (fileName, FileMode.Create)) { Stream st = response.GetResponseStream (); int cLength = (int) response.ContentLength; @@ -337,11 +337,11 @@ namespace System.Net if (cLength > 0 && notify_total < cLength) throw new WebException ("Download aborted prematurely.", WebExceptionStatus.ReceiveFailure); - } catch (ThreadInterruptedException){ - if (request != null) - request.Abort (); - throw; } + } catch (ThreadInterruptedException){ + if (request != null) + request.Abort (); + throw; } } @@ -1713,8 +1713,8 @@ namespace System.Net async Task DownloadFileTaskAsyncCore (WebRequest request, WebResponse response, string fileName, CancellationToken token) { + Stream st = response.GetResponseStream (); using (FileStream f = new FileStream (fileName, FileMode.Create)) { - Stream st = response.GetResponseStream (); int cLength = (int)response.ContentLength; int length = (cLength <= -1 || cLength > 32 * 1024) ? 32 * 1024 : cLength; diff --git a/mcs/class/System/System.Text.RegularExpressions/BaseMachine.cs b/mcs/class/System/System.Text.RegularExpressions/BaseMachine.cs deleted file mode 100644 index 6f588775b49..00000000000 --- a/mcs/class/System/System.Text.RegularExpressions/BaseMachine.cs +++ /dev/null @@ -1,188 +0,0 @@ -// -// BaseMachine.cs -// -// Author: -// author: Dan Lewis (dlewis@gmx.co.uk) -// (c) 2002 -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.Collections.Specialized; -using System.Collections.Generic; - -namespace System.Text.RegularExpressions -{ - abstract class BaseMachine : IMachine - { - internal delegate void MatchAppendEvaluator (Match match, StringBuilder sb); - - public virtual string Replace (Regex regex, string input, string replacement, int count, int startat) - { - ReplacementEvaluator ev = new ReplacementEvaluator (regex, replacement); - if (regex.RightToLeft) - return RTLReplace (regex, input, new MatchEvaluator (ev.Evaluate), count, startat); - else - return LTRReplace (regex, input, new MatchAppendEvaluator (ev.EvaluateAppend), count, startat, ev.NeedsGroupsOrCaptures); - } - - virtual public string [] Split (Regex regex, string input, int count, int startat) - { - var splits = new List (); - if (count == 0) - count = Int32.MaxValue; - - int ptr = startat; - Match m = null; - while (--count > 0) { - if (m != null) - m = m.NextMatch (); - else - m = regex.Match (input, ptr); - - if (!m.Success) - break; - - if (regex.RightToLeft) - splits.Add (input.Substring (m.Index + m.Length, ptr - m.Index - m.Length)); - else - splits.Add (input.Substring (ptr, m.Index - ptr)); - - int gcount = m.Groups.Count; - for (int gindex = 1; gindex < gcount; gindex++) { - Group grp = m.Groups [gindex]; - if (grp.Length > 0) - splits.Add (input.Substring (grp.Index, grp.Length)); - } - - if (regex.RightToLeft) - ptr = m.Index; - else - ptr = m.Index + m.Length; - - } - - if (regex.RightToLeft && ptr >= 0) - splits.Add (input.Substring (0, ptr)); - if (!regex.RightToLeft && ptr <= input.Length) - splits.Add (input.Substring (ptr)); - - return splits.ToArray (); - } - - public Match Scan (Regex regex, string text, int start, int end) - { - return Scan (regex, text, start, end, false); - } - - public abstract Match Scan (Regex regex, string text, int start, int end, bool substring_mode); - - virtual public string Result (string replacement, Match match) - { - return ReplacementEvaluator.Evaluate (replacement, match); - } - - internal string LTRReplace (Regex regex, string input, MatchAppendEvaluator evaluator, int count, int startat) { - return LTRReplace (regex, input, evaluator, count, startat, true); - } - - internal string LTRReplace (Regex regex, string input, MatchAppendEvaluator evaluator, int count, int startat, bool needs_groups_or_captures) - { - this.needs_groups_or_captures = needs_groups_or_captures; - - Match m = Scan (regex, input, startat, input.Length); - if (!m.Success) - return input; - - StringBuilder result = new StringBuilder (input.Length); - int ptr = startat; - int counter = count; - - result.Append (input, 0, ptr); - - do { - if (count != -1) - if (counter-- <= 0) - break; - if (m.Index < ptr) - throw new SystemException ("how"); - result.Append (input, ptr, m.Index - ptr); - evaluator (m, result); - - ptr = m.Index + m.Length; - m = m.NextMatch (); - } while (m.Success); - - result.Append (input, ptr, input.Length - ptr); - - return result.ToString (); - } - - internal string RTLReplace (Regex regex, string input, MatchEvaluator evaluator, int count, int startat) - { - Match m = Scan (regex, input, startat, input.Length); - if (!m.Success) - return input; - - int ptr = startat; - int counter = count; -#if NET_2_1 - var pieces = new System.Collections.Generic.List (); -#else - StringCollection pieces = new StringCollection (); -#endif - - pieces.Add (input.Substring (ptr)); - - do { - if (count != -1) - if (counter-- <= 0) - break; - if (m.Index + m.Length > ptr) - throw new SystemException ("how"); - pieces.Add (input.Substring (m.Index + m.Length, ptr - m.Index - m.Length)); - pieces.Add (evaluator (m)); - - ptr = m.Index; - m = m.NextMatch (); - } while (m.Success); - - StringBuilder result = new StringBuilder (); - - result.Append (input, 0, ptr); - for (int i = pieces.Count; i > 0; ) - result.Append (pieces [--i]); - - pieces.Clear (); - - return result.ToString (); - } - - // Specify whenever Match objects created by this machine need to be fully - // built. If false, these can be omitted, avoiding some memory allocations and - // processing time. - protected bool needs_groups_or_captures = true; - } -} diff --git a/mcs/class/System/System.Text.RegularExpressions/CILCompiler.cs b/mcs/class/System/System.Text.RegularExpressions/CILCompiler.cs deleted file mode 100644 index bebd38bff9f..00000000000 --- a/mcs/class/System/System.Text.RegularExpressions/CILCompiler.cs +++ /dev/null @@ -1,1863 +0,0 @@ -using System; -using System.Collections; -using System.Globalization; -using System.Reflection; -using System.Reflection.Emit; -using System.Threading; - -using System.Collections.Generic; - -namespace System.Text.RegularExpressions { - - // - // Compiler which generates IL bytecode to perform the matching instead of - // interpreting a program. - // For simplicity, we inherit from RxCompiler, and generate the IL code based - // on the program generated by it. This also allows us to fallback to interpretation - // if we can't handle something. - // This is net 2.0, since 1.0 doesn't support DynamicMethods - // FIXME: Add support for 1.0, and CompileToAssembly - // FIXME: Overwrite RxCompiler methods so we don't have to decode char - // matching opcodes - // - - class CILCompiler : RxCompiler, ICompiler { - DynamicMethod[] eval_methods; - bool[] eval_methods_defined; - - /* - * To avoid the overhead of decoding the countless opcode variants created - * by RxCompiler, we save the original, 'generic' version and its flags - * in these two tables. - */ - private Dictionary generic_ops; - private Dictionary op_flags; - private Dictionary labels; - - static FieldInfo fi_str = typeof (RxInterpreter).GetField ("str", BindingFlags.Instance|BindingFlags.NonPublic); - static FieldInfo fi_string_start = typeof (RxInterpreter).GetField ("string_start", BindingFlags.Instance|BindingFlags.NonPublic); - static FieldInfo fi_string_end = typeof (RxInterpreter).GetField ("string_end", BindingFlags.Instance|BindingFlags.NonPublic); - static FieldInfo fi_program = typeof (RxInterpreter).GetField ("program", BindingFlags.Instance|BindingFlags.NonPublic); - static FieldInfo fi_marks = typeof (RxInterpreter).GetField ("marks", BindingFlags.Instance|BindingFlags.NonPublic); - static FieldInfo fi_groups = typeof (RxInterpreter).GetField ("groups", BindingFlags.Instance|BindingFlags.NonPublic); - static FieldInfo fi_deep = typeof (RxInterpreter).GetField ("deep", BindingFlags.Instance|BindingFlags.Public|BindingFlags.NonPublic); - static FieldInfo fi_stack = typeof (RxInterpreter).GetField ("stack", BindingFlags.Instance|BindingFlags.Public|BindingFlags.NonPublic); - static FieldInfo fi_mark_start = typeof (Mark).GetField ("Start", BindingFlags.Instance|BindingFlags.Public|BindingFlags.NonPublic); - static FieldInfo fi_mark_end = typeof (Mark).GetField ("End", BindingFlags.Instance|BindingFlags.Public|BindingFlags.NonPublic); - //static FieldInfo fi_mark_index = typeof (Mark).GetField ("Index", BindingFlags.Instance|BindingFlags.Public|BindingFlags.NonPublic); - - static MethodInfo mi_stack_get_count, mi_stack_set_count, mi_stack_push, mi_stack_pop; - static MethodInfo mi_set_start_of_match, mi_is_word_char, mi_reset_groups; - static MethodInfo mi_checkpoint, mi_backtrack, mi_open, mi_close; - static MethodInfo mi_get_last_defined, mi_mark_get_index, mi_mark_get_length; - - public static readonly bool trace_compile = Environment.GetEnvironmentVariable ("MONO_TRACE_RX_COMPILE") != null; - - public CILCompiler () { - generic_ops = new Dictionary (); - op_flags = new Dictionary (); - } - - IMachineFactory ICompiler.GetMachineFactory () { - byte[] code = new byte [curpos]; - Buffer.BlockCopy (program, 0, code, 0, curpos); - - eval_methods = new DynamicMethod [code.Length]; - eval_methods_defined = new bool [code.Length]; - - // The main eval method - DynamicMethod main = GetEvalMethod (code, 11); - - if (main != null) - return new RxInterpreterFactory (code, (EvalDelegate)main.CreateDelegate (typeof (EvalDelegate))); - else - return new RxInterpreterFactory (code, null); - } - - DynamicMethod GetEvalMethod (byte[] program, int pc) { - if (eval_methods_defined [pc]) - return eval_methods [pc]; - - // FIXME: Recursion ? - eval_methods_defined [pc] = true; - - eval_methods [pc] = CreateEvalMethod (program, pc); - return eval_methods [pc]; - } - - private MethodInfo GetMethod (Type t, string name, ref MethodInfo cached) { - if (cached == null) { - cached = t.GetMethod (name, BindingFlags.Static|BindingFlags.Instance|BindingFlags.Public|BindingFlags.NonPublic); - if (cached == null) - throw new Exception ("Method not found: " + name); - } - return cached; - } - - private MethodInfo GetMethod (string name, ref MethodInfo cached) { - return GetMethod (typeof (RxInterpreter), name, ref cached); - } - - private int ReadInt (byte[] code, int pc) { - int val = code [pc]; - val |= code [pc + 1] << 8; - val |= code [pc + 2] << 16; - val |= code [pc + 3] << 24; - return val; - } - - static OpFlags MakeFlags (bool negate, bool ignore, bool reverse, bool lazy) { - OpFlags flags = 0; - if (negate) flags |= OpFlags.Negate; - if (ignore) flags |= OpFlags.IgnoreCase; - if (reverse) flags |= OpFlags.RightToLeft; - if (lazy) flags |= OpFlags.Lazy; - - return flags; - } - - void EmitGenericOp (RxOp op, bool negate, bool ignore, bool reverse, bool lazy) { - generic_ops [curpos] = (int)op; - op_flags [curpos] = (int)MakeFlags (negate, ignore, reverse, false); - } - - public override void EmitOp (RxOp op, bool negate, bool ignore, bool reverse) { - EmitGenericOp (op, negate, ignore, reverse, false); - base.EmitOp (op, negate, ignore, reverse); - } - - public override void EmitOpIgnoreReverse (RxOp op, bool ignore, bool reverse) { - EmitGenericOp (op, false, ignore, reverse, false); - base.EmitOpIgnoreReverse (op, ignore, reverse); - } - - public override void EmitOpNegateReverse (RxOp op, bool negate, bool reverse) { - EmitGenericOp (op, negate, false, reverse, false); - base.EmitOpNegateReverse (op, negate, reverse); - } - - class Frame { - public Label label_pass, label_fail; - - public Frame (ILGenerator ilgen) { - label_fail = ilgen.DefineLabel (); - label_pass = ilgen.DefineLabel (); - } - } - - LocalBuilder local_textinfo; - - /* - * Create a dynamic method which is equivalent to the RxInterpreter.EvalByteCode - * method specialized to the given program and a given pc. Return the newly - * created method or null if a not-supported opcode was encountered. - */ - DynamicMethod CreateEvalMethod (byte[] program, int pc) { - DynamicMethod m = new DynamicMethod ("Eval_" + pc, typeof (bool), new Type [] { typeof (RxInterpreter), typeof (int), typeof (int).MakeByRefType () }, typeof (RxInterpreter), true); - ILGenerator ilgen = m.GetILGenerator (); - - /* - Args: - interp - 0 - strpos - 1 - strpos_result - 2 - */ - - /* - * Recursive calls to EvalByteCode are inlined manually by calling - * EmitEvalMethodBody with the pc of the recursive call. Frame objects hold - * the information required to link together the code generated by the recursive - * call with the rest of the code. - */ - Frame frame = new Frame (ilgen); - - /* Cache the textinfo used by Char.ToLower () */ - local_textinfo = ilgen.DeclareLocal (typeof (TextInfo)); - ilgen.Emit (OpCodes.Call, typeof (Thread).GetMethod ("get_CurrentThread")); - ilgen.Emit (OpCodes.Call, typeof (Thread).GetMethod ("get_CurrentCulture")); - ilgen.Emit (OpCodes.Call, typeof (CultureInfo).GetMethod ("get_TextInfo")); - ilgen.Emit (OpCodes.Stloc, local_textinfo); - - m = EmitEvalMethodBody (m, ilgen, frame, program, pc, program.Length, false, false, out pc); - if (m == null) - return null; - - ilgen.MarkLabel (frame.label_pass); - ilgen.Emit (OpCodes.Ldarg_2); - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Stind_I4); - ilgen.Emit (OpCodes.Ldc_I4_1); - ilgen.Emit (OpCodes.Ret); - - ilgen.MarkLabel (frame.label_fail); - ilgen.Emit (OpCodes.Ldc_I4_0); - ilgen.Emit (OpCodes.Ret); - - return m; - } - - private int ReadShort (byte[] program, int pc) { - return (int)program [pc] | ((int)program [pc + 1] << 8); - } - - private Label CreateLabelForPC (ILGenerator ilgen, int pc) { - if (labels == null) - labels = new Dictionary (); - Label l; - if (!labels.TryGetValue (pc, out l)) { - l = ilgen.DefineLabel (); - labels [pc] = l; - } - - return l; - } - - private int GetILOffset (ILGenerator ilgen) { - return (int)typeof (ILGenerator).GetField ("code_len", BindingFlags.Instance|BindingFlags.NonPublic).GetValue (ilgen); - } - - /* - * Emit IL code for a sequence of opcodes between pc and end_pc. If there is a - * match, set strpos (Arg 1) to the position after the match, then - * branch to frame.label_pass. Otherwise branch to frame.label_fail, - * and leave strpos at an undefined position. The caller should - * generate code to save the original value of strpos if it needs it. - * If one_op is true, only generate code for one opcode and set out_pc - * to the next pc after the opcode. - * If no_bump is true, don't bump strpos in char matching opcodes. - * Keep this in synch with RxInterpreter.EvalByteCode (). It it is sync with - * the version in r111969. - * FIXME: Modify the regex tests so they are run with RegexOptions.Compiled as - * well. - */ - private DynamicMethod EmitEvalMethodBody (DynamicMethod m, ILGenerator ilgen, - Frame frame, byte[] program, - int pc, int end_pc, - bool one_op, bool no_bump, - out int out_pc) - { - int start, length, end; - - out_pc = 0; - - int group_count = 1 + ReadShort (program, 1); - - while (pc < end_pc) { - RxOp op = (RxOp)program [pc]; - - // FIXME: Optimize this - if (generic_ops.ContainsKey (pc)) - op = (RxOp)generic_ops [pc]; - - if (trace_compile) { - Console.WriteLine ("compiling {0} pc={1} end_pc={2}, il_offset=0x{3:x}", op, pc, end_pc, GetILOffset (ilgen)); - } - - if (labels != null) { - Label l; - if (labels.TryGetValue (pc, out l)) { - ilgen.MarkLabel (l); - labels.Remove (pc); - } - } - - if (RxInterpreter.trace_rx) { - //Console.WriteLine ("evaluating: {0} at pc: {1}, strpos: {2}", op, pc, strpos); - ilgen.Emit (OpCodes.Ldstr, "evaluating: {0} at pc: {1}, strpos: {2}"); - ilgen.Emit (OpCodes.Ldc_I4, (int)op); - ilgen.Emit (OpCodes.Box, typeof (RxOp)); - ilgen.Emit (OpCodes.Ldc_I4, pc); - ilgen.Emit (OpCodes.Box, typeof (int)); - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Box, typeof (int)); - ilgen.Emit (OpCodes.Call, typeof (Console).GetMethod ("WriteLine", new Type [] { typeof (string), typeof (object), typeof (object), typeof (object) })); - } - - switch (op) { - case RxOp.Anchor: - case RxOp.AnchorReverse: { - bool reverse = (RxOp)program [pc] == RxOp.AnchorReverse; - length = ReadShort (program, pc + 3); - pc += ReadShort (program, pc + 1); - - // Optimize some common cases by inlining the code generated for the - // anchor body - RxOp anch_op = (RxOp)program [pc]; - - // FIXME: Do this even if the archor op is not the last in the regex - if (!reverse && group_count == 1 && anch_op == RxOp.Char && (RxOp)program [pc + 2] == RxOp.True) { - - /* - * while (strpos < string_end) { - * if (str [strpos] == program [pc + 1]) { - * match_start = strpos; - * strpos_result = strpos + 1; - * marks [groups [0]].Start = strpos; - * if (groups.Length > 1) - * marks [groups [0]].End = res; - * return true; - * } - * strpos ++; - * } - * return false; - */ - // Add some locals to avoid an indirection - LocalBuilder local_string_end = ilgen.DeclareLocal (typeof (int)); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_string_end); - ilgen.Emit (OpCodes.Stloc, local_string_end); - LocalBuilder local_str = ilgen.DeclareLocal (typeof (string)); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_str); - ilgen.Emit (OpCodes.Stloc, local_str); - - //while (strpos < string_end) { - // -> Done at the end of the loop like mcs does - Label l1 = ilgen.DefineLabel (); - Label l2 = ilgen.DefineLabel (); - ilgen.Emit (OpCodes.Br, l2); - ilgen.MarkLabel (l1); - - // if (str [strpos] == program [pc + 1]) { - Label l3 = ilgen.DefineLabel (); - ilgen.Emit (OpCodes.Ldloc, local_str); - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Callvirt, typeof (string).GetMethod ("get_Chars")); - ilgen.Emit (OpCodes.Conv_I4); - ilgen.Emit (OpCodes.Ldc_I4, (int)program [pc + 1]); - ilgen.Emit (OpCodes.Beq, l3); - - // The true case is done after the loop - - // } - // strpos++; - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldc_I4_1); - ilgen.Emit (OpCodes.Add); - ilgen.Emit (OpCodes.Starg, 1); - //} - ilgen.MarkLabel (l2); - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldloc, local_string_end); - ilgen.Emit (OpCodes.Blt, l1); - - //return false; - ilgen.Emit (OpCodes.Br, frame.label_fail); - - // True case - ilgen.MarkLabel (l3); - // call SetStartOfMatch (strpos) - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Call, GetMethod (typeof (RxInterpreter), "SetStartOfMatch", ref mi_set_start_of_match)); - // strpos++; - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldc_I4_1); - ilgen.Emit (OpCodes.Add); - ilgen.Emit (OpCodes.Starg, 1); - // return true; - ilgen.Emit (OpCodes.Br, frame.label_pass); - - } else { - // General case - - //Console.WriteLine ("Anchor op " + anch_op); - - // Add some locals to avoid an indirection - LocalBuilder local_string_end = ilgen.DeclareLocal (typeof (int)); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_string_end); - ilgen.Emit (OpCodes.Ldc_I4_1); - ilgen.Emit (OpCodes.Add); - ilgen.Emit (OpCodes.Stloc, local_string_end); - - //while (strpos < string_end + 1) { - // -> Done at the end of the loop like mcs does - Label l1 = ilgen.DefineLabel (); - Label l2 = ilgen.DefineLabel (); - ilgen.Emit (OpCodes.Br, l2); - ilgen.MarkLabel (l1); - - //if (groups.Length > 1) { - // ResetGroups (); - // marks [groups [0]].Start = strpos; - //} - if (group_count > 1) { - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Call, GetMethod ("ResetGroups", ref mi_reset_groups)); - - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_marks); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_groups); - ilgen.Emit (OpCodes.Ldc_I4_0); - ilgen.Emit (OpCodes.Ldelem_I4); - ilgen.Emit (OpCodes.Ldelema, typeof (Mark)); - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Stfld, fi_mark_start); - } - - // if (EvalByteCode (pc, strpos, ref res)) { - - Frame new_frame = new Frame (ilgen); - - // old_stros = strpos; - LocalBuilder local_old_strpos = ilgen.DeclareLocal (typeof (int)); - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Stloc, local_old_strpos); - - m = EmitEvalMethodBody (m, ilgen, new_frame, program, pc, end_pc, false, false, out out_pc); - if (m == null) - return null; - - // Pass - ilgen.MarkLabel (new_frame.label_pass); - // marks [groups [0]].Start = old_strpos; - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_marks); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_groups); - ilgen.Emit (OpCodes.Ldc_I4_0); - ilgen.Emit (OpCodes.Ldelem_I4); - ilgen.Emit (OpCodes.Ldelema, typeof (Mark)); - ilgen.Emit (OpCodes.Ldloc, local_old_strpos); - ilgen.Emit (OpCodes.Stfld, fi_mark_start); - // if (groups.Length > 1) - // marks [groups [0]].End = res; - if (group_count > 1) { - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_marks); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_groups); - ilgen.Emit (OpCodes.Ldc_I4_0); - ilgen.Emit (OpCodes.Ldelem_I4); - ilgen.Emit (OpCodes.Ldelema, typeof (Mark)); - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Stfld, fi_mark_end); - } - - // return true; - ilgen.Emit (OpCodes.Br, frame.label_pass); - - // Fail - ilgen.MarkLabel (new_frame.label_fail); - // strpos = old_strpos +/- 1; - ilgen.Emit (OpCodes.Ldloc, local_old_strpos); - ilgen.Emit (OpCodes.Ldc_I4_1); - if (reverse) - ilgen.Emit (OpCodes.Sub); - else - ilgen.Emit (OpCodes.Add); - ilgen.Emit (OpCodes.Starg, 1); - //} - ilgen.MarkLabel (l2); - if (reverse) { - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldc_I4_0); - ilgen.Emit (OpCodes.Bge, l1); - } else { - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldloc, local_string_end); - ilgen.Emit (OpCodes.Blt, l1); - } - //return false; - ilgen.Emit (OpCodes.Br, frame.label_fail); - } - - goto End; - } - case RxOp.Branch: { - //if (EvalByteCode (pc + 3, strpos, ref res)) { - - int target_pc = pc + ReadShort (program, pc + 1); - - // Emit the rest of the code inline instead of making a recursive call - Frame new_frame = new Frame (ilgen); - - // old_strpos = strpos; - LocalBuilder local_old_strpos = ilgen.DeclareLocal (typeof (int)); - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Stloc, local_old_strpos); - - m = EmitEvalMethodBody (m, ilgen, new_frame, program, pc + 3, target_pc, false, false, out out_pc); - if (m == null) - return null; - - // Pass - ilgen.MarkLabel (new_frame.label_pass); - // return true; - ilgen.Emit (OpCodes.Br, frame.label_pass); - - // Fail - ilgen.MarkLabel (new_frame.label_fail); - // strpos = old_strpos; - ilgen.Emit (OpCodes.Ldloc, local_old_strpos); - ilgen.Emit (OpCodes.Starg, 1); - - pc = target_pc; - break; - } - case RxOp.Char: - case RxOp.UnicodeChar: - case RxOp.Range: - case RxOp.UnicodeRange: { - OpFlags flags = (OpFlags)op_flags [pc]; - bool negate = (flags & OpFlags.Negate) > 0; - bool ignore = (flags & OpFlags.IgnoreCase) > 0; - bool reverse = (flags & OpFlags.RightToLeft) > 0; - - //if (strpos < string_end) { - Label l1 = ilgen.DefineLabel (); - if (reverse) { - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldc_I4_0); - ilgen.Emit (OpCodes.Ble, l1); - } else { - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_string_end); - ilgen.Emit (OpCodes.Bge, l1); - } - - if (ignore) - ilgen.Emit (OpCodes.Ldloc, local_textinfo); - - // int c = str [strpos]; - LocalBuilder local_c = ilgen.DeclareLocal (typeof (char)); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_str); - ilgen.Emit (OpCodes.Ldarg_1); - if (reverse) { - ilgen.Emit (OpCodes.Ldc_I4_1); - ilgen.Emit (OpCodes.Sub); - } - ilgen.Emit (OpCodes.Callvirt, typeof (string).GetMethod ("get_Chars")); - if (ignore) - ilgen.Emit (OpCodes.Callvirt, typeof (TextInfo).GetMethod ("ToLower", new Type [] { typeof (char) })); - - if (op == RxOp.Char) { - ilgen.Emit (OpCodes.Conv_I4); - ilgen.Emit (OpCodes.Ldc_I4, (int)program [pc + 1]); - ilgen.Emit (negate ? OpCodes.Beq : OpCodes.Bne_Un, l1); - - pc += 2; - } else if (op == RxOp.UnicodeChar) { - ilgen.Emit (OpCodes.Conv_I4); - ilgen.Emit (OpCodes.Ldc_I4, ReadShort (program, pc + 1)); - ilgen.Emit (negate ? OpCodes.Beq : OpCodes.Bne_Un, l1); - - pc += 3; - } else if (op == RxOp.Range) { - ilgen.Emit (OpCodes.Stloc, local_c); - - // if (c >= program [pc + 1] && c <= program [pc + 2]) { - if (negate) { - Label l3 = ilgen.DefineLabel (); - - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Ldc_I4, (int)program [pc + 1]); - ilgen.Emit (OpCodes.Blt, l3); - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Ldc_I4, (int)program [pc + 2]); - ilgen.Emit (OpCodes.Bgt, l3); - ilgen.Emit (OpCodes.Br, l1); - ilgen.MarkLabel (l3); - } else { - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Ldc_I4, (int)program [pc + 1]); - ilgen.Emit (OpCodes.Blt, l1); - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Ldc_I4, (int)program [pc + 2]); - ilgen.Emit (OpCodes.Bgt, l1); - } - - pc += 3; - } else if (op == RxOp.UnicodeRange) { - ilgen.Emit (OpCodes.Stloc, local_c); - - // if (c >= program [pc + 1] && c <= program [pc + 2]) { - if (negate) { - Label l3 = ilgen.DefineLabel (); - - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Ldc_I4, ReadShort (program, pc + 1)); - ilgen.Emit (OpCodes.Blt, l3); - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Ldc_I4, ReadShort (program, pc + 3)); - ilgen.Emit (OpCodes.Bgt, l3); - ilgen.Emit (OpCodes.Br, l1); - ilgen.MarkLabel (l3); - } else { - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Ldc_I4, ReadShort (program, pc + 1)); - ilgen.Emit (OpCodes.Blt, l1); - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Ldc_I4, ReadShort (program, pc + 3)); - ilgen.Emit (OpCodes.Bgt, l1); - } - - pc += 5; - } else { - throw new NotSupportedException (); - } - - //ilgen.EmitWriteLine ("HIT:" + (char)program [pc + 1]); - if (!no_bump) { - // strpos++ / strpos--; - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldc_I4_1); - if (reverse) - ilgen.Emit (OpCodes.Sub); - else - ilgen.Emit (OpCodes.Add); - ilgen.Emit (OpCodes.Starg, 1); - } - Label l2 = ilgen.DefineLabel (); - ilgen.Emit (OpCodes.Br, l2); - //} - ilgen.MarkLabel (l1); - //return false; - ilgen.Emit (OpCodes.Br, frame.label_fail); - ilgen.MarkLabel (l2); - - break; - } - case RxOp.True: { - // return true; - ilgen.Emit (OpCodes.Br, frame.label_pass); - pc++; - break; - } - case RxOp.False: { - // return false; - ilgen.Emit (OpCodes.Br, frame.label_fail); - pc++; - break; - } - case RxOp.AnyPosition: { - pc++; - break; - } - case RxOp.StartOfString: { - //if (strpos != 0) - // return false; - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldc_I4_0); - ilgen.Emit (OpCodes.Bgt, frame.label_fail); - pc++; - break; - } - case RxOp.StartOfLine: { - // FIXME: windows line endings - //if (!(strpos == 0 || str [strpos - 1] == '\n')) - // return false; - Label l = ilgen.DefineLabel (); - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldc_I4_0); - ilgen.Emit (OpCodes.Beq, l); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_str); - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldc_I4_1); - ilgen.Emit (OpCodes.Sub); - ilgen.Emit (OpCodes.Callvirt, typeof (string).GetMethod ("get_Chars")); - ilgen.Emit (OpCodes.Ldc_I4, (int)'\n'); - ilgen.Emit (OpCodes.Beq, l); - ilgen.Emit (OpCodes.Br, frame.label_fail); - ilgen.MarkLabel (l); - - pc++; - break; - } - case RxOp.StartOfScan: { - //if (strpos != string_start) - // return false; - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_string_start); - ilgen.Emit (OpCodes.Bne_Un, frame.label_fail); - pc++; - break; - } - case RxOp.End: { - //if (!(strpos == string_end || (strpos == string_end - 1 && str [strpos] == '\n'))) - // return false; - Label l = ilgen.DefineLabel (); - - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_string_end); - ilgen.Emit (OpCodes.Beq, l); - - Label l2 = ilgen.DefineLabel (); - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_string_end); - ilgen.Emit (OpCodes.Ldc_I4_1); - ilgen.Emit (OpCodes.Sub); - ilgen.Emit (OpCodes.Bne_Un, l2); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_str); - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Callvirt, typeof (string).GetMethod ("get_Chars")); - ilgen.Emit (OpCodes.Ldc_I4, (int)'\n'); - ilgen.Emit (OpCodes.Bne_Un, l2); - ilgen.Emit (OpCodes.Br, l); - ilgen.MarkLabel (l2); - - ilgen.Emit (OpCodes.Br, frame.label_fail); - ilgen.MarkLabel (l); - - pc++; - break; - } - case RxOp.EndOfString: { - //if (strpos != string_end) - // return false; - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_string_end); - ilgen.Emit (OpCodes.Bne_Un, frame.label_fail); - pc++; - break; - } - case RxOp.EndOfLine: { - //if (!(strpos == string_end || str [strpos] == '\n')) - // return false; - Label l_match = ilgen.DefineLabel (); - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_string_end); - ilgen.Emit (OpCodes.Beq, l_match); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_str); - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Callvirt, typeof (string).GetMethod ("get_Chars")); - ilgen.Emit (OpCodes.Ldc_I4, (int)'\n'); - ilgen.Emit (OpCodes.Beq, l_match); - ilgen.Emit (OpCodes.Br, frame.label_fail); - ilgen.MarkLabel (l_match); - - pc++; - break; - } - case RxOp.WordBoundary: - case RxOp.NoWordBoundary: { - bool negate = op == RxOp.NoWordBoundary; - - //if (string_end == 0) - // return false; - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_string_end); - ilgen.Emit (OpCodes.Ldc_I4_0); - ilgen.Emit (OpCodes.Beq, frame.label_fail); - - Label l_match = ilgen.DefineLabel (); - - //if (strpos == 0) { - Label l1 = ilgen.DefineLabel (); - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldc_I4_0); - ilgen.Emit (OpCodes.Bne_Un, l1); - //if (!IsWordChar (str [strpos])) { - // return false; - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_str); - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Callvirt, typeof (string).GetMethod ("get_Chars")); - ilgen.Emit (OpCodes.Call, GetMethod ("IsWordChar", ref mi_is_word_char)); - ilgen.Emit (negate ? OpCodes.Brtrue : OpCodes.Brfalse, frame.label_fail); - ilgen.Emit (OpCodes.Br, l_match); - - //} else if (strpos == string_end) { - ilgen.MarkLabel (l1); - Label l2 = ilgen.DefineLabel (); - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_string_end); - ilgen.Emit (OpCodes.Bne_Un, l2); - //if (!IsWordChar (str [strpos - 1])) { - // return false; - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_str); - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldc_I4_1); - ilgen.Emit (OpCodes.Sub); - ilgen.Emit (OpCodes.Callvirt, typeof (string).GetMethod ("get_Chars")); - ilgen.Emit (OpCodes.Call, GetMethod ("IsWordChar", ref mi_is_word_char)); - ilgen.Emit (negate ? OpCodes.Brtrue : OpCodes.Brfalse, frame.label_fail); - ilgen.Emit (OpCodes.Br, l_match); - - //} else { - ilgen.MarkLabel (l2); - //if (IsWordChar (str [strpos]) == IsWordChar (str [strpos - 1])) { - // return false; - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_str); - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Callvirt, typeof (string).GetMethod ("get_Chars")); - ilgen.Emit (OpCodes.Call, GetMethod ("IsWordChar", ref mi_is_word_char)); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_str); - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldc_I4_1); - ilgen.Emit (OpCodes.Sub); - ilgen.Emit (OpCodes.Callvirt, typeof (string).GetMethod ("get_Chars")); - ilgen.Emit (OpCodes.Call, GetMethod ("IsWordChar", ref mi_is_word_char)); - ilgen.Emit (negate ? OpCodes.Bne_Un : OpCodes.Beq, frame.label_fail); - ilgen.Emit (OpCodes.Br, l_match); - - ilgen.MarkLabel (l_match); - - pc++; - break; - } - case RxOp.Bitmap: - case RxOp.UnicodeBitmap: { - OpFlags flags = (OpFlags)op_flags [pc]; - bool negate = (flags & OpFlags.Negate) > 0; - bool ignore = (flags & OpFlags.IgnoreCase) > 0; - bool reverse = (flags & OpFlags.RightToLeft) > 0; - bool unicode = (op == RxOp.UnicodeBitmap); - - //if (strpos < string_end) { - Label l1 = ilgen.DefineLabel (); - Label l2 = ilgen.DefineLabel (); - Label l_match = ilgen.DefineLabel (); - if (reverse) { - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldc_I4_0); - ilgen.Emit (OpCodes.Ble, l1); - } else { - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_string_end); - ilgen.Emit (OpCodes.Bge, l1); - } - // int c = str [strpos]; - LocalBuilder local_c = ilgen.DeclareLocal (typeof (int)); - if (ignore) - ilgen.Emit (OpCodes.Ldloc, local_textinfo); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_str); - ilgen.Emit (OpCodes.Ldarg_1); - if (reverse) { - ilgen.Emit (OpCodes.Ldc_I4_1); - ilgen.Emit (OpCodes.Sub); - } - ilgen.Emit (OpCodes.Callvirt, typeof (string).GetMethod ("get_Chars")); - ilgen.Emit (OpCodes.Conv_I4); - if (ignore) - ilgen.Emit (OpCodes.Callvirt, typeof (TextInfo).GetMethod ("ToLower", new Type [] { typeof (char) })); - // c -= program [pc + 1]; - if (unicode) { - ilgen.Emit (OpCodes.Ldc_I4, ReadShort (program, pc + 1)); - ilgen.Emit (OpCodes.Sub); - ilgen.Emit (OpCodes.Stloc, local_c); - length = ReadShort (program, pc + 3); - pc += 5; - } else { - ilgen.Emit (OpCodes.Ldc_I4, (int)program [pc + 1]); - ilgen.Emit (OpCodes.Sub); - ilgen.Emit (OpCodes.Stloc, local_c); - length = program [pc + 2]; - pc += 3; - } - // if (c < 0 || c >= (length << 3)) - // return false; - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Ldc_I4_0); - ilgen.Emit (OpCodes.Blt, negate ? l_match : frame.label_fail); - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Ldc_I4, length << 3); - ilgen.Emit (OpCodes.Bge, negate ? l_match : frame.label_fail); - - // Optimized version for small bitmaps - if (length <= 4) { - uint bitmap = program [pc]; - - if (length > 1) - bitmap |= ((uint)program [pc + 1] << 8); - if (length > 2) - bitmap |= ((uint)program [pc + 2] << 16); - if (length > 3) - bitmap |= ((uint)program [pc + 3] << 24); - - //if ((bitmap >> c) & 1) - ilgen.Emit (OpCodes.Ldc_I4, bitmap); - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Shr_Un); - ilgen.Emit (OpCodes.Ldc_I4_1); - ilgen.Emit (OpCodes.And); - ilgen.Emit (negate ? OpCodes.Brtrue : OpCodes.Brfalse, l1); - } else { - // if ((program [pc + (c >> 3)] & (1 << (c & 0x7))) != 0) { - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_program); - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Ldc_I4_3); - ilgen.Emit (OpCodes.Shr); - ilgen.Emit (OpCodes.Ldc_I4, pc); - ilgen.Emit (OpCodes.Add); - ilgen.Emit (OpCodes.Ldelem_I1); - ilgen.Emit (OpCodes.Ldc_I4_1); - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Ldc_I4, 7); - ilgen.Emit (OpCodes.And); - ilgen.Emit (OpCodes.Shl); - ilgen.Emit (OpCodes.And); - ilgen.Emit (OpCodes.Ldc_I4_0); - ilgen.Emit (negate ? OpCodes.Bne_Un : OpCodes.Beq, l1); - } - ilgen.MarkLabel (l_match); - if (!no_bump) { - // strpos++ / strpos--; - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldc_I4_1); - if (reverse) - ilgen.Emit (OpCodes.Sub); - else - ilgen.Emit (OpCodes.Add); - ilgen.Emit (OpCodes.Starg, 1); - } - // continue; - ilgen.Emit (OpCodes.Br, l2); - // } - //} - //return false; - ilgen.MarkLabel (l1); - ilgen.Emit (OpCodes.Br, frame.label_fail); - - ilgen.MarkLabel (l2); - - pc += length; - break; - } - case RxOp.String: - case RxOp.UnicodeString: { - OpFlags flags = (OpFlags)op_flags [pc]; - bool ignore = (flags & OpFlags.IgnoreCase) > 0; - bool reverse = (flags & OpFlags.RightToLeft) > 0; - bool unicode = (op == RxOp.UnicodeString); - - if (unicode) { - start = pc + 3; - length = ReadShort (program, pc + 1); - } else { - start = pc + 2; - length = program [pc + 1]; - } - //if (strpos + length > string_end) - // return false; - if (reverse) { - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldc_I4, length); - ilgen.Emit (OpCodes.Blt, frame.label_fail); - } else { - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldc_I4, length); - ilgen.Emit (OpCodes.Add); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_string_end); - ilgen.Emit (OpCodes.Bgt, frame.label_fail); - } - - /* Avoid unsafe code in Moonlight build */ -#if false && !NET_2_1 - // FIXME: - if (reverse || unicode) - throw new NotImplementedException (); - int i; - LocalBuilder local_strptr = ilgen.DeclareLocal (typeof (char).MakePointerType ()); - // char *strptr = &str.start_char + strpos - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_str); - ilgen.Emit (OpCodes.Ldflda, typeof (String).GetField ("start_char", BindingFlags.Instance|BindingFlags.NonPublic)); - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldc_I4_1); - ilgen.Emit (OpCodes.Shl); - ilgen.Emit (OpCodes.Add); - ilgen.Emit (OpCodes.Stloc, local_strptr); - - end = start + length; - for (i = 0; i < length; ++i) { - // if (*(strptr + i) != program [start + i]) - // return false; - if (ignore) - ilgen.Emit (OpCodes.Ldloc, local_textinfo); - ilgen.Emit (OpCodes.Ldloc, local_strptr); - ilgen.Emit (OpCodes.Ldc_I4, i * 2); - ilgen.Emit (OpCodes.Add); - ilgen.Emit (OpCodes.Ldind_I2); - if (ignore) - ilgen.Emit (OpCodes.Callvirt, typeof (TextInfo).GetMethod ("ToLower", new Type [] { typeof (char) })); - ilgen.Emit (OpCodes.Ldc_I4, (int)program [start + i]); - ilgen.Emit (OpCodes.Bne_Un, frame.label_fail); - } - - // strpos += length - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldc_I4, length); - ilgen.Emit (OpCodes.Add); - ilgen.Emit (OpCodes.Starg, 1); - -#else - // Allocate a local for 'str' to save an indirection - LocalBuilder local_str = ilgen.DeclareLocal (typeof (string)); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_str); - ilgen.Emit (OpCodes.Stloc, local_str); - - if (reverse) { - // strpos -= length; - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldc_I4, length); - ilgen.Emit (OpCodes.Sub); - ilgen.Emit (OpCodes.Starg, 1); - } - - // FIXME: Emit a loop for long strings - end = start + (unicode ? length * 2 : length); - while (start < end) { - //if (str [strpos] != program [start]) - // return false; - if (ignore) - ilgen.Emit (OpCodes.Ldloc, local_textinfo); - ilgen.Emit (OpCodes.Ldloc, local_str); - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Callvirt, typeof (string).GetMethod ("get_Chars")); - if (ignore) - ilgen.Emit (OpCodes.Callvirt, typeof (TextInfo).GetMethod ("ToLower", new Type [] { typeof (char) })); - ilgen.Emit (OpCodes.Ldc_I4, unicode ? ReadShort (program, start) : (int)program [start]); - ilgen.Emit (OpCodes.Bne_Un, frame.label_fail); - //strpos++; - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldc_I4_1); - ilgen.Emit (OpCodes.Add); - ilgen.Emit (OpCodes.Starg, 1); - - if (unicode) - start += 2; - else - start ++; - } - - if (reverse) { - // strpos -= length; - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldc_I4, length); - ilgen.Emit (OpCodes.Sub); - ilgen.Emit (OpCodes.Starg, 1); - } -#endif - - pc = end; - break; - } - case RxOp.OpenGroup: { - //Open (program [pc + 1] | (program [pc + 2] << 8), strpos); - int group_id = ReadShort (program, pc + 1); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldc_I4, group_id); - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Call, GetMethod ("Open", ref mi_open)); - - pc += 3; - break; - } - case RxOp.CloseGroup: { - //Close (program [pc + 1] | (program [pc + 2] << 8), strpos); - int group_id = ReadShort (program, pc + 1); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldc_I4, group_id); - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Call, GetMethod ("Close", ref mi_close)); - - pc += 3; - break; - } - case RxOp.Jump: { - int target_pc = pc + ReadShort (program, pc + 1); - if (target_pc > end_pc) - /* - * This breaks the our code generation logic, see - * https://bugzilla.novell.com/show_bug.cgi?id=466151 - * for an example. - */ - return null; - if (trace_compile) - Console.WriteLine ("\tjump target: {0}", target_pc); - if (labels == null) - labels = new Dictionary (); - Label l = CreateLabelForPC (ilgen, target_pc); - ilgen.Emit (OpCodes.Br, l); - pc += 3; - break; - } - case RxOp.Test: { - int target1 = pc + ReadShort (program, pc + 1); - int target2 = pc + ReadShort (program, pc + 3); - - if (trace_compile) - Console.WriteLine ("\temitting "); - - // old_stros = strpos; - LocalBuilder local_old_strpos = ilgen.DeclareLocal (typeof (int)); - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Stloc, local_old_strpos); - - Frame new_frame = new Frame (ilgen); - m = EmitEvalMethodBody (m, ilgen, new_frame, program, pc + 5, target1 < target2 ? target1 : target2, false, false, out pc); - if (m == null) - return null; - - if (trace_compile) { - Console.WriteLine ("\temitted "); - Console.WriteLine ("\ttarget1 = {0}", target1); - Console.WriteLine ("\ttarget2 = {0}", target2); - } - - Label l1 = CreateLabelForPC (ilgen, target1); - Label l2 = CreateLabelForPC (ilgen, target2); - - // Pass - ilgen.MarkLabel (new_frame.label_pass); - // strpos = old_strpos; - ilgen.Emit (OpCodes.Ldloc, local_old_strpos); - ilgen.Emit (OpCodes.Starg, 1); - ilgen.Emit (OpCodes.Br, l1); - - // Fail - ilgen.MarkLabel (new_frame.label_fail); - // strpos = old_strpos; - ilgen.Emit (OpCodes.Ldloc, local_old_strpos); - ilgen.Emit (OpCodes.Starg, 1); - ilgen.Emit (OpCodes.Br, l2); - - // Continue at pc, which should equal to target1 - break; - } - case RxOp.SubExpression: { - int target = pc + ReadShort (program, pc + 1); - - if (trace_compile) - Console.WriteLine ("\temitting "); - - // old_stros = strpos; - LocalBuilder local_old_strpos = ilgen.DeclareLocal (typeof (int)); - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Stloc, local_old_strpos); - - Frame new_frame = new Frame (ilgen); - m = EmitEvalMethodBody (m, ilgen, new_frame, program, pc + 3, target, false, false, out pc); - if (m == null) - return null; - - if (trace_compile) { - Console.WriteLine ("\temitted "); - Console.WriteLine ("\ttarget = {0}", target); - } - - Label l1 = CreateLabelForPC (ilgen, target); - - // Pass - ilgen.MarkLabel (new_frame.label_pass); - ilgen.Emit (OpCodes.Br, l1); - - // Fail - ilgen.MarkLabel (new_frame.label_fail); - // strpos = old_strpos; - ilgen.Emit (OpCodes.Ldloc, local_old_strpos); - ilgen.Emit (OpCodes.Starg, 1); - ilgen.Emit (OpCodes.Br, frame.label_fail); - - // Continue at pc, which should equal to target - break; - } - case RxOp.TestCharGroup: { - int char_group_end = pc + ReadShort (program, pc + 1); - pc += 3; - - Label label_match = ilgen.DefineLabel (); - - /* Determine the negate/reverse flags by examining the first op */ - OpFlags flags = (OpFlags)op_flags [pc]; - - /* Determine whenever this is a negated character class */ - /* If it is, then the conditions are ANDed together, not ORed */ - bool revert = (flags & OpFlags.Negate) > 0; - bool reverse = (flags & OpFlags.RightToLeft) > 0; - - /* - * Generate code for all the matching ops in the group - */ - while (pc < char_group_end) { - Frame new_frame = new Frame (ilgen); - m = EmitEvalMethodBody (m, ilgen, new_frame, program, pc, Int32.MaxValue, true, true, out pc); - if (m == null) - return null; - - if (!revert) { - // Pass - ilgen.MarkLabel (new_frame.label_pass); - ilgen.Emit (OpCodes.Br, label_match); - - // Fail - // Just fall through to the next test - ilgen.MarkLabel (new_frame.label_fail); - } else { - // Pass - // Just fall through to the next test - ilgen.MarkLabel (new_frame.label_pass); - Label l2 = ilgen.DefineLabel (); - ilgen.Emit (OpCodes.Br, l2); - - // Fail - // Fail completely - ilgen.MarkLabel (new_frame.label_fail); - ilgen.Emit (OpCodes.Br, frame.label_fail); - - ilgen.MarkLabel (l2); - } - } - - if (revert) { - /* Success */ - ilgen.Emit (OpCodes.Br, label_match); - } else { - // If we reached here, all the matching ops have failed - ilgen.Emit (OpCodes.Br, frame.label_fail); - } - - ilgen.MarkLabel (label_match); - - // strpos++ / strpos--; - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldc_I4_1); - if (reverse) - ilgen.Emit (OpCodes.Sub); - else - ilgen.Emit (OpCodes.Add); - ilgen.Emit (OpCodes.Starg, 1); - - break; - } - case RxOp.FastRepeat: - case RxOp.FastRepeatLazy: { - /* - * A FastRepeat is a simplified version of Repeat which does - * not contain another repeat inside, so backtracking is - * easier. - * FIXME: Implement faster backtracking versions for - * simple inner exceptions like chars/strings. - */ - bool lazy = program [pc] == (byte)RxOp.FastRepeatLazy; - int tail = pc + ReadShort (program, pc + 1); - start = ReadInt (program, pc + 3); - end = ReadInt (program, pc + 7); - //Console.WriteLine ("min: {0}, max: {1} tail: {2}", start, end, tail); - - // deep = null; - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldnull); - ilgen.Emit (OpCodes.Stfld, fi_deep); - - LocalBuilder local_length = ilgen.DeclareLocal (typeof (int)); - - ilgen.Emit (OpCodes.Ldc_I4_0); - ilgen.Emit (OpCodes.Stloc, local_length); - - LocalBuilder local_old_strpos = ilgen.DeclareLocal (typeof (int)); - - // First match at least 'start' items - if (start > 0) { - //for (length = 0; length < start; ++length) { - Label l_loop_footer = ilgen.DefineLabel (); - ilgen.Emit (OpCodes.Br, l_loop_footer); - Label l_loop_body = ilgen.DefineLabel (); - ilgen.MarkLabel (l_loop_body); - - // int old_strpos = strpos; - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Stloc, local_old_strpos); - - // if (!EvalByteCode (pc + 11, strpos, ref res)) - Frame new_frame = new Frame (ilgen); - m = EmitEvalMethodBody (m, ilgen, new_frame, program, pc + 11, tail, false, false, out out_pc); - if (m == null) - return null; - - // Fail - // return false; - ilgen.MarkLabel (new_frame.label_fail); - ilgen.Emit (OpCodes.Br, frame.label_fail); - - // Pass - ilgen.MarkLabel (new_frame.label_pass); - // length++ - ilgen.Emit (OpCodes.Ldloc, local_length); - ilgen.Emit (OpCodes.Ldc_I4_1); - ilgen.Emit (OpCodes.Add); - ilgen.Emit (OpCodes.Stloc, local_length); - // Loop footer - ilgen.MarkLabel (l_loop_footer); - ilgen.Emit (OpCodes.Ldloc, local_length); - ilgen.Emit (OpCodes.Ldc_I4, start); - ilgen.Emit (OpCodes.Blt, l_loop_body); - } - - if (lazy) { - Label l_loop_footer = ilgen.DefineLabel (); - //while (true) { - ilgen.Emit (OpCodes.Br, l_loop_footer); - Label l_loop_body = ilgen.DefineLabel (); - ilgen.MarkLabel (l_loop_body); - // Match the tail - // int cp = Checkpoint (); - LocalBuilder local_cp = ilgen.DeclareLocal (typeof (int)); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Call, GetMethod ("Checkpoint", ref mi_checkpoint)); - ilgen.Emit (OpCodes.Stloc, local_cp); - - // int old_strpos = strpos; - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Stloc, local_old_strpos); - - // if (EvalByteCode (tail, strpos, ref res)) { - Frame new_frame = new Frame (ilgen); - m = EmitEvalMethodBody (m, ilgen, new_frame, program, tail, end_pc, false, false, out out_pc); - if (m == null) - return null; - - // Success: - ilgen.MarkLabel (new_frame.label_pass); - // return true; - ilgen.Emit (OpCodes.Br, frame.label_pass); - - // Fail: - ilgen.MarkLabel (new_frame.label_fail); - // Backtrack (cp); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldloc, local_cp); - ilgen.Emit (OpCodes.Call, GetMethod ("Backtrack", ref mi_backtrack)); - // strpos = old_strpos; - ilgen.Emit (OpCodes.Ldloc, local_old_strpos); - ilgen.Emit (OpCodes.Starg, 1); - - //if (length >= end) - // return false; - ilgen.Emit (OpCodes.Ldloc, local_length); - ilgen.Emit (OpCodes.Ldc_I4, end); - ilgen.Emit (OpCodes.Bge, frame.label_fail); - - // Match an item - //if (!EvalByteCode (pc + 11, strpos, ref res)) - new_frame = new Frame (ilgen); - m = EmitEvalMethodBody (m, ilgen, new_frame, program, pc + 11, tail, false, false, out out_pc); - if (m == null) - return null; - - // Success: - ilgen.MarkLabel (new_frame.label_pass); - // length ++; - ilgen.Emit (OpCodes.Ldloc, local_length); - ilgen.Emit (OpCodes.Ldc_I4_1); - ilgen.Emit (OpCodes.Add); - ilgen.Emit (OpCodes.Stloc, local_length); - ilgen.Emit (OpCodes.Br, l_loop_body); - - // Fail: - ilgen.MarkLabel (new_frame.label_fail); - // return false; - ilgen.Emit (OpCodes.Br, frame.label_fail); - - // Loop footer - ilgen.MarkLabel (l_loop_footer); - ilgen.Emit (OpCodes.Br, l_loop_body); - } else { - // Then match as many items as possible, recording - // backtracking information - - //int old_stack_size = stack.Count; - LocalBuilder local_old_stack_size = ilgen.DeclareLocal (typeof (int)); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldflda, fi_stack); - ilgen.Emit (OpCodes.Call, GetMethod (typeof (RxInterpreter.IntStack), "get_Count", ref mi_stack_get_count)); - ilgen.Emit (OpCodes.Stloc, local_old_stack_size); - //while (length < end) { - Label l_loop_footer = ilgen.DefineLabel (); - ilgen.Emit (OpCodes.Br, l_loop_footer); - Label l_loop_body = ilgen.DefineLabel (); - ilgen.MarkLabel (l_loop_body); - // int cp = Checkpoint (); - LocalBuilder local_cp = ilgen.DeclareLocal (typeof (int)); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Call, GetMethod ("Checkpoint", ref mi_checkpoint)); - ilgen.Emit (OpCodes.Stloc, local_cp); - - // int old_strpos = strpos; - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Stloc, local_old_strpos); - - // if (!EvalByteCode (pc + 11, strpos, ref res)) { - Frame new_frame = new Frame (ilgen); - m = EmitEvalMethodBody (m, ilgen, new_frame, program, pc + 11, tail, false, false, out out_pc); - if (m == null) - return null; - - // Fail: - ilgen.MarkLabel (new_frame.label_fail); - // strpos = old_strpos - ilgen.Emit (OpCodes.Ldloc, local_old_strpos); - ilgen.Emit (OpCodes.Starg, 1); - // Backtrack (cp); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldloc, local_cp); - ilgen.Emit (OpCodes.Call, GetMethod ("Backtrack", ref mi_backtrack)); - - // break; - Label l_after_loop = ilgen.DefineLabel (); - ilgen.Emit (OpCodes.Br, l_after_loop); - - // Success: - ilgen.MarkLabel (new_frame.label_pass); - - //stack.Push (cp); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldflda, fi_stack); - ilgen.Emit (OpCodes.Ldloc, local_cp); - ilgen.Emit (OpCodes.Call, GetMethod (typeof (RxInterpreter.IntStack), "Push", ref mi_stack_push)); - //stack.Push (strpos); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldflda, fi_stack); - ilgen.Emit (OpCodes.Ldloc, local_old_strpos); - ilgen.Emit (OpCodes.Call, GetMethod (typeof (RxInterpreter.IntStack), "Push", ref mi_stack_push)); - // length++ - ilgen.Emit (OpCodes.Ldloc, local_length); - ilgen.Emit (OpCodes.Ldc_I4_1); - ilgen.Emit (OpCodes.Add); - ilgen.Emit (OpCodes.Stloc, local_length); - // Loop footer - ilgen.MarkLabel (l_loop_footer); - ilgen.Emit (OpCodes.Ldloc, local_length); - ilgen.Emit (OpCodes.Ldc_I4, end); - ilgen.Emit (OpCodes.Blt, l_loop_body); - - ilgen.MarkLabel (l_after_loop); - - // Then, match the tail, backtracking as necessary. - - //while (true) { - l_loop_footer = ilgen.DefineLabel (); - ilgen.Emit (OpCodes.Br, l_loop_footer); - l_loop_body = ilgen.DefineLabel (); - ilgen.MarkLabel (l_loop_body); - - if (RxInterpreter.trace_rx) { - ilgen.Emit (OpCodes.Ldstr, "matching tail at: {0}"); - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Box, typeof (int)); - ilgen.Emit (OpCodes.Call, typeof (Console).GetMethod ("WriteLine", new Type [] { typeof (string), typeof (object) })); - } - - // if (EvalByteCode (tail, strpos, ref res)) { - new_frame = new Frame (ilgen); - m = EmitEvalMethodBody (m, ilgen, new_frame, program, tail, end_pc, false, false, out out_pc); - if (m == null) - return null; - - // Success: - ilgen.MarkLabel (new_frame.label_pass); - - if (RxInterpreter.trace_rx) { - ilgen.Emit (OpCodes.Ldstr, "tail matched at: {0}"); - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Box, typeof (int)); - ilgen.Emit (OpCodes.Call, typeof (Console).GetMethod ("WriteLine", new Type [] { typeof (string), typeof (object) })); - } - - // stack.Count = old_stack_size; - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldflda, fi_stack); - ilgen.Emit (OpCodes.Ldloc, local_old_stack_size); - ilgen.Emit (OpCodes.Call, GetMethod (typeof (RxInterpreter.IntStack), "set_Count", ref mi_stack_set_count)); - // return true; - ilgen.Emit (OpCodes.Br, frame.label_pass); - - // Fail: - ilgen.MarkLabel (new_frame.label_fail); - - if (RxInterpreter.trace_rx) { - ilgen.Emit (OpCodes.Ldstr, "tail failed to match at: {0}"); - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Box, typeof (int)); - ilgen.Emit (OpCodes.Call, typeof (Console).GetMethod ("WriteLine", new Type [] { typeof (string), typeof (object) })); - } - - // if (stack.Count == old_stack_size) - // return false; - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldflda, fi_stack); - ilgen.Emit (OpCodes.Call, GetMethod (typeof (RxInterpreter.IntStack), "get_Count", ref mi_stack_get_count)); - ilgen.Emit (OpCodes.Ldloc, local_old_stack_size); - ilgen.Emit (OpCodes.Beq, frame.label_fail); - - // Backtrack - //strpos = stack.Pop (); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldflda, fi_stack); - ilgen.Emit (OpCodes.Call, GetMethod (typeof (RxInterpreter.IntStack), "Pop", ref mi_stack_pop)); - ilgen.Emit (OpCodes.Starg, 1); - //Backtrack (stack.Pop ()); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldflda, fi_stack); - ilgen.Emit (OpCodes.Call, GetMethod (typeof (RxInterpreter.IntStack), "Pop", ref mi_stack_pop)); - ilgen.Emit (OpCodes.Call, GetMethod ("Backtrack", ref mi_backtrack)); - - if (RxInterpreter.trace_rx) { - //Console.WriteLine ("backtracking to: {0}", strpos); - ilgen.Emit (OpCodes.Ldstr, "backtracking to: {0}"); - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Box, typeof (int)); - ilgen.Emit (OpCodes.Call, typeof (Console).GetMethod ("WriteLine", new Type [] { typeof (string), typeof (object) })); - } - - // Loop footer - ilgen.MarkLabel (l_loop_footer); - ilgen.Emit (OpCodes.Br, l_loop_body); - } - - // We already processed the tail - pc = out_pc; - goto End; - } - - case RxOp.CategoryAny: - case RxOp.CategoryAnySingleline: - case RxOp.CategoryWord: - case RxOp.CategoryDigit: - case RxOp.CategoryWhiteSpace: - case RxOp.CategoryEcmaWord: - case RxOp.CategoryEcmaWhiteSpace: - case RxOp.CategoryUnicodeSpecials: - case RxOp.CategoryUnicode: { - OpFlags flags = (OpFlags)op_flags [pc]; - bool negate = (flags & OpFlags.Negate) > 0; - bool reverse = (flags & OpFlags.RightToLeft) > 0; - - //if (strpos < string_end) { - Label l_nomatch = ilgen.DefineLabel (); - if (reverse) { - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldc_I4_0); - ilgen.Emit (OpCodes.Ble, l_nomatch); - } else { - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_string_end); - ilgen.Emit (OpCodes.Bge, l_nomatch); - } - - // int c = str [strpos]; - LocalBuilder local_c = ilgen.DeclareLocal (typeof (char)); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_str); - ilgen.Emit (OpCodes.Ldarg_1); - if (reverse) { - ilgen.Emit (OpCodes.Ldc_I4_1); - ilgen.Emit (OpCodes.Sub); - } - ilgen.Emit (OpCodes.Callvirt, typeof (string).GetMethod ("get_Chars")); - ilgen.Emit (OpCodes.Stloc, local_c); - - Label l_match = ilgen.DefineLabel (); - - Label l_true, l_false; - - l_true = negate ? l_nomatch : l_match; - l_false = negate ? l_match : l_nomatch; - - switch (op) { - case RxOp.CategoryAny: - // if (str [strpos] != '\n') { - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Ldc_I4, (int)'\n'); - ilgen.Emit (OpCodes.Bne_Un, l_true); - break; - case RxOp.CategoryAnySingleline: - ilgen.Emit (OpCodes.Br, l_true); - break; - case RxOp.CategoryWord: - // if (Char.IsLetterOrDigit (c) || Char.GetUnicodeCategory (c) == UnicodeCategory.ConnectorPunctuation) { - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Call, typeof (Char).GetMethod ("IsLetterOrDigit", new Type [] { typeof (char) })); - ilgen.Emit (OpCodes.Brtrue, l_true); - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Call, typeof (Char).GetMethod ("GetUnicodeCategory", new Type [] { typeof (char) })); - ilgen.Emit (OpCodes.Ldc_I4, (int)UnicodeCategory.ConnectorPunctuation); - ilgen.Emit (OpCodes.Beq, l_true); - break; - case RxOp.CategoryDigit: - // if (Char.IsDigit (c)) { - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Call, typeof (Char).GetMethod ("IsDigit", new Type [] { typeof (char) })); - ilgen.Emit (OpCodes.Brtrue, l_true); - break; - case RxOp.CategoryWhiteSpace: - // if (Char.IsWhiteSpace (c)) { - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Call, typeof (Char).GetMethod ("IsWhiteSpace", new Type [] { typeof (char) })); - ilgen.Emit (OpCodes.Brtrue, l_true); - break; - case RxOp.CategoryEcmaWord: - // if ('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || '0' <= c && c <= '9' || c == '_') { - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Ldc_I4, (int)'a' - 1); - ilgen.Emit (OpCodes.Cgt); - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Ldc_I4, (int)'z' + 1); - ilgen.Emit (OpCodes.Clt); - ilgen.Emit (OpCodes.And); - ilgen.Emit (OpCodes.Brtrue, l_true); - - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Ldc_I4, (int)'A' - 1); - ilgen.Emit (OpCodes.Cgt); - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Ldc_I4, (int)'Z' + 1); - ilgen.Emit (OpCodes.Clt); - ilgen.Emit (OpCodes.And); - ilgen.Emit (OpCodes.Brtrue, l_true); - - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Ldc_I4, (int)'0' - 1); - ilgen.Emit (OpCodes.Cgt); - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Ldc_I4, (int)'9' + 1); - ilgen.Emit (OpCodes.Clt); - ilgen.Emit (OpCodes.And); - ilgen.Emit (OpCodes.Brtrue, l_true); - - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Ldc_I4, (int)'_'); - ilgen.Emit (OpCodes.Beq, l_true); - break; - case RxOp.CategoryEcmaWhiteSpace: - // if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '\f' || c == '\v') { - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Ldc_I4, (int)' '); - ilgen.Emit (OpCodes.Beq, l_true); - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Ldc_I4, (int)'\t'); - ilgen.Emit (OpCodes.Beq, l_true); - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Ldc_I4, (int)'\n'); - ilgen.Emit (OpCodes.Beq, l_true); - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Ldc_I4, (int)'\r'); - ilgen.Emit (OpCodes.Beq, l_true); - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Ldc_I4, (int)'\f'); - ilgen.Emit (OpCodes.Beq, l_true); - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Ldc_I4, (int)'\v'); - ilgen.Emit (OpCodes.Beq, l_true); - break; - case RxOp.CategoryUnicodeSpecials: - // if ('\uFEFF' <= c && c <= '\uFEFF' || '\uFFF0' <= c && c <= '\uFFFD') { - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Ldc_I4, (int)'\uFEFF' - 1); - ilgen.Emit (OpCodes.Cgt); - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Ldc_I4, (int)'\uFEFF' + 1); - ilgen.Emit (OpCodes.Clt); - ilgen.Emit (OpCodes.And); - ilgen.Emit (OpCodes.Brtrue, l_true); - - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Ldc_I4, (int)'\uFFF0' - 1); - ilgen.Emit (OpCodes.Cgt); - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Ldc_I4, (int)'\uFFFD' + 1); - ilgen.Emit (OpCodes.Clt); - ilgen.Emit (OpCodes.And); - ilgen.Emit (OpCodes.Brtrue, l_true); - break; - case RxOp.CategoryUnicode: - // if (Char.GetUnicodeCategory (c) == (UnicodeCategory)program [pc + 1]) { - ilgen.Emit (OpCodes.Ldloc, local_c); - ilgen.Emit (OpCodes.Call, typeof (Char).GetMethod ("GetUnicodeCategory", new Type [] { typeof (char) })); - ilgen.Emit (OpCodes.Ldc_I4, (int)program [pc + 1]); - ilgen.Emit (OpCodes.Beq, l_true); - break; - } - - ilgen.Emit (OpCodes.Br, l_false); - - ilgen.MarkLabel (l_match); - - // strpos++; - if (!no_bump) { - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldc_I4_1); - if (reverse) - ilgen.Emit (OpCodes.Sub); - else - ilgen.Emit (OpCodes.Add); - ilgen.Emit (OpCodes.Starg, 1); - } - // } - Label l2 = ilgen.DefineLabel (); - ilgen.Emit (OpCodes.Br, l2); - //} - ilgen.MarkLabel (l_nomatch); - //return false; - ilgen.Emit (OpCodes.Br, frame.label_fail); - - ilgen.MarkLabel (l2); - - if (op == RxOp.CategoryUnicode) - pc += 2; - else - pc++; - break; - } - case RxOp.Reference: { - OpFlags flags = (OpFlags)op_flags [pc]; - bool ignore = (flags & OpFlags.IgnoreCase) > 0; - bool reverse = (flags & OpFlags.RightToLeft) > 0; - - //length = GetLastDefined (program [pc + 1] | ((int)program [pc + 2] << 8)); - LocalBuilder loc_length = ilgen.DeclareLocal (typeof (int)); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldc_I4, ReadShort (program, pc + 1)); - ilgen.Emit (OpCodes.Call, GetMethod (typeof (RxInterpreter), "GetLastDefined", ref mi_get_last_defined)); - ilgen.Emit (OpCodes.Stloc, loc_length); - //if (length < 0) - // return false; - ilgen.Emit (OpCodes.Ldloc, loc_length); - ilgen.Emit (OpCodes.Ldc_I4_0); - ilgen.Emit (OpCodes.Blt, frame.label_fail); - //start = marks [length].Index; - LocalBuilder loc_start = ilgen.DeclareLocal (typeof (int)); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_marks); - ilgen.Emit (OpCodes.Ldloc, loc_length); - ilgen.Emit (OpCodes.Ldelema, typeof (Mark)); - ilgen.Emit (OpCodes.Call, GetMethod (typeof (Mark), "get_Index", ref mi_mark_get_index)); - ilgen.Emit (OpCodes.Stloc, loc_start); - // length = marks [length].Length; - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_marks); - ilgen.Emit (OpCodes.Ldloc, loc_length); - ilgen.Emit (OpCodes.Ldelema, typeof (Mark)); - ilgen.Emit (OpCodes.Call, GetMethod (typeof (Mark), "get_Length", ref mi_mark_get_length)); - ilgen.Emit (OpCodes.Stloc, loc_length); - if (reverse) { - //ptr -= length; - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldloc, loc_length); - ilgen.Emit (OpCodes.Sub); - ilgen.Emit (OpCodes.Starg, 1); - //if (ptr < 0) - //goto Fail; - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldc_I4_0); - ilgen.Emit (OpCodes.Blt, frame.label_fail); - } else { - //if (strpos + length > string_end) - // return false; - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldloc, loc_length); - ilgen.Emit (OpCodes.Add); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_string_end); - ilgen.Emit (OpCodes.Bgt, frame.label_fail); - } - - LocalBuilder local_str = ilgen.DeclareLocal (typeof (string)); - ilgen.Emit (OpCodes.Ldarg_0); - ilgen.Emit (OpCodes.Ldfld, fi_str); - ilgen.Emit (OpCodes.Stloc, local_str); - - // end = start + length; - LocalBuilder loc_end = ilgen.DeclareLocal (typeof (int)); - ilgen.Emit (OpCodes.Ldloc, loc_start); - ilgen.Emit (OpCodes.Ldloc, loc_length); - ilgen.Emit (OpCodes.Add); - ilgen.Emit (OpCodes.Stloc, loc_end); - //for (; start < end; ++start) { - Label l_loop_footer = ilgen.DefineLabel (); - ilgen.Emit (OpCodes.Br, l_loop_footer); - Label l_loop_body = ilgen.DefineLabel (); - ilgen.MarkLabel (l_loop_body); - //if (str [strpos] != str [start]) - //return false; - if (ignore) - ilgen.Emit (OpCodes.Ldloc, local_textinfo); - ilgen.Emit (OpCodes.Ldloc, local_str); - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Callvirt, typeof (string).GetMethod ("get_Chars")); - if (ignore) - ilgen.Emit (OpCodes.Callvirt, typeof (TextInfo).GetMethod ("ToLower", new Type [] { typeof (char) })); - if (ignore) - ilgen.Emit (OpCodes.Ldloc, local_textinfo); - ilgen.Emit (OpCodes.Ldloc, local_str); - ilgen.Emit (OpCodes.Ldloc, loc_start); - ilgen.Emit (OpCodes.Callvirt, typeof (string).GetMethod ("get_Chars")); - if (ignore) - ilgen.Emit (OpCodes.Callvirt, typeof (TextInfo).GetMethod ("ToLower", new Type [] { typeof (char) })); - ilgen.Emit (OpCodes.Bne_Un, frame.label_fail); - // strpos++; - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldc_I4_1); - ilgen.Emit (OpCodes.Add); - ilgen.Emit (OpCodes.Starg, 1); - // start++ - ilgen.Emit (OpCodes.Ldloc, loc_start); - ilgen.Emit (OpCodes.Ldc_I4_1); - ilgen.Emit (OpCodes.Add); - ilgen.Emit (OpCodes.Stloc, loc_start); - // Loop footer - ilgen.MarkLabel (l_loop_footer); - ilgen.Emit (OpCodes.Ldloc, loc_start); - ilgen.Emit (OpCodes.Ldloc, loc_end); - ilgen.Emit (OpCodes.Blt, l_loop_body); - - if (reverse) { - //ptr -= length; - ilgen.Emit (OpCodes.Ldarg_1); - ilgen.Emit (OpCodes.Ldloc, loc_length); - ilgen.Emit (OpCodes.Sub); - ilgen.Emit (OpCodes.Starg, 1); - } - - pc += 3; - break; - } - case RxOp.Repeat: - case RxOp.RepeatLazy: - case RxOp.IfDefined: - // FIXME: - if (RxInterpreter.trace_rx || trace_compile) - Console.WriteLine ("Opcode " + op + " not supported."); - return null; - default: - throw new NotImplementedException ("Opcode '" + op + "' not supported by the regex->IL compiler."); - } - - if (one_op) - break; - } - - End: - - out_pc = pc; - - return m; - } - } - -} - diff --git a/mcs/class/System/System.Text.RegularExpressions/Capture.cs b/mcs/class/System/System.Text.RegularExpressions/Capture.cs deleted file mode 100644 index edaf0767f47..00000000000 --- a/mcs/class/System/System.Text.RegularExpressions/Capture.cs +++ /dev/null @@ -1,73 +0,0 @@ -// -// assembly: System -// namespace: System.Text.RegularExpressions -// file: Capture.cs -// -// author: Dan Lewis (dlewis@gmx.co.uk) -// (c) 2002 - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; - -namespace System.Text.RegularExpressions { - - [Serializable] - public class Capture { - public int Index { - get { return index; } - } - - public int Length { - get { return length; } - } - - public string Value { - get { return text == null ? String.Empty : text.Substring (index, length); } - } - - public override string ToString () - { - return Value; - } - - // internal members - - internal Capture (string text) : this (text, 0, 0) { } - - internal Capture (string text, int index, int length) - { - this.text = text; - this.index = index; - this.length = length; - } - - internal string Text { - get { return text; } - } - - // private - - internal int index, length; - internal string text; - } -} diff --git a/mcs/class/System/System.Text.RegularExpressions/CaptureCollection.cs b/mcs/class/System/System.Text.RegularExpressions/CaptureCollection.cs deleted file mode 100644 index 3c9ef451d3e..00000000000 --- a/mcs/class/System/System.Text.RegularExpressions/CaptureCollection.cs +++ /dev/null @@ -1,85 +0,0 @@ -// -// System.Text.RegularExpressions.CaptureCollection -// -// Authors: -// Dan Lewis (dlewis@gmx.co.uk) -// Dick Porter (dick@ximian.com) -// -// (C) 2002 Dan Lewis -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Collections; - -namespace System.Text.RegularExpressions -{ - [Serializable] - public class CaptureCollection: ICollection, IEnumerable - { - private Capture [] list; - - /* No public constructor */ - internal CaptureCollection (int n) - { - list = new Capture [n]; - } - - public int Count { - get { return list.Length; } - } - - public bool IsReadOnly { - get { return true; } - } - - public bool IsSynchronized { - get { return false; } - } - - public Capture this [int i] { - get { - if (i < 0 || i >= Count) - throw new ArgumentOutOfRangeException ("Index is out of range"); - return list [i]; - } - } - - internal void SetValue (Capture cap, int i) - { - list [i] = cap; - } - - public object SyncRoot { - get { return list; } - } - - public void CopyTo (Array array, int arrayIndex) - { - list.CopyTo (array, arrayIndex); - } - - public IEnumerator GetEnumerator () - { - return list.GetEnumerator (); - } - } -} diff --git a/mcs/class/System/System.Text.RegularExpressions/ChangeLog b/mcs/class/System/System.Text.RegularExpressions/ChangeLog deleted file mode 100644 index 56f73813603..00000000000 --- a/mcs/class/System/System.Text.RegularExpressions/ChangeLog +++ /dev/null @@ -1,1084 +0,0 @@ -2010-07-20 Miguel de Icaza - - * parser.cs (ParseEscape): Now parses with some context, whether - we are parsing inside a character range which can not contain - back-references or when we are parsing on a string context which - can contain back references. - - This fixes bug #577346 which exposed a bug parsing this: - - new Regex("[\\177-\\377]") - -2010-06-29 Raja R Harinath - - Mitigate a possible source of unbounded memory growth - * interpreter.cs (Backtrack): Move mark_start back, and invalidate - discarded marks. - -2010-06-29 Raja R Harinath - - Make trace output resemble assembler listing - * compiler.cs (LinkRef.ToString) [TRACE_REGEX]: Add pretty-printer - in TRACE_REGEX mode. - (TraceRegexp): Indent the output. - (TraceRegexpLabel): New. Prints out a line label. - (EmitCount): Don't trace. All callers are traced. - (ResolveLink): Trace line labels. - -2010-06-21 Rodrigo Kumpera - - * compiler.cs: Use conditional compilation to enable - tracing to avoid code bloat. - -2010-06-21 Rodrigo Kumpera - - * parser.cs: Handle repetition of position assertions. - - Fixes #610587. - -2010-06-21 Rodrigo Kumpera - - * compiler.cs: Add new internal flag to switch on regexp tracing. - The code is a statc readonly variable so the JIT can eliminate - all tracing code during normal runs. - -2010-03-20 Miguel de Icaza - - * RxInterpreter.cs: Removed warnings. - -2010-02-03 Rodrigo Kumpera - - * BaseMachine.cs (Split): Don't add empty strings if they don't come from - the first capture group. Fixes #566117. - -2010-01-12 Miguel de Icaza - - * Regex.cs: Re-enable the new regex compiler as the bug seems to - be gone now. - -2009-09-07 Raja R Harinath - - * Regex.cs (Escape, Unescape): Add null checks. - (validate_options): Add ECMAScript option checks. - (Replace, Split): Add a few bounds checks. - -2009-09-07 Raja R Harinath - - Add some null checks and bounds checks. - * Regex.cs (default_startat): New. Replaces the fragment - 'RightToLeft ? input.Length : 0' with a null-safe variant. - (Replace) : Add null checks for argument strings. - (Split): Likewise. - (.ctor): Likewise. Validate regex options partially. - (Match): Add null check on string arguments, and bounds checks for - offset and length arguments. - -2009-08-20 Raja R Harinath - - Final piece of explicit numeric group support - * parser.cs (gap): New. - (GetMapping): Return it. - (ResolveReferences): Collect explicit numeric groups which may not - match their indices. - (HandleExplicitNumericGroups): New. Process the above list to - assign appropriate indices, and compute the correct value of 'gap'. - -2009-08-20 Raja R Harinath - - * syntax.cs (CapturingGroup.Index): Rename from Number to clarify - semantics. - (CapturingGroup.CompareTo): New. - * parser.cs, syntax.cs: Update to changes. - -2009-08-20 Raja R Harinath - - Implement some more group number/index distinction - * Regex.cs (gap, Gap): New. - (Init, InitNewRegex): Update it. - (GroupNumberFromName): If the 'name' is beyond the gap, it is an - explicit numeric group -- use the name as the group number. - (GetGroupIndex): Use a binary search to map a group number to its - index when we know that they don't match. - (GroupNumbers): Use group number, not group index, for explicit - numeric groups. - * Match.cs (.ctor): Use the newly introduce 'Regex.Gap'. - -2009-08-19 Raja R Harinath - - * Regex.cs (group_numbers): New. - (GetGroupNumbers): Move array initialization ... - (GroupNumbers): ... to new on-demand initializer. - -2009-08-19 Raja R Harinath - - * Regex.cs (group_names): Rename from _groupNumbersToNameMap. - (GetGroupNamesArray): Use an IDictionaryEnumerator to walk the - mapping, since both the key and value are used in the loop. - -2009-08-19 Raja R Harinath - - Introduce 'gap' concept into all the variants of regex - * arch.cs (IMachineFactory::Gap): New property. - * compiler.cs (InterpreterFactory): Update to changes. - * RxCompiler.cs (RxInterpreterFactory): Likewise. - * JvmReMachineFactory.cs: Likewise. - * parser.cs (GetMapping): Return the 'gap' index. Move creation - of mapping dictionary ... - * Regex.cs (CreateMachineFactory): ... here. Update to changes. - -2009-08-18 Raja R Harinath - - Distinguish between the internal index of a group and group number. - * Regex.cs (GetGroupIndex): New. - (GroupNameFromNumber): Use it. - * GroupCollection.cs (.ctor): Introduce 'gap' argument. It is the - index of the first group whose group number differs from its index. - (Item.get): Likewise. - -2009-08-18 Raja R Harinath - - * parser.cs (GetMapping): Extend duplicate check for numeric - groups too. - -2009-08-17 Raja R Harinath - - * parser.cs (ResolveReferences): Handle some cases of - explicitly-named numeric groups. - -2009-08-17 Raja R Harinath - - * parser.cs (ResolveReferences): Rearrange slightly to prepare for - future changes. - -2009-08-17 Raja R Harinath - - * Regex.cs (GetGroupNumbers): List group numbers in ascending order. - (GetGroupNames): List names in order of group number. - -2009-08-12 Raja R Harinath - - * syntax.cs (BackslashNumber.ResolveReference): Improve ECMAScript - semantics. Handle cases like "group 43 exists but group 4 doesn't". - -2009-08-10 Raja R Harinath - - * syntax.cs (BackslashNumber.ResolveReference): Implement fallback - to octal numbers, and ECMAScript semantics. - * parser.cs (ResolveReferences): Use it. - -2009-08-10 Raja R Harinath - - * syntax.cs (BackslashNumber): New class. - * parser.cs (ParseSpecial): Create it instead of 'Reference' if a - numeric backreference is seen. - -2009-08-10 Raja R Harinath - - * parser.cs (ResolveReferences): Allow named groups to be - referred-to by their group numbers too. - -2009-04-23 Sebastien Pouliot - - * Regex.cs: Remove Compiler-related support for NET_2_1 - * RegexOptions.cs: Remove Compile from values available on NET_2_1 - -2009-03-04 Zoltan Varga - - * RxInterpreter.cs (ResetGroups): Avoid allocating larger than needed - arrays. - -2009-02-27 Jonathan Pryor - - * Regex.cs (Replace): Check that input & evaluator are not null, as - documented in MSDN (and the variance found while testing DbLinq). - -2009-02-27 Zoltan Varga - - * BaseMachine.cs (LTRReplace): Initialize the StringBuilder with an - appropriate initial length. - -2009-02-24 Zoltan Varga - - * CILCompiler.cs: Partially inline calls to Char.ToLower () to speed - up ignorecase matching. - -2009-02-16 Jb Evain - - * Regex.cs: on the NET_2_1 profile, always use the old engine for now. - -2009-02-14 Zoltan Varga - - * Regex.cs: Add a MONO_NEW_RX variable to enable the new regex - engine. - -2009-02-04 Zoltan Varga - - * Regex.cs: Disable the new regex engine for now. - -2009-01-14 Zoltan Varga - - * CILCompiler.cs: Avoid throwing exceptions for a few more unhandled opcodes. - Implement the reverse/ignorecase versions of Reference. Fix the reverse - version of Bitmap. Error out if a Jump opcode jumps outside the current - pc range. This works around #466151. - -2009-01-12 Jb Evain - - * RxInterpreter.cs: set trace_rx to false for NET_2_1. - * Regex.cs: set old_rx to false for NET_2_1. - -2009-01-07 Zoltan Varga - - * RxInterpreter.cs: Add support for constant strings in anchors. Fixes - #464135. - -2008-11-18 Gonzalo Paniagua Javier - - * cache.cs: avoid infinite loop. - -2008-11-14 Gonzalo Paniagua Javier - - * cache.cs: - * Regex.cs: honor CacheSize value. - -2008-11-13 Zoltan Varga - - * RxInterpreter.cs: Fix pc computation in various opcodes. Fixes #443841. - -2008-11-11 Zoltan Varga - - * CILCompiler.cs: Implement Reference opcode. - -2008-10-30 Zoltan Varga - - * CILCompiler.cs: Implement SubExpression opcode. - - * CILCompiler.cs: Save and restore strpos in the Test opcode. Fixes - #439947. - -2008-10-25 Zoltan Varga - - * CILCompiler.cs: Implement Test opcode. - -2008-10-25 Gonzalo Paniagua Javier - - * RxInterpreter.cs: implement missing Unicode* opcodes and - StringReverseIgnoreCase. - -2008-10-25 Zoltan Varga - - * RxOp.cs: Remove unused Generic opcodes. - - * RxCompiler.cs: Emit opcodes with flags using methods which can be - overriden by CILCompiler.cs, so we only have to override a few methods. - - * CILCompiler.cs: Simplify based on the RxCompiler changes. Implement - UnicodeString opcode. Throw a NotImplementedException when an unsupported - opcode is encountered, since the IL compiler is now believed to be feature - complete. - -2008-10-24 Zoltan Varga - - * RxInterpreter.cs CILCompiler.cs gen-interp.cs: Fix the reading of short - values from the instruction stream. - - * RxOp.cs: Add some missing unicode opcodes. - - * gen-interp.cs RxInterpreter.cs: Generate Bitmap/UnicodeBitmap opcodes too. - - * CILCompiler.cs (EmitEvalMethodBody): Add an 'end_pc' argument to mark the - end of the bytecode range which needs to be compiled. Use it to avoid - compiling the same bytecode multiple times in various opcodes. Fix - RxOp.Jump implementation. Add implementation for unicode opcodes. - -2008-10-09 Zoltan Varga - - * CILCompiler.cs: Implement NoBitmap/NoBitmapIgnoreCase. Fixes #432172. - -2008-09-14 Zoltan Varga - - * gen-interp.cs: New file to generate the all variants of the character - checking opcodes in RxInterpreter.cs. - - * RxInterpreter.cs: Replace hand written code with code generated by - gen-interp.cs. - - * RxInterpreter.cs: Fix the failure case of the No opcodes. Fixes - #426142. - -2008-09-13 Zoltan Varga - - * RxInterpreter.cs RxCompiler.cs: Implement some missing Category opcodes. - -2008-09-07 Zoltan Varga - - * CILCompiler.cs: Override ICompiler.EmitSet too so we set op_flags for - Bitmap opcodes too. Fixes #424073. - -2008-09-06 Zoltan Varga - - * Regex.cs: Make the new regex interpreter+compiler the default. - -2008-08-31 Zoltan Varga - - * RxInterpreter.cs: Port the Anchor+StartOfString optimization from the old - interpreter. Add credits. - - * RxCompiler.cs (EmitString): Lowercase the string if ignore is true. - - * CILCompiler.cs: Fix the setting of the match position in the - anchor+char optimization. - - * CILCompiler.cs: Implement FastRepeatLazy. - - * CILCompiler.cs: Get rid of commented out code. Also get rid of - frame.local_strpos_res, since the generated code already set Arg1 to - the same value. - -2008-08-30 Zoltan Varga - - * CILCompiler.cs: Initialize all mi_ variables lazily. - - * CILCompiler.cs: Implement FastRepeat. - - * RxInterpreter.cs: Add back SetStartOfMatch, make it protected so as to - avoid a warning. - - * CILCompiler.cs RxOp.cs: Merge lots of changes from RxInterpreter.cs, - refactor the code. - -2008-08-29 Zoltan Varga - - * RxInterpreter.cs RxCompiler.cs RxOp.cs: Implement/fix this so all the - regex tests now run. The Repeat code is taken from the old interpreter. - -2008-08-28 Zoltan Varga - - * RxInterpreter.cs RxCompiler.cs RxOp.cs: Add support for - Category.AnySingleline. - -2008-08-27 Zoltan Varga - - * RxCompiler.cs: Use Array.Copy since Buffer.BlockCopy operates on bytes. - -2008-07-31 Jb Evain - - * BaseMachine.cs: clean up for NET_2_1. - -2008-06-05 Roei Erez - - * JvmReMachine.jvm.cs: Fix a bug in match that contains - empty group at the end. - -2008-04-13 Jb Evain - - * Regex.cs: update undocumented fields for the 2.1 profile. - Merged from the Moonlight 2 branch. - -2008-02-26 Zoltan Varga - - * CILCompiler.cs: Implement StringIgnoreCase. - - * CILCompiler.cs: Implement grouping support. - - * CILCompiler.cs: Implement character groups. - -2008-02-25 Zoltan Varga - - * CILCompiler.cs: Implement lots of missing opcodes. - -2008-02-18 Zoltan Varga - - * CILCompiler.cs (EmitEvalMethodBody): Check for the not-yet supported - groups.Count > 1. - -Thu Feb 14 19:03:00 CET 2008 Paolo Molaro - - * RxCompiler.cs, RxInterpreter.cs, RxOp.cs, CILCompiler.cs : support for word - boundary position opcodes, ignorecase backreference and more capture - work. - -Thu Feb 14 17:11:10 CET 2008 Paolo Molaro - - * RxCompiler.cs, RxInterpreter.cs, RxOp.cs: replace EcmaDigit with - Range, fixed matching of "" =~ /$/, implementedt TestCharGroup. - Fixes and other misc opcodes implemented. - -2008-02-13 Zoltan Varga - - * CILCompiler.cs: Restructure some code to avoid a branch inside a loop. - - * CILCompiler.cs: Fix the unsafe string matching code. - - * CILCompiler.cs: Improved version which emits only one method in most cases. - - * CILCompiler.cs: Fix some comments. - - * CILCompiler.cs: New file, extracted from RxCompiler.cs. - - * RxInterpreter.cs RxCompiler.cs: First version of regex IL compiler. - -Wed Feb 13 13:18:12 CET 2008 Paolo Molaro - - * RxCompiler.cs, RxInterpreter.cs, RxOp.cs: unicode categories and - some grouping/capture support. - -Tue Feb 12 19:16:49 CET 2008 Paolo Molaro - - * RxCompiler.cs, RxInterpreter.cs, RxOp.cs: experimental new - interpreter. - -2008-02-10 Zoltan Varga - - * replace.cs (NeedsGroupsOrCaptures): New property. Determines whenever the - replacement process needs access to the groups or captures properties of the - Match object. - - * Group.cs: Add an internal ctor which avoids allocations. - - * Match.cs: Ditto. - - * BaseMachine.cs interpreter.cs: Add an optimization to avoid fully creating - Match objects during Replace () if the replacement string is simple. - - * BaseMachine.cs Regex.cs: Make LTRReplace and RTLReplace instance methods to - avoid creating two machines for each Regex.Replace () call. - - * interpreter.cs (Eval): Remove a needless string allocation. - -2007-12-04 Arina Itkes - - * parser.cs: Max value of m for a construct {n,m} is 2147483647. - -2007-11-15 Miguel de Icaza - - * Revert the patch from Juraj Skripsky as it made the class - non-thread safe (see #341986). - -2007-11-08 Raja R Harinath - - Fix 324390 - * BaseMachine.cs (LTRReplace): Don't use non-advancement of 'ptr' - to deduce absence of matches -- a match can have length 0. - (RTLReplace): Likewise. - -2007-11-07 Raja R Harinath - - Support RegexOptions.RightToLeft in Replace(). - * BaseMachine.cs (Replace): Use either LTRReplace or RTLReplace - based on regex. - (LTRReplace): Make internal and rename the MatchAppendEvaluator - version of Replace to this. - (RTLReplace): New. - * Regex.cs (Replace): Use LTRReplace and RTLReplace from BaseMachine. - * replace.cs (ReplacementEvaluator.Evaluate): Optimize simple case. - Based on patch by Stephane Delcroix. - - * replace.cs (Compile): Don't unescape string. - -2007-11-01 Gert Driesen - - * Match.cs: Do not throw NotSupportedException on zero-length - replacement argument. - -2007-10-29 Arina Itkes - - * Regex.cs: Moving creation of Regex machine to ctor. - It increases an initialization time of Regex but reduce a - process time while APIs calling. Also it solves the problem - of missed multi thread synchronization. - -2007-10-29 Arina Itkes - - * Match.cs: Fix for Result method of Match. Throwing an exception - if Result method was called on a failed Match. - -2007-10-24 Juraj Skripsky - - * Regex.cs: Store and re-use IMachine, no need to re-instantiate - it every time we're matching. - -2007-10-24 Arina Itkes - - * Regex.cs Match.cs arch.cs compiler.cs interpreter.cs - Refactoring of Interpreter with extracting of base abstract class - that executes some methods that were moved from Regex and Match classes. - Added a field that maps group numbers to group names in Regex for - improvement of performance of GroupNameFromNumber method. - -2007-10-21 Gert Driesen - - * RegexTest.cs: Removed. Test was already moved to the appropriate - location. - -2007-06-21 Juraj Skripsky - - * quicksearch.ch: Optimization. Add byte array as skip table for - chars <= 255, falling back to the hashtable for chars > 255 and - skip distances > 255. - -2007-04-18 Raja R Harinath - - Fix #80554 - * parser.cs (ResolveReferences): Don't throw an expression if a - capture assertion reference cannot be resolved. - (ParseGroupingConstruct): Provide fallback expression to a capture - assertion. - * syntax.cs (CaptureAssertion): If the bareword doesn't refer to - the name of a capture group, fallback to treating it as a literal - expression. - -2007-04-04 Raja R Harinath - - * interpreter.cs (Eval) : Distribute for loop - inside if. - for () if (a) s1; else s2; => if (a) for () s1; else for () s2; - -2007-04-03 Raja R Harinath - - * Regex.cs (~Regex): Don't define in NET_2_0 profile. - -2007-01-02 Raja R Harinath - - Fix #79472 - * parser.cs (Parser.GetMapping): Use the actual group numbers to - build the mapping. - -2006-09-28 Andrew Skiba - - * Regex.cs: TARGET_JVM - -2006-05-30 Gert Driesen - - * CaptureCollection.cs: Removed virtual keyword to fix API mismatches. - * MatchCollection.cs: Removed virtual keyword to fix API mismatches. - * GroupCollection.cs: Removed virtual keyword to fix API mismatches. - -2006-05-08 Raja R Harinath - - Fix #78278 - Remove 65535-limit on number of repetitions matched by a pattern. - We still have a 65535 limit on the length of a pattern and the - number of groups in a pattern. - * compiler.cs (PatternCompiler.EmitCount): New. Emits an int as - two ushorts into the program stream. - (EmitInfo, EmitRepeat, EmitFastRepeat): Use it to emit integers - rather than shorts. - * interpreter.cs (Intepreter.ReadProgramCount): Read an int - emitted into the program stream. - (Interpreter): Use it. Update counts. - (Interpreter.Eval) [OpCode.Repeat, OpCode.FastRepeat]: Likewise. - * parser.cs (ParseGroup): Pass 0x7ffffff as the max value for '*' - and '+' repetition patterns. - * arch.cs (Info, Repeat, FastRepeat): Update description. - -2006-04-18 Raja R Harinath - - Treat fixed repetitions of simple regexes as simple too. - * syntax.cs (Expression.IsComplex): Make abstract. - (Group.IsComplex, Alternation.IsComplex): Move ... - (CompositeExpression.IsComplex): ... here. - (Group.GetAnchorInfo): Reduce allocations. Avoid creating another - ArrayList, and use a StringBuilder to build up the string. - (Repetition.GetAnchorInfo): Use a StringBuilder to build up the string. - (ExpressionAssertion.IsComplex): Override. - -2006-04-17 Florian Gross - Raja R Harinath - - * syntax.cs (CharacterClass.Compile): Emit categories after the - character intervals so that the evaluator can pick up the - 'IgnoreCase' flag. - -2006-04-07 Raja R Harinath - - Fix #78007 - * interpreter.cs (Interpreter.Eval) [Anchor, Position.StartOfString]: - Don't reset 'ptr' to 0 during forward scan. - - Fix #76345 - * interpreter.cs (Interpreter.FastEval) [FastRepeat]: If the first - tail operation has a 'negate' flag, avoid the "match next char" - optimization. - - Fix #69269 - * arch.cs (OpCode.NotCategory): New. Stands for matching a - character _not_ from the given category. - * debug.cs (DisassembleBlock): Handle it. - * compiler.cs (ICompiler.EmitNotCategory): New. - (Compiler.EmitNotCategory): New. Emit OpCode.NotCategory. - * syntax.cs (CharacterClass.Compile): Don't conflate negation of - the character class and negation of the category. Use - EmitNotCategory. - * interpreter.cs (Interpreter.Eval): Pass OpCode.NotCategory to - EvalChar. - (Interpreter.EvalChar): Handle it. - -2006-04-06 Raja R Harinath - - Fix #77487 - * interpreter.cs (Eval) [Until, FastUntil]: Set 'deep' to null - when evaluating the tail. Ensure that backtracks don't confuse - the recursion vs. iteration detector. - -2006-04-03 Raja R Harinath - - * interpreter.cs (Eval) [Until, lazy]: Avoid extra evaluation on a - degenerate match. - -2006-03-30 Raja R Harinath - - Fix #77626 - * parser.cs (Parser.ParseCharacterClass): Don't automatically - assume there's a range when we see '-'. Ensure that we have seen - at least one other character, and that we aren't already parsing a - range. Handle some more errors. - -2005-12-19 Kornél Pál - - * Regex.cs: Added support for regular expressions compiled to - assemblies by compiling the pattern. This solution ignores existing - CIL code but provides full support for regular expression classes - compiled by MS.NET. - -2005-11-21 Sebastien Pouliot - - * CaptureCollection.cs: Fixed length check. - * Group.cs: Added missing validation for Synchronized method. - * Match.cs: Added missing validation for Synchronized and Result - methods. - * MatchEvaluator.cs: Added [Serializable] for 2.0 profile. - * RegexCompilationInfo.cs: Added missing property validation. - * Regex.cs: Implemented UseOptionC and UseOptionR protected methods - (now documented). Fixed API for 2.0 profile. - * RegexRunner.cs: Stubbed CharInClass for 2.0 profile. - -2005-11-17 Sebastien Pouliot - - * Match.cs: Removed the ": base ()" on the private ctor as it is - unrequired and cause an extra public ctor to added (bug #76736). - * MatchCollection.cs: Add missing virtual to indexer property. - -2005-09-23 Raja R Harinath - - * interpreter.cs (Interpreter.Eval) [OpCode.Until]: Invert the - sense of a test to reflect the code re-organization. - -2005-09-22 Raja R Harinath - - Fix #72152, #72989. - * interpreter.cs (Interpreter.Eval) [OpCode.Until]: Avoid some - cases of recursion when dealing with eager quantifiers too. We - now avoid recursion when handling the innermost quantifier. - (Interpreter.IntStack, Interpreter.stack): New. Stack to help - implement backtracking in eager quantifiers. - -2005-09-21 Raja R Harinath - - * interpreter.cs (Interpreter.Eval) [OpCode.Until]: Avoid some - cases of recursion when dealing with the minimum count and lazy - quantifiers. - -2005-08-23 Raja R Harinath - - * regex.cs: Remove. Split into ... - * MatchEvaluator.cs, Regex.cs, RegexCompilationInfo.cs, - RegexOptions.cs: ... these. Now every publicly exposed type in - this namespace has its own file. - -2005-07-21 Florian Gross - - * Fixed a bug in category.cs that caused ECMAScript \d to fail. - -2005-07-13 Raja R Harinath - - Make even more lazier. - * MatchCollection.cs (TryToGet): Don't generate match i+1 when - we're looking for match i. Change post-conditions. - (FullList): New helper property. Ensures the list is fully populated. - (Count, CopyTo): Use it. - (Enumerator.Current): Update to new post-conditions of TryToGet. - (Enumerator.MoveNext): Likewise. Don't modify index if we're - beyond the end. - -2005-07-08 Raja R Harinath - - * MatchCollection.cs: Convert to incremental mode. - * regex.cs (Regex.Matches): Update. Pass responsibility of - generating all matches to MatchCollection. - -2005-06-14 Raja R Harinath - - * parser.cs (Parser.ConsumeWhitespace): Add bounds check. - - Fix #74753. - * Match.cs (Match) [zero-argument variant]: Make private. - * GroupCollection (Item) [string variant]: Don't look for the - group number in an empty match. - -2005-06-10 Raja R Harinath - - * interpreter.cs (Interpreter.GenerateMatch): Avoid allocating two - intermediate arrays to build the final result. - (Interpreter.GetGroupInfo, Interpreter.PopulateGroup): New helper - functions. - * CaptureCollection.cs (list): Change from ArrayList to list. - (SetValue): New internal helper, used by Interpreter.PopulateGroup. - (Enumerator): Remove helper class. - (IEnumerator.GetEnumerator): Just use list.GetEnumerator. - * GroupCollection.cs: Likewise. - * Group.cs (Group): Move responsibility of populating 'Captures' - to Interpreter.PopulateGroup. - * Match.cs (Match): Move responsibility of populating 'Groups' to - Interpreter.GenerateMatch. - -2005-05-25 Raja R Harinath - - * replace.cs (ReplacementEvaluator.Compile): Rewrite to avoid - creating several intermediate strings. Simplify internal - intermediate representation. - (ReplacementEvaluator.EvaluateAppend): New. Version of Evaluate - that builds the result directly on a passed-in StringBuilder. - (ReplacementEvaluator.Evaluate): Just a wrapper around - EvaluateAppend. - * regex.cs (MatchAppendEvaluator): New internal delegate. - (Regex.Replace): Use MatchAppendEvaluator. - (Regex.Adapter): New class used to adapt a MatchEvaluator to a - MatchAppendEvaluator. - -2005-05-24 Raja R Harinath - - * replace.cs (ReplacementEvaluator.CompileTerm): Fix group - returned by $+. - -2005-05-20 Ben Maurer - - * regex.cs: Some memory allocation optimizations. - -2005-05-20 Raja R Harinath - - Fix #74735. - * replace.cs (ReplacementEvaluator.Compile): Allow CompileTerm to - fail and yet have advanced the pointer. Append the scanned-over - portion to the "literal" being built. - (ReplacementEvaluator.CompileTerm): Don't throw any exceptions. - If a term cannot be recognized, just return null. - - * compiler.cs (InterpreterFactory.GroupCount): Fix. The 0'th - index corresponds to Opcode.Info. - - * parser.cs (Parser.Unescape): If the string doesn't contain any - '\' character, don't allocate a new string. - - * replace.cs (ReplacementEvalutator.Term.AppendResult): Rename - from GetResult. Append to a passed-in StringBuilder rather than - return a string. - (ReplacementEvaluator.Evaluate): Update. - - * Capture.cs, Group.cs, Match.cs: New files split out of ... - * match.cs: ... this. Remove. - -2005-02-27 Gonzalo Paniagua Javier - - * parser.cs: stuff inside {} might not be a quantifier. Fixes - bug #69193. - -2005-01-10 Gonzalo Paniagua Javier - - * quicksearch.cs: handle IgnoreCase when getting the shift distance. - Fixes bug #69065. Patch by mei@work.email.ne.jp. - -2005-01-08 Miguel de Icaza - - * syntax.cs: Applied patch from mei@work.email.ne.jp to fix bug - #71077. - - * parser.cs: Turns out that \digit sequences are octal sequences - (no leading zero is needed); And the three octal digit rule - applies to the leading zero as well. - - This fixes the Unescape method. - -2004-11-29 Gonzalo Paniagua Javier - - * regex.cs: use NextMatch to move on to the next match. Fixes bug - #57274. - -2004-11-09 Atsushi Enomoto - - * parser.cs : cast. - -2004-11-08 Ben Maurer - - * replace.cs, parser.cs: Use stringbuilder for allocation sanity. - -2004-10-21 Joerg Rosenkranz - - * regex.cs: Fixed a bug introduced with the last patch which - prevented any replacements when a postive count is given. - This also happens in all overloads without count parameter. - -2004-10-18 Gonzalo Paniagua Javier - - * regex.cs: in Replace, when count is negative, replacement continues - to the end of the string. - - Fixes bug #68398. Patch by Jon Larimer. - -2004-06-10 Gert Driesen - - * RegexRunner.cs: fixed case mismatch of methods - -2004-06-10 Gert Driesen - - * RegexRunner.cs: marked TODO, added missing protected internal - fields, throw NotImplementedException in all methods - -2004-06-10 Gert Driesen - - * RegexRunnerFactory.cs: removed comment, no longer throw exception - from ctor - * regex.cs: fixed public API signature by renaming protected - internal fields and adding destructor, added MonoTODO attribute to - fields and method that are not yet implemented, changed not - implemented methods to throw NotImplementedException instead of - Exception, fixed names of field that are serialized - -2004-06-06 Jambunathan K - - * parser.cs: Fixed issues with Regex.Unescape() identified as part of - debugging bug #58256. The original problem reported was about - inconsistency between the way we treat replacement patterns and the - way microsoft treats the replacement patterns in Regex.Replace(). MS - implementation is buggy and doesn't honour escape sequences in the - replacement patterns, even though the SDK claims otherwise. - - -2004-06-01 Gonzalo Paniagua Javier - - * syntax.cs: re-applied my patch from 2004-05-27 plus a fix which is - emitting a Category.All if both a category and its negated value are - present. - -2004-06-01 Gonzalo Paniagua Javier - - * syntax.cs: reverting my previous patch. It causes bigger problems. - -2004-05-27 Gonzalo Paniagua Javier - - * category.cs: added LastValue field to mark the end of enum Category. - * syntax.cs: in CharacterClass, use Category.LastValue to get the size - of the array needed. Use a BitArray instead of bool[]. - In AddCategory(), don't set the opposite category as false. Fixes - bug #59150. All tests pass. - -2004-05-25 Jackson Harper - - * parser.cs: Allow creating a regular expression using {,n} as the - specified. The min bounds is set to -1, I am not completely sure - if that is what it is supposed to be but MS does not set it to 0 - based on testing. Patch by dave-gnome-bugs@earth.li. Fixes bug #56761. - -2004-05-12 Dick Porter - - * regex.cs: - * quicksearch.cs: - * RegexRunnerFactory.cs: - * RegexRunner.cs: More public API difference fixes. - - * GroupCollection.cs: - * MatchCollection.cs: - * CaptureCollection.cs: Moved GroupCollection, MatchCollection and - CaptureCollection so that they no longer inherit from the - non-standard RegexCollectionBase class. Fixes the API difference. - -2004-04-19 Gonzalo Paniagua Javier - - * arch.cs: - * compiler.cs: - * interpreter.cs: - * parser.cs: - * syntax.cs: - Patch by Eric Durand Tremblay. - 1) Capture inner group when named. - 2) Resolved parse error caused by not capturing inner group - 3) Resolved incorrect capture group - 4) Now, not capturing anything when unnamed ( correct behavior) - - -2004-04-19 Gonzalo Paniagua Javier - - * arch.cs: - * compiler.cs: - * interpreter.cs: - * parser.cs: - * syntax.cs: converted to unix line endings. - -2004-03-30 Lluis Sanchez Gual - - * collections.cs: In the indexer, return an empty group if the requested - group is not found. - * match.cs: Added default constructor for Group. - -2004-03-24 Gonzalo Paniagua Javier - - * parser.cs: fixed group numbering. - -2004-03-22 Jackson Harper - - * parser.cs: Use the group number as the name in mapping. Patch by - Gert Driesen. - * regex.cs: Fix off by one error. Patch by Gert Driesen. - -2004-03-17 Francois Beauchemin - * syntax.cs, interpreter.cs, quicksearch.cs, regex.cs, compiler.cs : - Revised support for RigthToLeft. - quicksearch has now an reverse option. - This fixes bug #54537 - - * regex.cs, compiler.cs : - Some code to support CILCompiler. - * regex.cs : - Added some undocumented of MS. - -2004-03-16 Gonzalo Paniagua Javier - - * parser.cs: allow a @"\0" escape sequence. Fixes bug #54797. - -2004-02-01 Miguel de Icaza - - * syntax.cs, interval.cs: Applied patch from Marco Cravairo - through Francois Beauchemin who reviewed on the mailing list. - This fixes bug #45976 - -2004-01-16 Gonzalo Paniagua Javier - - * parser.cs: an opening brace without a - quantifier do not cause a parse error. Fixes bug #52924. - -2004-01-07 Lluis Sanchez Gual - - * regex.cs: In Split(), if the last match is at the end of the string, - an empty string must be added to the array of results. - -2003-12-15 Sanjay Gupta - * match.cs: Check for null value before Substring method call. - Fixes bug #52034. - -2003-11-21 Juraj Skripsky - - * quicksearch.cs: Create and use hashtable only for "long" search - strings. - - (Search): Use simple scan for a single-character search strings. - - (GetChar): Simplify case sensitivity handling. - -2003-11-27 Gonzalo Paniagua Javier - - * interpreter.cs: when evaluating a degenerate match, restore the - RepeatContext if fail. Fixes bug #42529. - -2003-11-22 Jackson Harper - - * regex.cs: Add CultureInvariant flag to RegexOptions. - -2003-11-20 Juraj Skripsky - - * quicksearch.cs: Use a hashtable instead of an array for the - shift table to improve the memory usage. - -2003-11-19 Gonzalo Paniagua Javier - - * regex.cs: - (Split): include capture groups in the results, if any. Fixes bug - #51146. - -2003-07-09 Gonzalo Paniagua Javier - - * regex.cs: patch from Eric Lindvall that fixes bug - #44830. - -2003-03-05 Miguel de Icaza - - * category.cs (CategoryUtils.CategoryFromName): Use StartsWith - ("Is") instead of a substring for (0,2) which was throwing an - exception causing Category.None to be returned - -2003-01-17 Gonzalo Paniagua Javier - - * collections.cs: fixed bug #30091. - -2002-12-20 Gonzalo Paniagua Javier - - * regex.cs: fixed little mistake (closes #35860). - -2002-11-12 Jackson Harper - - * arch.cs compiler.cs regex.cs: Added mapping attribute to MachineFactories - -2002-11-06 Gonzalo Paniagua Javier - - * parser.cs: detect illegal \ at end of pattern. Fixes 31334. - -2002-10-25 Gonzalo Paniagua Javier - - * parser.cs: applied fix from Tim Haynes (thaynes@openlinksw.com) to - solve bug #32807. Also modified GetMapping to return the same as MS. - -2002-08-28 Juli Mallett - - * arch.cs, compiler.cs: Give the interpreter machine a property - for the retrieval of the group count. - - * regex.cs: Use the new GroupCount property of the factory to - initialise the current group count, and restructure code to compile - the pattern only the first time it is needed (essentially backing - out the previous revision of regex.cs, to use the new code.) - -2002-08-14 Cesar Octavio Lopez Nataren - - * regex.cs: Added the ctr for ISerializable implementation and - implemented the GetObjectData function. - -2002-07-30 Juli Mallett - - * regex.cs: Fixed bug where the expression would not be - re-evaluated for grouping purposes when factory caches were - used, resulting in no groups being recognised after one call - with a given pattern and no change in options. - -2002-05-13 Dan Lewis - - * regex.cs: Fixed bug in split. - -2002-05-08 Dan Lewis - - * interpreter.cs: Moved to an array-based stack representation - for faster captures. - - * match.cs, collections.cs: Decoupled capture representation from - interpreter internals. - - * cache.cs: Changed Key type from struct to class for speed. - -2002-04-06 Dan Lewis - - * cache.cs: Object methods should be overridden with "override". - -2002-04-04 Dan Lewis - - * RegexRunner.cs, RegexRunnerFactory.cs: MS support classes. Stubs - added for completeness. - - * regex.cs, match.cs, collections.cs: Serializable attribute. - -2002-04-04 Dan Lewis - - * regex.cs: Added static Matches and IsMatch methods. - -2002-04-03 Dan Lewis - - * ChangeLog: Added changelog. - - * cache.cs: Fixed bug in MRUList.Evict. diff --git a/mcs/class/System/System.Text.RegularExpressions/Group.cs b/mcs/class/System/System.Text.RegularExpressions/Group.cs deleted file mode 100644 index ca7c74a1edd..00000000000 --- a/mcs/class/System/System.Text.RegularExpressions/Group.cs +++ /dev/null @@ -1,73 +0,0 @@ -// -// assembly: System -// namespace: System.Text.RegularExpressions -// file: Group.cs -// -// author: Dan Lewis (dlewis@gmx.co.uk) -// (c) 2002 -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Text.RegularExpressions { - - [Serializable] - public partial class Group : Capture { - - [MonoTODO ("not thread-safe")] - public static Group Synchronized (Group inner) - { - if (inner == null) - throw new ArgumentNullException ("inner"); - return inner; - } - - internal static Group Fail = new Group (); - public CaptureCollection Captures { - get { return captures; } - } - public bool Success { - get { return success; } - } - - // internal - internal Group (string text, int index, int length, int n_caps) : base (text, index, length) - { - success = true; - captures = new CaptureCollection (n_caps); - captures.SetValue (this, n_caps - 1); - } - - internal Group (string text, int index, int length) : base (text, index, length) - { - success = true; - } - - internal Group () : base ("") - { - success = false; - captures = new CaptureCollection (0); - } - - private bool success; - private CaptureCollection captures; - } -} diff --git a/mcs/class/System/System.Text.RegularExpressions/GroupCollection.cs b/mcs/class/System/System.Text.RegularExpressions/GroupCollection.cs deleted file mode 100644 index 66f709fb905..00000000000 --- a/mcs/class/System/System.Text.RegularExpressions/GroupCollection.cs +++ /dev/null @@ -1,109 +0,0 @@ -// -// System.Text.RegularExpressions.GroupCollection -// -// Authors: -// Dan Lewis (dlewis@gmx.co.uk) -// Dick Porter (dick@ximian.com) -// -// (C) 2002 Dan Lewis -// (C) 2004 Novell, Inc. -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; - -namespace System.Text.RegularExpressions -{ - [Serializable] - public class GroupCollection: ICollection, IEnumerable - { - private Group [] list; - private int gap; - - /* No public constructor */ - internal GroupCollection (int n, int gap) - { - list = new Group [n]; - this.gap = gap; - } - - public int Count { - get { return list.Length; } - } - - public bool IsReadOnly { - get { return true; } - } - - public bool IsSynchronized { - get { return false; } - } - - public Group this [int groupnum] { - get { - if (groupnum >= gap) { - Match m = (Match) list [0]; - groupnum = m == Match.Empty ? -1 : m.Regex.GetGroupIndex (groupnum); - } - return groupnum < 0 ? Group.Fail : list [groupnum]; - } - } - - internal void SetValue (Group g, int i) - { - list [i] = g; - } - - public Group this [string groupName] { - get { - // The 0th group is the match. - Match m = (Match) list [0]; - if (m != Match.Empty) { - int number = m.Regex.GroupNumberFromName (groupName); - if (number != -1) - return this [number]; - } - - return Group.Fail; - } - } - - public object SyncRoot { - get { return list; } - } - - public void CopyTo (Array array, int arrayIndex) - { - list.CopyTo (array, arrayIndex); - } - - public IEnumerator GetEnumerator () - { - return list.GetEnumerator (); - } - } -} - - - diff --git a/mcs/class/System/System.Text.RegularExpressions/JvmReMachineFactory.cs b/mcs/class/System/System.Text.RegularExpressions/JvmReMachineFactory.cs deleted file mode 100644 index 184aefb2275..00000000000 --- a/mcs/class/System/System.Text.RegularExpressions/JvmReMachineFactory.cs +++ /dev/null @@ -1,74 +0,0 @@ -// -// JvmReMachineFactory.jvm.cs -// -// Author: -// Arina Itkes -// -// Copyright (C) 2007 Mainsoft, Inc. -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -using System; -using System.Collections; -using System.Text; - -namespace System.Text.RegularExpressions -{ - sealed class JvmReMachineFactory : IMachineFactory - { - readonly JvmReMachine _machine; - - public JvmReMachineFactory (PatternData patternData) { - _machine = new JvmReMachine (patternData); - } - - public IMachine NewInstance () { - return _machine; - } - - public JvmReMachine GetMachine () { - return _machine; - } - - public IDictionary Mapping { - get { return _machine.Mapping; } - set { throw new NotImplementedException ("Mapping setter of JvmReMachineFactory should not be called."); }//We must implement the setter of interface but it is not in use - } - - public string [] NamesMapping { - get { return _machine.NamesMapping; } - set { throw new NotImplementedException ("NamesMapping setter of JvmReMachineFactory should not be called."); }//We must implement the setter of interface but it is not in use - } - - public int GroupCount { - get { return _machine.GroupCount; } - } - - public int Gap { - // FIXME: fix definition once JvmMachine is updated - get { return 1 + GroupCount; } - set { throw new NotImplementedException ("Gap setter of JvmReMachineFactory should not be called."); }//We must implement the setter of interface but it is not in use - } - } -} \ No newline at end of file diff --git a/mcs/class/System/System.Text.RegularExpressions/Match.cs b/mcs/class/System/System.Text.RegularExpressions/Match.cs deleted file mode 100644 index e5a232ab90c..00000000000 --- a/mcs/class/System/System.Text.RegularExpressions/Match.cs +++ /dev/null @@ -1,118 +0,0 @@ -// -// assembly: System -// namespace: System.Text.RegularExpressions -// file: Match.cs -// -// author: Dan Lewis (dlewis@gmx.co.uk) -// (c) 2002 -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Text.RegularExpressions { - - [Serializable] - public partial class Match : Group { - public static Match Empty { - get { return empty; } - } - - [MonoTODO ("not thread-safe")] - public static Match Synchronized (Match inner) - { - if (inner == null) - throw new ArgumentNullException ("inner"); - return inner; // FIXME need to sync on machine access - } - - public virtual GroupCollection Groups { - get { return groups; } - } - - public Match NextMatch () - { - if (this == Empty) - return Empty; - - int scan_ptr = regex.RightToLeft ? Index : Index + Length; - - // next match after an empty match: make sure scan ptr makes progress - - if (Length == 0) - scan_ptr += regex.RightToLeft ? -1 : +1; - - return machine.Scan (regex, Text, scan_ptr, text_length); - } - - public virtual string Result (string replacement) - { - if (replacement == null) - throw new ArgumentNullException ("replacement"); - if (machine == null) - throw new NotSupportedException ("Result cannot be called on failed Match."); - - return machine.Result (replacement, this); - } - - // internal - - private Match () - { - this.regex = null; - this.machine = null; - this.text_length = 0; - - this.groups = new GroupCollection (1, 1); - groups.SetValue (this, 0); - } - - internal Match (Regex regex, IMachine machine, string text, int text_length, int n_groups, - int index, int length) : - base (text, index, length) { - this.regex = regex; - this.machine = machine; - this.text_length = text_length; - } - internal Match (Regex regex, IMachine machine, string text, int text_length, int n_groups, - int index, int length, int n_caps) : - base (text, index, length, n_caps) - { - this.regex = regex; - this.machine = machine; - this.text_length = text_length; - - this.groups = new GroupCollection (n_groups, regex.Gap); - groups.SetValue (this, 0); - } - internal Regex Regex { - get { return regex; } - } - - // private - - private Regex regex; - private IMachine machine; - private int text_length; - private GroupCollection groups; - - private static Match empty = new Match (); - } -} diff --git a/mcs/class/System/System.Text.RegularExpressions/MatchCollection.cs b/mcs/class/System/System.Text.RegularExpressions/MatchCollection.cs deleted file mode 100644 index 5cc0a733de7..00000000000 --- a/mcs/class/System/System.Text.RegularExpressions/MatchCollection.cs +++ /dev/null @@ -1,150 +0,0 @@ -// -// System.Text.RegularExpressions.MatchCollection -// -// Authors: -// Dan Lewis (dlewis@gmx.co.uk) -// Dick Porter (dick@ximian.com) -// -// (C) 2002 Dan Lewis -// (C) 2004 Novell, Inc. -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; - -namespace System.Text.RegularExpressions -{ - [Serializable] - public class MatchCollection: ICollection, IEnumerable { - private Match current; - - // Stores all the matches before 'current'. If !current.Success, it has all the successful matches. - private ArrayList list; - - /* No public constructor */ - internal MatchCollection (Match start) - { - current = start; - list = new ArrayList (); - } - - public int Count { - get { return FullList.Count; } - } - - public bool IsReadOnly { - get { return true; } - } - - public bool IsSynchronized { - get { return false; } - } - - - public virtual Match this [int i] { - get { - if (i < 0 || !TryToGet (i)) - throw new ArgumentOutOfRangeException ("i"); - return i < list.Count ? (Match) list [i] : current; - } - } - - public object SyncRoot { - get { return list; } - } - - public void CopyTo (Array array, int arrayIndex) - { - FullList.CopyTo (array, arrayIndex); - } - - public IEnumerator GetEnumerator () - { - // If !current.Success, the list is fully populated. So, just use it. - return current.Success ? new Enumerator (this) : list.GetEnumerator (); - } - - // Returns true when: i < list.Count => this [i] == list [i] - // i == list.Count && current.Success => this [i] == current - private bool TryToGet (int i) - { - while (i > list.Count && current.Success) { - list.Add (current); - current = current.NextMatch (); - } - // Here we have: !(i > list.Count && current.Success) - // or in a slightly more useful form: i > list.Count => current.Success == false - return i < list.Count || current.Success; - } - - private ICollection FullList { - get { - if (TryToGet (Int32.MaxValue)) { - // list.Count == Int32.MaxValue && current.Success - // i.e., we have more than Int32.MaxValue matches. - // We can't represent that number with Int32. - throw new SystemException ("too many matches"); - } - return list; - } - } - - class Enumerator : IEnumerator { - int index; - MatchCollection coll; - - internal Enumerator (MatchCollection coll) - { - this.coll = coll; - index = -1; - } - - void IEnumerator.Reset () - { - index = -1; - } - - object IEnumerator.Current { - get { - if (index < 0) - throw new InvalidOperationException ("'Current' called before 'MoveNext()'"); - if (index > coll.list.Count) - throw new SystemException ("MatchCollection in invalid state"); - if (index == coll.list.Count && !coll.current.Success) - throw new InvalidOperationException ("'Current' called after 'MoveNext()' returned false"); - return index < coll.list.Count ? coll.list [index] : coll.current; - } - } - - bool IEnumerator.MoveNext () - { - if (index > coll.list.Count) - throw new SystemException ("MatchCollection in invalid state"); - if (index == coll.list.Count && !coll.current.Success) - return false; - return coll.TryToGet (++index); - } - } - } -} diff --git a/mcs/class/System/System.Text.RegularExpressions/MatchEvaluator.cs b/mcs/class/System/System.Text.RegularExpressions/MatchEvaluator.cs deleted file mode 100644 index 1e8894373b9..00000000000 --- a/mcs/class/System/System.Text.RegularExpressions/MatchEvaluator.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// assembly: System -// namespace: System.Text.RegularExpressions -// file: regex.cs -// -// author: Dan Lewis (dlewis@gmx.co.uk) -// (c) 2002 -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Text.RegularExpressions { - - [Serializable] - public delegate string MatchEvaluator (Match match); -} diff --git a/mcs/class/System/System.Text.RegularExpressions/Regex.cs b/mcs/class/System/System.Text.RegularExpressions/Regex.cs deleted file mode 100644 index ac662abc630..00000000000 --- a/mcs/class/System/System.Text.RegularExpressions/Regex.cs +++ /dev/null @@ -1,686 +0,0 @@ -// -// assembly: System -// namespace: System.Text.RegularExpressions -// file: regex.cs -// -// author: Dan Lewis (dlewis@gmx.co.uk) -// (c) 2002 - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Text; -using System.Collections; -using System.Reflection; -#if !FULL_AOT_RUNTIME -using System.Reflection.Emit; -#endif -using System.Runtime.Serialization; - -using RegularExpression = System.Text.RegularExpressions.Syntax.RegularExpression; -using Parser = System.Text.RegularExpressions.Syntax.Parser; - -using System.Diagnostics; - - -namespace System.Text.RegularExpressions { - - [Serializable] - public partial class Regex : ISerializable { - -#if !FULL_AOT_RUNTIME - [MonoTODO] - public static void CompileToAssembly (RegexCompilationInfo [] regexes, AssemblyName aname) - { - Regex.CompileToAssembly(regexes, aname, new CustomAttributeBuilder [] {}, null); - } - - [MonoTODO] - public static void CompileToAssembly (RegexCompilationInfo [] regexes, AssemblyName aname, - CustomAttributeBuilder [] attribs) - { - Regex.CompileToAssembly(regexes, aname, attribs, null); - } - - [MonoTODO] - public static void CompileToAssembly (RegexCompilationInfo [] regexes, AssemblyName aname, - CustomAttributeBuilder [] attribs, string resourceFile) - { - throw new NotImplementedException (); - // TODO : Make use of attribs and resourceFile parameters - /* - AssemblyBuilder asmBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly (aname, AssemblyBuilderAccess.RunAndSave); - ModuleBuilder modBuilder = asmBuilder.DefineDynamicModule("InnerRegexModule",aname.Name); - Parser psr = new Parser (); - - System.Console.WriteLine("CompileToAssembly"); - - for(int i=0; i < regexes.Length; i++) - { - System.Console.WriteLine("Compiling expression :" + regexes[i].Pattern); - RegularExpression re = psr.ParseRegularExpression (regexes[i].Pattern, regexes[i].Options); - - // compile - - CILCompiler cmp = new CILCompiler (modBuilder, i); - bool reverse = (regexes[i].Options & RegexOptions.RightToLeft) !=0; - re.Compile (cmp, reverse); - cmp.Close(); - - } - - - // Define a runtime class with specified name and attributes. - TypeBuilder builder = modBuilder.DefineType("ITest"); - builder.CreateType(); - asmBuilder.Save(aname.Name); - */ - } -#endif - - public static string Escape (string str) - { - if (str == null) - throw new ArgumentNullException ("str"); - return Parser.Escape (str); - } - - public static string Unescape (string str) - { - if (str == null) - throw new ArgumentNullException ("str"); - return Parser.Unescape (str); - } - - public static bool IsMatch (string input, string pattern) - { - return IsMatch (input, pattern, RegexOptions.None); - } - - public static bool IsMatch (string input, string pattern, RegexOptions options) - { - Regex re = new Regex (pattern, options); - return re.IsMatch (input); - } - - public static Match Match (string input, string pattern) - { - return Regex.Match (input, pattern, RegexOptions.None); - } - - public static Match Match (string input, string pattern, RegexOptions options) - { - Regex re = new Regex (pattern, options); - return re.Match (input); - } - - public static MatchCollection Matches (string input, string pattern) - { - return Matches (input, pattern, RegexOptions.None); - } - - public static MatchCollection Matches (string input, string pattern, RegexOptions options) - { - Regex re = new Regex (pattern, options); - return re.Matches (input); - } - - public static string Replace (string input, string pattern, MatchEvaluator evaluator) - { - return Regex.Replace (input, pattern, evaluator, RegexOptions.None); - } - - public static string Replace (string input, string pattern, MatchEvaluator evaluator, - RegexOptions options) - { - Regex re = new Regex (pattern, options); - return re.Replace (input, evaluator); - } - - public static string Replace (string input, string pattern, string replacement) - { - return Regex.Replace (input, pattern, replacement, RegexOptions.None); - } - - public static string Replace (string input, string pattern, string replacement, - RegexOptions options) - { - Regex re = new Regex (pattern, options); - return re.Replace (input, replacement); - } - - public static string [] Split (string input, string pattern) - { - return Regex.Split (input, pattern, RegexOptions.None); - } - - public static string [] Split (string input, string pattern, RegexOptions options) - { - Regex re = new Regex (pattern, options); - return re.Split (input); - } - - static FactoryCache cache = new FactoryCache (15); - public static int CacheSize { - get { return cache.Capacity; } - set { - if (value < 0) - throw new ArgumentOutOfRangeException ("CacheSize"); - - cache.Capacity = value; - } - } - - // private - - - // constructors - - // This constructor is used by compiled regular expressions that are - // classes derived from Regex class. No initialization required. - protected Regex () - { - } - - public Regex (string pattern) : this (pattern, RegexOptions.None) - { - } - - public Regex (string pattern, RegexOptions options) - { - if (pattern == null) - throw new ArgumentNullException ("pattern"); - validate_options (options); - this.pattern = pattern; - this.roptions = options; - Init (); - } - -#if NET_4_5 - [MonoTODO ("Timeouts are ignored.")] - public Regex (string pattern, RegexOptions options, TimeSpan matchTimeout) - : this (pattern, options) - { - MatchTimeout = matchTimeout; - } - - [MonoTODO ("Timeouts are ignored.")] - public TimeSpan MatchTimeout { - get; - private set; - } - - [MonoTODO ("Timeouts are ignored.")] - public static bool IsMatch ( - string input, string pattern, RegexOptions options, TimeSpan matchTimeout) - { - return IsMatch (input, pattern, options); - } - - [MonoTODO ("Timeouts are ignored.")] - public static Match Match ( - string input, string pattern, RegexOptions options, TimeSpan matchTimeout) - { - return Match (input, pattern, options); - } - - [MonoTODO ("Timeouts are ignored.")] - public static MatchCollection Matches ( - string input, string pattern, RegexOptions options, TimeSpan matchTimeout) - { - return Matches (input, pattern, options, matchTimeout); - } - - [MonoTODO ("Timeouts are ignored.")] - public static string Replace ( - string input, string pattern, string replacement, RegexOptions options, - TimeSpan matchTimeout) - { - return Replace (input, pattern, replacement, options); - } - - [MonoTODO ("Timeouts are ignored.")] - public static string Replace ( - string input, string pattern, MatchEvaluator evaluator, RegexOptions options, - TimeSpan matchTimeout) - { - return Replace (input, pattern, evaluator, options); - } - - [MonoTODO ("Timeouts are ignored.")] - public static string[] Split ( - string input, string pattern, RegexOptions options, TimeSpan matchTimeout) - { - return Split (input, pattern, options); - } - - public static readonly TimeSpan InfiniteMatchTimeout = TimeSpan.FromMilliseconds (-1); -#endif - - static void validate_options (RegexOptions options) - { - const RegexOptions allopts = - RegexOptions.None | - RegexOptions.IgnoreCase | - RegexOptions.Multiline | - RegexOptions.ExplicitCapture | -#if MOBILE || !NET_2_1 - RegexOptions.Compiled | -#endif - RegexOptions.Singleline | - RegexOptions.IgnorePatternWhitespace | - RegexOptions.RightToLeft | - RegexOptions.ECMAScript | - RegexOptions.CultureInvariant; - - const RegexOptions ecmaopts = - RegexOptions.IgnoreCase | - RegexOptions.Multiline | -#if MOBILE || !NET_2_1 - RegexOptions.Compiled | -#endif - RegexOptions.ECMAScript; - - if ((options & ~allopts) != 0) - throw new ArgumentOutOfRangeException ("options"); - if ((options & RegexOptions.ECMAScript) != 0 && (options & ~ecmaopts) != 0) - throw new ArgumentOutOfRangeException ("options"); - } - - private void Init () - { - this.machineFactory = cache.Lookup (this.pattern, this.roptions); - - if (this.machineFactory == null) { - InitNewRegex(); - } else { - this.group_count = this.machineFactory.GroupCount; - this.gap = this.machineFactory.Gap; - this.mapping = this.machineFactory.Mapping; - this.group_names = this.machineFactory.NamesMapping; - } - } - - private void InitNewRegex () - { - this.machineFactory = CreateMachineFactory (this.pattern, this.roptions); - cache.Add (this.pattern, this.roptions, this.machineFactory); - this.group_count = machineFactory.GroupCount; - this.gap = this.machineFactory.Gap; - this.mapping = machineFactory.Mapping; - this.group_names = this.machineFactory.NamesMapping; - } - -#if !NET_2_1 - // The new rx engine seems to be working now, but - // potential problems are being tracked down here: - // https://bugzilla.novell.com/show_bug.cgi?id=470827 - static readonly bool old_rx = - Environment.GetEnvironmentVariable ("MONO_NEW_RX") == null; -#endif - - private static IMachineFactory CreateMachineFactory (string pattern, RegexOptions options) - { - Parser psr = new Parser (); - RegularExpression re = psr.ParseRegularExpression (pattern, options); - -#if NET_2_1 - ICompiler cmp = new PatternCompiler (); -#else - ICompiler cmp; - if (!old_rx) { - if ((options & RegexOptions.Compiled) != 0) - cmp = new CILCompiler (); - else - cmp = new RxCompiler (); - } else { - cmp = new PatternCompiler (); - } -#endif - - re.Compile (cmp, (options & RegexOptions.RightToLeft) != 0); - - IMachineFactory machineFactory = cmp.GetMachineFactory (); - Hashtable mapping = new Hashtable (); - machineFactory.Gap = psr.GetMapping (mapping); - machineFactory.Mapping = mapping; - machineFactory.NamesMapping = GetGroupNamesArray (machineFactory.GroupCount, machineFactory.Mapping); - - return machineFactory; - } - - protected Regex (SerializationInfo info, StreamingContext context) : - this (info.GetString ("pattern"), - (RegexOptions) info.GetValue ("options", typeof (RegexOptions))) - { - } - - // public instance properties - - public RegexOptions Options { - get { return roptions; } - } - - public bool RightToLeft { - get { return (roptions & RegexOptions.RightToLeft) != 0; } - } - - // public instance methods - - public string [] GetGroupNames () - { - string [] names = new string [1 + group_count]; - Array.Copy (group_names, names, 1 + group_count); - return names; - } - - public int [] GetGroupNumbers () - { - int [] numbers = new int [1 + group_count]; - Array.Copy (GroupNumbers, numbers, 1 + group_count); - return numbers; - } - - public string GroupNameFromNumber (int i) - { - i = GetGroupIndex (i); - if (i < 0) - return ""; - - return group_names [i]; - } - - public int GroupNumberFromName (string name) - { - if (!mapping.Contains (name)) - return -1; - int i = (int) mapping [name]; - if (i >= gap) - i = Int32.Parse (name); - return i; - } - - internal int GetGroupIndex (int number) - { - if (number < gap) - return number; - if (gap > group_count) - return -1; - return Array.BinarySearch (GroupNumbers, gap, group_count - gap + 1, number); - } - - int default_startat (string input) - { - return (RightToLeft && input != null) ? input.Length : 0; - } - - // match methods - - public bool IsMatch (string input) - { - return IsMatch (input, default_startat (input)); - } - - public bool IsMatch (string input, int startat) - { - return Match (input, startat).Success; - } - - public Match Match (string input) - { - return Match (input, default_startat (input)); - } - - public Match Match (string input, int startat) - { - if (input == null) - throw new ArgumentNullException ("input"); - if (startat < 0 || startat > input.Length) - throw new ArgumentOutOfRangeException ("startat"); - return CreateMachine ().Scan (this, input, startat, input.Length, false); - } - - public Match Match (string input, int beginning, int length) - { - if (input == null) - throw new ArgumentNullException ("input"); - if (beginning < 0 || beginning > input.Length) - throw new ArgumentOutOfRangeException ("beginning"); - if (length < 0 || length > input.Length - beginning) - throw new ArgumentOutOfRangeException ("length"); - return CreateMachine ().Scan (this, input, beginning, beginning + length, true); - } - - public MatchCollection Matches (string input) - { - return Matches (input, default_startat (input)); - } - - public MatchCollection Matches (string input, int startat) - { - Match m = Match (input, startat); - return new MatchCollection (m); - } - - // replace methods - - public string Replace (string input, MatchEvaluator evaluator) - { - return Replace (input, evaluator, Int32.MaxValue, default_startat (input)); - } - - public string Replace (string input, MatchEvaluator evaluator, int count) - { - return Replace (input, evaluator, count, default_startat (input)); - } - - class Adapter { - MatchEvaluator ev; - public Adapter (MatchEvaluator ev) { this.ev = ev; } - public void Evaluate (Match m, StringBuilder sb) { sb.Append (ev (m)); } - } - - public string Replace (string input, MatchEvaluator evaluator, int count, int startat) - { - if (input == null) - throw new ArgumentNullException ("input"); - if (evaluator == null) - throw new ArgumentNullException ("evaluator"); - if (count < -1) - throw new ArgumentOutOfRangeException ("count"); - if (startat < 0 || startat > input.Length) - throw new ArgumentOutOfRangeException ("startat"); - - BaseMachine m = (BaseMachine)CreateMachine (); - - if (RightToLeft) - return m.RTLReplace (this, input, evaluator, count, startat); - - // NOTE: If this is a cause of a lot of allocations, we can convert it to - // use a ThreadStatic allocation mitigator - Adapter a = new Adapter (evaluator); - - return m.LTRReplace (this, input, new BaseMachine.MatchAppendEvaluator (a.Evaluate), - count, startat); - } - - public string Replace (string input, string replacement) - { - return Replace (input, replacement, Int32.MaxValue, default_startat (input)); - } - - public string Replace (string input, string replacement, int count) - { - return Replace (input, replacement, count, default_startat (input)); - } - - public string Replace (string input, string replacement, int count, int startat) - { - if (input == null) - throw new ArgumentNullException ("input"); - if (replacement == null) - throw new ArgumentNullException ("replacement"); - if (count < -1) - throw new ArgumentOutOfRangeException ("count"); - if (startat < 0 || startat > input.Length) - throw new ArgumentOutOfRangeException ("startat"); - - return CreateMachine ().Replace (this, input, replacement, count, startat); - } - - // split methods - - public string [] Split (string input) - { - return Split (input, Int32.MaxValue, default_startat (input)); - } - - public string [] Split (string input, int count) - { - return Split (input, count, default_startat (input)); - } - - public string [] Split (string input, int count, int startat) - { - if (input == null) - throw new ArgumentNullException ("input"); - if (count < 0) - throw new ArgumentOutOfRangeException ("count"); - if (startat < 0 || startat > input.Length) - throw new ArgumentOutOfRangeException ("startat"); - - return CreateMachine ().Split (this, input, count, startat); - } - - // This method is called at the end of the constructor of compiled - // regular expression classes to do internal initialization. - protected void InitializeReferences () - { - if (refsInitialized) - throw new NotSupportedException ("This operation is only allowed once per object."); - - refsInitialized = true; - - // Compile pattern that results in performance loss as existing - // CIL code is ignored but provides support for regular - // expressions compiled to assemblies. - Init (); - } -#if !NET_2_1 - protected bool UseOptionC () - { - return ((roptions & RegexOptions.Compiled) != 0); - } -#endif - protected bool UseOptionR () - { - return ((roptions & RegexOptions.RightToLeft) != 0); - } - - // object methods - - public override string ToString () - { - return pattern; - } - - // ISerializable interface - void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context) - { - info.AddValue ("pattern", this.ToString (), typeof (string)); - info.AddValue ("options", this.Options, typeof (RegexOptions)); - } - - // internal - - internal int GroupCount { - get { return group_count; } - } - - internal int Gap { - get { return gap; } - } - - // private - - private IMachine CreateMachine () - { - return machineFactory.NewInstance (); - } - - private static string [] GetGroupNamesArray (int groupCount, IDictionary mapping) - { - string [] group_names = new string [groupCount + 1]; - IDictionaryEnumerator de = mapping.GetEnumerator (); - while (de.MoveNext ()) - group_names [(int) de.Value] = (string) de.Key; - return group_names; - } - - private int [] GroupNumbers { - get { - if (group_numbers == null) { - group_numbers = new int [1 + group_count]; - for (int i = 0; i < gap; ++i) - group_numbers [i] = i; - for (int i = gap; i <= group_count; ++i) - group_numbers [i] = Int32.Parse (group_names [i]); - return group_numbers; - } - return group_numbers; - } - } - - private IMachineFactory machineFactory; - private IDictionary mapping; - private int group_count; - private int gap; - private bool refsInitialized; - private string [] group_names; - private int [] group_numbers; - - // protected members - - protected internal string pattern; - protected internal RegexOptions roptions; - - // MS undocumented members -#if NET_2_1 - [MonoTODO] - internal System.Collections.Generic.Dictionary capnames; - [MonoTODO] - internal System.Collections.Generic.Dictionary caps; -#else - [MonoTODO] - protected internal System.Collections.Hashtable capnames; - [MonoTODO] - protected internal System.Collections.Hashtable caps; - - [MonoTODO] - protected internal RegexRunnerFactory factory; -#endif - [MonoTODO] - protected internal int capsize; - [MonoTODO] - protected internal string [] capslist; - } -} diff --git a/mcs/class/System/System.Text.RegularExpressions/RegexCompilationInfo.cs b/mcs/class/System/System.Text.RegularExpressions/RegexCompilationInfo.cs deleted file mode 100644 index 2addae024bd..00000000000 --- a/mcs/class/System/System.Text.RegularExpressions/RegexCompilationInfo.cs +++ /dev/null @@ -1,89 +0,0 @@ -// -// assembly: System -// namespace: System.Text.RegularExpressions -// file: regex.cs -// -// author: Dan Lewis (dlewis@gmx.co.uk) -// (c) 2002 -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Text.RegularExpressions { - - [Serializable] - public class RegexCompilationInfo { - - public RegexCompilationInfo (string pattern, RegexOptions options, string name, string fullnamespace, bool ispublic) - { - Pattern = pattern; - Options = options; - Name = name; - Namespace = fullnamespace; - IsPublic = ispublic; - } - - public bool IsPublic { - get { return isPublic; } - set { isPublic = value; } - } - - public string Name { - get { return name; } - set { - if (value == null) - throw new ArgumentNullException ("Name"); - if (value.Length == 0) - throw new ArgumentException ("Name"); - name = value; - } - } - - public string Namespace { - get { return nspace; } - set { - if (value == null) - throw new ArgumentNullException ("Namespace"); - nspace = value; - } - } - - public RegexOptions Options { - get { return options; } - set { options = value; } - } - - public string Pattern { - get { return pattern; } - set { - if (value == null) - throw new ArgumentNullException ("pattern"); - pattern = value; - } - } - - // private - - private string pattern, name, nspace; - private RegexOptions options; - private bool isPublic; - } -} diff --git a/mcs/class/System/System.Text.RegularExpressions/RegexMatchTimeoutException.cs b/mcs/class/System/System.Text.RegularExpressions/RegexMatchTimeoutException.cs deleted file mode 100644 index b6ffb1a4c3b..00000000000 --- a/mcs/class/System/System.Text.RegularExpressions/RegexMatchTimeoutException.cs +++ /dev/null @@ -1,82 +0,0 @@ -// Authors: -// Martin Baulig (martin.baulig@xamarin.com) -// -// Copyright 2012 Xamarin Inc. (http://www.xamarin.com) -// -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -#if NET_4_5 -using System; -using System.Runtime.Serialization; - -namespace System.Text.RegularExpressions { - [MonoTODO] - [Serializable] - public class RegexMatchTimeoutException : TimeoutException, ISerializable { - - string input = string.Empty; - string pattern = string.Empty; - TimeSpan timeout = TimeSpan.FromTicks (-1); - - public RegexMatchTimeoutException () - { - - } - - public RegexMatchTimeoutException (string message) - : base (message) - { - - } - - public RegexMatchTimeoutException (string message, Exception inner) - : base (message, inner) - { - } - - public RegexMatchTimeoutException (string regexInput, string regexPattern, - TimeSpan matchTimeout) - { - input = regexInput; - pattern = regexPattern; - timeout = matchTimeout; - } - - protected RegexMatchTimeoutException (SerializationInfo info, StreamingContext context) - : base (info, context) - { - throw new NotImplementedException (); - } - - public string Input { - get { return input; } - } - - public string Pattern { - get { return pattern; } - } - - public TimeSpan MatchTimeout { - get { return timeout; } - } - } -} -#endif diff --git a/mcs/class/System/System.Text.RegularExpressions/RegexOptions.cs b/mcs/class/System/System.Text.RegularExpressions/RegexOptions.cs deleted file mode 100644 index 1a2599d64a5..00000000000 --- a/mcs/class/System/System.Text.RegularExpressions/RegexOptions.cs +++ /dev/null @@ -1,47 +0,0 @@ -// -// assembly: System -// namespace: System.Text.RegularExpressions -// file: regex.cs -// -// author: Dan Lewis (dlewis@gmx.co.uk) -// (c) 2002 - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Text.RegularExpressions { - - [Flags] - public enum RegexOptions { - None = 0x000, - IgnoreCase = 0x001, - Multiline = 0x002, - ExplicitCapture = 0x004, -#if MOBILE || !NET_2_1 - Compiled = 0x008, -#endif - Singleline = 0x010, - IgnorePatternWhitespace = 0x020, - RightToLeft = 0x040, - ECMAScript = 0x100, - CultureInvariant = 0x200 - } -} diff --git a/mcs/class/System/System.Text.RegularExpressions/RegexRunner.cs b/mcs/class/System/System.Text.RegularExpressions/RegexRunner.cs deleted file mode 100644 index 48b42b9314f..00000000000 --- a/mcs/class/System/System.Text.RegularExpressions/RegexRunner.cs +++ /dev/null @@ -1,173 +0,0 @@ -// -// assembly: System -// namespace: System.Text.RegularExpressions -// file: RegexRunner.cs -// -// author: Dan Lewis (dihlewis@yahoo.co.uk) -// (c) 2002 -// Copyright (C) 2005 Novell, Inc (http://www.novell.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.ComponentModel; - -namespace System.Text.RegularExpressions { - - [EditorBrowsable (EditorBrowsableState.Never)] - [MonoTODO ("RegexRunner is not supported by Mono.")] - public abstract class RegexRunner { - // constructor - - [MonoTODO] - protected internal RegexRunner () - { - } - - // protected abstract - - protected abstract bool FindFirstChar (); - - protected abstract void Go (); - - protected abstract void InitTrackCount (); - - // protected methods - - [MonoTODO] - protected void Capture (int capnum, int start, int end) { - throw new NotImplementedException (); - } - [MonoTODO] - protected static bool CharInClass (char ch, string charClass) - { - throw new NotImplementedException (); - } - [MonoTODO] - protected static bool CharInSet (char ch, string set, string category) { - throw new NotImplementedException (); - } - - [MonoTODO] - protected void Crawl (int i) { - throw new NotImplementedException (); - } - - [MonoTODO] - protected int Crawlpos () { - throw new NotImplementedException (); - } - - [MonoTODO] - protected void DoubleCrawl () { - throw new NotImplementedException (); - } - - [MonoTODO] - protected void DoubleStack () { - throw new NotImplementedException (); - } - - [MonoTODO] - protected void DoubleTrack () { - throw new NotImplementedException (); - } - - [MonoTODO] - protected void EnsureStorage () { - throw new NotImplementedException (); - } - - [MonoTODO] - protected bool IsBoundary (int index, int startpos, int endpos) { - throw new NotImplementedException (); - } - - [MonoTODO] - protected bool IsECMABoundary (int index, int startpos, int endpos) { - throw new NotImplementedException (); - } - - [MonoTODO] - protected bool IsMatched (int cap) { - throw new NotImplementedException (); - } - - [MonoTODO] - protected int MatchIndex (int cap) { - throw new NotImplementedException (); - } - - [MonoTODO] - protected int MatchLength (int cap) { - throw new NotImplementedException (); - } - - [MonoTODO] - protected int Popcrawl () { - throw new NotImplementedException (); - } - - [MonoTODO] - protected void TransferCapture (int capnum, int uncapnum, int start, int end) { - throw new NotImplementedException (); - } - - [MonoTODO] - protected void Uncapture () { - throw new NotImplementedException (); - } - - // internal - - protected internal Match Scan (Regex regex, string text, int textbeg, int textend, int textstart, int prevlen, bool quick) { - throw new NotImplementedException (); - } - - [MonoTODO] - protected internal int[] runcrawl; - [MonoTODO] - protected internal int runcrawlpos; - [MonoTODO] - protected internal Match runmatch; - [MonoTODO] - protected internal Regex runregex; - [MonoTODO] - protected internal int[] runstack; - [MonoTODO] - protected internal int runstackpos; - [MonoTODO] - protected internal string runtext; - [MonoTODO] - protected internal int runtextbeg; - [MonoTODO] - protected internal int runtextend; - [MonoTODO] - protected internal int runtextpos; - [MonoTODO] - protected internal int runtextstart; - [MonoTODO] - protected internal int[] runtrack; - [MonoTODO] - protected internal int runtrackcount; - [MonoTODO] - protected internal int runtrackpos; - } -} diff --git a/mcs/class/System/System.Text.RegularExpressions/RegexRunnerFactory.cs b/mcs/class/System/System.Text.RegularExpressions/RegexRunnerFactory.cs deleted file mode 100644 index d4df8aaa755..00000000000 --- a/mcs/class/System/System.Text.RegularExpressions/RegexRunnerFactory.cs +++ /dev/null @@ -1,41 +0,0 @@ -// -// assembly: System -// namespace: System.Text.RegularExpressions -// file: RegexRunnerFactory.cs -// -// author: Dan Lewis (dihlewis@yahoo.co.uk) -// (c) 2002 - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.ComponentModel; - -namespace System.Text.RegularExpressions { - [EditorBrowsable (EditorBrowsableState.Never)] - public abstract class RegexRunnerFactory { - protected RegexRunnerFactory () { - } - - protected internal abstract RegexRunner CreateInstance (); - } -} diff --git a/mcs/class/System/System.Text.RegularExpressions/RxCompiler.cs b/mcs/class/System/System.Text.RegularExpressions/RxCompiler.cs deleted file mode 100644 index b1495432d68..00000000000 --- a/mcs/class/System/System.Text.RegularExpressions/RxCompiler.cs +++ /dev/null @@ -1,768 +0,0 @@ -using System; -using System.Collections; -using System.Globalization; -using System.Reflection; -using System.Reflection.Emit; - -namespace System.Text.RegularExpressions { - - /* This behaves like a growing list of tuples (base, offsetpos) */ - class RxLinkRef: LinkRef { - public int[] offsets; - public int current = 0; - - public RxLinkRef () - { - offsets = new int [8]; - } - - // the start of the branch instruction - // in the program stream - public void PushInstructionBase (int offset) - { - if ((current & 1) != 0) - throw new Exception (); - if (current == offsets.Length) { - int[] newarray = new int [offsets.Length * 2]; - Array.Copy (offsets, newarray, offsets.Length); - offsets = newarray; - } - offsets [current++] = offset; - } - - // the position in the program stream where the jump offset is stored - public void PushOffsetPosition (int offset) - { - if ((current & 1) == 0) - throw new Exception (); - offsets [current++] = offset; - } - - } - - class RxCompiler : ICompiler { - protected byte[] program = new byte [32]; - protected int curpos = 0; - - public RxCompiler () { - } - - void MakeRoom (int bytes) - { - while (curpos + bytes > program.Length) { - int newsize = program.Length * 2; - byte[] newp = new byte [newsize]; - Buffer.BlockCopy (program, 0, newp, 0, program.Length); - program = newp; - } - } - - void Emit (byte val) - { - MakeRoom (1); - program [curpos] = val; - ++curpos; - } - - void Emit (RxOp opcode) - { - Emit ((byte)opcode); - } - - void Emit (ushort val) - { - MakeRoom (2); - program [curpos] = (byte)val; - program [curpos + 1] = (byte)(val >> 8); - curpos += 2; - } - - void Emit (int val) - { - MakeRoom (4); - program [curpos] = (byte)val; - program [curpos + 1] = (byte)(val >> 8); - program [curpos + 2] = (byte)(val >> 16); - program [curpos + 3] = (byte)(val >> 24); - curpos += 4; - } - - void BeginLink (LinkRef lref) { - RxLinkRef link = lref as RxLinkRef; - link.PushInstructionBase (curpos); - } - - void EmitLink (LinkRef lref) - { - RxLinkRef link = lref as RxLinkRef; - link.PushOffsetPosition (curpos); - Emit ((ushort)0); - } - - // ICompiler implementation - public void Reset () - { - curpos = 0; - } - - public IMachineFactory GetMachineFactory () - { - byte[] code = new byte [curpos]; - Buffer.BlockCopy (program, 0, code, 0, curpos); - //Console.WriteLine ("Program size: {0}", curpos); - - return new RxInterpreterFactory (code, null); - } - - public void EmitFalse () - { - Emit (RxOp.False); - } - - public void EmitTrue () - { - Emit (RxOp.True); - } - - /* Overriden by CILCompiler */ - public virtual void EmitOp (RxOp op, bool negate, bool ignore, bool reverse) { - int offset = 0; - if (negate) - offset += 1; - if (ignore) - offset += 2; - if (reverse) - offset += 4; - - Emit ((RxOp)((int)op + offset)); - } - - public virtual void EmitOpIgnoreReverse (RxOp op, bool ignore, bool reverse) { - int offset = 0; - if (ignore) - offset += 1; - if (reverse) - offset += 2; - - Emit ((RxOp)((int)op + offset)); - } - - public virtual void EmitOpNegateReverse (RxOp op, bool negate, bool reverse) { - int offset = 0; - if (negate) - offset += 1; - if (reverse) - offset += 2; - - Emit ((RxOp)((int)op + offset)); - } - - public void EmitCharacter (char c, bool negate, bool ignore, bool reverse) - { - if (ignore) - c = Char.ToLower (c); - if (c < 256) { - EmitOp (RxOp.Char, negate, ignore, reverse); - Emit ((byte)c); - } else { - EmitOp (RxOp.UnicodeChar, negate, ignore, reverse); - Emit ((ushort)c); - } - } - - void EmitUniCat (UnicodeCategory cat, bool negate, bool reverse) - { - EmitOpNegateReverse (RxOp.CategoryUnicode, negate, reverse); - Emit ((byte)cat); - } - - void EmitCatGeneral (Category cat, bool negate, bool reverse) - { - EmitOpNegateReverse (RxOp.CategoryGeneral, negate, reverse); - Emit ((byte)cat); - } - - public void EmitCategory (Category cat, bool negate, bool reverse) - { - switch (cat) { - case Category.Any: - case Category.EcmaAny: - EmitOpNegateReverse (RxOp.CategoryAny, negate, reverse); - break; - case Category.AnySingleline: - EmitOpNegateReverse (RxOp.CategoryAnySingleline, negate, reverse); - break; - case Category.Word: - EmitOpNegateReverse (RxOp.CategoryWord, negate, reverse); - break; - case Category.Digit: - EmitOpNegateReverse (RxOp.CategoryDigit, negate, reverse); - break; - case Category.WhiteSpace: - EmitOpNegateReverse (RxOp.CategoryWhiteSpace, negate, reverse); - break; - /* FIXME: translate EcmaWord, EcmaWhiteSpace into Bitmaps? EcmaWhiteSpace will fit very well with the IL engine */ - case Category.EcmaWord: - EmitOpNegateReverse (RxOp.CategoryEcmaWord, negate, reverse); - break; - case Category.EcmaDigit: - EmitRange ('0', '9', negate, false, reverse); - break; - case Category.EcmaWhiteSpace: - EmitOpNegateReverse (RxOp.CategoryEcmaWhiteSpace, negate, reverse); - break; - case Category.UnicodeSpecials: - EmitOpNegateReverse (RxOp.CategoryUnicodeSpecials, negate, reverse); - break; - // Unicode categories... - // letter - case Category.UnicodeLu: EmitUniCat (UnicodeCategory.UppercaseLetter, negate, reverse); break; - case Category.UnicodeLl: EmitUniCat (UnicodeCategory.LowercaseLetter, negate, reverse); break; - case Category.UnicodeLt: EmitUniCat (UnicodeCategory.TitlecaseLetter, negate, reverse); break; - case Category.UnicodeLm: EmitUniCat (UnicodeCategory.ModifierLetter, negate, reverse); break; - case Category.UnicodeLo: EmitUniCat (UnicodeCategory.OtherLetter, negate, reverse); break; - // mark - case Category.UnicodeMn: EmitUniCat (UnicodeCategory.NonSpacingMark, negate, reverse); break; - case Category.UnicodeMe: EmitUniCat (UnicodeCategory.EnclosingMark, negate, reverse); break; - case Category.UnicodeMc: EmitUniCat (UnicodeCategory.SpacingCombiningMark, negate, reverse); break; - case Category.UnicodeNd: EmitUniCat (UnicodeCategory.DecimalDigitNumber, negate, reverse); break; - // number - case Category.UnicodeNl: EmitUniCat (UnicodeCategory.LetterNumber, negate, reverse); break; - case Category.UnicodeNo: EmitUniCat (UnicodeCategory.OtherNumber, negate, reverse); break; - // separator - case Category.UnicodeZs: EmitUniCat (UnicodeCategory.SpaceSeparator, negate, reverse); break; - case Category.UnicodeZl: EmitUniCat (UnicodeCategory.LineSeparator, negate, reverse); break; - case Category.UnicodeZp: EmitUniCat (UnicodeCategory.ParagraphSeparator, negate, reverse); break; - // punctuation - case Category.UnicodePd: EmitUniCat (UnicodeCategory.DashPunctuation, negate, reverse); break; - case Category.UnicodePs: EmitUniCat (UnicodeCategory.OpenPunctuation, negate, reverse); break; - case Category.UnicodePi: EmitUniCat (UnicodeCategory.InitialQuotePunctuation, negate, reverse); break; - case Category.UnicodePe: EmitUniCat (UnicodeCategory.ClosePunctuation, negate, reverse); break; - case Category.UnicodePf: EmitUniCat (UnicodeCategory.FinalQuotePunctuation, negate, reverse); break; - case Category.UnicodePc: EmitUniCat (UnicodeCategory.ConnectorPunctuation, negate, reverse); break; - case Category.UnicodePo: EmitUniCat (UnicodeCategory.OtherPunctuation, negate, reverse); break; - // symbol - case Category.UnicodeSm: EmitUniCat (UnicodeCategory.MathSymbol, negate, reverse); break; - case Category.UnicodeSc: EmitUniCat (UnicodeCategory.CurrencySymbol, negate, reverse); break; - case Category.UnicodeSk: EmitUniCat (UnicodeCategory.ModifierSymbol, negate, reverse); break; - case Category.UnicodeSo: EmitUniCat (UnicodeCategory.OtherSymbol, negate, reverse); break; - // other - case Category.UnicodeCc: EmitUniCat (UnicodeCategory.Control, negate, reverse); break; - case Category.UnicodeCf: EmitUniCat (UnicodeCategory.Format, negate, reverse); break; - case Category.UnicodeCo: EmitUniCat (UnicodeCategory.PrivateUse, negate, reverse); break; - case Category.UnicodeCs: EmitUniCat (UnicodeCategory.Surrogate, negate, reverse); break; - case Category.UnicodeCn: EmitUniCat (UnicodeCategory.OtherNotAssigned, negate, reverse); break; - // Unicode block ranges... - case Category.UnicodeBasicLatin: - EmitRange ('\u0000', '\u007F', negate, false, reverse); break; - case Category.UnicodeLatin1Supplement: - EmitRange ('\u0080', '\u00FF', negate, false, reverse); break; - case Category.UnicodeLatinExtendedA: - EmitRange ('\u0100', '\u017F', negate, false, reverse); break; - case Category.UnicodeLatinExtendedB: - EmitRange ('\u0180', '\u024F', negate, false, reverse); break; - case Category.UnicodeIPAExtensions: - EmitRange ('\u0250', '\u02AF', negate, false, reverse); break; - case Category.UnicodeSpacingModifierLetters: - EmitRange ('\u02B0', '\u02FF', negate, false, reverse); break; - case Category.UnicodeCombiningDiacriticalMarks: - EmitRange ('\u0300', '\u036F', negate, false, reverse); break; - case Category.UnicodeGreek: - EmitRange ('\u0370', '\u03FF', negate, false, reverse); break; - case Category.UnicodeCyrillic: - EmitRange ('\u0400', '\u04FF', negate, false, reverse); break; - case Category.UnicodeArmenian: - EmitRange ('\u0530', '\u058F', negate, false, reverse); break; - case Category.UnicodeHebrew: - EmitRange ('\u0590', '\u05FF', negate, false, reverse); break; - case Category.UnicodeArabic: - EmitRange ('\u0600', '\u06FF', negate, false, reverse); break; - case Category.UnicodeSyriac: - EmitRange ('\u0700', '\u074F', negate, false, reverse); break; - case Category.UnicodeThaana: - EmitRange ('\u0780', '\u07BF', negate, false, reverse); break; - case Category.UnicodeDevanagari: - EmitRange ('\u0900', '\u097F', negate, false, reverse); break; - case Category.UnicodeBengali: - EmitRange ('\u0980', '\u09FF', negate, false, reverse); break; - case Category.UnicodeGurmukhi: - EmitRange ('\u0A00', '\u0A7F', negate, false, reverse); break; - case Category.UnicodeGujarati: - EmitRange ('\u0A80', '\u0AFF', negate, false, reverse); break; - case Category.UnicodeOriya: - EmitRange ('\u0B00', '\u0B7F', negate, false, reverse); break; - case Category.UnicodeTamil: - EmitRange ('\u0B80', '\u0BFF', negate, false, reverse); break; - case Category.UnicodeTelugu: - EmitRange ('\u0C00', '\u0C7F', negate, false, reverse); break; - case Category.UnicodeKannada: - EmitRange ('\u0C80', '\u0CFF', negate, false, reverse); break; - case Category.UnicodeMalayalam: - EmitRange ('\u0D00', '\u0D7F', negate, false, reverse); break; - case Category.UnicodeSinhala: - EmitRange ('\u0D80', '\u0DFF', negate, false, reverse); break; - case Category.UnicodeThai: - EmitRange ('\u0E00', '\u0E7F', negate, false, reverse); break; - case Category.UnicodeLao: - EmitRange ('\u0E80', '\u0EFF', negate, false, reverse); break; - case Category.UnicodeTibetan: - EmitRange ('\u0F00', '\u0FFF', negate, false, reverse); break; - case Category.UnicodeMyanmar: - EmitRange ('\u1000', '\u109F', negate, false, reverse); break; - case Category.UnicodeGeorgian: - EmitRange ('\u10A0', '\u10FF', negate, false, reverse); break; - case Category.UnicodeHangulJamo: - EmitRange ('\u1100', '\u11FF', negate, false, reverse); break; - case Category.UnicodeEthiopic: - EmitRange ('\u1200', '\u137F', negate, false, reverse); break; - case Category.UnicodeCherokee: - EmitRange ('\u13A0', '\u13FF', negate, false, reverse); break; - case Category.UnicodeUnifiedCanadianAboriginalSyllabics: - EmitRange ('\u1400', '\u167F', negate, false, reverse); break; - case Category.UnicodeOgham: - EmitRange ('\u1680', '\u169F', negate, false, reverse); break; - case Category.UnicodeRunic: - EmitRange ('\u16A0', '\u16FF', negate, false, reverse); break; - case Category.UnicodeKhmer: - EmitRange ('\u1780', '\u17FF', negate, false, reverse); break; - case Category.UnicodeMongolian: - EmitRange ('\u1800', '\u18AF', negate, false, reverse); break; - case Category.UnicodeLatinExtendedAdditional: - EmitRange ('\u1E00', '\u1EFF', negate, false, reverse); break; - case Category.UnicodeGreekExtended: - EmitRange ('\u1F00', '\u1FFF', negate, false, reverse); break; - case Category.UnicodeGeneralPunctuation: - EmitRange ('\u2000', '\u206F', negate, false, reverse); break; - case Category.UnicodeSuperscriptsandSubscripts: - EmitRange ('\u2070', '\u209F', negate, false, reverse); break; - case Category.UnicodeCurrencySymbols: - EmitRange ('\u20A0', '\u20CF', negate, false, reverse); break; - case Category.UnicodeCombiningMarksforSymbols: - EmitRange ('\u20D0', '\u20FF', negate, false, reverse); break; - case Category.UnicodeLetterlikeSymbols: - EmitRange ('\u2100', '\u214F', negate, false, reverse); break; - case Category.UnicodeNumberForms: - EmitRange ('\u2150', '\u218F', negate, false, reverse); break; - case Category.UnicodeArrows: - EmitRange ('\u2190', '\u21FF', negate, false, reverse); break; - case Category.UnicodeMathematicalOperators: - EmitRange ('\u2200', '\u22FF', negate, false, reverse); break; - case Category.UnicodeMiscellaneousTechnical: - EmitRange ('\u2300', '\u23FF', negate, false, reverse); break; - case Category.UnicodeControlPictures: - EmitRange ('\u2400', '\u243F', negate, false, reverse); break; - case Category.UnicodeOpticalCharacterRecognition: - EmitRange ('\u2440', '\u245F', negate, false, reverse); break; - case Category.UnicodeEnclosedAlphanumerics: - EmitRange ('\u2460', '\u24FF', negate, false, reverse); break; - case Category.UnicodeBoxDrawing: - EmitRange ('\u2500', '\u257F', negate, false, reverse); break; - case Category.UnicodeBlockElements: - EmitRange ('\u2580', '\u259F', negate, false, reverse); break; - case Category.UnicodeGeometricShapes: - EmitRange ('\u25A0', '\u25FF', negate, false, reverse); break; - case Category.UnicodeMiscellaneousSymbols: - EmitRange ('\u2600', '\u26FF', negate, false, reverse); break; - case Category.UnicodeDingbats: - EmitRange ('\u2700', '\u27BF', negate, false, reverse); break; - case Category.UnicodeBraillePatterns: - EmitRange ('\u2800', '\u28FF', negate, false, reverse); break; - case Category.UnicodeCJKRadicalsSupplement: - EmitRange ('\u2E80', '\u2EFF', negate, false, reverse); break; - case Category.UnicodeKangxiRadicals: - EmitRange ('\u2F00', '\u2FDF', negate, false, reverse); break; - case Category.UnicodeIdeographicDescriptionCharacters: - EmitRange ('\u2FF0', '\u2FFF', negate, false, reverse); break; - case Category.UnicodeCJKSymbolsandPunctuation: - EmitRange ('\u3000', '\u303F', negate, false, reverse); break; - case Category.UnicodeHiragana: - EmitRange ('\u3040', '\u309F', negate, false, reverse); break; - case Category.UnicodeKatakana: - EmitRange ('\u30A0', '\u30FF', negate, false, reverse); break; - case Category.UnicodeBopomofo: - EmitRange ('\u3100', '\u312F', negate, false, reverse); break; - case Category.UnicodeHangulCompatibilityJamo: - EmitRange ('\u3130', '\u318F', negate, false, reverse); break; - case Category.UnicodeKanbun: - EmitRange ('\u3190', '\u319F', negate, false, reverse); break; - case Category.UnicodeBopomofoExtended: - EmitRange ('\u31A0', '\u31BF', negate, false, reverse); break; - case Category.UnicodeEnclosedCJKLettersandMonths: - EmitRange ('\u3200', '\u32FF', negate, false, reverse); break; - case Category.UnicodeCJKCompatibility: - EmitRange ('\u3300', '\u33FF', negate, false, reverse); break; - case Category.UnicodeCJKUnifiedIdeographsExtensionA: - EmitRange ('\u3400', '\u4DB5', negate, false, reverse); break; - case Category.UnicodeCJKUnifiedIdeographs: - EmitRange ('\u4E00', '\u9FFF', negate, false, reverse); break; - case Category.UnicodeYiSyllables: - EmitRange ('\uA000', '\uA48F', negate, false, reverse); break; - case Category.UnicodeYiRadicals: - EmitRange ('\uA490', '\uA4CF', negate, false, reverse); break; - case Category.UnicodeHangulSyllables: - EmitRange ('\uAC00', '\uD7A3', negate, false, reverse); break; - case Category.UnicodeHighSurrogates: - EmitRange ('\uD800', '\uDB7F', negate, false, reverse); break; - case Category.UnicodeHighPrivateUseSurrogates: - EmitRange ('\uDB80', '\uDBFF', negate, false, reverse); break; - case Category.UnicodeLowSurrogates: - EmitRange ('\uDC00', '\uDFFF', negate, false, reverse); break; - case Category.UnicodePrivateUse: - EmitRange ('\uE000', '\uF8FF', negate, false, reverse); break; - case Category.UnicodeCJKCompatibilityIdeographs: - EmitRange ('\uF900', '\uFAFF', negate, false, reverse); break; - case Category.UnicodeAlphabeticPresentationForms: - EmitRange ('\uFB00', '\uFB4F', negate, false, reverse); break; - case Category.UnicodeArabicPresentationFormsA: - EmitRange ('\uFB50', '\uFDFF', negate, false, reverse); break; - case Category.UnicodeCombiningHalfMarks: - EmitRange ('\uFE20', '\uFE2F', negate, false, reverse); break; - case Category.UnicodeCJKCompatibilityForms: - EmitRange ('\uFE30', '\uFE4F', negate, false, reverse); break; - case Category.UnicodeSmallFormVariants: - EmitRange ('\uFE50', '\uFE6F', negate, false, reverse); break; - case Category.UnicodeArabicPresentationFormsB: - EmitRange ('\uFE70', '\uFEFE', negate, false, reverse); break; - case Category.UnicodeHalfwidthandFullwidthForms: - EmitRange ('\uFF00', '\uFFEF', negate, false, reverse); break; - - // Complex categories - case Category.UnicodeL: - case Category.UnicodeM: - case Category.UnicodeN: - case Category.UnicodeZ: - case Category.UnicodeP: - case Category.UnicodeS: - case Category.UnicodeC: - EmitCatGeneral (cat, negate, reverse); break; - - default: - throw new NotImplementedException ("Missing category: " + cat); - } - } - - public void EmitNotCategory (Category cat, bool negate, bool reverse) - { - // not sure why the compiler needed this separate interface funtion - if (negate) { - EmitCategory (cat, false, reverse); - } else { - EmitCategory (cat, true, reverse); - } - } - - public void EmitRange (char lo, char hi, bool negate, bool ignore, bool reverse) - { - if (lo < 256 && hi < 256) { - EmitOp (RxOp.Range, negate, ignore, reverse); - Emit ((byte)lo); - Emit ((byte)hi); - } else { - EmitOp (RxOp.UnicodeRange, negate, ignore, reverse); - Emit ((ushort)lo); - Emit ((ushort)hi); - } - } - - public void EmitSet (char lo, BitArray set, bool negate, bool ignore, bool reverse) - { - int len = (set.Length + 0x7) >> 3; - if (lo < 256 && len < 256) { - EmitOp (RxOp.Bitmap, negate, ignore, reverse); - Emit ((byte)lo); - Emit ((byte)len); - } else { - EmitOp (RxOp.UnicodeBitmap, negate, ignore, reverse); - Emit ((ushort)lo); - Emit ((ushort)len); - } - // emit the bitmap bytes - int b = 0; - while (len-- != 0) { - int word = 0; - for (int i = 0; i < 8; ++ i) { - if (b >= set.Length) - break; - if (set [b ++]) - word |= 1 << i; - } - Emit ((byte)word); - } - } - - public void EmitString (string str, bool ignore, bool reverse) - { - bool islatin1 = false; - int i; - int offset = 0; - if (ignore) - offset += 1; - if (reverse) - offset += 2; - if (ignore) - str = str.ToLower (); - if (str.Length < 256) { - islatin1 = true; - for (i = 0; i < str.Length; ++i) { - if (str [i] >= 256) { - islatin1 = false; - break; - } - } - } - if (islatin1) { - EmitOpIgnoreReverse (RxOp.String, ignore, reverse); - Emit ((byte)str.Length); - for (i = 0; i < str.Length; ++i) - Emit ((byte)str [i]); - } else { - EmitOpIgnoreReverse (RxOp.UnicodeString, ignore, reverse); - if (str.Length > ushort.MaxValue) - throw new NotSupportedException (); - Emit ((ushort)str.Length); - for (i = 0; i < str.Length; ++i) - Emit ((ushort)str [i]); - } - } - - public void EmitPosition (Position pos) - { - switch (pos) { - case Position.Any: - Emit (RxOp.AnyPosition); - break; - case Position.Start: - Emit (RxOp.StartOfString); - break; - case Position.StartOfString: - Emit (RxOp.StartOfString); - break; - case Position.StartOfLine: - Emit (RxOp.StartOfLine); - break; - case Position.StartOfScan: - Emit (RxOp.StartOfScan); - break; - case Position.End: - Emit (RxOp.End); - break; - case Position.EndOfString: - Emit (RxOp.EndOfString); - break; - case Position.EndOfLine: - Emit (RxOp.EndOfLine); - break; - case Position.Boundary: - Emit (RxOp.WordBoundary); - break; - case Position.NonBoundary: - Emit (RxOp.NoWordBoundary); - break; - default: - throw new NotSupportedException (); - } - } - - public void EmitOpen (int gid) - { - if (gid > ushort.MaxValue) - throw new NotSupportedException (); - Emit (RxOp.OpenGroup); - Emit ((ushort)gid); - } - - public void EmitClose (int gid) - { - if (gid > ushort.MaxValue) - throw new NotSupportedException (); - Emit (RxOp.CloseGroup); - Emit ((ushort)gid); - } - - public void EmitBalanceStart(int gid, int balance, bool capture, LinkRef tail) - { - BeginLink (tail); - Emit (RxOp.BalanceStart); - Emit ((ushort)gid); - Emit ((ushort)balance); - Emit ((byte)(capture ? 1 : 0)); - EmitLink (tail); - } - - public void EmitBalance () - { - Emit (RxOp.Balance); - } - - public void EmitReference (int gid, bool ignore, bool reverse) - { - if (gid > ushort.MaxValue) - throw new NotSupportedException (); - EmitOpIgnoreReverse (RxOp.Reference, ignore, reverse); - Emit ((ushort)gid); - } - - public void EmitIfDefined (int gid, LinkRef tail) - { - if (gid > ushort.MaxValue) - throw new NotSupportedException (); - BeginLink (tail); - Emit (RxOp.IfDefined); - EmitLink (tail); - Emit ((ushort)gid); - } - - public void EmitSub (LinkRef tail) - { - BeginLink (tail); - Emit (RxOp.SubExpression); - EmitLink (tail); - } - - public void EmitTest (LinkRef yes, LinkRef tail) - { - BeginLink (yes); - BeginLink (tail); - Emit (RxOp.Test); - EmitLink (yes); - EmitLink (tail); - } - - public void EmitBranch (LinkRef next) - { - BeginLink (next); - Emit (RxOp.Branch); - EmitLink (next); - } - - public void EmitJump (LinkRef target) - { - BeginLink (target); - Emit (RxOp.Jump); - EmitLink (target); - } - - public void EmitIn (LinkRef tail) - { - // emitted for things like [\dabcfh] - BeginLink (tail); - Emit (RxOp.TestCharGroup); - EmitLink (tail); - } - - public void EmitRepeat (int min, int max, bool lazy, LinkRef until) - { - BeginLink (until); - Emit (lazy ? RxOp.RepeatLazy : RxOp.Repeat); - EmitLink (until); - Emit (min); - Emit (max); - } - - public void EmitUntil (LinkRef repeat) - { - ResolveLink (repeat); - Emit (RxOp.Until); - } - - public void EmitInfo (int count, int min, int max) - { - Emit (RxOp.Info); - if (count > ushort.MaxValue) - throw new NotSupportedException (); - Emit ((ushort)count); - Emit (min); - Emit (max); - } - - public void EmitFastRepeat (int min, int max, bool lazy, LinkRef tail) - { - BeginLink (tail); - Emit (lazy ? RxOp.FastRepeatLazy : RxOp.FastRepeat); - EmitLink (tail); - Emit (min); - Emit (max); - } - - public void EmitAnchor (bool reverse, int offset, LinkRef tail) - { - BeginLink (tail); - if (reverse) - Emit (RxOp.AnchorReverse); - else - Emit (RxOp.Anchor); - EmitLink (tail); - if (offset > ushort.MaxValue) - throw new NotSupportedException (); - Emit ((ushort)offset); - } - - // event for the CILCompiler - public void EmitBranchEnd () - { - } - - public void EmitAlternationEnd () - { - } - - public LinkRef NewLink () - { - return new RxLinkRef (); - } - - public void ResolveLink (LinkRef link) - { - RxLinkRef l = link as RxLinkRef; - for (int i = 0; i < l.current; i += 2) { - int offset = curpos - l.offsets [i]; - if (offset > ushort.MaxValue) - throw new NotSupportedException (); - int offsetpos = l.offsets [i + 1]; - program [offsetpos] = (byte)offset; - program [offsetpos + 1] = (byte)(offset >> 8); - } - } - - } - - class RxInterpreterFactory : IMachineFactory { - public RxInterpreterFactory (byte[] program, EvalDelegate eval_del) { - this.program = program; - this.eval_del = eval_del; - } - - public IMachine NewInstance () { - return new RxInterpreter (program, eval_del); - } - - public int GroupCount { - get { - return (int)program [1] | ((int)program [2] << 8); - } - } - - public int Gap { - get { return gap; } - set { gap = value; } - } - - public IDictionary Mapping { - get { return mapping; } - set { mapping = value; } - } - - public string [] NamesMapping { - get { return namesMapping; } - set { namesMapping = value; } - } - - private IDictionary mapping; - private byte[] program; - private EvalDelegate eval_del; - private string[] namesMapping; - private int gap; - } - -} - diff --git a/mcs/class/System/System.Text.RegularExpressions/RxInterpreter.cs b/mcs/class/System/System.Text.RegularExpressions/RxInterpreter.cs deleted file mode 100644 index cd8f259d747..00000000000 --- a/mcs/class/System/System.Text.RegularExpressions/RxInterpreter.cs +++ /dev/null @@ -1,2447 +0,0 @@ - -// Based upon interpreter.cs, written by Dan Lewis (dlewis@gmx.co.uk) -// -// There are a couple of bits flagged with DEAD_CODE which are bits that do -// not seem to have been completed -// -using System; -using System.Collections; -using System.Globalization; -using System.Diagnostics; - -namespace System.Text.RegularExpressions { - - internal delegate bool EvalDelegate (RxInterpreter interp, int strpos, ref int strpos_result); - - sealed class RxInterpreter: BaseMachine { - byte[] program; - string str; - int string_start; - int string_end; - int group_count; -// int match_start; - int[] groups; - EvalDelegate eval_del; // optimized EvalByteCode method created by the CILCompiler - - Mark[] marks = null; // mark stack - int mark_start; // start of current checkpoint - int mark_end; // end of checkpoint/next free mark - - IntStack stack; // utility stack - - RepeatContext repeat; // current repeat context - RepeatContext deep; // points to the most-nested repeat context - - /* The readonly ensures the JIT can optimize out if (trace_rx) statements */ - public static readonly bool trace_rx = -#if !NET_2_1 - Environment.GetEnvironmentVariable ("MONO_TRACE_RX") != null; -#else - false; -#endif - - // private classes - - internal struct IntStack { - int [] values; - int count; - public int Pop () - { - return values [--count]; - } - public void Push (int value) - { - if (values == null) { - values = new int [8]; - } else if (count == values.Length) { - int new_size = values.Length; - new_size += new_size >> 1; - int [] new_values = new int [new_size]; - for (int i = 0; i < count; ++i) - new_values [i] = values [i]; - values = new_values; - } - values [count++] = value; - } - public int Top { - get { return values [count - 1]; } - } - public int Count { - get { return count; } - set { - if (value > count) - throw new SystemException ("can only truncate the stack"); - count = value; - } - } - } - - private class RepeatContext { - public RepeatContext (RepeatContext previous, int min, int max, bool lazy, int expr_pc) { - this.previous = previous; - this.min = min; - this.max = max; - this.lazy = lazy; - this.expr_pc = expr_pc; - - this.start = -1; - this.count = 0; - } - - public int Count { - get { return count; } - set { count = value; } - } - - public int Start { - get { return start; } - set { start = value; } - } - - public bool IsMinimum { - get { return min <= count; } - } - - public bool IsMaximum { - get { return max <= count; } - } - - public bool IsLazy { - get { return lazy; } - } - - public int Expression { - get { return expr_pc; } - } - - public RepeatContext Previous { - get { return previous; } - } - - private int start; - private int min, max; - private bool lazy; - private int expr_pc; - private RepeatContext previous; - - private int count; - } - - static int ReadInt (byte[] code, int pc) - { - int val = code [pc]; - val |= (int)code [pc + 1] << 8; - val |= (int)code [pc + 2] << 16; - val |= (int)code [pc + 3] << 24; - return val; - } - - public RxInterpreter (byte[] program, EvalDelegate eval_del) - { - this.program = program; - this.eval_del = eval_del; - group_count = 1 + (program [1] | ((int)program [2] << 8)); - groups = new int [group_count]; - stack = new IntStack (); - - ResetGroups (); - } - - public override Match Scan (Regex regex, string text, int start, int end, bool substring_mode) { - str = text; - string_start = start; - string_end = end; - int res = 0; - - bool match; - if (eval_del != null) { - match = eval_del (this, start, ref res); - } else { - match = EvalByteCode (11, start, ref res); - } - marks [groups [0]].End = res; - if (match) { - return GenerateMatch (regex); - //Match m = new Match (regex, this, text, end, 0, match_start, res - match_start); - //return m; - } - return Match.Empty; - } - - // capture management - private void Open (int gid, int ptr) { - int m = groups [gid]; - if (m < mark_start || marks [m].IsDefined) { - m = CreateMark (m); - groups [gid] = m; - } - - marks [m].Start = ptr; - } - - private void Close (int gid, int ptr) { - marks [groups [gid]].End = ptr; - } - - private bool Balance (int gid, int balance_gid, bool capture, int ptr) { - int b = groups [balance_gid]; - - if(b == -1 || marks[b].Index < 0) { - //Group not previously matched - return false; - } - Debug.Assert (marks [b].IsDefined, "Regex", "Balancng group not closed"); - if (gid > 0 && capture){ - Open (gid, marks [b].Index + marks [b].Length); - Close (gid, ptr); - } - - groups [balance_gid] = marks[b].Previous; - - return true; - } - - private int Checkpoint () { - mark_start = mark_end; - return mark_start; - } - - private void Backtrack (int cp) { - for (int i = 0; i < groups.Length; ++ i) { - int m = groups [i]; - while (cp <= m) - m = marks [m].Previous; - groups [i] = m; - } - } - - private void ResetGroups () { - int n = groups.Length; - if (marks == null) - marks = new Mark [n]; - - for (int i = 0; i < n; ++ i) { - groups [i] = i; - - marks [i].Start = -1; - marks [i].End = -1; - marks [i].Previous = -1; - } - mark_start = 0; - mark_end = n; - } - - private int GetLastDefined (int gid) { - int m = groups [gid]; - while (m >= 0 && !marks [m].IsDefined) - m = marks [m].Previous; - - return m; - } - - private int CreateMark (int previous) { - if (mark_end == marks.Length) { - Mark [] dest = new Mark [marks.Length * 2]; - marks.CopyTo (dest, 0); - marks = dest; - } - - int m = mark_end ++; - marks [m].Start = marks [m].End = -1; - marks [m].Previous = previous; - - return m; - } - - private void GetGroupInfo (int gid, out int first_mark_index, out int n_caps) - { - first_mark_index = -1; - n_caps = 0; - for (int m = groups [gid]; m >= 0; m = marks [m].Previous) { - if (!marks [m].IsDefined) - continue; - if (first_mark_index < 0) - first_mark_index = m; - ++n_caps; - } - } - - private void PopulateGroup (Group g, int first_mark_index, int n_caps) - { - int i = 1; - for (int m = marks [first_mark_index].Previous; m >= 0; m = marks [m].Previous) { - if (!marks [m].IsDefined) - continue; - Capture cap = new Capture (str, marks [m].Index, marks [m].Length); - g.Captures.SetValue (cap, n_caps - 1 - i); - ++i; - } - } - - private Match GenerateMatch (Regex regex) - { - int n_caps, first_mark_index; - Group g; - GetGroupInfo (0, out first_mark_index, out n_caps); - - // Avoid fully populating the Match instance if not needed - if (!needs_groups_or_captures) - return new Match (regex, this, str, string_end, 0, marks [first_mark_index].Index, marks [first_mark_index].Length); - - Match retval = new Match (regex, this, str, string_end, groups.Length, - marks [first_mark_index].Index, marks [first_mark_index].Length, n_caps); - PopulateGroup (retval, first_mark_index, n_caps); - - for (int gid = 1; gid < groups.Length; ++ gid) { - GetGroupInfo (gid, out first_mark_index, out n_caps); - if (first_mark_index < 0) { - g = Group.Fail; - } else { - g = new Group (str, marks [first_mark_index].Index, marks [first_mark_index].Length, n_caps); - PopulateGroup (g, first_mark_index, n_caps); - } - retval.Groups.SetValue (g, gid); - } - return retval; - } - - // used by the IL backend - internal void SetStartOfMatch (int pos) - { - marks [groups [0]].Start = pos; - } - - static bool IsWordChar (char c) - { - return Char.IsLetterOrDigit (c) || Char.GetUnicodeCategory (c) == UnicodeCategory.ConnectorPunctuation; - } - - bool EvalByteCode (int pc, int strpos, ref int strpos_result) - { - // luckily the IL engine can deal with char_group_end at compile time - // this code offset needs to be checked only in opcodes that handle - // a single char and that are included in a TestCharGroup expression: - // the engine is supposed to jump to this offset as soons as the - // first opcode in the expression matches - // The code pattern becomes: - // on successfull match: check if char_group_end is nonzero and jump to - // test_char_group_passed after adjusting strpos - // on failure: try the next expression by simply advancing pc - int char_group_end = 0; - int length, start, end; - while (true) { - if (trace_rx) { - Console.WriteLine ("evaluating: {0} at pc: {1}, strpos: {2}, cge: {3}", (RxOp)program [pc], pc, strpos, char_group_end); - //Console.WriteLine ("deep: " + (deep == null ? 0 : deep.GetHashCode ()) + " repeat: " + (this.repeat == null ? 0 : this.repeat.GetHashCode ())); - } - switch ((RxOp)program [pc]) { - case RxOp.True: - if (char_group_end != 0) { - pc = char_group_end; - char_group_end = 0; - continue; - } - strpos_result = strpos; - return true; - case RxOp.False: - return false; - case RxOp.AnyPosition: - pc++; - continue; - case RxOp.StartOfString: - if (strpos != 0) - return false; - pc++; - continue; - case RxOp.StartOfLine: - if (strpos == 0 || str [strpos - 1] == '\n') { - pc++; - continue; - } - return false; - case RxOp.StartOfScan: - if (strpos != string_start) - return false; - pc++; - continue; - case RxOp.End: - if (strpos == string_end || (strpos == string_end - 1 && str [strpos] == '\n')) { - pc++; - continue; - } - return false; - case RxOp.EndOfString: - if (strpos != string_end) - return false; - pc++; - continue; - case RxOp.EndOfLine: - if (strpos == string_end || str [strpos] == '\n') { - pc++; - continue; - } - return false; - case RxOp.WordBoundary: - if (string_end == 0) - return false; - if (strpos == 0) { - if (IsWordChar (str [strpos])) { - pc++; - continue; - } - } else if (strpos == string_end) { - if (IsWordChar (str [strpos - 1])) { - pc++; - continue; - } - } else { - if (IsWordChar (str [strpos]) != IsWordChar (str [strpos - 1])) { - pc++; - continue; - } - } - return false; - case RxOp.NoWordBoundary: - if (string_end == 0) - return false; - if (strpos == 0) { - if (!IsWordChar (str [strpos])) { - pc++; - continue; - } - } else if (strpos == string_end) { - if (!IsWordChar (str [strpos - 1])) { - pc++; - continue; - } - } else { - if (IsWordChar (str [strpos]) == IsWordChar (str [strpos - 1])) { - pc++; - continue; - } - } - return false; - case RxOp.Anchor: - int skip = program [pc + 1] | ((int)program [pc + 2] << 8); - int anch_offset = program [pc + 3] | ((int)program [pc + 4] << 8); - - /* - * In the general case, we have to evaluate the bytecode - * starting at pc + skip, however the optimizer emits some - * special cases, whose bytecode begins at pc + 5. - */ - int anch_pc = pc + 5; - RxOp anch_op = (RxOp)(program[anch_pc] & 0x00ff); - - bool spec_anch = false; - - // FIXME: Add more special cases from interpreter.cs - if (anch_op == RxOp.String || anch_op == RxOp.StringIgnoreCase) { - if (pc + skip == anch_pc + 2 + program [anch_pc + 1] + 1) { - // Anchor - // String - // True - spec_anch = true; - if (trace_rx) - Console.WriteLine (" string anchor at {0}, offset {1}", anch_pc, anch_offset); - } - } - - pc += skip; - - if ((RxOp)program [pc] == RxOp.StartOfString) { - if (strpos == 0) { - int res = strpos; - if (groups.Length > 1) { - ResetGroups (); - marks [groups [0]].Start = strpos; - } - if (EvalByteCode (pc + 1, strpos, ref res)) { - marks [groups [0]].Start = strpos; - if (groups.Length > 1) - marks [groups [0]].End = res; - strpos_result = res; - return true; - } - } - return false; - } - - // it's important to test also the end of the string - // position for things like: "" =~ /$/ - end = string_end + 1; - while (strpos < end) { - if (spec_anch) { - if (anch_op == RxOp.String || anch_op == RxOp.StringIgnoreCase) { - /* - * This means the match must contain a given - * string at a constant position, so we can skip - * forward until the string matches. This is a win if - * the rest of the regex - * has a complex positive lookbehind for example. - */ - int tmp_res = strpos; - if (!EvalByteCode (anch_pc, strpos + anch_offset, ref tmp_res)) { - strpos ++; - continue; - } - } - } - int res = strpos; - if (groups.Length > 1) { - ResetGroups (); - marks [groups [0]].Start = strpos; - } - if (EvalByteCode (pc, strpos, ref res)) { -// match_start = strpos; - marks [groups [0]].Start = strpos; - if (groups.Length > 1) - marks [groups [0]].End = res; - strpos_result = res; - return true; - } - strpos++; - } - return false; - case RxOp.AnchorReverse: - length = program [pc + 3] | ((int)program [pc + 4] << 8); - pc += program [pc + 1] | ((int)program [pc + 2] << 8); - // it's important to test also the end of the string - // position for things like: "" =~ /$/ - end = 0; - while (strpos >= 0) { - int res = strpos; - if (groups.Length > 1) { - ResetGroups (); - marks [groups [0]].Start = strpos; - } - if (EvalByteCode (pc, strpos, ref res)) { -// match_start = strpos; - marks [groups [0]].Start = strpos; - if (groups.Length > 1) - marks [groups [0]].End = res; - strpos_result = res; - return true; - } - strpos--; - } - return false; - case RxOp.Reference: - length = GetLastDefined (program [pc + 1] | ((int)program [pc + 2] << 8)); - if (length < 0) - return false; - start = marks [length].Index; - length = marks [length].Length; - if (strpos + length > string_end) - return false; - for (end = start + length; start < end; ++start) { - if (str [strpos] != str [start]) - return false; - strpos++; - } - pc += 3; - continue; - case RxOp.ReferenceIgnoreCase: - length = GetLastDefined (program [pc + 1] | ((int)program [pc + 2] << 8)); - if (length < 0) - return false; - start = marks [length].Index; - length = marks [length].Length; - if (strpos + length > string_end) - return false; - for (end = start + length; start < end; ++start) { - if (str [strpos] != str [start] && Char.ToLower (str [strpos]) != Char.ToLower (str [start])) - return false; - strpos++; - } - pc += 3; - continue; - case RxOp.ReferenceReverse: { - length = GetLastDefined (program [pc + 1] | ((int)program [pc + 2] << 8)); - if (length < 0) - return false; - start = marks [length].Index; - length = marks [length].Length; - if (strpos - length < 0) - return false; - int p = strpos - length; - for (end = start + length; start < end; ++start, ++p) { - if (str [p] != str [start]) - return false; - } - strpos -= length; - pc += 3; - continue; - } - case RxOp.IfDefined: - if (GetLastDefined (program [pc + 3] | ((int)program [pc + 4] << 8)) >= 0) - pc += 5; - else - pc += program [pc + 1] | ((int)program [pc + 2] << 8); - continue; - case RxOp.SubExpression: { - int res = 0; - if (EvalByteCode (pc + 3, strpos, ref res)) { - pc += program [pc + 1] | ((int)program [pc + 2] << 8); - strpos = res; - continue; - } - return false; - } - case RxOp.Test: { - int res = 0; - // FIXME: checkpoint - if (EvalByteCode (pc + 5, strpos, ref res)) { - pc += program [pc + 1] | ((int)program [pc + 2] << 8); - } else { - pc += program [pc + 3] | ((int)program [pc + 4] << 8); - } - continue; - } - case RxOp.OpenGroup: - Open (program [pc + 1] | ((int)program [pc + 2] << 8), strpos); - pc += 3; - continue; - case RxOp.CloseGroup: - Close (program [pc + 1] | ((int)program [pc + 2] << 8), strpos); - pc += 3; - continue; - case RxOp.BalanceStart: { - int res = 0; - - if (!EvalByteCode (pc + 8, strpos, ref res)) - goto Fail; - - int gid = program [pc + 1] | ((int)program [pc + 2] << 8); - int balance_gid = program [pc + 3] | ((int)program [pc + 4] << 8); - bool capture = program [pc + 5] > 0; - if (!Balance (gid, balance_gid, capture, strpos)) - goto Fail; - - strpos = res; - pc += program[pc + 6] | ((int)program [pc + 7] << 8); - break; - } - case RxOp.Balance: { - goto Pass; - } - - case RxOp.Jump: - pc += program [pc + 1] | ((int)program [pc + 2] << 8); - continue; - case RxOp.TestCharGroup: - char_group_end = pc + (program [pc + 1] | ((int)program [pc + 2] << 8)); - pc += 3; - continue; - case RxOp.String: - start = pc + 2; - length = program [pc + 1]; - if (strpos + length > string_end) - return false; - end = start + length; - for (; start < end; ++start) { - if (str [strpos] != program [start]) - return false; - strpos++; - } - pc = end; - continue; - case RxOp.StringIgnoreCase: - start = pc + 2; - length = program [pc + 1]; - if (strpos + length > string_end) - return false; - end = start + length; - for (; start < end; ++start) { - if (str [strpos] != program [start] && Char.ToLower (str [strpos]) != program [start]) - return false; - strpos++; - } - pc = end; - continue; - case RxOp.StringReverse: { - start = pc + 2; - length = program [pc + 1]; - if (strpos < length) - return false; - int p = strpos - length; - end = start + length; - for (; start < end; ++start, ++p) { - if (str [p] != program [start]) - return false; - } - strpos -= length; - pc = end; - continue; - } - case RxOp.StringIgnoreCaseReverse: { - start = pc + 2; - length = program [pc + 1]; - if (strpos < length) - return false; - int p = strpos - length; - end = start + length; - for (; start < end; ++start, ++p) { - if (str [p] != program [start] && Char.ToLower (str [p]) != program [start]) - return false; - } - strpos -= length; - pc = end; - continue; - } - case RxOp.UnicodeString: { - start = pc + 3; - length = program [pc + 1] | ((int)program [pc + 2] << 8); - if (strpos + length > string_end) - return false; - end = start + length * 2; - for (; start < end; start += 2) { - int c = program [start] | ((int)program [start + 1] << 8); - if (str [strpos] != c) - return false; - strpos++; - } - pc = end; - continue; - } - case RxOp.UnicodeStringIgnoreCase: { - start = pc + 3; - length = program [pc + 1] | ((int)program [pc + 2] << 8); - if (strpos + length > string_end) - return false; - end = start + length * 2; - for (; start < end; start += 2) { - int c = program [start] | ((int)program [start + 1] << 8); - if (str [strpos] != c && Char.ToLower (str [strpos]) != c) - return false; - strpos++; - } - pc = end; - continue; - } - case RxOp.UnicodeStringReverse: { - start = pc + 3; - length = program [pc + 1] | ((int)program [pc + 2] << 8); - if (strpos < length) - return false; - int p = strpos - length; - end = start + length * 2; - for (; start < end; start += 2, p += 2) { - int c = program [start] | ((int)program [start + 1] << 8); - if (str [p] != c) - return false; - } - strpos -= length; - pc = end; - continue; - } - case RxOp.UnicodeStringIgnoreCaseReverse: { - start = pc + 3; - length = program [pc + 1] | ((int)program [pc + 2] << 8); - if (strpos < length) - return false; - int p = strpos - length; - end = start + length * 2; - for (; start < end; start += 2, p += 2) { - int c = program [start] | ((int)program [start + 1] << 8); - if (str [p] != c && Char.ToLower (str [p]) != c) - return false; - } - strpos -= length; - pc = end; - continue; - } - - /* - * The opcodes below are basically specialized versions of one - * generic opcode, which has three parameters: - * - reverse (Reverse), revert (No), ignore-case (IgnoreCase) - * Thus each opcode has 8 variants. - * FIXME: Maybe move all unusual variations - * (Reverse+IgnoreCase+Unicode) into a generic GenericChar opcode - * like in the old interpreter. - * FIXME: Move all the Reverse opcodes to a separate method. - */ -#if FALSE - if (!reverse) { - if (strpos < string_end && (COND (str [strpos]))) { - if (!revert) { - strpos ++; - if (char_group_end != 0) - goto test_char_group_passed; - pc += ins_len; - continue; - } else { - /* - * If we are inside a char group, the cases are ANDed - * together, so we have to continue checking the - * other cases, and we need to increase strpos after - * the final check. - * The char group is termined by a True, hence the - * + 1 below. - * FIXME: Optimize this. - */ - pc += ins_len; - if (char_group_end == 0 || (pc + 1 == char_group_end)) - strpos ++; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - continue; - } - } else { - if (!revert) { - if (char_group_end == 0) - return false; - pc += ins_len; - continue; - } else { - /* Fail both inside and outside a char group */ - return false; - } - } - } else { - // Same as above, but use: - // - strpos > 0 instead of strpos < string_len - // - COND (str [strpos - 1]) instead of COND (str [strpos]) - // - strpos -- instead of strpos ++ - } -#endif - // GENERATED BY gen-interp.cs, DO NOT MODIFY - - /* Char */ - - case RxOp.Char: - if (strpos < string_end) { - char c = str [strpos]; - if (((c == program [pc + 1]))) { - strpos ++; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 2; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 2; - continue; - - /* Range */ - - case RxOp.Range: - if (strpos < string_end) { - char c = str [strpos]; - if (((c >= program [pc + 1] && c <= program [pc + 2]))) { - strpos ++; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 3; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 3; - continue; - - /* UnicodeRange */ - - case RxOp.UnicodeRange: - if (strpos < string_end) { - char c = str [strpos]; - if (((c >= (program [pc + 1] | ((int)program [pc + 2] << 8))) && (c <= (program [pc + 3] | ((int)program [pc + 4] << 8))))) { - strpos ++; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 5; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 5; - continue; - - /* UnicodeChar */ - - case RxOp.UnicodeChar: - if (strpos < string_end) { - char c = str [strpos]; - if (((c == (program [pc + 1] | ((int)program [pc + 2] << 8))))) { - strpos ++; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 3; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 3; - continue; - - /* CategoryAny */ - - case RxOp.CategoryAny: - if (strpos < string_end) { - char c = str [strpos]; - if (((c != '\n'))) { - strpos ++; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 1; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 1; - continue; - - /* CategoryAnySingleline */ - - case RxOp.CategoryAnySingleline: - if (strpos < string_end) { - // char c = str [strpos]; - if ((true)) { - strpos ++; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 1; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 1; - continue; - - /* CategoryWord */ - - case RxOp.CategoryWord: - if (strpos < string_end) { - char c = str [strpos]; - if (((Char.IsLetterOrDigit (c) || Char.GetUnicodeCategory (c) == UnicodeCategory.ConnectorPunctuation))) { - strpos ++; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 1; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 1; - continue; - - /* CategoryDigit */ - - case RxOp.CategoryDigit: - if (strpos < string_end) { - char c = str [strpos]; - if (((Char.IsDigit (c)))) { - strpos ++; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 1; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 1; - continue; - - /* CategoryWhiteSpace */ - - case RxOp.CategoryWhiteSpace: - if (strpos < string_end) { - char c = str [strpos]; - if (((Char.IsWhiteSpace (c)))) { - strpos ++; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 1; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 1; - continue; - - /* CategoryEcmaWord */ - - case RxOp.CategoryEcmaWord: - if (strpos < string_end) { - char c = str [strpos]; - if ((('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || '0' <= c && c <= '9' || c == '_'))) { - strpos ++; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 1; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 1; - continue; - - /* CategoryEcmaWhiteSpace */ - - case RxOp.CategoryEcmaWhiteSpace: - if (strpos < string_end) { - char c = str [strpos]; - if (((c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '\f' || c == '\v'))) { - strpos ++; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 1; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 1; - continue; - - /* CategoryUnicodeSpecials */ - - case RxOp.CategoryUnicodeSpecials: - if (strpos < string_end) { - char c = str [strpos]; - if ((('\uFEFF' <= c && c <= '\uFEFF' || '\uFFF0' <= c && c <= '\uFFFD'))) { - strpos ++; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 1; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 1; - continue; - - /* CategoryUnicode */ - - case RxOp.CategoryUnicode: - if (strpos < string_end) { - char c = str [strpos]; - if (((Char.GetUnicodeCategory (c) == (UnicodeCategory)program [pc + 1]))) { - strpos ++; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 2; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 2; - continue; - - /* CategoryGeneral */ - - case RxOp.CategoryGeneral: - if (strpos < string_end) { - char c = str [strpos]; - if (((CategoryUtils.IsCategory ((Category)program [pc + 1], c)))) { - strpos ++; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 2; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 2; - continue; - - /* Bitmap */ - - case RxOp.Bitmap: - if (strpos < string_end) { - char c = str [strpos]; - int c2 = (int)c; c2 -= program [pc + 1]; length = program [pc + 2]; - if (((c2 >= 0 && c2 < (length << 3) && (program [pc + 3 + (c2 >> 3)] & (1 << (c2 & 0x7))) != 0))) { - strpos ++; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 3 + program [pc + 2]; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 3 + program [pc + 2]; - continue; - - /* UnicodeBitmap */ - - case RxOp.UnicodeBitmap: - if (strpos < string_end) { - char c = str [strpos]; - int c2 = (int)c; c2 -= (program [pc + 1] | ((int)program [pc + 2] << 8)); length = (program [pc + 3] | ((int)program [pc + 4] << 8)); - if (((c2 >= 0 && c2 < (length << 3) && (program [pc + 5 + (c2 >> 3)] & (1 << (c2 & 0x7))) != 0))) { - strpos ++; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 5 + (program [pc + 3] | ((int)program [pc + 4] << 8)); - continue; - } - } - if (char_group_end == 0) - return false; - pc += 5 + (program [pc + 3] | ((int)program [pc + 4] << 8)); - continue; - case RxOp.CharIgnoreCase: - if (strpos < string_end) { - char c = Char.ToLower (str [strpos]); - if (((c == program [pc + 1]))) { - strpos ++; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 2; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 2; - continue; - case RxOp.RangeIgnoreCase: - if (strpos < string_end) { - char c = Char.ToLower (str [strpos]); - if (((c >= program [pc + 1] && c <= program [pc + 2]))) { - strpos ++; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 3; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 3; - continue; - case RxOp.UnicodeRangeIgnoreCase: - if (strpos < string_end) { - char c = Char.ToLower (str [strpos]); - if (((c >= (program [pc + 1] | ((int)program [pc + 2] << 8))) && (c <= (program [pc + 3] | ((int)program [pc + 4] << 8))))) { - strpos ++; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 5; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 5; - continue; - case RxOp.UnicodeCharIgnoreCase: - if (strpos < string_end) { - char c = Char.ToLower (str [strpos]); - if (((c == (program [pc + 1] | ((int)program [pc + 2] << 8))))) { - strpos ++; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 3; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 3; - continue; - case RxOp.BitmapIgnoreCase: - if (strpos < string_end) { - char c = Char.ToLower (str [strpos]); - int c2 = (int)c; c2 -= program [pc + 1]; length = program [pc + 2]; - if (((c2 >= 0 && c2 < (length << 3) && (program [pc + 3 + (c2 >> 3)] & (1 << (c2 & 0x7))) != 0))) { - strpos ++; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 3 + program [pc + 2]; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 3 + program [pc + 2]; - continue; - case RxOp.UnicodeBitmapIgnoreCase: - if (strpos < string_end) { - char c = Char.ToLower (str [strpos]); - int c2 = (int)c; c2 -= (program [pc + 1] | ((int)program [pc + 2] << 8)); length = (program [pc + 3] | ((int)program [pc + 4] << 8)); - if (((c2 >= 0 && c2 < (length << 3) && (program [pc + 5 + (c2 >> 3)] & (1 << (c2 & 0x7))) != 0))) { - strpos ++; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 5 + (program [pc + 3] | ((int)program [pc + 4] << 8)); - continue; - } - } - if (char_group_end == 0) - return false; - pc += 5 + (program [pc + 3] | ((int)program [pc + 4] << 8)); - continue; - case RxOp.NoChar: - if (strpos < string_end) { - char c = str [strpos]; - if (!((c == program [pc + 1]))) { - pc += 2; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos ++; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoRange: - if (strpos < string_end) { - char c = str [strpos]; - if (!((c >= program [pc + 1] && c <= program [pc + 2]))) { - pc += 3; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos ++; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoUnicodeRange: - if (strpos < string_end) { - char c = str [strpos]; - if (!((c >= (program [pc + 1] | ((int)program [pc + 2] << 8))) && (c <= (program [pc + 3] | ((int)program [pc + 4] << 8))))) { - pc += 5; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos ++; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoUnicodeChar: - if (strpos < string_end) { - char c = str [strpos]; - if (!((c == (program [pc + 1] | ((int)program [pc + 2] << 8))))) { - pc += 3; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos ++; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoCategoryAny: - if (strpos < string_end) { - char c = str [strpos]; - if (!((c != '\n'))) { - pc += 1; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos ++; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoCategoryAnySingleline: - if (strpos < string_end) { -#if DEAD_CODE - char c = str [strpos]; - if (!(true)) { - pc += 1; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos ++; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } -#endif - } - return false; - case RxOp.NoCategoryWord: - if (strpos < string_end) { - char c = str [strpos]; - if (!((Char.IsLetterOrDigit (c) || Char.GetUnicodeCategory (c) == UnicodeCategory.ConnectorPunctuation))) { - pc += 1; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos ++; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoCategoryDigit: - if (strpos < string_end) { - char c = str [strpos]; - if (!((Char.IsDigit (c)))) { - pc += 1; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos ++; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoCategoryWhiteSpace: - if (strpos < string_end) { - char c = str [strpos]; - if (!((Char.IsWhiteSpace (c)))) { - pc += 1; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos ++; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoCategoryEcmaWord: - if (strpos < string_end) { - char c = str [strpos]; - if (!(('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || '0' <= c && c <= '9' || c == '_'))) { - pc += 1; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos ++; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoCategoryEcmaWhiteSpace: - if (strpos < string_end) { - char c = str [strpos]; - if (!((c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '\f' || c == '\v'))) { - pc += 1; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos ++; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoCategoryUnicodeSpecials: - if (strpos < string_end) { - char c = str [strpos]; - if (!(('\uFEFF' <= c && c <= '\uFEFF' || '\uFFF0' <= c && c <= '\uFFFD'))) { - pc += 1; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos ++; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoCategoryUnicode: - if (strpos < string_end) { - char c = str [strpos]; - if (!((Char.GetUnicodeCategory (c) == (UnicodeCategory)program [pc + 1]))) { - pc += 2; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos ++; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoCategoryGeneral: - if (strpos < string_end) { - char c = str [strpos]; - if (!((CategoryUtils.IsCategory ((Category)program [pc + 1], c)))) { - pc += 2; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos ++; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoBitmap: - if (strpos < string_end) { - char c = str [strpos]; - int c2 = (int)c; c2 -= program [pc + 1]; length = program [pc + 2]; - if (!((c2 >= 0 && c2 < (length << 3) && (program [pc + 3 + (c2 >> 3)] & (1 << (c2 & 0x7))) != 0))) { - pc += 3 + program [pc + 2]; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos ++; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoUnicodeBitmap: - if (strpos < string_end) { - char c = str [strpos]; - int c2 = (int)c; c2 -= (program [pc + 1] | ((int)program [pc + 2] << 8)); length = (program [pc + 3] | ((int)program [pc + 4] << 8)); - if (!((c2 >= 0 && c2 < (length << 3) && (program [pc + 5 + (c2 >> 3)] & (1 << (c2 & 0x7))) != 0))) { - pc += 5 + (program [pc + 3] | ((int)program [pc + 4] << 8)); - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos ++; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoCharIgnoreCase: - if (strpos < string_end) { - char c = Char.ToLower (str [strpos]); - if (!((c == program [pc + 1]))) { - pc += 2; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos ++; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoRangeIgnoreCase: - if (strpos < string_end) { - char c = Char.ToLower (str [strpos]); - if (!((c >= program [pc + 1] && c <= program [pc + 2]))) { - pc += 3; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos ++; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoUnicodeRangeIgnoreCase: - if (strpos < string_end) { - char c = Char.ToLower (str [strpos]); - if (!((c >= (program [pc + 1] | ((int)program [pc + 2] << 8))) && (c <= (program [pc + 3] | ((int)program [pc + 4] << 8))))) { - pc += 5; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos ++; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoUnicodeCharIgnoreCase: - if (strpos < string_end) { - char c = Char.ToLower (str [strpos]); - if (!((c == (program [pc + 1] | ((int)program [pc + 2] << 8))))) { - pc += 3; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos ++; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoBitmapIgnoreCase: - if (strpos < string_end) { - char c = Char.ToLower (str [strpos]); - int c2 = (int)c; c2 -= program [pc + 1]; length = program [pc + 2]; - if (!((c2 >= 0 && c2 < (length << 3) && (program [pc + 3 + (c2 >> 3)] & (1 << (c2 & 0x7))) != 0))) { - pc += 3 + program [pc + 2]; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos ++; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoUnicodeBitmapIgnoreCase: - if (strpos < string_end) { - char c = Char.ToLower (str [strpos]); - int c2 = (int)c; c2 -= (program [pc + 1] | ((int)program [pc + 2] << 8)); length = (program [pc + 3] | ((int)program [pc + 4] << 8)); - if (!((c2 >= 0 && c2 < (length << 3) && (program [pc + 5 + (c2 >> 3)] & (1 << (c2 & 0x7))) != 0))) { - pc += 5 + (program [pc + 3] | ((int)program [pc + 4] << 8)); - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos ++; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.CharReverse: - if (strpos > 0) { - char c = str [strpos - 1]; - if (((c == program [pc + 1]))) { - strpos --; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 2; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 2; - continue; - case RxOp.RangeReverse: - if (strpos > 0) { - char c = str [strpos - 1]; - if (((c >= program [pc + 1] && c <= program [pc + 2]))) { - strpos --; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 3; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 3; - continue; - case RxOp.UnicodeRangeReverse: - if (strpos > 0) { - char c = str [strpos - 1]; - if (((c >= (program [pc + 1] | ((int)program [pc + 2] << 8))) && (c <= (program [pc + 3] | ((int)program [pc + 4] << 8))))) { - strpos --; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 5; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 5; - continue; - case RxOp.UnicodeCharReverse: - if (strpos > 0) { - char c = str [strpos - 1]; - if (((c == (program [pc + 1] | ((int)program [pc + 2] << 8))))) { - strpos --; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 3; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 3; - continue; - case RxOp.CategoryAnyReverse: - if (strpos > 0) { - char c = str [strpos - 1]; - if (((c != '\n'))) { - strpos --; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 1; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 1; - continue; - case RxOp.CategoryAnySinglelineReverse: - if (strpos > 0) { - //char c = str [strpos - 1]; - if ((true)) { - strpos --; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 1; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 1; - continue; - case RxOp.CategoryWordReverse: - if (strpos > 0) { - char c = str [strpos - 1]; - if (((Char.IsLetterOrDigit (c) || Char.GetUnicodeCategory (c) == UnicodeCategory.ConnectorPunctuation))) { - strpos --; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 1; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 1; - continue; - case RxOp.CategoryDigitReverse: - if (strpos > 0) { - char c = str [strpos - 1]; - if (((Char.IsDigit (c)))) { - strpos --; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 1; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 1; - continue; - case RxOp.CategoryWhiteSpaceReverse: - if (strpos > 0) { - char c = str [strpos - 1]; - if (((Char.IsWhiteSpace (c)))) { - strpos --; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 1; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 1; - continue; - case RxOp.CategoryEcmaWordReverse: - if (strpos > 0) { - char c = str [strpos - 1]; - if ((('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || '0' <= c && c <= '9' || c == '_'))) { - strpos --; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 1; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 1; - continue; - case RxOp.CategoryEcmaWhiteSpaceReverse: - if (strpos > 0) { - char c = str [strpos - 1]; - if (((c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '\f' || c == '\v'))) { - strpos --; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 1; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 1; - continue; - case RxOp.CategoryUnicodeSpecialsReverse: - if (strpos > 0) { - char c = str [strpos - 1]; - if ((('\uFEFF' <= c && c <= '\uFEFF' || '\uFFF0' <= c && c <= '\uFFFD'))) { - strpos --; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 1; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 1; - continue; - case RxOp.CategoryUnicodeReverse: - if (strpos > 0) { - char c = str [strpos - 1]; - if (((Char.GetUnicodeCategory (c) == (UnicodeCategory)program [pc + 1]))) { - strpos --; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 2; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 2; - continue; - case RxOp.CategoryGeneralReverse: - if (strpos > 0) { - char c = str [strpos - 1]; - if (((CategoryUtils.IsCategory ((Category)program [pc + 1], c)))) { - strpos --; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 2; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 2; - continue; - case RxOp.BitmapReverse: - if (strpos > 0) { - char c = str [strpos - 1]; - int c2 = (int)c; c2 -= program [pc + 1]; length = program [pc + 2]; - if (((c2 >= 0 && c2 < (length << 3) && (program [pc + 3 + (c2 >> 3)] & (1 << (c2 & 0x7))) != 0))) { - strpos --; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 3 + program [pc + 2]; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 3 + program [pc + 2]; - continue; - case RxOp.UnicodeBitmapReverse: - if (strpos > 0) { - char c = str [strpos - 1]; - int c2 = (int)c; c2 -= (program [pc + 1] | ((int)program [pc + 2] << 8)); length = (program [pc + 3] | ((int)program [pc + 4] << 8)); - if (((c2 >= 0 && c2 < (length << 3) && (program [pc + 5 + (c2 >> 3)] & (1 << (c2 & 0x7))) != 0))) { - strpos --; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 5 + (program [pc + 3] | ((int)program [pc + 4] << 8)); - continue; - } - } - if (char_group_end == 0) - return false; - pc += 5 + (program [pc + 3] | ((int)program [pc + 4] << 8)); - continue; - case RxOp.CharIgnoreCaseReverse: - if (strpos > 0) { - char c = Char.ToLower (str [strpos - 1]); - if (((c == program [pc + 1]))) { - strpos --; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 2; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 2; - continue; - case RxOp.RangeIgnoreCaseReverse: - if (strpos > 0) { - char c = Char.ToLower (str [strpos - 1]); - if (((c >= program [pc + 1] && c <= program [pc + 2]))) { - strpos --; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 3; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 3; - continue; - case RxOp.UnicodeRangeIgnoreCaseReverse: - if (strpos > 0) { - char c = Char.ToLower (str [strpos - 1]); - if (((c >= (program [pc + 1] | ((int)program [pc + 2] << 8))) && (c <= (program [pc + 3] | ((int)program [pc + 4] << 8))))) { - strpos --; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 5; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 5; - continue; - case RxOp.UnicodeCharIgnoreCaseReverse: - if (strpos > 0) { - char c = Char.ToLower (str [strpos - 1]); - if (((c == (program [pc + 1] | ((int)program [pc + 2] << 8))))) { - strpos --; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 3; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 3; - continue; - case RxOp.BitmapIgnoreCaseReverse: - if (strpos > 0) { - char c = Char.ToLower (str [strpos - 1]); - int c2 = (int)c; c2 -= program [pc + 1]; length = program [pc + 2]; - if (((c2 >= 0 && c2 < (length << 3) && (program [pc + 3 + (c2 >> 3)] & (1 << (c2 & 0x7))) != 0))) { - strpos --; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 3 + program [pc + 2]; - continue; - } - } - if (char_group_end == 0) - return false; - pc += 3 + program [pc + 2]; - continue; - case RxOp.UnicodeBitmapIgnoreCaseReverse: - if (strpos > 0) { - char c = Char.ToLower (str [strpos - 1]); - int c2 = (int)c; c2 -= (program [pc + 1] | ((int)program [pc + 2] << 8)); length = (program [pc + 3] | ((int)program [pc + 4] << 8)); - if (((c2 >= 0 && c2 < (length << 3) && (program [pc + 5 + (c2 >> 3)] & (1 << (c2 & 0x7))) != 0))) { - strpos --; - if (char_group_end != 0) - goto test_char_group_passed; - pc += 5 + (program [pc + 3] | ((int)program [pc + 4] << 8)); - continue; - } - } - if (char_group_end == 0) - return false; - pc += 5 + (program [pc + 3] | ((int)program [pc + 4] << 8)); - continue; - case RxOp.NoCharReverse: - if (strpos > 0) { - char c = str [strpos - 1]; - if (!((c == program [pc + 1]))) { - pc += 2; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos --; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoRangeReverse: - if (strpos > 0) { - char c = str [strpos - 1]; - if (!((c >= program [pc + 1] && c <= program [pc + 2]))) { - pc += 3; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos --; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoUnicodeRangeReverse: - if (strpos > 0) { - char c = str [strpos - 1]; - if (!((c >= (program [pc + 1] | ((int)program [pc + 2] << 8))) && (c <= (program [pc + 3] | ((int)program [pc + 4] << 8))))) { - pc += 5; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos --; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoUnicodeCharReverse: - if (strpos > 0) { - char c = str [strpos - 1]; - if (!((c == (program [pc + 1] | ((int)program [pc + 2] << 8))))) { - pc += 3; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos --; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoCategoryAnyReverse: - if (strpos > 0) { - char c = str [strpos - 1]; - if (!((c != '\n'))) { - pc += 1; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos --; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoCategoryAnySinglelineReverse: - if (strpos > 0) { -#if DEAD_CODe - char c = str [strpos - 1]; - if (!(true)) { - pc += 1; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos --; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } -#endif - } - return false; - case RxOp.NoCategoryWordReverse: - if (strpos > 0) { - char c = str [strpos - 1]; - if (!((Char.IsLetterOrDigit (c) || Char.GetUnicodeCategory (c) == UnicodeCategory.ConnectorPunctuation))) { - pc += 1; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos --; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoCategoryDigitReverse: - if (strpos > 0) { - char c = str [strpos - 1]; - if (!((Char.IsDigit (c)))) { - pc += 1; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos --; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoCategoryWhiteSpaceReverse: - if (strpos > 0) { - char c = str [strpos - 1]; - if (!((Char.IsWhiteSpace (c)))) { - pc += 1; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos --; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoCategoryEcmaWordReverse: - if (strpos > 0) { - char c = str [strpos - 1]; - if (!(('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || '0' <= c && c <= '9' || c == '_'))) { - pc += 1; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos --; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoCategoryEcmaWhiteSpaceReverse: - if (strpos > 0) { - char c = str [strpos - 1]; - if (!((c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '\f' || c == '\v'))) { - pc += 1; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos --; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoCategoryUnicodeSpecialsReverse: - if (strpos > 0) { - char c = str [strpos - 1]; - if (!(('\uFEFF' <= c && c <= '\uFEFF' || '\uFFF0' <= c && c <= '\uFFFD'))) { - pc += 1; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos --; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoCategoryUnicodeReverse: - if (strpos > 0) { - char c = str [strpos - 1]; - if (!((Char.GetUnicodeCategory (c) == (UnicodeCategory)program [pc + 1]))) { - pc += 2; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos --; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoCategoryGeneralReverse: - if (strpos > 0) { - char c = str [strpos - 1]; - if (!((CategoryUtils.IsCategory ((Category)program [pc + 1], c)))) { - pc += 2; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos --; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoBitmapReverse: - if (strpos > 0) { - char c = str [strpos - 1]; - int c2 = (int)c; c2 -= program [pc + 1]; length = program [pc + 2]; - if (!((c2 >= 0 && c2 < (length << 3) && (program [pc + 3 + (c2 >> 3)] & (1 << (c2 & 0x7))) != 0))) { - pc += 3 + program [pc + 2]; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos --; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoUnicodeBitmapReverse: - if (strpos > 0) { - char c = str [strpos - 1]; - int c2 = (int)c; c2 -= (program [pc + 1] | ((int)program [pc + 2] << 8)); length = (program [pc + 3] | ((int)program [pc + 4] << 8)); - if (!((c2 >= 0 && c2 < (length << 3) && (program [pc + 5 + (c2 >> 3)] & (1 << (c2 & 0x7))) != 0))) { - pc += 5 + (program [pc + 3] | ((int)program [pc + 4] << 8)); - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos --; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoCharIgnoreCaseReverse: - if (strpos > 0) { - char c = Char.ToLower (str [strpos - 1]); - if (!((c == program [pc + 1]))) { - pc += 2; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos --; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoRangeIgnoreCaseReverse: - if (strpos > 0) { - char c = Char.ToLower (str [strpos - 1]); - if (!((c >= program [pc + 1] && c <= program [pc + 2]))) { - pc += 3; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos --; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoUnicodeRangeIgnoreCaseReverse: - if (strpos > 0) { - char c = Char.ToLower (str [strpos - 1]); - if (!((c >= (program [pc + 1] | ((int)program [pc + 2] << 8))) && (c <= (program [pc + 3] | ((int)program [pc + 4] << 8))))) { - pc += 5; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos --; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoUnicodeCharIgnoreCaseReverse: - if (strpos > 0) { - char c = Char.ToLower (str [strpos - 1]); - if (!((c == (program [pc + 1] | ((int)program [pc + 2] << 8))))) { - pc += 3; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos --; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoBitmapIgnoreCaseReverse: - if (strpos > 0) { - char c = Char.ToLower (str [strpos - 1]); - int c2 = (int)c; c2 -= program [pc + 1]; length = program [pc + 2]; - if (!((c2 >= 0 && c2 < (length << 3) && (program [pc + 3 + (c2 >> 3)] & (1 << (c2 & 0x7))) != 0))) { - pc += 3 + program [pc + 2]; - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos --; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - case RxOp.NoUnicodeBitmapIgnoreCaseReverse: - if (strpos > 0) { - char c = Char.ToLower (str [strpos - 1]); - int c2 = (int)c; c2 -= (program [pc + 1] | ((int)program [pc + 2] << 8)); length = (program [pc + 3] | ((int)program [pc + 4] << 8)); - if (!((c2 >= 0 && c2 < (length << 3) && (program [pc + 5 + (c2 >> 3)] & (1 << (c2 & 0x7))) != 0))) { - pc += 5 + (program [pc + 3] | ((int)program [pc + 4] << 8)); - if (char_group_end == 0 || (pc + 1 == char_group_end)) { - strpos --; - if (pc + 1 == char_group_end) - goto test_char_group_passed; - } - continue; - } - } - return false; - - // END OF GENERATED CODE - - case RxOp.Branch: { - int res = 0; - if (EvalByteCode (pc + 3, strpos, ref res)) { - strpos_result = res; - return true; - } - //Console.WriteLine ("branch offset: {0}", program [pc + 1] | ((int)program [pc + 2] << 8)); - pc += program [pc + 1] | ((int)program [pc + 2] << 8); - continue; - } - case RxOp.Repeat: - case RxOp.RepeatLazy: { - /* - * Repetation is modelled by two opcodes: Repeat and Until which - * contain the the qualified regex between them, i.e.: - * Repeat, , Until, - * It is processed as follows: - * Repeat, [Until, ]*, - * This means that nested quantifiers are processed a bit - * strangely: when the inner quantifier fails to match, its - * tail is processed which includes the outer Until. - * - * This code is from the old interpreter.cs. - * - * FIXME: Rethink this. - */ - - int res = 0; - - this.repeat = new RepeatContext ( - this.repeat, // previous context - ReadInt (program, pc + 3), // minimum - ReadInt (program, pc + 7), // maximum - (RxOp)program [pc] == RxOp.RepeatLazy, // lazy - pc + 11 // subexpression - ); - - int until = pc + (program [pc + 1] | ((int)program [pc + 2] << 8)); - if (!EvalByteCode (until, strpos, ref res)) { - this.repeat = this.repeat.Previous; - return false; - } - - strpos = res; - strpos_result = strpos; - return true; - } - case RxOp.Until: { - RepeatContext current = this.repeat; - int res = 0; - - // - // Can we avoid recursion? - // - // Backtracking can be forced in nested quantifiers from the tail of this quantifier. - // Thus, we cannot, in general, use a simple loop on repeat.Expression to handle - // quantifiers. - // - // If 'deep' was unmolested, that implies that there was no nested quantifiers. - // Thus, we can safely avoid recursion. - // - if (deep == current) - goto Pass; - - start = current.Start; - int start_count = current.Count; - - // First match at least 'start' items without backtracking - while (!current.IsMinimum) { - ++ current.Count; - current.Start = strpos; - deep = current; - if (!EvalByteCode (current.Expression, strpos, ref res)) { - current.Start = start; - current.Count = start_count; - goto Fail; - } - strpos = res; - if (deep != current) // recursive mode - goto Pass; - } - - if (strpos == current.Start) { - // degenerate match ... match tail or fail - this.repeat = current.Previous; - deep = null; - if (EvalByteCode (pc + 1, strpos, ref res)) { - strpos = res; - goto Pass; - } - this.repeat = current; - goto Fail; - } - - if (current.IsLazy) { - for (;;) { - // match tail first ... - this.repeat = current.Previous; - deep = null; - int cp = Checkpoint (); - if (EvalByteCode (pc + 1, strpos, ref res)) { - strpos = res; - goto Pass; - } - - Backtrack (cp); - - // ... then match more - this.repeat = current; - if (current.IsMaximum) - goto Fail; - ++ current.Count; - current.Start = strpos; - deep = current; - if (!EvalByteCode (current.Expression, strpos, ref res)) { - current.Start = start; - current.Count = start_count; - goto Fail; - } - strpos = res; - if (deep != current) // recursive mode - goto Pass; - // Degenerate match: ptr has not moved since the last (failed) tail match. - // So, next and subsequent tail matches will fail. - if (strpos == current.Start) - goto Fail; - } - } else { - int stack_size = stack.Count; - - // match greedily as much as possible - while (!current.IsMaximum) { - int cp = Checkpoint (); - int old_ptr = strpos; - int old_start = current.Start; - - ++ current.Count; - if (trace_rx) - Console.WriteLine ("recurse with count {0}.", current.Count); - current.Start = strpos; - deep = current; - if (!EvalByteCode (current.Expression, strpos, ref res)) { - -- current.Count; - current.Start = old_start; - Backtrack (cp); - break; - } - strpos = res; - if (deep != current) { - // recursive mode: no more backtracking, truncate the stack - stack.Count = stack_size; - goto Pass; - } - stack.Push (cp); - stack.Push (old_ptr); - - // Degenerate match: no point going on - if (strpos == current.Start) - break; - } - - if (trace_rx) - Console.WriteLine ("matching tail: {0} pc={1}", strpos, pc + 1); - // then, match the tail, backtracking as necessary. - this.repeat = current.Previous; - for (;;) { - deep = null; - if (EvalByteCode (pc + 1, strpos, ref res)) { - strpos = res; - stack.Count = stack_size; - goto Pass; - } - if (stack.Count == stack_size) { - this.repeat = current; - goto Fail; - } - - --current.Count; - strpos = stack.Pop (); - Backtrack (stack.Pop ()); - if (trace_rx) - Console.WriteLine ("backtracking to {0} expr={1} pc={2}", strpos, current.Expression, pc); - } - } - } - - case RxOp.FastRepeat: - case RxOp.FastRepeatLazy: { - /* - * A FastRepeat is a simplified version of Repeat which does - * not contain another repeat inside, so backtracking is - * easier. - */ - bool lazy = program [pc] == (byte)RxOp.FastRepeatLazy; - int res = 0; - int tail = pc + (program [pc + 1] | ((int)program [pc + 2] << 8)); - start = ReadInt (program, pc + 3); - end = ReadInt (program, pc + 7); - //Console.WriteLine ("min: {0}, max: {1} tail: {2}", start, end, tail); - length = 0; - - deep = null; - - // First match at least 'start' items - while (length < start) { - if (!EvalByteCode (pc + 11, strpos, ref res)) - return false; - strpos = res; - length++; - } - - if (lazy) { - while (true) { - // Match the tail - int cp = Checkpoint (); - if (EvalByteCode (tail, strpos, ref res)) { - strpos = res; - goto repeat_success; - } - Backtrack (cp); - - if (length >= end) - return false; - - // Match an item - if (!EvalByteCode (pc + 11, strpos, ref res)) - return false; - strpos = res; - length ++; - } - } else { - // Then match as many items as possible, recording - // backtracking information - int old_stack_size = stack.Count; - while (length < end) { - int cp = Checkpoint (); - if (!EvalByteCode (pc + 11, strpos, ref res)) { - Backtrack (cp); - break; - } - stack.Push (cp); - stack.Push (strpos); - strpos = res; - length++; - } - - if (tail <= pc) - throw new Exception (); - - // Then, match the tail, backtracking as necessary. - while (true) { - if (EvalByteCode (tail, strpos, ref res)) { - strpos = res; - stack.Count = old_stack_size; - goto repeat_success; - } - if (stack.Count == old_stack_size) - return false; - - // Backtrack - strpos = stack.Pop (); - Backtrack (stack.Pop ()); - if (trace_rx) - Console.WriteLine ("backtracking to: {0}", strpos); - } - } - - repeat_success: - // We matched the tail too so just return - goto Pass; - } - - default: - Console.WriteLine ("evaluating: {0} at pc: {1}, strpos: {2}", (RxOp)program [pc], pc, strpos); - throw new NotSupportedException (); - } - continue; - - Pass: - strpos_result = strpos; - return true; - Fail: - return false; - test_char_group_passed: - pc = char_group_end; - char_group_end = 0; - continue; - } // end of while (true) - } - } -} diff --git a/mcs/class/System/System.Text.RegularExpressions/RxOp.cs b/mcs/class/System/System.Text.RegularExpressions/RxOp.cs deleted file mode 100644 index 43f817248be..00000000000 --- a/mcs/class/System/System.Text.RegularExpressions/RxOp.cs +++ /dev/null @@ -1,238 +0,0 @@ - -namespace System.Text.RegularExpressions { - - // for the IgnoreCase opcodes, the char data is stored lowercased - // two-byte integers are in little endian format - enum RxOp : byte { - // followed by count, min, max integers - Info, - - False, - True, - - // position anchors - AnyPosition, - StartOfString, - StartOfLine, - StartOfScan, - EndOfString, - EndOfLine, - End, - WordBoundary, - NoWordBoundary, - - // latin1 strings - // followed by single byte length and latin1 bytes - // keep the order, see EmitString () - String, - StringIgnoreCase, - StringReverse, - StringIgnoreCaseReverse, - - // followed by two byte length and unicode chars (two bytes per char) - // a better setup may be to reference the chars in the patterns string - // (offset, length) pairs, at least when the pattern contains them, - // but this means we can't lowercase before hand: consider using a separate - // string/array - // keep the order, see EmitString () - UnicodeString, - UnicodeStringIgnoreCase, - UnicodeStringReverse, - UnicodeStringIgnoreCaseReverse, - - // latin1 single char - // followed by a latin1 byte - // keep the order, see EmitCharacter () - Char, - NoChar, - CharIgnoreCase, - NoCharIgnoreCase, - CharReverse, - NoCharReverse, - CharIgnoreCaseReverse, - NoCharIgnoreCaseReverse, - - // followed by latin1 min and max bytes - // keep the order, see EmitRange () - Range, - NoRange, - RangeIgnoreCase, - NoRangeIgnoreCase, - RangeReverse, - NoRangeReverse, - RangeIgnoreCaseReverse, - NoRangeIgnoreCaseReverse, - - // followed by lowbyte and length of the bitmap and by the bitmap - // keep the order, see EmitSet () - Bitmap, - NoBitmap, - BitmapIgnoreCase, - NoBitmapIgnoreCase, - BitmapReverse, - NoBitmapReverse, - BitmapIgnoreCaseReverse, - NoBitmapIgnoreCaseReverse, - - // unicode chars - // followed by a unicode char - // keep the order, see EmitCharacter () - UnicodeChar, - NoUnicodeChar, - UnicodeCharIgnoreCase, - NoUnicodeCharIgnoreCase, - UnicodeCharReverse, - NoUnicodeCharReverse, - UnicodeCharIgnoreCaseReverse, - NoUnicodeCharIgnoreCaseReverse, - - // followed by unicode char min and max chars - // keep the order, see EmitRange () - UnicodeRange, - NoUnicodeRange, - UnicodeRangeIgnoreCase, - NoUnicodeRangeIgnoreCase, - UnicodeRangeReverse, - NoUnicodeRangeReverse, - UnicodeRangeIgnoreCaseReverse, - NoUnicodeRangeIgnoreCaseReverse, - - // followed by lowchar and length of the bitmap and by the bitmap - UnicodeBitmap, - NoUnicodeBitmap, - UnicodeBitmapIgnoreCase, - NoUnicodeBitmapIgnoreCase, - UnicodeBitmapReverse, - NoUnicodeBitmapReverse, - UnicodeBitmapIgnoreCaseReverse, - NoUnicodeBitmapIgnoreCaseReverse, - - // add reverse and negate versions of the categories - CategoryAny, - NoCategoryAny, - CategoryAnyReverse, - NoCategoryAnyReverse, - CategoryAnySingleline, - NoCategoryAnySingleline, - CategoryAnySinglelineReverse, - NoCategoryAnySinglelineReverse, - CategoryDigit, - NoCategoryDigit, - CategoryDigitReverse, - NoCategoryDigitReverse, - CategoryWord, - NoCategoryWord, - CategoryWordReverse, - NoCategoryWordReverse, - CategoryWhiteSpace, - NoCategoryWhiteSpace, - CategoryWhiteSpaceReverse, - NoCategoryWhiteSpaceReverse, - CategoryEcmaWord, - NoCategoryEcmaWord, - CategoryEcmaWordReverse, - NoCategoryEcmaWordReverse, - CategoryEcmaWhiteSpace, - NoCategoryEcmaWhiteSpace, - CategoryEcmaWhiteSpaceReverse, - NoCategoryEcmaWhiteSpaceReverse, - - // followed by a unicode category value (byte) - CategoryUnicode, - NoCategoryUnicode, - CategoryUnicodeReverse, - NoCategoryUnicodeReverse, - - CategoryUnicodeLetter, - NoCategoryUnicodeLetter, - CategoryUnicodeLetterReverse, - NoCategoryUnicodeLetterReverse, - CategoryUnicodeMark, - NoCategoryUnicodeMark, - CategoryUnicodeMarkReverse, - NoCategoryUnicodeMarkReverse, - CategoryUnicodeNumber, - NoCategoryUnicodeNumber, - CategoryUnicodeNumberReverse, - NoCategoryUnicodeNumberReverse, - CategoryUnicodeSeparator, - NoCategoryUnicodeSeparator, - CategoryUnicodeSeparatorReverse, - NoCategoryUnicodeSeparatorReverse, - CategoryUnicodePunctuation, - NoCategoryUnicodePunctuation, - CategoryUnicodePunctuationReverse, - NoCategoryUnicodePunctuationReverse, - CategoryUnicodeSymbol, - NoCategoryUnicodeSymbol, - CategoryUnicodeSymbolReverse, - NoCategoryUnicodeSymbolReverse, - CategoryUnicodeSpecials, - NoCategoryUnicodeSpecials, - CategoryUnicodeSpecialsReverse, - NoCategoryUnicodeSpecialsReverse, - CategoryUnicodeOther, - NoCategoryUnicodeOther, - CategoryUnicodeOtherReverse, - NoCategoryUnicodeOtherReverse, - // add more categories - - // followed by Category value (byte) - CategoryGeneral, - NoCategoryGeneral, - CategoryGeneralReverse, - NoCategoryGeneralReverse, - - // backreferences - // followed by two-byte reference number - // keep the order, see EmitReference () - Reference, - ReferenceIgnoreCase, - ReferenceReverse, - ReferenceIgnoreCaseReverse, - - // group/capture support - // followed by two-byte group id - OpenGroup, - CloseGroup, - - BalanceStart, - Balance, - - // followed by offset and two-byte group id - IfDefined, - - // skip ahead num bytes - // followed by two-byte offset - Jump, - - // followed by two-byte offset - SubExpression, - - // followed by true and false two-byte offsets - Test, - - // followed by two-byte offset - Branch, - - // followed by two-byte offset - TestCharGroup, - - // anchoring expression - // followed by offset of tail and offset - Anchor, - AnchorReverse, - - // repetition support - // followed by min, max ints - Repeat, - RepeatLazy, - Until, - FastRepeat, - FastRepeatLazy, - // followed by min byte - RepeatInfinite, - RepeatInfiniteLazy, - } -} - diff --git a/mcs/class/System/System.Text.RegularExpressions/arch.cs b/mcs/class/System/System.Text.RegularExpressions/arch.cs deleted file mode 100644 index 89ce958e6b0..00000000000 --- a/mcs/class/System/System.Text.RegularExpressions/arch.cs +++ /dev/null @@ -1,365 +0,0 @@ -// -// assembly: System -// namespace: System.Text.RegularExpressions -// file: arch.cs -// -// author: Dan Lewis (dlewis@gmx.co.uk) -// (c) 2002 - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; - -namespace System.Text.RegularExpressions { - - enum OpCode : ushort { - False = 0, // always fails - True, // always succeeds - - // matching - - Position, // zero-width position assertion - String, // match string literal - Reference, // back reference - - // character matching - - Character, // match character exactly - Category, // match character from category - NotCategory, // match character _not_ from category - Range, // match character from range - Set, // match character from set - In, // match character from group of tests - - // capturing - - Open, // open group - Close, // close group - Balance, // balance groups - BalanceStart, //track balance group length - - // control flow - - IfDefined, // conditional on capture - Sub, // non-backtracking subexpression - Test, // non-backtracking lookahead/behind - Branch, // alternative expression - Jump, // unconditional goto - Repeat, // new repeat context - Until, // repeat subexpression within context - FastRepeat, // repeat simple subexpression - Anchor, // anchoring expression - - // miscellaneous - - Info // pattern information - } - - [Flags] - enum OpFlags : ushort { - None = 0x000, - Negate = 0x100, // succeed on mismatch - IgnoreCase = 0x200, // case insensitive matching - RightToLeft = 0x400, // right-to-left matching - Lazy = 0x800 // minimizing repeat - } - - enum Position : ushort { - Any, // anywhere - Start, // start of string \A - StartOfString, // start of string \A - StartOfLine, // start of line ^ - StartOfScan, // start of scan \G - End, // end or before newline at end \Z - EndOfString, // end of string \z - EndOfLine, // end of line $ - Boundary, // word boundary \b - NonBoundary // not word boundary \B - }; - - // see category.cs for Category enum - - interface IMachine { - Match Scan (Regex regex, string text, int start, int end); - Match Scan (Regex regex, string text, int start, int end, bool substring_mode); - string [] Split (Regex regex, string input, int count, int startat); - string Replace (Regex regex, string input, string replacement, int count, int startat); - string Result (string replacement, Match match); - } - - interface IMachineFactory { - IMachine NewInstance (); - IDictionary Mapping { get; set; } - int GroupCount { get; } - int Gap { get; set; } // Index of first group whose number differs from its index, or 1+GroupCount - string [] NamesMapping { get; set; } - } - - // Anchor SKIP OFFSET - // - // Flags: [RightToLeft] ?? - // SKIP: relative address of tail expression - // OFFSET: offset of anchor from start of pattern - // - // Usage: - // - // Anchor :1 OFFSET - // - // True - // 1: - // - // Notes: - // - // In practice, the anchoring expression is only going to be - // Position (StartOfString, StartOfLine, StartOfScan) or String. - // This is because the optimizer looks for position anchors at the - // start of the expression, and if that fails it looks for the - // longest substring. If an expression has neither a position - // anchor or a longest substring anchor, then the anchoring expression - // is left empty. Since an empty expression will anchor at any - // position in any string, the entire input string will be scanned. - - // String LEN STR... - // - // Flags: [RightToLeft, IgnoreCase] - // LEN: length of string - // STR: string characters - - // Branch SKIP - // - // SKIP: relative address of next branch - // - // Branch :1 - // - // Jump :4 - // 1: Branch :2 - // - // Jump :4 - // 2: Branch :3 - // - // Jump :4 - // 3: False - // 4: - - // Repeat SKIP MIN MAX - // - // Flags: [Lazy] - // SKIP: relative address of Until instruction - // MIN: minimum iterations (2 slots) - // MAX: maximum iterations (2 slots, 0x7fffffff is infinity) - // - // Repeat :1 MIN MAX - // - // Until - // 1: - - // FastRepeat SKIP MIN MAX - // - // Flags: [Lazy] - // SKIP: relative address of tail expression - // MIN: minimum iterations (2 slots) - // MAX: maximum iterations (2 slots, 0x7fffffff is infinity) - // - // FastRepeat :1 MIN MAX - // - // True - // 1: - // - // Notes: - // - // The subexpression of a FastRepeat construct must not contain any - // complex operators. These include: Open, Close, Balance, Repeat, - // FastRepeat, Sub, Test. In addition, the subexpression must have - // been determined to have a fixed width. - - // Sub SKIP - // - // SKIP: relative address of tail expression - // - // Sub :1 - // - // 1: - // - // Notes: - // - // The Sub operator invokes an independent subexpression. This means - // that the subexpression will match only once and so will not - // participate in any backtracking. - - // Test TSKIP FSKIP - // - // TSKIP: relative address of true expression - // FSKIP: relative address of false expression - // - // Usage: (?(?=test)true|false) - // - // Test :1 :2 - // - // 1: - // Jump - // 2: - // - // - // Usage: (?(?=test)true) - // - // Test :1 :2 - // - // 1: - // 2: - // - // Usage: (?=test) - // - // Test :1 :2 - // - // 1: - // Jump 3: - // 2: False - // 3: - // - // Notes: - // - // For negative lookaheads, just swap the values of TSKIP and - // FSKIP. For lookbehinds, the test expression must be compiled - // in reverse. The test expression is always executed as an - // independent subexpression, so its behaviour is non-backtracking - // (like a Sub clause.) - - // IfDefined SKIP GID - // - // SKIP: relative address of else expression - // GID: number of group to check - // - // Usage: (?(gid)true) - // - // IfDefined :1 - // - // 1: - // - // Usage: (?(gid)true|false) - // - // IfDefined :1 - // - // Jump :2 - // 1: - // 2: - - // Jump SKIP - // - // SKIP: relative address of target expression - // - // Jump :1 - // ... - // :1 - - // Character CHAR - // - // Flags: [Negate, IgnoreCase, RightToLeft] - // CHAR: exact character to match - - // Category CAT - // - // Flags: [Negate, RightToLeft] - // CAT: category to match (see Category enum) - - // Range LO HI - // - // Flags: [Negate, IgnoreCase, RightToLeft] - // LO: lowest character in range - // HI: higest character in range - - // Set LO LEN SET... - // - // Flags: [Negate, IgnoreCase, RightToLeft] - // LO: lowest character in set - // LEN: number of words in set - // SET: bit array representing characters in set - // - // Notes: - // - // Each word in the set represents 16 characters, so the first word - // defines membership for characters LO to LO + 15, the second for - // LO + 16 to LO + 31, and so on up to LO + (LEN * 16 - 1). It is - // up to the compiler to provide a compact representation for sparse - // unicode sets. The simple way is to use Set 0 4096. Other methods - // involve paritioning the set and placing the components into an - // In block. - - // In SKIP - // - // SKIP: relative address of tail expression - // - // Usage: [expr] - // - // In :1 - // - // True - // :1 - // - // Usage: [^expr] - // - // In :1 - // - // False - // :1 - // - // Notes: - // - // The In instruction consumes a single character, using the flags - // of the first instruction in the subexpression to determine its - // IgnoreCase and RightToLeft properties. The subexpression is then - // applied to the single character as a disjunction. If any instruction - // in the subexpression succeeds, the entire In construct succeeds - // and matching continues with the tail. - - // Position POS - // - // POS: position to match (see Position enum) - - // Open GID - // - // GID: number of group to open - - // Close GID - // - // GID: number of group to close - - // Balance GID BAL - // - // GID: number of capturing group (0 if none) - // BAL: number of group to undefine - - // Info GROUPS MIN MAX - // - // GROUPS: number of capturing groups (2 slots) - // MIN: minimum width of pattern (2 slots) - // MAX: maximum width of pattern (2 slots, 0x7fffffff means undefined) - - // False - - // True - - // Reference GID - // - // Flags: [IgnoreCase, RightToLeft] - // GID: number of group to reference -} diff --git a/mcs/class/System/System.Text.RegularExpressions/cache.cs b/mcs/class/System/System.Text.RegularExpressions/cache.cs deleted file mode 100644 index f4076227528..00000000000 --- a/mcs/class/System/System.Text.RegularExpressions/cache.cs +++ /dev/null @@ -1,179 +0,0 @@ -// -// assembly: System -// namespace: System.Text.RegularExpressions -// file: cache.cs -// -// author: Dan Lewis (dlewis@gmx.co.uk) -// (c) 2002 - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; - -namespace System.Text.RegularExpressions { - - class FactoryCache { - public FactoryCache (int capacity) { - this.capacity = capacity; - this.factories = new Hashtable (capacity); - this.mru_list = new MRUList (); - } - - public void Add (string pattern, RegexOptions options, IMachineFactory factory) { - lock (this) { - Key k = new Key (pattern, options); - Cleanup (); - factories[k] = factory; - mru_list.Use (k); - } - } - - // lock must be held by the caller - void Cleanup () - { - while (factories.Count >= capacity && capacity > 0) { - object victim = mru_list.Evict (); - if (victim != null) - factories.Remove ((Key) victim); - } - } - - public IMachineFactory Lookup (string pattern, RegexOptions options) { - lock (this) { - Key k = new Key (pattern, options); - if (factories.Contains (k)) { - mru_list.Use (k); - return (IMachineFactory)factories[k]; - } - } - - return null; - } - - public int Capacity { - get { return capacity; } - set { - // < 0 check done in the caller (Regex.CacheSize) - lock (this) { - capacity = value; - Cleanup (); - } - } - } - - private int capacity; - private Hashtable factories; - private MRUList mru_list; - - class Key { - public string pattern; - public RegexOptions options; - - public Key (string pattern, RegexOptions options) { - this.pattern = pattern; - this.options = options; - } - - public override int GetHashCode () { - return pattern.GetHashCode () ^ (int)options; - } - - public override bool Equals (object o) { - if (o == null || !(o is Key)) - return false; - - Key k = (Key)o; - return options == k.options && pattern.Equals (k.pattern); - } - - public override string ToString () { - return "('" + pattern + "', [" + options + "])"; - } - } - } - - class MRUList { - public MRUList () { - head = tail = null; - } - - public void Use (object o) { - Node node; - - if (head == null) { - node = new Node (o); - head = tail = node; - return; - } - - node = head; - while (node != null && !o.Equals (node.value)) - node = node.previous; - - if (node == null) - node = new Node (o); - else { - if (node == head) - return; - - if (node == tail) - tail = node.next; - else - node.previous.next = node.next; - - node.next.previous = node.previous; - } - - head.next = node; - node.previous = head; - node.next = null; - head = node; - } - - public object Evict () { - if (tail == null) - return null; - - object o = tail.value; - tail = tail.next; - - if (tail == null) - head = null; - else - tail.previous = null; - - return o; - } - - private Node head, tail; - - private class Node { - public object value; - public Node previous, next; - - public Node (object value) { - this.value = value; - } - } - } -} diff --git a/mcs/class/System/System.Text.RegularExpressions/category.cs b/mcs/class/System/System.Text.RegularExpressions/category.cs deleted file mode 100644 index b64dcb3a583..00000000000 --- a/mcs/class/System/System.Text.RegularExpressions/category.cs +++ /dev/null @@ -1,660 +0,0 @@ -// -// assembly: System -// namespace: System.Text.RegularExpressions -// file: category.cs -// -// author: Dan Lewis (dlewis@gmx.co.uk) -// (c) 2002 - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Globalization; - -namespace System.Text.RegularExpressions { - - enum Category : ushort { - None, - - // canonical classes - - Any, // any character except newline . - AnySingleline, // any character . (s option) - Word, // any word character \w - Digit, // any digit character \d - WhiteSpace, // any whitespace character \s - - // ECMAScript classes - - - EcmaAny, - EcmaAnySingleline, - EcmaWord, // [a-zA-Z_0-9] - EcmaDigit, // [0-9] - EcmaWhiteSpace, // [ \f\n\r\t\v] - - // unicode categories - - UnicodeL, // Letter - UnicodeM, // Mark - UnicodeN, // Number - UnicodeZ, // Separator - UnicodeP, // Punctuation - UnicodeS, // Symbol - UnicodeC, // Other - - UnicodeLu, // UppercaseLetter - UnicodeLl, // LowercaseLetter - UnicodeLt, // TitlecaseLetter - UnicodeLm, // ModifierLetter - UnicodeLo, // OtherLetter - UnicodeMn, // NonspacingMark - UnicodeMe, // EnclosingMark - UnicodeMc, // SpacingMark - UnicodeNd, // DecimalNumber - UnicodeNl, // LetterNumber - UnicodeNo, // OtherNumber - UnicodeZs, // SpaceSeparator - UnicodeZl, // LineSeparator - UnicodeZp, // ParagraphSeparator - UnicodePd, // DashPunctuation - UnicodePs, // OpenPunctuation - UnicodePi, // InitialPunctuation - UnicodePe, // ClosePunctuation - UnicodePf, // FinalPunctuation - UnicodePc, // ConnectorPunctuation - UnicodePo, // OtherPunctuation - UnicodeSm, // MathSymbol - UnicodeSc, // CurrencySymbol - UnicodeSk, // ModifierSymbol - UnicodeSo, // OtherSymbol - UnicodeCc, // Control - UnicodeCf, // Format - UnicodeCo, // PrivateUse - UnicodeCs, // Surrogate - UnicodeCn, // Unassigned - - // unicode block ranges - - // notes: the categories marked with a star are valid unicode block ranges, - // but don't seem to be accepted by the MS parser using the /p{...} format. - // any ideas? - - UnicodeBasicLatin, - UnicodeLatin1Supplement, // * - UnicodeLatinExtendedA, // * - UnicodeLatinExtendedB, // * - UnicodeIPAExtensions, - UnicodeSpacingModifierLetters, - UnicodeCombiningDiacriticalMarks, - UnicodeGreek, - UnicodeCyrillic, - UnicodeArmenian, - UnicodeHebrew, - UnicodeArabic, - UnicodeSyriac, - UnicodeThaana, - UnicodeDevanagari, - UnicodeBengali, - UnicodeGurmukhi, - UnicodeGujarati, - UnicodeOriya, - UnicodeTamil, - UnicodeTelugu, - UnicodeKannada, - UnicodeMalayalam, - UnicodeSinhala, - UnicodeThai, - UnicodeLao, - UnicodeTibetan, - UnicodeMyanmar, - UnicodeGeorgian, - UnicodeHangulJamo, - UnicodeEthiopic, - UnicodeCherokee, - UnicodeUnifiedCanadianAboriginalSyllabics, - UnicodeOgham, - UnicodeRunic, - UnicodeKhmer, - UnicodeMongolian, - UnicodeLatinExtendedAdditional, - UnicodeGreekExtended, - UnicodeGeneralPunctuation, - UnicodeSuperscriptsandSubscripts, - UnicodeCurrencySymbols, - UnicodeCombiningMarksforSymbols, - UnicodeLetterlikeSymbols, - UnicodeNumberForms, - UnicodeArrows, - UnicodeMathematicalOperators, - UnicodeMiscellaneousTechnical, - UnicodeControlPictures, - UnicodeOpticalCharacterRecognition, - UnicodeEnclosedAlphanumerics, - UnicodeBoxDrawing, - UnicodeBlockElements, - UnicodeGeometricShapes, - UnicodeMiscellaneousSymbols, - UnicodeDingbats, - UnicodeBraillePatterns, - UnicodeCJKRadicalsSupplement, - UnicodeKangxiRadicals, - UnicodeIdeographicDescriptionCharacters, - UnicodeCJKSymbolsandPunctuation, - UnicodeHiragana, - UnicodeKatakana, - UnicodeBopomofo, - UnicodeHangulCompatibilityJamo, - UnicodeKanbun, - UnicodeBopomofoExtended, - UnicodeEnclosedCJKLettersandMonths, - UnicodeCJKCompatibility, - UnicodeCJKUnifiedIdeographsExtensionA, - UnicodeCJKUnifiedIdeographs, - UnicodeYiSyllables, - UnicodeYiRadicals, - UnicodeHangulSyllables, - UnicodeHighSurrogates, - UnicodeHighPrivateUseSurrogates, - UnicodeLowSurrogates, - UnicodePrivateUse, - UnicodeCJKCompatibilityIdeographs, - UnicodeAlphabeticPresentationForms, - UnicodeArabicPresentationFormsA, // * - UnicodeCombiningHalfMarks, - UnicodeCJKCompatibilityForms, - UnicodeSmallFormVariants, - UnicodeArabicPresentationFormsB, // * - UnicodeSpecials, - UnicodeHalfwidthandFullwidthForms, - - UnicodeOldItalic, - UnicodeGothic, - UnicodeDeseret, - UnicodeByzantineMusicalSymbols, - UnicodeMusicalSymbols, - UnicodeMathematicalAlphanumericSymbols, - UnicodeCJKUnifiedIdeographsExtensionB, - UnicodeCJKCompatibilityIdeographsSupplement, - UnicodeTags, - - LastValue // Keep this with the higher value in the enumeration - } - - class CategoryUtils { - public static Category CategoryFromName (string name) { - try { - if (name.StartsWith ("Is")) // remove prefix from block range - name = name.Substring (2); - - return (Category) Enum.Parse (typeof (Category), "Unicode" + name, false); - } - catch (ArgumentException) { - return Category.None; - } - } - - public static bool IsCategory (Category cat, char c) { - switch (cat) { - case Category.None: - return false; - - case Category.Any: - return c != '\n'; - - case Category.AnySingleline: - return true; - - case Category.Word: - return - Char.IsLetterOrDigit (c) || - IsCategory (UnicodeCategory.ConnectorPunctuation, c); - - case Category.Digit: - return Char.IsDigit (c); - - case Category.WhiteSpace: - return Char.IsWhiteSpace (c); - - // ECMA categories - - case Category.EcmaAny: - return c != '\n'; - - case Category.EcmaAnySingleline: - return true; - - case Category.EcmaWord: - return - 'a' <= c && c <= 'z' || - 'A' <= c && c <= 'Z' || - '0' <= c && c <= '9' || - '_' == c; - - case Category.EcmaDigit: - return - '0' <= c && c <= '9'; - - case Category.EcmaWhiteSpace: - return - c == ' ' || - c == '\f' || - c == '\n' || - c == '\r' || - c == '\t' || - c == '\v'; - - // Unicode categories... - - // letter - - case Category.UnicodeLu: return IsCategory (UnicodeCategory.UppercaseLetter, c); - case Category.UnicodeLl: return IsCategory (UnicodeCategory.LowercaseLetter, c); - case Category.UnicodeLt: return IsCategory (UnicodeCategory.TitlecaseLetter, c); - case Category.UnicodeLm: return IsCategory (UnicodeCategory.ModifierLetter, c); - case Category.UnicodeLo: return IsCategory (UnicodeCategory.OtherLetter, c); - - // mark - - case Category.UnicodeMn: return IsCategory (UnicodeCategory.NonSpacingMark, c); - case Category.UnicodeMe: return IsCategory (UnicodeCategory.EnclosingMark, c); - case Category.UnicodeMc: return IsCategory (UnicodeCategory.SpacingCombiningMark, c); - case Category.UnicodeNd: return IsCategory (UnicodeCategory.DecimalDigitNumber, c); - - // number - - case Category.UnicodeNl: return IsCategory (UnicodeCategory.LetterNumber, c); - case Category.UnicodeNo: return IsCategory (UnicodeCategory.OtherNumber, c); - - // separator - - case Category.UnicodeZs: return IsCategory (UnicodeCategory.SpaceSeparator, c); - case Category.UnicodeZl: return IsCategory (UnicodeCategory.LineSeparator, c); - case Category.UnicodeZp: return IsCategory (UnicodeCategory.ParagraphSeparator, c); - - // punctuation - - case Category.UnicodePd: return IsCategory (UnicodeCategory.DashPunctuation, c); - case Category.UnicodePs: return IsCategory (UnicodeCategory.OpenPunctuation, c); - case Category.UnicodePi: return IsCategory (UnicodeCategory.InitialQuotePunctuation, c); - case Category.UnicodePe: return IsCategory (UnicodeCategory.ClosePunctuation, c); - case Category.UnicodePf: return IsCategory (UnicodeCategory.FinalQuotePunctuation, c); - case Category.UnicodePc: return IsCategory (UnicodeCategory.ConnectorPunctuation, c); - case Category.UnicodePo: return IsCategory (UnicodeCategory.OtherPunctuation, c); - - // symbol - - case Category.UnicodeSm: return IsCategory (UnicodeCategory.MathSymbol, c); - case Category.UnicodeSc: return IsCategory (UnicodeCategory.CurrencySymbol, c); - case Category.UnicodeSk: return IsCategory (UnicodeCategory.ModifierSymbol, c); - case Category.UnicodeSo: return IsCategory (UnicodeCategory.OtherSymbol, c); - - // other - - case Category.UnicodeCc: return IsCategory (UnicodeCategory.Control, c); - case Category.UnicodeCf: return IsCategory (UnicodeCategory.Format, c); - case Category.UnicodeCo: return IsCategory (UnicodeCategory.PrivateUse, c); - case Category.UnicodeCs: return IsCategory (UnicodeCategory.Surrogate, c); - case Category.UnicodeCn: return IsCategory (UnicodeCategory.OtherNotAssigned, c); - - case Category.UnicodeL: // letter - return - IsCategory (UnicodeCategory.UppercaseLetter, c) || - IsCategory (UnicodeCategory.LowercaseLetter, c) || - IsCategory (UnicodeCategory.TitlecaseLetter, c) || - IsCategory (UnicodeCategory.ModifierLetter, c) || - IsCategory (UnicodeCategory.OtherLetter, c); - - case Category.UnicodeM: // mark - return - IsCategory (UnicodeCategory.NonSpacingMark, c) || - IsCategory (UnicodeCategory.EnclosingMark, c) || - IsCategory (UnicodeCategory.SpacingCombiningMark, c); - - case Category.UnicodeN: // number - return - IsCategory (UnicodeCategory.DecimalDigitNumber, c) || - IsCategory (UnicodeCategory.LetterNumber, c) || - IsCategory (UnicodeCategory.OtherNumber, c); - - case Category.UnicodeZ: // separator - return - IsCategory (UnicodeCategory.SpaceSeparator, c) || - IsCategory (UnicodeCategory.LineSeparator, c) || - IsCategory (UnicodeCategory.ParagraphSeparator, c); - - case Category.UnicodeP: // punctuation - return - IsCategory (UnicodeCategory.DashPunctuation, c) || - IsCategory (UnicodeCategory.OpenPunctuation, c) || - IsCategory (UnicodeCategory.InitialQuotePunctuation, c) || - IsCategory (UnicodeCategory.ClosePunctuation, c) || - IsCategory (UnicodeCategory.FinalQuotePunctuation, c) || - IsCategory (UnicodeCategory.ConnectorPunctuation, c) || - IsCategory (UnicodeCategory.OtherPunctuation, c); - - case Category.UnicodeS: // symbol - return - IsCategory (UnicodeCategory.MathSymbol, c) || - IsCategory (UnicodeCategory.CurrencySymbol, c) || - IsCategory (UnicodeCategory.ModifierSymbol, c) || - IsCategory (UnicodeCategory.OtherSymbol, c); - - case Category.UnicodeC: // other - return - IsCategory (UnicodeCategory.Control, c) || - IsCategory (UnicodeCategory.Format, c) || - IsCategory (UnicodeCategory.PrivateUse, c) || - IsCategory (UnicodeCategory.Surrogate, c) || - IsCategory (UnicodeCategory.OtherNotAssigned, c); - - // Unicode block ranges... - - case Category.UnicodeBasicLatin: - return '\u0000' <= c && c <= '\u007F'; - - case Category.UnicodeLatin1Supplement: - return '\u0080' <= c && c <= '\u00FF'; - - case Category.UnicodeLatinExtendedA: - return '\u0100' <= c && c <= '\u017F'; - - case Category.UnicodeLatinExtendedB: - return '\u0180' <= c && c <= '\u024F'; - - case Category.UnicodeIPAExtensions: - return '\u0250' <= c && c <= '\u02AF'; - - case Category.UnicodeSpacingModifierLetters: - return '\u02B0' <= c && c <= '\u02FF'; - - case Category.UnicodeCombiningDiacriticalMarks: - return '\u0300' <= c && c <= '\u036F'; - - case Category.UnicodeGreek: - return '\u0370' <= c && c <= '\u03FF'; - - case Category.UnicodeCyrillic: - return '\u0400' <= c && c <= '\u04FF'; - - case Category.UnicodeArmenian: - return '\u0530' <= c && c <= '\u058F'; - - case Category.UnicodeHebrew: - return '\u0590' <= c && c <= '\u05FF'; - - case Category.UnicodeArabic: - return '\u0600' <= c && c <= '\u06FF'; - - case Category.UnicodeSyriac: - return '\u0700' <= c && c <= '\u074F'; - - case Category.UnicodeThaana: - return '\u0780' <= c && c <= '\u07BF'; - - case Category.UnicodeDevanagari: - return '\u0900' <= c && c <= '\u097F'; - - case Category.UnicodeBengali: - return '\u0980' <= c && c <= '\u09FF'; - - case Category.UnicodeGurmukhi: - return '\u0A00' <= c && c <= '\u0A7F'; - - case Category.UnicodeGujarati: - return '\u0A80' <= c && c <= '\u0AFF'; - - case Category.UnicodeOriya: - return '\u0B00' <= c && c <= '\u0B7F'; - - case Category.UnicodeTamil: - return '\u0B80' <= c && c <= '\u0BFF'; - - case Category.UnicodeTelugu: - return '\u0C00' <= c && c <= '\u0C7F'; - - case Category.UnicodeKannada: - return '\u0C80' <= c && c <= '\u0CFF'; - - case Category.UnicodeMalayalam: - return '\u0D00' <= c && c <= '\u0D7F'; - - case Category.UnicodeSinhala: - return '\u0D80' <= c && c <= '\u0DFF'; - - case Category.UnicodeThai: - return '\u0E00' <= c && c <= '\u0E7F'; - - case Category.UnicodeLao: - return '\u0E80' <= c && c <= '\u0EFF'; - - case Category.UnicodeTibetan: - return '\u0F00' <= c && c <= '\u0FFF'; - - case Category.UnicodeMyanmar: - return '\u1000' <= c && c <= '\u109F'; - - case Category.UnicodeGeorgian: - return '\u10A0' <= c && c <= '\u10FF'; - - case Category.UnicodeHangulJamo: - return '\u1100' <= c && c <= '\u11FF'; - - case Category.UnicodeEthiopic: - return '\u1200' <= c && c <= '\u137F'; - - case Category.UnicodeCherokee: - return '\u13A0' <= c && c <= '\u13FF'; - - case Category.UnicodeUnifiedCanadianAboriginalSyllabics: - return '\u1400' <= c && c <= '\u167F'; - - case Category.UnicodeOgham: - return '\u1680' <= c && c <= '\u169F'; - - case Category.UnicodeRunic: - return '\u16A0' <= c && c <= '\u16FF'; - - case Category.UnicodeKhmer: - return '\u1780' <= c && c <= '\u17FF'; - - case Category.UnicodeMongolian: - return '\u1800' <= c && c <= '\u18AF'; - - case Category.UnicodeLatinExtendedAdditional: - return '\u1E00' <= c && c <= '\u1EFF'; - - case Category.UnicodeGreekExtended: - return '\u1F00' <= c && c <= '\u1FFF'; - - case Category.UnicodeGeneralPunctuation: - return '\u2000' <= c && c <= '\u206F'; - - case Category.UnicodeSuperscriptsandSubscripts: - return '\u2070' <= c && c <= '\u209F'; - - case Category.UnicodeCurrencySymbols: - return '\u20A0' <= c && c <= '\u20CF'; - - case Category.UnicodeCombiningMarksforSymbols: - return '\u20D0' <= c && c <= '\u20FF'; - - case Category.UnicodeLetterlikeSymbols: - return '\u2100' <= c && c <= '\u214F'; - - case Category.UnicodeNumberForms: - return '\u2150' <= c && c <= '\u218F'; - - case Category.UnicodeArrows: - return '\u2190' <= c && c <= '\u21FF'; - - case Category.UnicodeMathematicalOperators: - return '\u2200' <= c && c <= '\u22FF'; - - case Category.UnicodeMiscellaneousTechnical: - return '\u2300' <= c && c <= '\u23FF'; - - case Category.UnicodeControlPictures: - return '\u2400' <= c && c <= '\u243F'; - - case Category.UnicodeOpticalCharacterRecognition: - return '\u2440' <= c && c <= '\u245F'; - - case Category.UnicodeEnclosedAlphanumerics: - return '\u2460' <= c && c <= '\u24FF'; - - case Category.UnicodeBoxDrawing: - return '\u2500' <= c && c <= '\u257F'; - - case Category.UnicodeBlockElements: - return '\u2580' <= c && c <= '\u259F'; - - case Category.UnicodeGeometricShapes: - return '\u25A0' <= c && c <= '\u25FF'; - - case Category.UnicodeMiscellaneousSymbols: - return '\u2600' <= c && c <= '\u26FF'; - - case Category.UnicodeDingbats: - return '\u2700' <= c && c <= '\u27BF'; - - case Category.UnicodeBraillePatterns: - return '\u2800' <= c && c <= '\u28FF'; - - case Category.UnicodeCJKRadicalsSupplement: - return '\u2E80' <= c && c <= '\u2EFF'; - - case Category.UnicodeKangxiRadicals: - return '\u2F00' <= c && c <= '\u2FDF'; - - case Category.UnicodeIdeographicDescriptionCharacters: - return '\u2FF0' <= c && c <= '\u2FFF'; - - case Category.UnicodeCJKSymbolsandPunctuation: - return '\u3000' <= c && c <= '\u303F'; - - case Category.UnicodeHiragana: - return '\u3040' <= c && c <= '\u309F'; - - case Category.UnicodeKatakana: - return '\u30A0' <= c && c <= '\u30FF'; - - case Category.UnicodeBopomofo: - return '\u3100' <= c && c <= '\u312F'; - - case Category.UnicodeHangulCompatibilityJamo: - return '\u3130' <= c && c <= '\u318F'; - - case Category.UnicodeKanbun: - return '\u3190' <= c && c <= '\u319F'; - - case Category.UnicodeBopomofoExtended: - return '\u31A0' <= c && c <= '\u31BF'; - - case Category.UnicodeEnclosedCJKLettersandMonths: - return '\u3200' <= c && c <= '\u32FF'; - - case Category.UnicodeCJKCompatibility: - return '\u3300' <= c && c <= '\u33FF'; - - case Category.UnicodeCJKUnifiedIdeographsExtensionA: - return '\u3400' <= c && c <= '\u4DB5'; - - case Category.UnicodeCJKUnifiedIdeographs: - return '\u4E00' <= c && c <= '\u9FFF'; - - case Category.UnicodeYiSyllables: - return '\uA000' <= c && c <= '\uA48F'; - - case Category.UnicodeYiRadicals: - return '\uA490' <= c && c <= '\uA4CF'; - - case Category.UnicodeHangulSyllables: - return '\uAC00' <= c && c <= '\uD7A3'; - - case Category.UnicodeHighSurrogates: - return '\uD800' <= c && c <= '\uDB7F'; - - case Category.UnicodeHighPrivateUseSurrogates: - return '\uDB80' <= c && c <= '\uDBFF'; - - case Category.UnicodeLowSurrogates: - return '\uDC00' <= c && c <= '\uDFFF'; - - case Category.UnicodePrivateUse: - return '\uE000' <= c && c <= '\uF8FF'; - - case Category.UnicodeCJKCompatibilityIdeographs: - return '\uF900' <= c && c <= '\uFAFF'; - - case Category.UnicodeAlphabeticPresentationForms: - return '\uFB00' <= c && c <= '\uFB4F'; - - case Category.UnicodeArabicPresentationFormsA: - return '\uFB50' <= c && c <= '\uFDFF'; - - case Category.UnicodeCombiningHalfMarks: - return '\uFE20' <= c && c <= '\uFE2F'; - - case Category.UnicodeCJKCompatibilityForms: - return '\uFE30' <= c && c <= '\uFE4F'; - - case Category.UnicodeSmallFormVariants: - return '\uFE50' <= c && c <= '\uFE6F'; - - case Category.UnicodeArabicPresentationFormsB: - return '\uFE70' <= c && c <= '\uFEFE'; - - case Category.UnicodeHalfwidthandFullwidthForms: - return '\uFF00' <= c && c <= '\uFFEF'; - - case Category.UnicodeSpecials: - return - '\uFEFF' <= c && c <= '\uFEFF' || - '\uFFF0' <= c && c <= '\uFFFD'; - - // these block ranges begin above 0x10000 - - case Category.UnicodeOldItalic: - case Category.UnicodeGothic: - case Category.UnicodeDeseret: - case Category.UnicodeByzantineMusicalSymbols: - case Category.UnicodeMusicalSymbols: - case Category.UnicodeMathematicalAlphanumericSymbols: - case Category.UnicodeCJKUnifiedIdeographsExtensionB: - case Category.UnicodeCJKCompatibilityIdeographsSupplement: - case Category.UnicodeTags: - return false; - - default: - return false; - } - } - - private static bool IsCategory (UnicodeCategory uc, char c) { - if (Char.GetUnicodeCategory (c) == uc) - return true; - - return false; - } - } -} diff --git a/mcs/class/System/System.Text.RegularExpressions/compiler.cs b/mcs/class/System/System.Text.RegularExpressions/compiler.cs deleted file mode 100644 index cd2a8bc305c..00000000000 --- a/mcs/class/System/System.Text.RegularExpressions/compiler.cs +++ /dev/null @@ -1,533 +0,0 @@ -// -// assembly: System -// namespace: System.Text.RegularExpressions -// file: compiler.cs -// -// author: Dan Lewis (dlewis@gmx.co.uk) -// (c) 2002 - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Diagnostics; -using System.Collections; - -namespace System.Text.RegularExpressions { - abstract class LinkRef { -#if TRACE_REGEX - static int next_label = 1; - int label = next_label++; - - public override string ToString () - { - return "L" + label.ToString (); - } -#endif - } - - interface ICompiler { - void Reset (); - IMachineFactory GetMachineFactory (); - - // instruction emission - - void EmitFalse (); - void EmitTrue (); - - // character matching - - void EmitCharacter (char c, bool negate, bool ignore, bool reverse); - void EmitCategory (Category cat, bool negate, bool reverse); - void EmitNotCategory (Category cat, bool negate, bool reverse); - void EmitRange (char lo, char hi, bool negate, bool ignore, bool reverse); - void EmitSet (char lo, BitArray set, bool negate, bool ignore, bool reverse); - - // other operators - - void EmitString (string str, bool ignore, bool reverse); - void EmitPosition (Position pos); - void EmitOpen (int gid); - void EmitClose (int gid); - void EmitBalanceStart(int gid, int balance, bool capture, LinkRef tail); - void EmitBalance (); - void EmitReference (int gid, bool ignore, bool reverse); - - // constructs - - void EmitIfDefined (int gid, LinkRef tail); - void EmitSub (LinkRef tail); - void EmitTest (LinkRef yes, LinkRef tail); - void EmitBranch (LinkRef next); - void EmitJump (LinkRef target); - void EmitRepeat (int min, int max, bool lazy, LinkRef until); - void EmitUntil (LinkRef repeat); - void EmitIn (LinkRef tail); - void EmitInfo (int count, int min, int max); - void EmitFastRepeat (int min, int max, bool lazy, LinkRef tail); - void EmitAnchor (bool reverse, int offset, LinkRef tail); - - // event for the CILCompiler - void EmitBranchEnd(); - void EmitAlternationEnd(); - - LinkRef NewLink (); - void ResolveLink (LinkRef link); - } - - class InterpreterFactory : IMachineFactory { - public InterpreterFactory (ushort[] pattern) { - this.pattern = pattern; - } - - public IMachine NewInstance () { - return new Interpreter (pattern); - } - - public int GroupCount { - get { return pattern[1]; } - } - - public int Gap { - get { return gap; } - set { gap = value; } - } - - public IDictionary Mapping { - get { return mapping; } - set { mapping = value; } - } - - public string [] NamesMapping { - get { return namesMapping; } - set { namesMapping = value; } - } - - private IDictionary mapping; - private ushort[] pattern; - private string [] namesMapping; - private int gap; - } - - class PatternCompiler : ICompiler { - public static ushort EncodeOp (OpCode op, OpFlags flags) { - return (ushort)((int)op | ((int)flags & 0xff00)); - } - - [Conditional ("TRACE_REGEX")] - static void TraceRegexp (string fmt, params object[] args) - { - Console.Write ("\t"); - Console.WriteLine (fmt, args); - } - - [Conditional ("TRACE_REGEX")] - static void TraceRegexpLabel (LinkRef lref) - { - Console.Write ("{0}:", lref); - } - - public static void DecodeOp (ushort word, out OpCode op, out OpFlags flags) { - op = (OpCode)(word & 0x00ff); - flags = (OpFlags)(word & 0xff00); - } - - public PatternCompiler () { - pgm = new ArrayList (); - } - - // ICompiler implementation - - public void Reset () { - pgm.Clear (); - } - - public IMachineFactory GetMachineFactory () { - ushort[] image = new ushort[pgm.Count]; - pgm.CopyTo (image); - - return new InterpreterFactory (image); - } - - public void EmitFalse () { - Emit (OpCode.False); - TraceRegexp ("false"); - } - - public void EmitTrue () { - Emit (OpCode.True); - - TraceRegexp ("true"); - } - - void EmitCount (int count) - { - uint ucount = (uint) count; - Emit ((ushort) (ucount & 0xFFFF)); // lo 16bits - Emit ((ushort) (ucount >> 16)); // hi - } - - public void EmitCharacter (char c, bool negate, bool ignore, bool reverse) { - Emit (OpCode.Character, MakeFlags (negate, ignore, reverse, false)); - - if (ignore) - c = Char.ToLower (c); - - Emit ((ushort)c); - - TraceRegexp ("character {0} negate {1} ignore {2} reverse {3}", c, negate, ignore, reverse); - } - - public void EmitCategory (Category cat, bool negate, bool reverse) { - Emit (OpCode.Category, MakeFlags (negate, false, reverse, false)); - Emit ((ushort)cat); - - TraceRegexp ("category {0} negate {1} reverse {2}", cat, negate, reverse); - } - - public void EmitNotCategory (Category cat, bool negate, bool reverse) { - Emit (OpCode.NotCategory, MakeFlags (negate, false, reverse, false)); - Emit ((ushort)cat); - - TraceRegexp ("not category {0} negate {1} reverse {2}", cat, negate, reverse); - } - - public void EmitRange (char lo, char hi, bool negate, bool ignore, bool reverse) { - Emit (OpCode.Range, MakeFlags (negate, ignore, reverse, false)); - Emit ((ushort)lo); - Emit ((ushort)hi); - - TraceRegexp ("char range '{0}' - '{1}' negate {2} ignore {3} reverse {4}", lo, hi, negate, ignore, reverse); - } - - public void EmitSet (char lo, BitArray set, bool negate, bool ignore, bool reverse) { - Emit (OpCode.Set, MakeFlags (negate, ignore, reverse, false)); - Emit ((ushort)lo); - - int len = (set.Length + 0xf) >> 4; - Emit ((ushort)len); - - int b = 0; - while (len -- != 0) { - ushort word = 0; - for (int i = 0; i < 16; ++ i) { - if (b >= set.Length) - break; - - if (set[b ++]) - word |= (ushort)(1 << i); - } - - Emit (word); - } - - TraceRegexp ("set lo '{0}' - '{1}' negate {2} ignore {3} reverse {4}", lo, set, negate, ignore, reverse); - } - - public void EmitString (string str, bool ignore, bool reverse) { - Emit (OpCode.String, MakeFlags (false, ignore, reverse, false)); - int len = str.Length; - Emit ((ushort)len); - - if (ignore) - str = str.ToLower (); - - for (int i = 0; i < len; ++ i) - Emit ((ushort)str[i]); - TraceRegexp ("string '{0}' ignore {1} reverse {2}", str, ignore, reverse); - } - - public void EmitPosition (Position pos) { - Emit (OpCode.Position, 0); - Emit ((ushort)pos); - - TraceRegexp ("position {0}", pos); - } - - public void EmitOpen (int gid) { - Emit (OpCode.Open); - Emit ((ushort)gid); - - TraceRegexp ("open {0}", gid); - } - - public void EmitClose (int gid) { - Emit (OpCode.Close); - Emit ((ushort)gid); - - TraceRegexp ("close {0}", gid); - } - - - - public void EmitBalanceStart (int gid, int balance, bool capture, LinkRef tail) { - BeginLink (tail); - Emit (OpCode.BalanceStart); - Emit ((ushort)gid); - Emit ((ushort)balance); - Emit ((ushort)(capture ? 1 : 0)); - EmitLink (tail); - - TraceRegexp ("balance start gid {0} balance {1} capture {2} tail {3}", gid, balance, capture, tail); - } - - public void EmitBalance () { - Emit (OpCode.Balance); - - TraceRegexp ("balance"); - } - - public void EmitReference (int gid, bool ignore, bool reverse) { - Emit (OpCode.Reference, MakeFlags (false, ignore, reverse, false)); - Emit ((ushort)gid); - - TraceRegexp ("reference gid {0} ignore {1} reverse {2}", gid, ignore, reverse); - } - - public void EmitIfDefined (int gid, LinkRef tail) { - BeginLink (tail); - Emit (OpCode.IfDefined); - EmitLink (tail); - Emit ((ushort)gid); - - TraceRegexp ("if defined gid {1} tail {2}", gid, tail); - } - - public void EmitSub (LinkRef tail) { - BeginLink (tail); - Emit (OpCode.Sub); - EmitLink (tail); - - TraceRegexp ("sub {0}", tail); - } - - public void EmitTest (LinkRef yes, LinkRef tail) { - BeginLink (yes); - BeginLink (tail); - Emit (OpCode.Test); - EmitLink (yes); - EmitLink (tail); - - TraceRegexp ("test yes {0} tail {1}", yes, tail); - } - - public void EmitBranch (LinkRef next) { - BeginLink (next); - Emit (OpCode.Branch, 0); - EmitLink (next); - - TraceRegexp ("branch next {0}", next); - } - - public void EmitJump (LinkRef target) { - BeginLink (target); - Emit (OpCode.Jump, 0); - EmitLink (target); - - TraceRegexp ("jmp target {0}", target); - } - - public void EmitRepeat (int min, int max, bool lazy, LinkRef until) { - BeginLink (until); - Emit (OpCode.Repeat, MakeFlags (false, false, false, lazy)); - EmitLink (until); - EmitCount (min); - EmitCount (max); - - TraceRegexp ("repeat min {0} max {1} lazy {2} until {3}", min, max, lazy, until); - } - - public void EmitUntil (LinkRef repeat) { - ResolveLink (repeat); - Emit (OpCode.Until); - - TraceRegexp ("end until {0}", repeat); - } - - public void EmitFastRepeat (int min, int max, bool lazy, LinkRef tail) { - BeginLink (tail); - Emit (OpCode.FastRepeat, MakeFlags (false, false, false, lazy)); - EmitLink (tail); - EmitCount (min); - EmitCount (max); - - TraceRegexp ("repeat-fast min {0} max {1} lazy {2} tail {3}", min, max, lazy, tail); - } - - public void EmitIn (LinkRef tail) { - BeginLink (tail); - Emit (OpCode.In); - EmitLink (tail); - - TraceRegexp ("in tail {0}", tail); - } - - public void EmitAnchor (bool reverse, int offset, LinkRef tail) { - BeginLink (tail); - Emit (OpCode.Anchor, MakeFlags(false, false, reverse, false)); - EmitLink (tail); - Emit ((ushort)offset); - - TraceRegexp ("anchor reverse {0} offset {1} tail {2}", reverse, offset, tail); - } - - public void EmitInfo (int count, int min, int max) { - Emit (OpCode.Info); - EmitCount (count); - EmitCount (min); - EmitCount (max); - - TraceRegexp ("info group count {0} match_min {1} match_max {2}", count, min, max); - } - - public LinkRef NewLink () { - return new PatternLinkStack (); - } - - public void ResolveLink (LinkRef lref) { - PatternLinkStack stack = (PatternLinkStack)lref; - - while (stack.Pop ()) - pgm[stack.OffsetAddress] = (ushort)stack.GetOffset (CurrentAddress); - - TraceRegexpLabel (lref); - } - - public void EmitBranchEnd(){} - public void EmitAlternationEnd(){} - - // private members - - private static OpFlags MakeFlags (bool negate, bool ignore, bool reverse, bool lazy) { - OpFlags flags = 0; - if (negate) flags |= OpFlags.Negate; - if (ignore) flags |= OpFlags.IgnoreCase; - if (reverse) flags |= OpFlags.RightToLeft; - if (lazy) flags |= OpFlags.Lazy; - - return flags; - } - - private void Emit (OpCode op) { - Emit (op, (OpFlags)0); - } - - private void Emit (OpCode op, OpFlags flags) { - Emit (EncodeOp (op, flags)); - } - - private void Emit (ushort word) { - pgm.Add (word); - } - - private int CurrentAddress { - get { return pgm.Count; } - } - - private void BeginLink (LinkRef lref) { - PatternLinkStack stack = (PatternLinkStack)lref; - stack.BaseAddress = CurrentAddress; - } - - private void EmitLink (LinkRef lref) { - PatternLinkStack stack = (PatternLinkStack)lref; - stack.OffsetAddress = CurrentAddress; - Emit ((ushort)0); // placeholder - stack.Push (); - } - - - private class PatternLinkStack : LinkStack { - public PatternLinkStack () { - } - - public int BaseAddress { - set { link.base_addr = value; } - } - - public int OffsetAddress { - get { return link.offset_addr; } - set { link.offset_addr = value; } - } - - public int GetOffset (int target_addr) { - return target_addr - link.base_addr; - } - - // LinkStack implementation - - protected override object GetCurrent () { return link; } - protected override void SetCurrent (object l) { link = (Link)l; } - - private struct Link { - public int base_addr; - public int offset_addr; - } - - Link link; - } - - private ArrayList pgm; - } - - abstract class LinkStack : LinkRef { - public LinkStack () { - stack = new Stack (); - } - - public void Push () { - stack.Push (GetCurrent ()); - } - - public bool Pop () { - if (stack.Count > 0) { - SetCurrent (stack.Pop ()); - return true; - } - - return false; - } - - protected abstract object GetCurrent (); - protected abstract void SetCurrent (object l); - - private Stack stack; - } - - //Used by CILCompiler and Interpreter - internal struct Mark { - public int Start, End; - public int Previous; - - public bool IsDefined { - get { return Start >= 0 && End >= 0; } - } - - public int Index { - get { return Start < End ? Start : End; } - } - - public int Length { - get { return Start < End ? End - Start : Start - End; } - } - } - -} diff --git a/mcs/class/System/System.Text.RegularExpressions/debug.cs b/mcs/class/System/System.Text.RegularExpressions/debug.cs deleted file mode 100644 index 072b41091c1..00000000000 --- a/mcs/class/System/System.Text.RegularExpressions/debug.cs +++ /dev/null @@ -1,231 +0,0 @@ -// -// assembly: System -// namespace: System.Text.RegularExpressions -// file: debug.cs -// -// author: Dan Lewis (dlewis@gmx.co.uk) -// (c) 2002 - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; - -namespace System.Text.RegularExpressions { - - class Disassembler { - public static void DisassemblePattern (ushort[] image) { - DisassembleBlock (image, 0, 0); - } - - public static void DisassembleBlock (ushort[] image, int pc, int depth) { - OpCode op; - OpFlags flags; - - for (;;) { - if (pc >= image.Length) - return; - - PatternCompiler.DecodeOp (image[pc], out op, out flags); - Console.Write (FormatAddress (pc) + ": "); // address - Console.Write (new string (' ', depth * 2)); // indent - Console.Write (DisassembleOp (image, pc)); // instruction - Console.WriteLine (); - - int skip; - switch (op) { - case OpCode.False: case OpCode.True: case OpCode.Until: - skip = 1; - break; - - case OpCode.Character: case OpCode.Category: case OpCode.NotCategory: - case OpCode.Position: - case OpCode.Open: case OpCode.Close: case OpCode.Reference: - case OpCode.Sub: case OpCode.Branch: case OpCode.Jump: case OpCode.In: - skip = 2; - break; - - case OpCode.Balance: case OpCode.IfDefined: case OpCode.Range: - case OpCode.Test: case OpCode.Anchor: - skip = 3; - break; - - case OpCode.Repeat: case OpCode.FastRepeat: case OpCode.Info: - skip = 4; - break; - - case OpCode.String: skip = image[pc + 1] + 2; break; - case OpCode.Set: skip = image[pc + 2] + 3; break; - - default: - skip = 1; - break; - } - - pc += skip; - } - } - - public static string DisassembleOp (ushort[] image, int pc) { - OpCode op; - OpFlags flags; - - PatternCompiler.DecodeOp (image[pc], out op, out flags); - string str = op.ToString (); - if (flags != 0) - str += "[" + flags.ToString ("f") + "]"; - - switch (op) { - case OpCode.False: case OpCode.True: case OpCode.Until: - default: - break; - - case OpCode.Info: - str += " " + image[pc + 1]; - str += " (" + image[pc + 2] + ", " + image[pc + 3] + ")"; - break; - - case OpCode.Character: - str += " '" + FormatChar ((char)image[pc + 1]) + "'"; - break; - - case OpCode.Category: - case OpCode.NotCategory: - str += " /" + (Category)image[pc + 1]; - break; - - case OpCode.Range: - str += " '" + FormatChar ((char)image[pc + 1]) + "', "; - str += " '" + FormatChar ((char)image[pc + 2]) + "'"; - break; - - case OpCode.Set: - str += " " + FormatSet (image, pc + 1); - break; - - case OpCode.String: - str += " '" + ReadString (image, pc + 1) + "'"; - break; - - case OpCode.Position: - str += " /" + (Position)image[pc + 1]; - break; - - case OpCode.Open: case OpCode.Close: case OpCode.Reference: - str += " " + image[pc + 1]; - break; - - case OpCode.Balance: - str += " " + image[pc + 1] + " " + image[pc + 2]; - break; - - case OpCode.IfDefined: case OpCode.Anchor: - str += " :" + FormatAddress (pc + image[pc + 1]); - str += " " + image[pc + 2]; - break; - - case OpCode.Sub: case OpCode.Branch: case OpCode.Jump: - case OpCode.In: - str += " :" + FormatAddress (pc + image[pc + 1]); - break; - - case OpCode.Test: - str += " :" + FormatAddress (pc + image[pc + 1]); - str += ", :" + FormatAddress (pc + image[pc + 2]); - break; - - case OpCode.Repeat: case OpCode.FastRepeat: - str += " :" + FormatAddress (pc + image[pc + 1]); - str += " (" + image[pc + 2] + ", "; - if (image[pc + 3] == 0xffff) - str += "Inf"; - else - str += image[pc + 3]; - str += ")"; - break; - - } - - return str; - } - - // private static members - - private static string ReadString (ushort[] image, int pc) { - int len = image[pc]; - char[] chars = new char[len]; - - for (int i = 0; i < len; ++ i) - chars[i] = (char)image[pc + i + 1]; - - return new string (chars); - } - - private static string FormatAddress (int pc) { - return pc.ToString ("x4"); - } - - private static string FormatSet (ushort[] image, int pc) { - int lo = image[pc ++]; - int hi = (image[pc ++] << 4) - 1; - - string str = "["; - - bool hot = false; - char a = (char)0, b; - for (int i = 0; i <= hi; ++ i) { - bool m = (image[pc + (i >> 4)] & (1 << (i & 0xf))) != 0; - - if (m & !hot) { // start of range - a = (char)(lo + i); - hot = true; - } - else if (hot & (!m || i == hi)) { // end of range - b = (char)(lo + i - 1); - - str += FormatChar (a); - if (b != a) - str += "-" + FormatChar (b); - - hot = false; - } - } - - str += "]"; - return str; - } - - private static string FormatChar (char c) { - if (c == '-' || c == ']') - return "\\" + c; - - if (Char.IsLetterOrDigit (c) || Char.IsSymbol (c)) - return c.ToString (); - - if (Char.IsControl (c)) { - return "^" + (char)('@' + c); - } - - return "\\u" + ((int)c).ToString ("x4"); - } - } -} diff --git a/mcs/class/System/System.Text.RegularExpressions/gen-interp.cs b/mcs/class/System/System.Text.RegularExpressions/gen-interp.cs deleted file mode 100644 index 73247629282..00000000000 --- a/mcs/class/System/System.Text.RegularExpressions/gen-interp.cs +++ /dev/null @@ -1,184 +0,0 @@ -// -// This file is not part of the build. It is used to generate the character related -// opcodes in RxInterpreter.cs. -// - -using System; - -class Op { - public string name, body, cond, len; - - public Op (string name, string body, string cond, string len) { - this.name = name; - this.body = body; - this.cond = cond; - this.len = len; - } -} - -public class GenInterp -{ - public static int base_indent; - - public static void write (int indent, string format, params string[] args) { - for (int i = 0; i < base_indent + indent; ++i) - Console.Write ("\t"); - Console.WriteLine (format, args); - } - - public static void Main () { - base_indent = 4; - - write (0, "// GENERATED BY gen-interp.cs, DO NOT MODIFY"); - - Op[] ops = new Op [] { - - new Op ("Char", "", "(c == program [pc + 1])", "2"), - new Op ("Range", "", "(c >= program [pc + 1] && c <= program [pc + 2])", "3"), - new Op ("UnicodeRange", "", "(c >= (program [pc + 1] | ((int)program [pc + 2] << 8))) && (c <= (program [pc + 3] | ((int)program [pc + 4] << 8)))", "5"), - new Op ("UnicodeChar", "", "(c == (program [pc + 1] | ((int)program [pc + 2] << 8)))", "3"), - new Op ("CategoryAny", "", @"(c != '\n')", "1"), - new Op ("CategoryAnySingleline", "", "true", "1"), - new Op ("CategoryWord", "", "(Char.IsLetterOrDigit (c) || Char.GetUnicodeCategory (c) == UnicodeCategory.ConnectorPunctuation)", "1"), - new Op ("CategoryDigit", "", "(Char.IsDigit (c))", "1"), - new Op ("CategoryWhiteSpace", "", "(Char.IsWhiteSpace (c))", "1"), - new Op ("CategoryEcmaWord", "", "('a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || '0' <= c && c <= '9' || c == '_')", "1"), - new Op ("CategoryEcmaWhiteSpace", "", @"(c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '\f' || c == '\v')", "1"), - new Op ("CategoryUnicodeSpecials", "", @"('\uFEFF' <= c && c <= '\uFEFF' || '\uFFF0' <= c && c <= '\uFFFD')", "1"), - new Op ("CategoryUnicode", "", "(Char.GetUnicodeCategory (c) == (UnicodeCategory)program [pc + 1])", "2"), - new Op ("CategoryGeneral", "", "(CategoryUtils.IsCategory ((Category)program [pc + 1], c))", "2"), - new Op ("Bitmap", "int c2 = (int)c; c2 -= program [pc + 1]; length = program [pc + 2];", "(c2 >= 0 && c2 < (length << 3) && (program [pc + 3 + (c2 >> 3)] & (1 << (c2 & 0x7))) != 0)", "3 + program [pc + 2]"), - new Op ("UnicodeBitmap", "int c2 = (int)c; c2 -= (program [pc + 1] | ((int)program [pc + 2] << 8)); length = (program [pc + 3] | ((int)program [pc + 4] << 8));", "(c2 >= 0 && c2 < (length << 3) && (program [pc + 5 + (c2 >> 3)] & (1 << (c2 & 0x7))) != 0)", "5 + (program [pc + 3] | ((int)program [pc + 4] << 8))") - }; - - for (int i1 = 0; i1 < 2; ++i1) { - for (int i2 = 0; i2 < 2; ++i2) { - for (int i3 = 0; i3 < 2; ++i3) { - bool reverse = (i1 == 1); - bool revert = (i2 == 1); - bool ignore = (i3 == 1); - - foreach (Op op in ops) { - if (op.name.StartsWith ("Category") && ignore) - // These have no IgnoreCase versions - continue; - - if (i1 == 0 && i2 == 0 && i3 == 0) { - write (0, ""); - write (0, "/* {0} */", op.name); - write (0, ""); - } - - write (0, "case RxOp.{0}{1}{2}{3}:", revert ? "No" : "", op.name, ignore ? "IgnoreCase" : "", reverse ? "Reverse" : ""); - if (reverse) - write (1, "if (strpos > 0) {{"); - else - write (1, "if (strpos < string_end) {{"); - if (!ignore) { - if (reverse) - write (2, "char c = str [strpos - 1];"); - else - write (2, "char c = str [strpos];"); - } else { - if (reverse) - write (2, "char c = Char.ToLower (str [strpos - 1]);"); - else - write (2, "char c = Char.ToLower (str [strpos]);"); - } - if (op.body != String.Empty) - write (2, op.body); - write (2, "if ({0}({1})) {{", revert ? "!" : "", op.cond); - // TRUE case - if (!revert) { - if (!reverse) - write (3, "strpos ++;"); - else - write (3, "strpos --;"); - write (3, "if (char_group_end != 0)"); - write (4, "goto test_char_group_passed;"); - write (3, "pc += {0};", "" + op.len); - write (3, "continue;"); - } else { - /* - * If we are inside a char group, the cases are ANDed - * together, so we have to continue checking the - * other cases, and we need to increase strpos after - * the final check. - * The char group is termined by a True, hence the - * + 1 below. - */ - write (3, "pc += {0};", "" + op.len); - write (3, "if (char_group_end == 0 || (pc + 1 == char_group_end)) {{"); - if (!reverse) - write (4, "strpos ++;"); - else - write (4, "strpos --;"); - write (3, "if (pc + 1 == char_group_end)"); - write (4, "goto test_char_group_passed;"); - write (3, "}}"); - write (3, "continue;"); - } - write (2, "}}"); - write (1, "}}"); - - // FALSE case - if (!revert) { - write (1, "if (char_group_end == 0)"); - write (2, "return false;"); - write (1, "pc += {0};", "" + op.len); - write (1, "continue;"); - } else { - /* Fail both inside and outside a char group */ - write (1, "return false;"); - } - -#if FALSE - if (strpos < string_end && (COND (str [strpos]))) { - if (!revert) { - strpos ++; - if (char_group_end != 0) - goto test_char_group_passed; - pc += ins_len; - continue; - } else { - /* - * If we are inside a char group, the cases are ANDed - * together, so we have to continue checking the - * other cases, and we need to increase strpos after - * the final check. - * The char group is termined by a True, hence the - * + 1 below. - * FIXME: Optimize this. - */ - pc += ins_len; - if (char_group_end == 0 || (pc + 1 == char_group_end)) - strpos ++; - continue; - } - } else { - if (!revert) { - if (char_group_end == 0) - return false; - pc += ins_len; - continue; - } else { - /* Fail both inside and outside a char group */ - return false; - } - } - } else { - // Same as above, but use: - // - strpos > 0 instead of strpos < string_len - // - COND (str [strpos - 1]) instead of COND (str [strpos]) - // - strpos -- instead of strpos ++ - } -#endif - } - } - } - } - - write (0, ""); - write (0, "// END OF GENERATED CODE"); - } -} diff --git a/mcs/class/System/System.Text.RegularExpressions/interpreter.cs b/mcs/class/System/System.Text.RegularExpressions/interpreter.cs deleted file mode 100644 index 3c70a3b030c..00000000000 --- a/mcs/class/System/System.Text.RegularExpressions/interpreter.cs +++ /dev/null @@ -1,1182 +0,0 @@ -// -// assembly: System -// namespace: System.Text.RegularExpressions -// file: interpreter.cs -// -// author: Dan Lewis (dlewis@gmx.co.uk) -// (c) 2002 - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.Diagnostics; -using System.Globalization; - -namespace System.Text.RegularExpressions { - - partial class Interpreter : BaseMachine { - private int ReadProgramCount (int ptr) - { - int ret = program [ptr + 1]; - ret <<= 16; - ret += program [ptr]; - return ret; - } - - public Interpreter (ushort[] program) { - this.program = program; - this.qs = null; - - // process info block - Debug.Assert ((OpCode)program[0] == OpCode.Info, "Regex", "Cant' find info block"); - this.group_count = ReadProgramCount (1) + 1; - this.match_min = ReadProgramCount (3); - //this.match_max = ReadProgramCount (5); - - // setup - - this.program_start = 7; - this.groups = new int [group_count]; - } - - // IMachine implementation - - public override Match Scan (Regex regex, string text, int start, int end, bool substring_mode) { - this.regex_rtl = (regex.Options & RegexOptions.RightToLeft) != 0; - - if (!initialized) - { - this.text_start = regex_rtl && substring_mode ? end : start; - this.text_end = regex_rtl ? substring_mode ? start : 0 : end; - this.initialized = true; - } - else - { - this.text_start = start; - this.text_end = end; - } - this.text = text; - this.scan_ptr = text_start; - this.substring_mode = substring_mode; - - if (Eval (Mode.Match, ref scan_ptr, program_start)) - return GenerateMatch (regex); - - return Match.Empty; - } - - // private methods - - private void Reset () { - ResetGroups (); - fast = repeat = null; - } - - private bool Eval (Mode mode, ref int ref_ptr, int pc) { - int ptr = ref_ptr; - Begin: - for (;;) { - ushort word = program[pc]; - OpCode op = (OpCode)(word & 0x00ff); - OpFlags flags = (OpFlags)(word & 0xff00); - - switch (op) { - case OpCode.Anchor: { - int skip = program[pc + 1]; - - int anch_offset = program[pc + 2]; - bool anch_reverse = (flags & OpFlags.RightToLeft) != 0; - int anch_ptr = anch_reverse ? ptr - anch_offset : ptr + anch_offset; - int anch_end = (regex_rtl ? text_start : text_end) - match_min + anch_offset; // maximum anchor position - - - int anch_begin = 0; - - - // the general case for an anchoring expression is at the bottom, however we - // do some checks for the common cases before to save processing time. the current - // optimizer only outputs three types of anchoring expressions: fixed position, - // fixed substring, and no anchor. - - OpCode anch_op = (OpCode)(program[pc + 3] & 0x00ff); - if (anch_op == OpCode.Position && skip == 6) { // position anchor - // Anchor - // Position - // True - - switch ((Position)program[pc + 4]) { - case Position.StartOfString: - if (anch_reverse || anch_offset == 0) { - if (anch_reverse) - ptr = anch_offset; - if (TryMatch (ref ptr, pc + skip)) - goto Pass; - } - break; - - case Position.StartOfLine: - if (anch_ptr == 0) { - ptr = 0; - if (TryMatch (ref ptr, pc + skip)) - goto Pass; - - ++ anch_ptr; - } - - while ((anch_reverse && anch_ptr >= 0) || (!anch_reverse && anch_ptr <= anch_end)) { - if (anch_ptr == 0 || text[anch_ptr - 1] == '\n') { - if (anch_reverse) - ptr = anch_ptr == anch_end ? anch_ptr : anch_ptr + anch_offset; - else - ptr = anch_ptr == 0 ? anch_ptr : anch_ptr - anch_offset; - if (TryMatch (ref ptr, pc + skip)) - goto Pass; - } - - if (anch_reverse) - -- anch_ptr; - else - ++ anch_ptr; - } - break; - - case Position.StartOfScan: - if (anch_ptr == scan_ptr) { - ptr = anch_reverse ? scan_ptr + anch_offset : scan_ptr - anch_offset; - if (TryMatch (ref ptr, pc + skip)) - goto Pass; - } - break; - - default: - // FIXME - break; - } - } - else if (qs != null || - (anch_op == OpCode.String && skip == 6 + program[pc + 4])) { // substring anchor - // Anchor - // String - // True - - bool reverse = ((OpFlags)program[pc + 3] & OpFlags.RightToLeft) != 0; - - if (qs == null) { - bool ignore = ((OpFlags)program[pc + 3] & OpFlags.IgnoreCase) != 0; - string substring = GetString (pc + 3); - qs = new QuickSearch (substring, ignore, reverse); - } - while ((anch_reverse && anch_ptr >= anch_begin) - || (!anch_reverse && anch_ptr <= anch_end)) { - - if (reverse) - { - anch_ptr = qs.Search (text, anch_ptr, anch_begin); - if (anch_ptr != -1) - anch_ptr += qs.Length ; - - } - else - anch_ptr = qs.Search (text, anch_ptr, anch_end); - if (anch_ptr < 0) - break; - - ptr = reverse ? anch_ptr + anch_offset : anch_ptr - anch_offset; - if (TryMatch (ref ptr, pc + skip)) - goto Pass; - - if (reverse) - anch_ptr -= 2; - else - ++ anch_ptr; - } - } - else if (anch_op == OpCode.True) { // no anchor - // Anchor - // True - - - while ((anch_reverse && anch_ptr >= anch_begin) - || (!anch_reverse && anch_ptr <= anch_end)) { - - ptr = anch_ptr; - if (TryMatch (ref ptr, pc + skip)) - goto Pass; - if (anch_reverse) - -- anch_ptr; - else - ++ anch_ptr; - } - } - else { // general case - // Anchor - // - // True - - while ((anch_reverse && anch_ptr >= anch_begin) - || (!anch_reverse && anch_ptr <= anch_end)) { - - ptr = anch_ptr; - if (Eval (Mode.Match, ref ptr, pc + 3)) { - // anchor expression passed: try real expression at the correct offset - - ptr = anch_reverse ? anch_ptr + anch_offset : anch_ptr - anch_offset; - if (TryMatch (ref ptr, pc + skip)) - goto Pass; - } - - if (anch_reverse) - -- anch_ptr; - else - ++ anch_ptr; - } - } - - goto Fail; - } - - case OpCode.False: { - goto Fail; - } - - case OpCode.True: { - goto Pass; - } - - case OpCode.Position: { - if (!IsPosition ((Position)program[pc + 1], ptr)) - goto Fail; - pc += 2; - break; - } - - case OpCode.String: { - bool reverse = (flags & OpFlags.RightToLeft) != 0; - bool ignore = (flags & OpFlags.IgnoreCase) != 0; - int len = program[pc + 1]; - - if (reverse) { - ptr -= len; - if ((!regex_rtl && ptr < 0) || (regex_rtl && ptr < text_end)) - goto Fail; - } - else - if (ptr + len > text_end) - goto Fail; - - pc += 2; - for (int i = 0; i < len; ++ i) { - char c = text[ptr + i]; - if (ignore) - c = Char.ToLower (c); - - if (c != (char)program[pc ++]) - goto Fail; - } - - if (!reverse) - ptr += len; - break; - } - - case OpCode.Reference: { - bool reverse = (flags & OpFlags.RightToLeft) != 0; - bool ignore = (flags & OpFlags.IgnoreCase) != 0; - int m = GetLastDefined (program [pc + 1]); - if (m < 0) - goto Fail; - - int str = marks [m].Index; - int len = marks [m].Length; - - if (reverse) { - ptr -= len; - if ((!regex_rtl && ptr < 0) || (regex_rtl && ptr < text_end)) - goto Fail; - } - else if (ptr + len > text_end) - goto Fail; - - pc += 2; - if (ignore) { - for (int i = 0; i < len; ++ i) { - if (Char.ToLower (text[ptr + i]) != Char.ToLower (text[str + i])) - goto Fail; - } - } else { - for (int i = 0; i < len; ++ i) { - if (text[ptr + i] != text[str + i]) - goto Fail; - } - } - - if (!reverse) - ptr += len; - break; - } - - case OpCode.Character: case OpCode.Category: case OpCode.NotCategory: - case OpCode.Range: case OpCode.Set: { - if (!EvalChar (mode, ref ptr, ref pc, false)) - goto Fail; - break; - } - - case OpCode.In: { - int target = pc + program[pc + 1]; - pc += 2; - if (!EvalChar (mode, ref ptr, ref pc, true)) - goto Fail; - - pc = target; - break; - } - - case OpCode.Open: { - Open (program[pc + 1], ptr); - pc += 2; - break; - } - - case OpCode.Close: { - Close (program[pc + 1], ptr); - pc += 2; - break; - } - - case OpCode.BalanceStart: { - - int start = ptr; //point before the balancing group - - if (!Eval (Mode.Match, ref ptr, pc + 5)) - goto Fail; - - - - if(!Balance (program[pc + 1], program[pc + 2], (program[pc + 3] == 1 ? true : false) , start)) { - goto Fail; - } - - - pc += program[pc + 4]; - break; - } - - case OpCode.Balance: { - goto Pass; - } - - case OpCode.IfDefined: { - int m = GetLastDefined (program [pc + 2]); - if (m < 0) - pc += program[pc + 1]; - else - pc += 3; - break; - } - - case OpCode.Sub: { - if (!Eval (Mode.Match, ref ptr, pc + 2)) - goto Fail; - - pc += program[pc + 1]; - break; - } - - case OpCode.Test: { - int cp = Checkpoint (); - int test_ptr = ptr; - if (Eval (Mode.Match, ref test_ptr, pc + 3)) - pc += program[pc + 1]; - else { - Backtrack (cp); - pc += program[pc + 2]; - } - break; - } - - case OpCode.Branch: { - OpCode branch_op; - do { - int cp = Checkpoint (); - if (Eval (Mode.Match, ref ptr, pc + 2)) - goto Pass; - - Backtrack (cp); - - pc += program[pc + 1]; - branch_op = (OpCode)(program[pc] & 0xff); - } while (branch_op != OpCode.False); - - goto Fail; - } - - case OpCode.Jump: { - pc += program[pc + 1]; - break; - } - - case OpCode.Repeat: { - this.repeat = new RepeatContext ( - this.repeat, // previous context - ReadProgramCount (pc + 2), // minimum - ReadProgramCount (pc + 4), // maximum - (flags & OpFlags.Lazy) != 0, // lazy - pc + 6 // subexpression - ); - - if (Eval (Mode.Match, ref ptr, pc + program[pc + 1])) - goto Pass; - else { - this.repeat = this.repeat.Previous; - goto Fail; - } - } - - case OpCode.Until: { - RepeatContext current = this.repeat; - - // - // Can we avoid recursion? - // - // Backtracking can be forced in nested quantifiers from the tail of this quantifier. - // Thus, we cannot, in general, use a simple loop on repeat.Expression to handle - // quantifiers. - // - // If 'deep' was unmolested, that implies that there was no nested quantifiers. - // Thus, we can safely avoid recursion. - // - if (deep == current) - goto Pass; - - int start = current.Start; - int start_count = current.Count; - - while (!current.IsMinimum) { - ++ current.Count; - current.Start = ptr; - deep = current; - if (!Eval (Mode.Match, ref ptr, current.Expression)) { - current.Start = start; - current.Count = start_count; - goto Fail; - } - if (deep != current) // recursive mode - goto Pass; - } - - if (ptr == current.Start) { - // degenerate match ... match tail or fail - this.repeat = current.Previous; - deep = null; - if (Eval (Mode.Match, ref ptr, pc + 1)) - goto Pass; - - this.repeat = current; - goto Fail; - } - - if (current.IsLazy) { - for (;;) { - // match tail first ... - this.repeat = current.Previous; - deep = null; - int cp = Checkpoint (); - if (Eval (Mode.Match, ref ptr, pc + 1)) - goto Pass; - - Backtrack (cp); - - // ... then match more - this.repeat = current; - if (current.IsMaximum) - goto Fail; - ++ current.Count; - current.Start = ptr; - deep = current; - if (!Eval (Mode.Match, ref ptr, current.Expression)) { - current.Start = start; - current.Count = start_count; - goto Fail; - } - if (deep != current) // recursive mode - goto Pass; - // Degenerate match: ptr has not moved since the last (failed) tail match. - // So, next and subsequent tail matches will fail. - if (ptr == current.Start) - goto Fail; - } - } else { - int stack_size = stack.Count; - - // match greedily as much as possible - while (!current.IsMaximum) { - int cp = Checkpoint (); - int old_ptr = ptr; - int old_start = current.Start; - - ++ current.Count; - current.Start = ptr; - deep = current; - if (!Eval (Mode.Match, ref ptr, current.Expression)) { - -- current.Count; - current.Start = old_start; - Backtrack (cp); - break; - } - if (deep != current) { - // recursive mode: no more backtracking, truncate the stack - stack.Count = stack_size; - goto Pass; - } - stack.Push (cp); - stack.Push (old_ptr); - - // Degenerate match: no point going on - if (ptr == current.Start) - break; - } - - // then, match the tail, backtracking as necessary. - this.repeat = current.Previous; - for (;;) { - deep = null; - if (Eval (Mode.Match, ref ptr, pc + 1)) { - stack.Count = stack_size; - goto Pass; - } - if (stack.Count == stack_size) { - this.repeat = current; - goto Fail; - } - - --current.Count; - ptr = stack.Pop (); - Backtrack (stack.Pop ()); - } - } - } - - case OpCode.FastRepeat: { - this.fast = new RepeatContext ( - fast, - ReadProgramCount (pc + 2), // minimum - ReadProgramCount (pc + 4), // maximum - (flags & OpFlags.Lazy) != 0, // lazy - pc + 6 // subexpression - ); - - fast.Start = ptr; - - int cp = Checkpoint (); - - pc += program[pc + 1]; // tail expression - ushort tail_word = program[pc]; - - int c1 = -1; // first character of tail operator - int c2 = -1; // ... and the same character, in upper case if ignoring case - int coff = 0; // 0 or -1 depending on direction - - OpCode tail_op = (OpCode)(tail_word & 0xff); - if (tail_op == OpCode.Character || tail_op == OpCode.String) { - OpFlags tail_flags = (OpFlags)(tail_word & 0xff00); - - if ((tail_flags & OpFlags.Negate) != 0) - goto skip; - - if (tail_op == OpCode.String) - { - int offset = 0; - - if ((tail_flags & OpFlags.RightToLeft) != 0) - { - offset = program[pc + 1] - 1 ; - } - - c1 = program[pc + 2 + offset]; // first char of string - } - else - c1 = program[pc + 1]; // character - - if ((tail_flags & OpFlags.IgnoreCase) != 0) - c2 = Char.ToUpper ((char)c1); // ignore case - else - c2 = c1; - - if ((tail_flags & OpFlags.RightToLeft) != 0) - coff = -1; // reverse - else - coff = 0; - } - - skip: - if (fast.IsLazy) { - if (!fast.IsMinimum && !Eval (Mode.Count, ref ptr, fast.Expression)) { - //Console.WriteLine ("lazy fast: failed mininum."); - fast = fast.Previous; - goto Fail; - } - - while (true) { - int p = ptr + coff; - if (c1 < 0 || (p >= 0 && ((regex_rtl && p >= text_end) || (!regex_rtl && p < text_end)) && (c1 == text[p] || c2 == text[p]))) { - deep = null; - if (Eval (Mode.Match, ref ptr, pc)) - break; - } - - if (fast.IsMaximum) { - //Console.WriteLine ("lazy fast: failed with maximum."); - fast = fast.Previous; - goto Fail; - } - - Backtrack (cp); - if (!Eval (Mode.Count, ref ptr, fast.Expression)) { - //Console.WriteLine ("lazy fast: no more."); - fast = fast.Previous; - goto Fail; - } - } - fast = fast.Previous; - goto Pass; - } - else { - if (!Eval (Mode.Count, ref ptr, fast.Expression)) { - fast = fast.Previous; - goto Fail; - } - - int width; - if (fast.Count > 0) - width = (ptr - fast.Start) / fast.Count; - else - width = 0; - - while (true) { - int p = ptr + coff; - if (c1 < 0 || (p >= 0 && ((regex_rtl && p >= text_end) || (!regex_rtl && p < text_end)) && (c1 == text[p] || c2 == text[p]))) { - deep = null; - if (Eval (Mode.Match, ref ptr, pc)) - break; - } - - -- fast.Count; - if (!fast.IsMinimum) { - fast = fast.Previous; - goto Fail; - } - - ptr -= width; - Backtrack (cp); - } - fast = fast.Previous; - goto Pass; - } - } - - case OpCode.Info: { - Debug.Assert (false, "Regex", "Info block found in pattern"); - goto Fail; - } - } - } - Pass: - ref_ptr = ptr; - - switch (mode) { - case Mode.Match: - return true; - - case Mode.Count: { - ++ fast.Count; - if (fast.IsMaximum || (fast.IsLazy && fast.IsMinimum)) - return true; - - pc = fast.Expression; - goto Begin; - } - } - - Fail: - switch (mode) { - case Mode.Match: - return false; - - case Mode.Count: { - if (!fast.IsLazy && fast.IsMinimum) - return true; - - ref_ptr = fast.Start; - return false; - } - } - - return false; - } - - private bool EvalChar (Mode mode, ref int ptr, ref int pc, bool multi) { - bool consumed = false; - char c = '\0'; - bool negate; - bool ignore; - - do { - ushort word = program[pc]; - OpCode op = (OpCode)(word & 0x00ff); - OpFlags flags = (OpFlags)(word & 0xff00); - - ++ pc; - - ignore = (flags & OpFlags.IgnoreCase) != 0; - - // consume character: the direction of an In construct is - // determined by the direction of its first op - - if (!consumed) { - if ((flags & OpFlags.RightToLeft) != 0) { - if ((substring_mode && ptr <= (regex_rtl ? text_end : text_start)) || (!substring_mode && ptr <= 0)) - return false; - - c = text[-- ptr]; - } - else { - if ((!regex_rtl && ptr >= text_end) || (regex_rtl && ptr >= text_start)) - return false; - - c = text[ptr ++]; - } - - if (ignore) - c = Char.ToLower (c); - - consumed = true; - } - - // negate flag - - negate = (flags & OpFlags.Negate) != 0; - - // execute op - - switch (op) { - case OpCode.True: - return true; - - case OpCode.False: - return false; - - case OpCode.Character: { - if (c == (char)program[pc ++]) - return !negate; - break; - } - - case OpCode.Category: { - if (CategoryUtils.IsCategory ((Category)program[pc ++], c)) - return !negate; - break; - } - - case OpCode.NotCategory: { - if (!CategoryUtils.IsCategory ((Category)program[pc ++], c)) - return !negate; - break; - } - - case OpCode.Range: { - int lo = (char)program[pc ++]; - int hi = (char)program[pc ++]; - if (lo <= c && c <= hi) - return !negate; - break; - } - - case OpCode.Set: { - int lo = (char)program[pc ++]; - int len = (char)program[pc ++]; - int bits = pc; - pc += len; - - int i = (int)c - lo; - if (i < 0 || i >= len << 4) - break; - - - if ((program[bits + (i >> 4)] & (1 << (i & 0xf))) != 0) - return !negate; - break; - } - } - } while (multi); - - return negate; - } - - private bool TryMatch (ref int ref_ptr, int pc) { - Reset (); - - int ptr = ref_ptr; - marks [groups [0]].Start = ptr; - if (Eval (Mode.Match, ref ptr, pc)) { - marks [groups [0]].End = ptr; - ref_ptr = ptr; - return true; - } - - return false; - } - - private bool IsPosition (Position pos, int ptr) { - switch (pos) { - case Position.Start: case Position.StartOfString: - return ptr == 0 || (substring_mode && ((!regex_rtl && ptr == text_start) || (regex_rtl && ptr == text_end))); - - case Position.StartOfLine: - return ptr == 0 || text[ptr - 1] == '\n' || (substring_mode && ((!regex_rtl && ptr == text_start) || (regex_rtl && ptr == text_end))); - - case Position.StartOfScan: - return ptr == scan_ptr; - - case Position.End: - return (!regex_rtl && ptr == text_end) || (regex_rtl && ptr == text_start) || - (((!regex_rtl && ptr == text_end - 1) || (regex_rtl && ptr == text_start - 1)) && text[ptr] == '\n'); - - case Position.EndOfLine: - return (!regex_rtl && ptr == text_end) || (regex_rtl && ptr == text_start) || text[ptr] == '\n'; - - case Position.EndOfString: - return (!regex_rtl && ptr == text_end) || (regex_rtl && ptr == text_start); - - case Position.Boundary: - if ((!regex_rtl && text_end == 0) || (regex_rtl && text_start == 0)) - return false; - - if (ptr == 0) - return IsWordChar (text[ptr]); - else if ((!regex_rtl && ptr == text_end) || (regex_rtl && ptr == text_start)) - return IsWordChar (text[ptr - 1]); - else - return IsWordChar (text[ptr]) != IsWordChar (text[ptr - 1]); - - case Position.NonBoundary: - if ((!regex_rtl && text_end == 0) || (regex_rtl && text_start == 0)) - return false; - - if (ptr == 0) - return !IsWordChar (text[ptr]); - else if ((!regex_rtl && ptr == text_end) || (regex_rtl && ptr == text_start)) - return !IsWordChar (text[ptr - 1]); - else - return IsWordChar (text[ptr]) == IsWordChar (text[ptr - 1]); - - default: - return false; - } - } - - private bool IsWordChar (char c) { - return CategoryUtils.IsCategory (Category.Word, c); - } - - private string GetString (int pc) { - int len = program[pc + 1]; - int str = pc + 2; - - char[] cs = new char[len]; - for (int i = 0; i < len; ++ i) - cs[i] = (char)program[str ++]; - - return new string (cs); - } - - // capture management - - private void Open (int gid, int ptr) { - int m = groups [gid]; - if (m < mark_start || marks [m].IsDefined) { - m = CreateMark (m); - groups [gid] = m; - } - - marks [m].Start = ptr; - } - - private void Close (int gid, int ptr) { - marks [groups [gid]].End = ptr; - } - - private bool Balance (int gid, int balance_gid, bool capture, int ptr) { - int b = groups [balance_gid]; - - if(b == -1 || marks[b].Index < 0) { - //Group not previously matched - return false; - } - Debug.Assert (marks [b].IsDefined, "Regex", "Balancng group not closed"); - if (gid > 0 && capture){ - Open (gid, marks [b].Index + marks [b].Length); - Close (gid, ptr); - } - - groups [balance_gid] = marks[b].Previous; - - return true; - } - - private int Checkpoint () { - mark_start = mark_end; - return mark_start; - } - - private void Backtrack (int cp) { - Debug.Assert (cp > mark_start, "Regex", "Attempt to backtrack forwards"); - for (int i = 0; i < groups.Length; ++ i) { - int m = groups [i]; - while (cp <= m) { - marks [m].Start = -1; - m = marks [m].Previous; - } - - groups [i] = m; - } - mark_start = cp; - } - - private void ResetGroups () { - int n = groups.Length; - if (marks == null) - marks = new Mark [n * 10]; - - for (int i = 0; i < n; ++ i) { - groups [i] = i; - - marks [i].Start = -1; - marks [i].End = -1; - marks [i].Previous = -1; - } - - mark_start = 0; - mark_end = n; - } - - private int GetLastDefined (int gid) { - int m = groups [gid]; - while (m >= 0 && !marks [m].IsDefined) - m = marks [m].Previous; - - return m; - } - - private int CreateMark (int previous) { - if (mark_end == marks.Length) { - Mark [] dest = new Mark [marks.Length * 2]; - marks.CopyTo (dest, 0); - marks = dest; - } - - int m = mark_end ++; - marks [m].Start = marks [m].End = -1; - marks [m].Previous = previous; - - return m; - } - - private void GetGroupInfo (int gid, out int first_mark_index, out int n_caps) - { - first_mark_index = -1; - n_caps = 0; - for (int m = groups [gid]; m >= 0; m = marks [m].Previous) { - if (!marks [m].IsDefined) - continue; - if (first_mark_index < 0) - first_mark_index = m; - ++n_caps; - } - } - - private void PopulateGroup (Group g, int first_mark_index, int n_caps) - { - int i = 1; - for (int m = marks [first_mark_index].Previous; m >= 0; m = marks [m].Previous) { - if (!marks [m].IsDefined) - continue; - Capture cap = new Capture (text, marks [m].Index, marks [m].Length); - g.Captures.SetValue (cap, n_caps - 1 - i); - ++i; - } - } - - private Match GenerateMatch (Regex regex) - { - int n_caps, first_mark_index; - Group g; - GetGroupInfo (0, out first_mark_index, out n_caps); - - // Avoid fully populating the Match instance if not needed - if (!needs_groups_or_captures) - return new Match (regex, this, text, text_end, 0, marks [first_mark_index].Index, marks [first_mark_index].Length); - - Match retval = new Match (regex, this, text, text_end, groups.Length, - marks [first_mark_index].Index, marks [first_mark_index].Length, n_caps); - PopulateGroup (retval, first_mark_index, n_caps); - - for (int gid = 1; gid < groups.Length; ++ gid) { - GetGroupInfo (gid, out first_mark_index, out n_caps); - if (first_mark_index < 0) { - g = Group.Fail; - } else { - g = new Group (text, marks [first_mark_index].Index, marks [first_mark_index].Length, n_caps); - PopulateGroup (g, first_mark_index, n_caps); - } - retval.Groups.SetValue (g, gid); - } - return retval; - } - - // interpreter attributes - - private ushort[] program; // regex program - private int program_start; // first instruction after info block - private string text; // input text - private int text_end; // end of input text (last character + 1) - private int group_count; // number of capturing groups - private int match_min;//, match_max; // match width information - private QuickSearch qs; // fast substring matcher - - private bool regex_rtl; - private int text_start; - private bool substring_mode; - private bool initialized; - - // match state - - private int scan_ptr; // start of scan - - private RepeatContext repeat; // current repeat context - private RepeatContext fast; // fast repeat context - - // Repeat/Until handling - private IntStack stack = new IntStack (); // utility stack - private RepeatContext deep; // points to the most-nested repeat context - - private Mark[] marks = null; // mark stack - private int mark_start; // start of current checkpoint - private int mark_end; // end of checkpoint/next free mark - - private int[] groups; // current group definitions - - // private classes - - private struct IntStack { - int [] values; - int count; - public int Pop () - { - return values [--count]; - } - public void Push (int value) - { - if (values == null) { - values = new int [8]; - } else if (count == values.Length) { - int new_size = values.Length; - new_size += new_size >> 1; - int [] new_values = new int [new_size]; - for (int i = 0; i < count; ++i) - new_values [i] = values [i]; - values = new_values; - } - values [count++] = value; - } - public int Top { - get { return values [count - 1]; } - } - public int Count { - get { return count; } - set { - if (value > count) - throw new SystemException ("can only truncate the stack"); - count = value; - } - } - } - - private class RepeatContext { - public RepeatContext (RepeatContext previous, int min, int max, bool lazy, int expr_pc) { - this.previous = previous; - this.min = min; - this.max = max; - this.lazy = lazy; - this.expr_pc = expr_pc; - - this.start = -1; - this.count = 0; - } - - public int Count { - get { return count; } - set { count = value; } - } - - public int Start { - get { return start; } - set { start = value; } - } - - public bool IsMinimum { - get { return min <= count; } - } - - public bool IsMaximum { - get { return max <= count; } - } - - public bool IsLazy { - get { return lazy; } - } - - public int Expression { - get { return expr_pc; } - } - - public RepeatContext Previous { - get { return previous; } - } - - private int start; - private int min, max; - private bool lazy; - private int expr_pc; - private RepeatContext previous; - - private int count; - } - - private enum Mode { - Search, - Match, - Count - } - } -} diff --git a/mcs/class/System/System.Text.RegularExpressions/interval.cs b/mcs/class/System/System.Text.RegularExpressions/interval.cs deleted file mode 100644 index 91da127f015..00000000000 --- a/mcs/class/System/System.Text.RegularExpressions/interval.cs +++ /dev/null @@ -1,334 +0,0 @@ -// -// assembly: System -// namespace: System.Text.RegularExpressions -// file: interval.cs -// -// author: Dan Lewis (dlewis@gmx.co.uk) -// (c) 2002 - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; - -namespace System.Text.RegularExpressions { - - struct Interval : IComparable { - public int low; - public int high; - public bool contiguous; - - public static Interval Empty { - get { - Interval i; - i.low = 0; - i.high = i.low - 1; - i.contiguous = true; - - return i; - } - } - - public static Interval Entire { - get { return new Interval (Int32.MinValue, Int32.MaxValue); } - } - - public Interval (int low, int high) { - if (low > high) { - int t = low; - low = high; - high = t; - } - - this.low = low; - this.high = high; - this.contiguous = true; - } - - public bool IsDiscontiguous { - get { return !contiguous; } - } - - public bool IsSingleton { - get { return contiguous && low == high; } - } - - public bool IsRange { - get { return !IsSingleton && !IsEmpty; } - } - - public bool IsEmpty { - get { return low > high; } - } - - public int Size { - get { - if (IsEmpty) - return 0; - - return high - low + 1; - } - } - - public bool IsDisjoint (Interval i) { - if (IsEmpty || i.IsEmpty) - return true; - - return !(low <= i.high && i.low <= high); - } - - public bool IsAdjacent (Interval i) { - if (IsEmpty || i.IsEmpty) - return false; - - return low == i.high + 1 || high == i.low - 1; - } - - public bool Contains (Interval i) { - if (!IsEmpty && i.IsEmpty) - return true; - if (IsEmpty) - return false; - - return low <= i.low && i.high <= high; - } - - public bool Contains (int i) { - return low <= i && i <= high; - } - - public bool Intersects (Interval i) { - if (IsEmpty || i.IsEmpty) - return false; - - return ((Contains (i.low) && !Contains (i.high)) || - (Contains (i.high) && !Contains (i.low))); - } - - public void Merge (Interval i) { - if (i.IsEmpty) - return; - if (IsEmpty) { - this.low = i.low; - this.high = i.high; - } - - if (i.low < low) - low = i.low; - if (i.high > high) - high = i.high; - } - - public void Intersect (Interval i) { - if (IsDisjoint (i)) { - low = 0; - high = low - 1; - return; - } - - if (i.low > low) - low = i.low; - if (i.high > high) - high = i.high; - } - - public int CompareTo (object o) { - return low - ((Interval)o).low; - } - - public new string ToString () { - if (IsEmpty) - return "(EMPTY)"; - else if (!contiguous) - return "{" + low + ", " + high + "}"; - else if (IsSingleton) - return "(" + low + ")"; - else - return "(" + low + ", " + high + ")"; - } - } - - class IntervalCollection : ICollection, IEnumerable { - public IntervalCollection () { - intervals = new ArrayList (); - } - - public Interval this[int i] { - get { return (Interval)intervals[i]; } - set { intervals[i] = value; } - } - - public void Add (Interval i) { - intervals.Add (i); - } - - public void Clear () { - intervals.Clear (); - } - - public void Sort () { - intervals.Sort (); - } - - public void Normalize () { - intervals.Sort (); - - int j = 0; - while (j < intervals.Count - 1) { - Interval a = (Interval)intervals[j]; - Interval b = (Interval)intervals[j + 1]; - - if (!a.IsDisjoint (b) || a.IsAdjacent (b)) { - a.Merge (b); - intervals[j] = a; - intervals.RemoveAt (j + 1); - } - else - ++ j; - } - - } - - public delegate double CostDelegate (Interval i); - - public IntervalCollection GetMetaCollection (CostDelegate cost_del) { - IntervalCollection meta = new IntervalCollection (); - - Normalize (); - Optimize (0, Count - 1, meta, cost_del); - meta.intervals.Sort (); - - return meta; - } - - private void Optimize (int begin, int end, IntervalCollection meta, CostDelegate cost_del) { - Interval set; - set.contiguous = false; - - int best_set_begin = -1; - int best_set_end = -1; - double best_set_cost = 0; - - for (int i = begin; i <= end; ++ i) { - set.low = this[i].low; - - double cost = 0.0; - for (int j = i; j <= end; ++ j) { - set.high = this[j].high; - cost += cost_del (this[j]); - - double set_cost = cost_del (set); - if (set_cost < cost && cost > best_set_cost) { - best_set_begin = i; - best_set_end = j; - best_set_cost = cost; - } - } - } - - if (best_set_begin < 0) { - // didn't find an optimal set: add original members - - for (int i = begin; i <= end; ++ i) - meta.Add (this[i]); - } - else { - // found set: add it ... - - set.low = this[best_set_begin].low; - set.high = this[best_set_end].high; - - meta.Add (set); - - // ... and optimize to the left and right - - if (best_set_begin > begin) - Optimize (begin, best_set_begin - 1, meta, cost_del); - if (best_set_end < end) - Optimize (best_set_end + 1, end, meta, cost_del); - } - } - - // ICollection implementation - - public int Count { - get { return intervals.Count; } - } - - public bool IsSynchronized { - get { return false; } - } - - public object SyncRoot { - get { return intervals; } - } - - public void CopyTo (Array array, int index) { - foreach (Interval i in intervals) { - if (index > array.Length) - break; - - array.SetValue (i, index ++); - } - } - - // IEnumerator implementation - - public IEnumerator GetEnumerator () { - return new Enumerator (intervals); - } - - private class Enumerator : IEnumerator { - public Enumerator (IList list) { - this.list = list; - Reset (); - } - - public object Current { - get { - if (ptr >= list.Count) - throw new InvalidOperationException (); - - return list[ptr]; - } - } - - public bool MoveNext () { - if (ptr > list.Count) - throw new InvalidOperationException (); - - return ++ ptr < list.Count; - } - - public void Reset () { - ptr = -1; - } - - private IList list; - private int ptr; - } - - // private fields - - private ArrayList intervals; - } -} diff --git a/mcs/class/System/System.Text.RegularExpressions/notes.txt b/mcs/class/System/System.Text.RegularExpressions/notes.txt deleted file mode 100644 index e385869d063..00000000000 --- a/mcs/class/System/System.Text.RegularExpressions/notes.txt +++ /dev/null @@ -1,39 +0,0 @@ -TODO: - -* Need to go through everything and square it with RightToLeft matching. - The support for this was built into an early version, and lots of things built - afterwards are not savvy about bi-directional matching. Things that spring to - mind: Regex match methods should start at 0 or text.Length depending on - direction. Do split and replace need changes? Match should be aware of its - direction (already applied some of this to NextMatch logic). The interpreter - needs to check left and right bounds. Anchoring and substring discovery need - to be reworked. RTL matches are going to have anchors on the right - ie $, \Z - and \z. This should be added to the anchor logic. QuickSearch needs to work in - reverse. There may be other stuff.... work through the code. - -* Add ECMAScript support to the parser. For example, [.\w\s\d] map to ECMA - categories instead of canonical ones [DONE]. There's different behaviour on - backreference/octal disambiguation. Find out what the runtime behavioural - difference is for cyclic backreferences eg (?(1)abc\1) - this is only briefly - mentioned in the spec. I couldn't find much on this in the ECMAScript - specification either. - -* Octal/backreference parsing needs a big fix. The rules are ridiculously complex. - -* Improve the perl test suite. Run under MS runtime to generate checksums for - each trial. Checksums should incorporate: all captures (index, length) for all - groups; names of explicit capturing groups, and the numbers they map to. Any - other state? RegexTrial.Execute() will then compare result and checksum. - -* The pattern (?(1?)a|b). It should fail: Perl fails, the MS implementation - fails, but I pass. The documentation says that the construct (?(X)...) can be - processed in two ways. If X is a valid group number, or a valid group name, - then the expression becomes a capture conditional - the (...) part is - executed only if X has been captured. If X is not a group number or name, then - it is treated as a positive lookahead., and (...) is only executed if the - lookahead succeeds. My code does the latter, but on further investigation it - appears that both Perl and MS fail to recognize an expression assertion if the - first character of the assertion is a number - which instead suggests a - capture conditional. The exception raised is something like "invalid group - number". I get the feeling the my behaviour seems more correct, but it's not - consistent with the other implementations, so it should probably be changed. diff --git a/mcs/class/System/System.Text.RegularExpressions/parser.cs b/mcs/class/System/System.Text.RegularExpressions/parser.cs deleted file mode 100644 index ff6a6e5eb75..00000000000 --- a/mcs/class/System/System.Text.RegularExpressions/parser.cs +++ /dev/null @@ -1,1244 +0,0 @@ -// -// assembly: System -// namespace: System.Text.RegularExpressions -// file: parser.cs -// -// author: Dan Lewis (dlewis@gmx.co.uk) -// (c) 2002 - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; -using System.Globalization; - -namespace System.Text.RegularExpressions.Syntax { - - class Parser { - public static int ParseDecimal (string str, ref int ptr) { - return ParseNumber (str, ref ptr, 10, 1, Int32.MaxValue); - } - - public static int ParseOctal (string str, ref int ptr) { - return ParseNumber (str, ref ptr, 8, 1, 3); - } - - public static int ParseHex (string str, ref int ptr, int digits) { - return ParseNumber (str, ref ptr, 16, digits, digits); - } - - public static int ParseNumber (string str, ref int ptr, int b, int min, int max) { - int p = ptr, n = 0, digits = 0, d; - if (max < min) - max = Int32.MaxValue; - - while (digits < max && p < str.Length) { - d = ParseDigit (str[p ++], b, digits); - if (d < 0) { - -- p; - break; - } - - n = n * b + d; - ++ digits; - } - - if (digits < min) - return -1; - - ptr = p; - return n; - } - - public static string ParseName (string str, ref int ptr) { - if (Char.IsDigit (str[ptr])) { - int gid = ParseNumber (str, ref ptr, 10, 1, 0); - if (gid > 0) - return gid.ToString (); - - return null; - } - - int start = ptr; - for (;;) { - if (!IsNameChar (str[ptr])) - break; - ++ ptr; - } - - if (ptr - start > 0) - return str.Substring (start, ptr - start); - - return null; - } - - public static string Escape (string str) { - string result = ""; - for (int i = 0; i < str.Length; ++ i) { - char c = str[i]; - switch (c) { - case '\\': case '*': case '+': case '?': case '|': - case '{': case '[': case '(': case ')': case '^': - case '$': case '.': case '#': case ' ': - result += "\\" + c; - break; - - case '\t': result += "\\t"; break; - case '\n': result += "\\n"; break; - case '\r': result += "\\r"; break; - case '\f': result += "\\f"; break; - - default: result += c; break; - } - } - - return result; - } - - public static string Unescape (string str) { - if (str.IndexOf ('\\') == -1) - return str; - return new Parser ().ParseString (str); - } - - // public instance - - public Parser () { - this.caps = new ArrayList (); - this.refs = new Hashtable (); - } - - public RegularExpression ParseRegularExpression (string pattern, RegexOptions options) { - this.pattern = pattern; - this.ptr = 0; - - caps.Clear (); - refs.Clear (); - this.num_groups = 0; - - try { - RegularExpression re = new RegularExpression (); - ParseGroup (re, options, null); - ResolveReferences (); - - re.GroupCount = num_groups; - - return re; - } - catch (IndexOutOfRangeException) { - throw NewParseException ("Unexpected end of pattern."); - } - } - - public int GetMapping (Hashtable mapping) - { - int end = caps.Count; - mapping.Add ("0", 0); - for (int i = 0; i < end; i++) { - CapturingGroup group = (CapturingGroup) caps [i]; - string name = group.Name != null ? group.Name : group.Index.ToString (); - if (mapping.Contains (name)) { - if ((int) mapping [name] != group.Index) - throw new SystemException ("invalid state"); - continue; - } - mapping.Add (name, group.Index); - } - - return gap; - } - - // private methods - - private void ParseGroup (Group group, RegexOptions options, Assertion assertion) { - bool is_top_level = group is RegularExpression; - - Alternation alternation = null; - string literal = null; - - Group current = new Group (); - Expression expr = null; - bool closed = false; - - while (true) { - ConsumeWhitespace (IsIgnorePatternWhitespace (options)); - if (ptr >= pattern.Length) - break; - - // (1) Parse for Expressions - - char ch = pattern[ptr ++]; - - switch (ch) { - case '^': { - Position pos = - IsMultiline (options) ? Position.StartOfLine : Position.Start; - expr = new PositionAssertion (pos); - break; - } - - case '$': { - Position pos = - IsMultiline (options) ? Position.EndOfLine : Position.End; - expr = new PositionAssertion (pos); - break; - } - - case '.': { - Category cat = - IsSingleline (options) ? Category.AnySingleline : Category.Any; - expr = new CharacterClass (cat, false); - break; - } - - case '\\': { - int c = ParseEscape (false); - if (c >= 0) - ch = (char)c; - else { - expr = ParseSpecial (options); - - if (expr == null) - ch = pattern[ptr ++]; // default escape - } - break; - } - - case '[': { - expr = ParseCharacterClass (options); - break; - } - - case '(': { - bool ignore = IsIgnoreCase (options); - expr = ParseGroupingConstruct (ref options); - if (expr == null) { - if (literal != null && IsIgnoreCase (options) != ignore) { - current.AppendExpression (new Literal (literal, IsIgnoreCase (options))); - literal = null; - } - - continue; - } - break; - } - - case ')': { - closed = true; - goto EndOfGroup; - } - - case '|': { - if (literal != null) { - current.AppendExpression (new Literal (literal, IsIgnoreCase (options))); - literal = null; - } - - if (assertion != null) { - if (assertion.TrueExpression == null) - assertion.TrueExpression = current; - else if (assertion.FalseExpression == null) - assertion.FalseExpression = current; - else - throw NewParseException ("Too many | in (?()|)."); - } - else { - if (alternation == null) - alternation = new Alternation (); - - alternation.AddAlternative (current); - } - - current = new Group (); - continue; - } - - case '*': case '+': case '?': { - throw NewParseException ("Bad quantifier."); - } - - default: - break; // literal character - } - - ConsumeWhitespace (IsIgnorePatternWhitespace (options)); - - // (2) Check for Repetitions - - if (ptr < pattern.Length) { - char k = pattern[ptr]; - int min = 0, max = 0; - bool lazy = false; - bool haveRep = false; - - - if (k == '?' || k == '*' || k == '+') { - ++ ptr; - haveRep = true; - - switch (k) { - case '?': min = 0; max = 1; break; - case '*': min = 0; max = 0x7fffffff; break; - case '+': min = 1; max = 0x7fffffff; break; - } - } else if (k == '{' && ptr + 1 < pattern.Length) { - int saved_ptr = ptr; - ++ptr; - haveRep = ParseRepetitionBounds (out min, out max, options); - if (!haveRep) - ptr = saved_ptr; - } - - if (haveRep) { - ConsumeWhitespace (IsIgnorePatternWhitespace (options)); - if (ptr < pattern.Length && pattern[ptr] == '?') { - ++ ptr; - lazy = true; - } - - //It doesn't make sense to assert a given position more than once. - bool ignore_repetition = false; - if (expr is PositionAssertion) { - ignore_repetition = min > 0 && !lazy; - max = 1; - } - - if (!ignore_repetition) { - Repetition repetition = new Repetition (min, max, lazy); - - if (expr == null) - repetition.Expression = new Literal (ch.ToString (), IsIgnoreCase (options)); - else - repetition.Expression = expr; - - expr = repetition; - } - } - } - - // (3) Append Expression and/or Literal - - if (expr == null) { - if (literal == null) - literal = ""; - literal += ch; - } - else { - if (literal != null) { - current.AppendExpression (new Literal (literal, IsIgnoreCase (options))); - literal = null; - } - - current.AppendExpression (expr); - expr = null; - } - - if (is_top_level && ptr >= pattern.Length) - goto EndOfGroup; - } - - EndOfGroup: - if (is_top_level && closed) - throw NewParseException ("Too many )'s."); - if (!is_top_level && !closed) - throw NewParseException ("Not enough )'s."); - - - // clean up literals and alternations - - if (literal != null) - current.AppendExpression (new Literal (literal, IsIgnoreCase (options))); - - if (assertion != null) { - if (assertion.TrueExpression == null) - assertion.TrueExpression = current; - else - assertion.FalseExpression = current; - - group.AppendExpression (assertion); - } - else if (alternation != null) { - alternation.AddAlternative (current); - group.AppendExpression (alternation); - } - else - group.AppendExpression (current); - } - - private Expression ParseGroupingConstruct (ref RegexOptions options) { - if (pattern[ptr] != '?') { - Group group; - - if (IsExplicitCapture (options)) - group = new Group (); - else { - group = new CapturingGroup (); - caps.Add (group); - } - - ParseGroup (group, options, null); - return group; - } - else - ++ ptr; - - switch (pattern[ptr]) { - case ':': { // non-capturing group - ++ ptr; - Group group = new Group (); - ParseGroup (group, options, null); - - return group; - } - - case '>': { // non-backtracking group - ++ ptr; - Group group = new NonBacktrackingGroup (); - ParseGroup (group, options, null); - - return group; - } - - case 'i': case 'm': case 'n': - case 's': case 'x': case '-': { // options - RegexOptions o = options; - ParseOptions (ref o, false); - if (pattern[ptr] == '-') { - ++ ptr; - ParseOptions (ref o, true); - } - - if (pattern[ptr] == ':') { // pass options to child group - ++ ptr; - Group group = new Group (); - ParseGroup (group, o, null); - return group; - } - else if (pattern[ptr] == ')') { // change options of enclosing group - ++ ptr; - options = o; - return null; - } - else - throw NewParseException ("Bad options"); - } - - case '<': case '=': case '!': { // lookahead/lookbehind - ExpressionAssertion asn = new ExpressionAssertion (); - if (!ParseAssertionType (asn)) - goto case '\''; // it's a (? ) construct - - Group test = new Group (); - ParseGroup (test, options, null); - - asn.TestExpression = test; - return asn; - } - - case '\'': { // named/balancing group - char delim; - if (pattern[ptr] == '<') - delim = '>'; - else - delim = '\''; - - ++ ptr; - string name = ParseName (); - - if (pattern[ptr] == delim) { - // capturing group - - if (name == null) - throw NewParseException ("Bad group name."); - - ++ ptr; - CapturingGroup cap = new CapturingGroup (); - cap.Name = name; - caps.Add (cap); - ParseGroup (cap, options, null); - - return cap; - } - else if (pattern[ptr] == '-') { - // balancing group - - ++ ptr; - string balance_name = ParseName (); - if (balance_name == null || pattern[ptr] != delim) - throw NewParseException ("Bad balancing group name."); - - ++ ptr; - BalancingGroup bal = new BalancingGroup (); - bal.Name = name; - - if(bal.IsNamed) { - caps.Add (bal); - } - - refs.Add (bal, balance_name); - - ParseGroup (bal, options, null); - - return bal; - } - else - throw NewParseException ("Bad group name."); - } - - case '(': { // expression/capture test - Assertion asn; - - ++ ptr; - int p = ptr; - string name = ParseName (); - if (name == null || pattern[ptr] != ')') { // expression test - // FIXME MS implementation doesn't seem to - // implement this version of (?(x) ...) - - ptr = p; - ExpressionAssertion expr_asn = new ExpressionAssertion (); - - if (pattern[ptr] == '?') { - ++ ptr; - if (!ParseAssertionType (expr_asn)) - throw NewParseException ("Bad conditional."); - } - else { - expr_asn.Negate = false; - expr_asn.Reverse = false; - } - - Group test = new Group (); - ParseGroup (test, options, null); - expr_asn.TestExpression = test; - asn = expr_asn; - } - else { // capture test - ++ ptr; - asn = new CaptureAssertion (new Literal (name, IsIgnoreCase (options))); - refs.Add (asn, name); - } - - Group group = new Group (); - ParseGroup (group, options, asn); - return group; - } - - case '#': { // comment - ++ ptr; - while (pattern[ptr ++] != ')') { - if (ptr >= pattern.Length) - throw NewParseException ("Unterminated (?#...) comment."); - } - return null; - } - - default: // error - throw NewParseException ("Bad grouping construct."); - } - } - - private bool ParseAssertionType (ExpressionAssertion assertion) { - if (pattern[ptr] == '<') { - switch (pattern[ptr + 1]) { - case '=': - assertion.Negate = false; - break; - case '!': - assertion.Negate = true; - break; - default: - return false; - } - - assertion.Reverse = true; - ptr += 2; - } - else { - switch (pattern[ptr]) { - case '=': - assertion.Negate = false; - break; - case '!': - assertion.Negate = true; - break; - default: - return false; - } - - assertion.Reverse = false; - ptr += 1; - } - - return true; - } - - private void ParseOptions (ref RegexOptions options, bool negate) { - for (;;) { - switch (pattern[ptr]) { - case 'i': - if (negate) - options &= ~RegexOptions.IgnoreCase; - else - options |= RegexOptions.IgnoreCase; - break; - - case 'm': - if (negate) - options &= ~RegexOptions.Multiline; - else - options |= RegexOptions.Multiline; - break; - - case 'n': - if (negate) - options &= ~RegexOptions.ExplicitCapture; - else - options |= RegexOptions.ExplicitCapture; - break; - - case 's': - if (negate) - options &= ~RegexOptions.Singleline; - else - options |= RegexOptions.Singleline; - break; - - case 'x': - if (negate) - options &= ~RegexOptions.IgnorePatternWhitespace; - else - options |= RegexOptions.IgnorePatternWhitespace; - break; - - default: - return; - } - - ++ ptr; - } - } - - private Expression ParseCharacterClass (RegexOptions options) { - bool negate = false; - if (pattern[ptr] == '^') { - negate = true; - ++ ptr; - } - - bool ecma = IsECMAScript (options); - CharacterClass cls = new CharacterClass (negate, IsIgnoreCase (options)); - - if (pattern[ptr] == ']') { - cls.AddCharacter (']'); - ++ ptr; - } - - int c = -1; - int last = -1; - bool range = false; - bool closed = false; - while (ptr < pattern.Length) { - c = pattern[ptr ++]; - - if (c == ']') { - closed = true; - break; - } - - if (c == '-' && last >= 0 && !range) { - range = true; - continue; - } - - if (c == '\\') { - c = ParseEscape (true); - if (c >= 0) - goto char_recognized; - - // didn't recognize escape - c = pattern [ptr ++]; - switch (c) { - case 'b': - c = '\b'; - goto char_recognized; - - case 'd': case 'D': - cls.AddCategory (ecma ? Category.EcmaDigit : Category.Digit, c == 'D'); - break; - - case 'w': case 'W': - cls.AddCategory (ecma ? Category.EcmaWord : Category.Word, c == 'W'); - break; - - case 's': case 'S': - cls.AddCategory (ecma ? Category.EcmaWhiteSpace : Category.WhiteSpace, c == 'S'); - break; - - case 'p': case 'P': - cls.AddCategory (ParseUnicodeCategory (), c == 'P'); // ignore ecma - break; - - default: // add escaped character - goto char_recognized; - } - - // if the pattern looks like [a-\s] ... - if (range) - throw NewParseException ("character range cannot have category \\" + c); - - last = -1; - continue; - } - - char_recognized: - if (range) { - // if 'range' is true, we know that 'last >= 0' - if (c < last) - throw NewParseException ("[" + last + "-" + c + "] range in reverse order."); - cls.AddRange ((char)last, (char)c); - last = -1; - range = false; - continue; - } - - cls.AddCharacter ((char)c); - last = c; - } - - if (!closed) - throw NewParseException ("Unterminated [] set."); - - if (range) - cls.AddCharacter ('-'); - - return cls; - } - - private bool ParseRepetitionBounds (out int min, out int max, RegexOptions options) { - int n, m; - min = max = 0; - - /* check syntax */ - - ConsumeWhitespace (IsIgnorePatternWhitespace (options)); - - if (pattern[ptr] == ',') { - n = -1; - } else { - n = ParseNumber (10, 1, 0); - ConsumeWhitespace (IsIgnorePatternWhitespace (options)); - } - - switch (pattern[ptr ++]) { - case '}': - m = n; - break; - case ',': - ConsumeWhitespace (IsIgnorePatternWhitespace (options)); - m = ParseNumber (10, 1, 0); - ConsumeWhitespace (IsIgnorePatternWhitespace (options)); - if (pattern[ptr ++] != '}') - return false; - break; - default: - return false; - } - - /* check bounds and ordering */ - - if (n > 0x7fffffff || m > 0x7fffffff) - throw NewParseException ("Illegal {x, y} - maximum of 2147483647."); - if (m >= 0 && m < n) - throw NewParseException ("Illegal {x, y} with x > y."); - - /* assign min and max */ - - min = n; - if (m > 0) - max = m; - else - max = 0x7fffffff; - - return true; - } - - private Category ParseUnicodeCategory () { - if (pattern[ptr ++] != '{') - throw NewParseException ("Incomplete \\p{X} character escape."); - - string name = ParseName (pattern, ref ptr); - if (name == null) - throw NewParseException ("Incomplete \\p{X} character escape."); - - Category cat = CategoryUtils.CategoryFromName (name); - if (cat == Category.None) - throw NewParseException ("Unknown property '" + name + "'."); - - if (pattern[ptr ++] != '}') - throw NewParseException ("Incomplete \\p{X} character escape."); - - return cat; - } - - private Expression ParseSpecial (RegexOptions options) { - int p = ptr; - bool ecma = IsECMAScript (options); - Expression expr = null; - - switch (pattern[ptr ++]) { - - // categories - - case 'd': - expr = new CharacterClass (ecma ? Category.EcmaDigit : Category.Digit, false); - break; - - case 'w': - expr = new CharacterClass (ecma ? Category.EcmaWord : Category.Word, false); - break; - - case 's': - expr = new CharacterClass (ecma ? Category.EcmaWhiteSpace : Category.WhiteSpace, false); - break; - - case 'p': - // this is odd - ECMAScript isn't supposed to support Unicode, - // yet \p{..} compiles and runs under the MS implementation - // identically to canonical mode. That's why I'm ignoring the - // value of ecma here. - - expr = new CharacterClass (ParseUnicodeCategory (), false); - break; - - case 'D': - expr = new CharacterClass (ecma ? Category.EcmaDigit : Category.Digit, true); - break; - - case 'W': - expr = new CharacterClass (ecma ? Category.EcmaWord : Category.Word, true); - break; - - case 'S': - expr = new CharacterClass (ecma ? Category.EcmaWhiteSpace : Category.WhiteSpace, true); - break; - - case 'P': - expr = new CharacterClass (ParseUnicodeCategory (), true); - break; - - // positions - - case 'A': expr = new PositionAssertion (Position.StartOfString); break; - case 'Z': expr = new PositionAssertion (Position.End); break; - case 'z': expr = new PositionAssertion (Position.EndOfString); break; - case 'G': expr = new PositionAssertion (Position.StartOfScan); break; - case 'b': expr = new PositionAssertion (Position.Boundary); break; - case 'B': expr = new PositionAssertion (Position.NonBoundary); break; - - // references - - case '1': case '2': case '3': case '4': case '5': - case '6': case '7': case '8': case '9': { - ptr --; - int n = ParseNumber (10, 1, 0); - if (n < 0) { - ptr = p; - return null; - } - - // FIXME test if number is within number of assigned groups - // this may present a problem for right-to-left matching - - Reference reference = new BackslashNumber (IsIgnoreCase (options), ecma); - refs.Add (reference, n.ToString ()); - expr = reference; - break; - } - - case 'k': { - char delim = pattern[ptr ++]; - if (delim == '<') - delim = '>'; - else if (delim != '\'') - throw NewParseException ("Malformed \\k<...> named backreference."); - - string name = ParseName (); - if (name == null || pattern[ptr] != delim) - throw NewParseException ("Malformed \\k<...> named backreference."); - - ++ ptr; - Reference reference = new Reference (IsIgnoreCase (options)); - refs.Add (reference, name); - expr = reference; - break; - } - - default: - expr = null; - break; - } - - if (expr == null) - ptr = p; - - return expr; - } - - private int ParseEscape (bool inCharacterClass) { - int p = ptr; - int c; - - if (p >= pattern.Length) - throw new ArgumentException ( - String.Format ("Parsing \"{0}\" - Illegal \\ at end of " + - "pattern.", pattern), pattern); - - switch (pattern[ptr ++]) { - - // standard escapes (except \b) - - case 'a': return '\u0007'; - case 't': return '\u0009'; - case 'r': return '\u000d'; - case 'v': return '\u000b'; - case 'f': return '\u000c'; - case 'n': return '\u000a'; - case 'e': return '\u001b'; - case '\\': return '\\'; - - // character codes - - case '0': - - // - // Turns out that octal values can be specified - // without a leading zero. But also the limit - // of three character should include this first - // one. - // - ptr--; - int prevptr = ptr; - int result = ParseOctal (pattern, ref ptr); - if (result == -1 && prevptr == ptr) - return 0; - - return result; - - case '1': case '2': case '3': case '4': case '5': - case '6': case '7': - if (inCharacterClass){ - ptr--; - return ParseOctal (pattern, ref ptr); - } - break; - - case 'x': - c = ParseHex (pattern, ref ptr, 2); - if (c < 0) - throw NewParseException ("Insufficient hex digits"); - - return c; - - case 'u': - c = ParseHex (pattern, ref ptr, 4); - if (c < 0) - throw NewParseException ("Insufficient hex digits"); - - return c; - - // control characters - - case 'c': - c = pattern[ptr ++]; - if (c >= '@' && c <= '_') - return c - '@'; - else - throw NewParseException ("Unrecognized control character."); - } - - // unknown escape - ptr = p; - return -1; - } - - private string ParseName () { - return Parser.ParseName (pattern, ref ptr); - } - - private static bool IsNameChar (char c) { - UnicodeCategory cat = Char.GetUnicodeCategory (c); - if (cat == UnicodeCategory.ModifierLetter) - return false; - if (cat == UnicodeCategory.ConnectorPunctuation) - return true; - return Char.IsLetterOrDigit (c); - } - - private int ParseNumber (int b, int min, int max) { - return Parser.ParseNumber (pattern, ref ptr, b, min, max); - } - - private static int ParseDigit (char c, int b, int n) { - switch (b) { - case 8: - if (c >= '0' && c <= '7') - return c - '0'; - else - return -1; - case 10: - if (c >= '0' && c <= '9') - return c - '0'; - else - return -1; - case 16: - if (c >= '0' && c <= '9') - return c - '0'; - else if (c >= 'a' && c <= 'f') - return 10 + c - 'a'; - else if (c >= 'A' && c <= 'F') - return 10 + c - 'A'; - else - return -1; - default: - return -1; - } - } - - private void ConsumeWhitespace (bool ignore) { - while (ptr < pattern.Length) { - if (pattern[ptr] == '(') { - if (ptr + 3 >= pattern.Length) - return; - - if (pattern[ptr + 1] != '?' || pattern[ptr + 2] != '#') - return; - - ptr += 3; - while (ptr < pattern.Length && pattern[ptr ++] != ')') - /* ignore */ ; - } - else if (ignore && pattern[ptr] == '#') { - while (ptr < pattern.Length && pattern[ptr ++] != '\n') - /* ignore */ ; - } - else if (ignore && Char.IsWhiteSpace (pattern[ptr])) { - while (ptr < pattern.Length && Char.IsWhiteSpace (pattern[ptr])) - ++ ptr; - } - else - return; - } - } - - private string ParseString (string pattern) { - this.pattern = pattern; - this.ptr = 0; - - StringBuilder result = new StringBuilder (pattern.Length); - while (ptr < pattern.Length) { - int c = pattern[ptr ++]; - if (c == '\\') { - c = ParseEscape (false); - - if(c < 0) { - c = pattern[ptr ++]; - if(c == 'b') - c = '\b'; - } - } - result.Append ((char) c); - } - - return result.ToString (); - } - - private void ResolveReferences () - { - int gid = 1; - Hashtable dict = new Hashtable (); - ArrayList explicit_numeric_groups = null; - - // number unnamed groups - - foreach (CapturingGroup group in caps) { - if (group.Name != null) - continue; - - dict.Add (gid.ToString (), group); - group.Index = gid ++; - ++ num_groups; - } - - // number named groups - - foreach (CapturingGroup group in caps) { - if (group.Name == null) - continue; - - if (dict.Contains (group.Name)) { - CapturingGroup prev = (CapturingGroup) dict [group.Name]; - group.Index = prev.Index; - - if (group.Index == gid) - gid ++; - else if (group.Index > gid) - explicit_numeric_groups.Add (group); - continue; - } - - if (Char.IsDigit (group.Name [0])) { - int ptr = 0; - int group_gid = ParseDecimal (group.Name, ref ptr); - if (ptr == group.Name.Length) { - group.Index = group_gid; - dict.Add (group.Name, group); - ++ num_groups; - - if (group_gid == gid) { - gid ++; - } else { - // all numbers before 'gid' are already in the dictionary. So, we know group_gid > gid - if (explicit_numeric_groups == null) - explicit_numeric_groups = new ArrayList (4); - explicit_numeric_groups.Add (group); - } - - continue; - } - } - - string gid_s = gid.ToString (); - while (dict.Contains (gid_s)) - gid_s = (++gid).ToString (); - - dict.Add (gid_s, group); - dict.Add (group.Name, group); - group.Index = gid ++; - ++ num_groups; - } - - gap = gid; // == 1 + num_groups, if explicit_numeric_groups == null - - if (explicit_numeric_groups != null) - HandleExplicitNumericGroups (explicit_numeric_groups); - - // resolve references - - foreach (Expression expr in refs.Keys) { - string name = (string) refs [expr]; - if (!dict.Contains (name)) { - if (expr is CaptureAssertion && !Char.IsDigit (name [0])) - continue; - BackslashNumber bn = expr as BackslashNumber; - if (bn != null && bn.ResolveReference (name, dict)) - continue; - throw NewParseException ("Reference to undefined group " + - (Char.IsDigit (name[0]) ? "number " : "name ") + - name); - } - - CapturingGroup group = (CapturingGroup)dict[name]; - if (expr is Reference) - ((Reference)expr).CapturingGroup = group; - else if (expr is CaptureAssertion) - ((CaptureAssertion)expr).CapturingGroup = group; - else if (expr is BalancingGroup) - ((BalancingGroup)expr).Balance = group; - } - } - - private void HandleExplicitNumericGroups (ArrayList explicit_numeric_groups) - { - int gid = gap; - int i = 0; - int n_explicit = explicit_numeric_groups.Count; - - explicit_numeric_groups.Sort (); - - // move 'gap' forward to skip over all explicit groups that - // turn out to match their index - for (; i < n_explicit; ++i) { - CapturingGroup g = (CapturingGroup) explicit_numeric_groups [i]; - if (g.Index > gid) - break; - if (g.Index == gid) - gid ++; - } - - gap = gid; - - // re-index all further groups so that the indexes are contiguous - int prev = gid; - for (; i < n_explicit; ++i) { - CapturingGroup g = (CapturingGroup) explicit_numeric_groups [i]; - if (g.Index == prev) { - g.Index = gid - 1; - } else { - prev = g.Index; - g.Index = gid ++; - } - } - } - - // flag helper functions - - private static bool IsIgnoreCase (RegexOptions options) { - return (options & RegexOptions.IgnoreCase) != 0; - } - - private static bool IsMultiline (RegexOptions options) { - return (options & RegexOptions.Multiline) != 0; - } - - private static bool IsExplicitCapture (RegexOptions options) { - return (options & RegexOptions.ExplicitCapture) != 0; - } - - private static bool IsSingleline (RegexOptions options) { - return (options & RegexOptions.Singleline) != 0; - } - - private static bool IsIgnorePatternWhitespace (RegexOptions options) { - return (options & RegexOptions.IgnorePatternWhitespace) != 0; - } - - private static bool IsECMAScript (RegexOptions options) { - return (options & RegexOptions.ECMAScript) != 0; - } - - // exception creation - - private ArgumentException NewParseException (string msg) { - msg = "parsing \"" + pattern + "\" - " + msg; - return new ArgumentException (msg, pattern); - } - - private string pattern; - private int ptr; - - private ArrayList caps; - private Hashtable refs; - private int num_groups; - private int gap; - } -} diff --git a/mcs/class/System/System.Text.RegularExpressions/quicksearch.cs b/mcs/class/System/System.Text.RegularExpressions/quicksearch.cs deleted file mode 100644 index 165290741da..00000000000 --- a/mcs/class/System/System.Text.RegularExpressions/quicksearch.cs +++ /dev/null @@ -1,236 +0,0 @@ -// -// assembly: System -// namespace: System.Text.RegularExpressions -// file: quicksearch.cs -// -// Authors: Dan Lewis (dlewis@gmx.co.uk) -// Juraj Skripsky (juraj@hotfeet.ch) -// -// (c) 2002 Dan Lewis -// (c) 2007 Juraj Skripsky -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; - -namespace System.Text.RegularExpressions { - internal class QuickSearch { - // simplified boyer-moore for fast substring matching - // (for short strings, we use simple scans) - public QuickSearch (string str, bool ignore) - : this(str, ignore, false) - { - } - - public QuickSearch (string str, bool ignore, bool reverse) { - this.str = str; - this.len = str.Length; - this.ignore = ignore; - this.reverse = reverse; - - if (ignore) - str = str.ToLower (); - - // create the shift table only for "long" search strings - if(len > THRESHOLD) - SetupShiftTable (); - } - - public string String { - get { return str; } - } - - public int Length { - get { return len; } - } - - public bool IgnoreCase { - get { return ignore; } - } - - public int Search (string text, int start, int end) { - int ptr = start; - - - if ( reverse ) - { - if (start < end) - return -1; - - if ( ptr > text.Length) - { - ptr = text.Length; - } - - // use simple scan for a single-character search string - if (len == 1) - { - while (--ptr >= end) - { - if(str[0] == GetChar(text[ptr])) - return ptr ; - - } - return -1; - } - - - if ( end < len) - end = len - 1 ; - - ptr--; - while (ptr >= end) - { - int i = len -1 ; - while (str[i] == GetChar(text[ptr - len +1 + i])) - { - if (-- i < 0) - return ptr - len + 1; - } - - if (ptr > end) - { - ptr -= GetShiftDistance (text[ptr - len ]); - - } - else - break; - } - - } - else - { - // use simple scan for a single-character search string - if (len == 1) - { - while (ptr <= end) - { - if(str[0] == GetChar(text[ptr])) - return ptr; - else - ptr++; - } - return -1; - } - - if (end > text.Length - len) - end = text.Length - len; - - while (ptr <= end) - { - int i = len - 1; - while (str[i] == GetChar(text[ptr + i])) - { - if (-- i < 0) - return ptr; - } - - if (ptr < end) - ptr += GetShiftDistance (text[ptr + len]); - else - break; - } - } - - return -1; - - } - - // private - - private void SetupShiftTable () { - bool needsExtendedTable = len > (byte.MaxValue - 1); - - byte maxLowChar = 0; - for (int i = 0; i < len; i++) { - char cur = str [i]; - if (cur <= (char)byte.MaxValue) { - if ((byte)cur > maxLowChar) - maxLowChar = (byte)cur; - } else - needsExtendedTable = true; - } - - shift = new byte [maxLowChar + 1]; - if (needsExtendedTable) - shiftExtended = new Hashtable (); - - for (int i = 0, j = len; i < len; i++, j--) { - char c = str [(!reverse ? i : j - 1)]; - if (c < shift.Length) { - if (j < byte.MaxValue) { - shift [c] = (byte)j; - continue; - } else { - shift [c] = byte.MaxValue; - } - } - shiftExtended [c] = j; - } - } - - private int GetShiftDistance (char c) { - if (shift == null) - return 1; - - c = GetChar (c); - if (c < shift.Length) { - int dist = shift [c]; - if (dist == 0) { - return len + 1; - } else { - if (dist != byte.MaxValue) - return dist; - } - } else { - if (c < (char)byte.MaxValue) - return len + 1; - } - - if (shiftExtended == null) - return len + 1; - - object s = shiftExtended [c]; - return (s != null ? (int)s : len + 1); - } - - private char GetChar(char c) { - return (!ignore ? c : Char.ToLower(c)); - } - - private string str; - private int len; - private bool ignore; - private bool reverse; - - // shift[idx] contains value x means - // x == 0 => shift dist. == len + 1 - // x == byte.Maxvalue => shift dist. >= 255, look it up in shiftExtended - // otherwise => shift dist. == x - private byte[] shift; - private Hashtable shiftExtended; - private readonly static int THRESHOLD = 5; - } - -} diff --git a/mcs/class/System/System.Text.RegularExpressions/replace.cs b/mcs/class/System/System.Text.RegularExpressions/replace.cs deleted file mode 100644 index 835ea7ce0aa..00000000000 --- a/mcs/class/System/System.Text.RegularExpressions/replace.cs +++ /dev/null @@ -1,248 +0,0 @@ -// -// assembly: System -// namespace: System.Text.RegularExpressions -// file: replace.cs -// -// author: Dan Lewis (dlewis@gmx.co.uk) -// (c) 2002 - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Text; -using System.Collections; - -using Parser = System.Text.RegularExpressions.Syntax.Parser; - -namespace System.Text.RegularExpressions { - - class ReplacementEvaluator { - public static string Evaluate (string replacement, Match match) - { - ReplacementEvaluator ev = new ReplacementEvaluator (match.Regex, replacement); - return ev.Evaluate (match); - } - - public ReplacementEvaluator (Regex regex, string replacement) - { - this.regex = regex; - this.replacement = replacement; - this.pieces = null; - this.n_pieces = 0; - Compile (); - } - - public string Evaluate (Match match) - { - if (n_pieces == 0) - return replacement; - StringBuilder sb = new StringBuilder (); - EvaluateAppend (match, sb); - return sb.ToString (); - } - - public void EvaluateAppend (Match match, StringBuilder sb) - { - if (n_pieces == 0) { - sb.Append (replacement); - return; - } - - int i = 0; - while (i < n_pieces) { - int k = pieces [i++]; - if (k >= 0) { - int count = pieces [i++]; - sb.Append (replacement, k, count); - } else if (k < -3) { - Group group = match.Groups [-(k + 4)]; - sb.Append (group.Text, group.Index, group.Length); - } else if (k == -1) { - sb.Append (match.Text); - } else if (k == -2) { - sb.Append (match.Text, 0, match.Index); - } else { // k == -3 - int matchend = match.Index + match.Length; - sb.Append (match.Text, matchend, match.Text.Length - matchend); - } - } - } - - public bool NeedsGroupsOrCaptures { - get { - if (n_pieces == 0) - return false; - else - return true; - } - } - - void Ensure (int size) - { - int new_size; - if (pieces == null) { - new_size = 4; - if (new_size < size) - new_size = size; - pieces = new int [new_size]; - } else if (size >= pieces.Length) { - new_size = pieces.Length + (pieces.Length >> 1); - if (new_size < size) - new_size = size; - int [] new_pieces = new int [new_size]; - Array.Copy (pieces, new_pieces, n_pieces); - pieces = new_pieces; - } - } - - void AddFromReplacement (int start, int end) - { - if (start == end) - return; - Ensure (n_pieces + 2); - pieces [n_pieces++] = start; - pieces [n_pieces++] = end - start; - } - - void AddInt (int i) - { - Ensure (n_pieces + 1); - pieces [n_pieces++] = i; - } - - // private - private void Compile () - { - int anchor = 0, ptr = 0, saveptr; - char c; - while (ptr < replacement.Length) { - c = replacement [ptr++]; - - if (c != '$') - continue; - - // If the '$' was the last character, just emit it as is - if (ptr == replacement.Length) - break; - - // If we saw a '$$' - if (replacement [ptr] == '$') { - // Everthing from 'anchor' upto and including the first '$' is copied from the replacement string - AddFromReplacement (anchor, ptr); - // skip over the second '$'. - anchor = ++ptr; - continue; - } - - saveptr = ptr - 1; - - int from_match = CompileTerm (ref ptr); - - // We couldn't recognize the term following the '$'. Just treat it as a literal. - // 'ptr' has already been advanced, no need to rewind it back - if (from_match >= 0) - continue; - - AddFromReplacement (anchor, saveptr); - AddInt (from_match); - anchor = ptr; - } - - // If we never needed to advance anchor, it means the result is the whole replacement string. - // We optimize that case by never allocating the pieces array. - if (anchor != 0) - AddFromReplacement (anchor, ptr); - } - - private int CompileTerm (ref int ptr) - { - char c = replacement [ptr]; - - if (Char.IsDigit (c)) { // numbered group - int n = Parser.ParseDecimal (replacement, ref ptr); - if (n < 0 || n > regex.GroupCount) - return 0; - - return -n - 4; - } - - ++ ptr; - - switch (c) { - case '{': { // named group - string name; - int n = -1; - - try { - // The parser is written such that there are few explicit range checks - // and depends on 'IndexOutOfRangeException' being thrown. - - if (Char.IsDigit (replacement [ptr])) { - n = Parser.ParseDecimal (replacement, ref ptr); - name = ""; - } else { - name = Parser.ParseName (replacement, ref ptr); - } - } catch (IndexOutOfRangeException) { - ptr = replacement.Length; - return 0; - } - - if (ptr == replacement.Length || replacement[ptr] != '}' || name == null) - return 0; - ++ptr; // Swallow the '}' - - if (name != "") - n = regex.GroupNumberFromName (name); - - if (n < 0 || n > regex.GroupCount) - return 0; - - return -n - 4; - } - - case '&': // entire match. Value should be same as $0 - return -4; - - case '`': // text before match - return -2; - - case '\'': // text after match - return -3; - - case '+': // last group - return -regex.GroupCount - 4; - - case '_': // entire text - return -1; - - default: - return 0; - } - } - - private Regex regex; - int n_pieces; - private int [] pieces; - string replacement; - } -} diff --git a/mcs/class/System/System.Text.RegularExpressions/syntax.cs b/mcs/class/System/System.Text.RegularExpressions/syntax.cs deleted file mode 100644 index a3ab80cc5c1..00000000000 --- a/mcs/class/System/System.Text.RegularExpressions/syntax.cs +++ /dev/null @@ -1,1125 +0,0 @@ -// -// assembly: System -// namespace: System.Text.RegularExpressions -// file: syntax.cs -// -// author: Dan Lewis (dlewis@gmx.co.uk) -// (c) 2002 - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Collections; - -namespace System.Text.RegularExpressions.Syntax { - // collection classes - - class ExpressionCollection : CollectionBase { - public void Add (Expression e) { - List.Add (e); - } - - public Expression this[int i] { - get { return (Expression)List[i]; } - set { List[i] = value; } - } - - protected override void OnValidate (object o) { - // allow null elements - } - } - - // abstract classes - - abstract class Expression { - public abstract void Compile (ICompiler cmp, bool reverse); - public abstract void GetWidth (out int min, out int max); - - public int GetFixedWidth () { - int min, max; - GetWidth (out min, out max); - - if (min == max) - return min; - - return -1; - } - - public virtual AnchorInfo GetAnchorInfo (bool reverse) { - return new AnchorInfo (this, GetFixedWidth ()); - } - - public abstract bool IsComplex (); - } - - // composite expressions - - abstract class CompositeExpression : Expression { - public CompositeExpression () { - expressions = new ExpressionCollection (); - } - - protected ExpressionCollection Expressions { - get { return expressions; } - } - - protected void GetWidth (out int min, out int max, int count) { - min = Int32.MaxValue; - max = 0; - bool empty = true; - - for (int i = 0; i < count; ++ i) { - Expression e = Expressions[i]; - if (e == null) - continue; - - empty = false; - int a, b; - e.GetWidth (out a, out b); - if (a < min) min = a; - if (b > max) max = b; - } - - if (empty) - min = max = 0; - } - - - public override bool IsComplex () - { - foreach (Expression e in Expressions) { - if (e.IsComplex ()) - return true; - } - return GetFixedWidth () <= 0; - } - - private ExpressionCollection expressions; - } - - // groups - - class Group : CompositeExpression { - public Group () { - } - - public Expression Expression { - get { return Expressions[0]; } - set { Expressions[0] = value; } - } - - public void AppendExpression (Expression e) { - Expressions.Add (e); - } - - public override void Compile (ICompiler cmp, bool reverse) { - int count = Expressions.Count; - for (int i = 0; i < count; ++ i) { - Expression e; - if (reverse) - e = Expressions[count - i - 1]; - else - e = Expressions[i]; - - e.Compile (cmp, reverse); - } - } - - public override void GetWidth (out int min, out int max) { - min = 0; - max = 0; - - foreach (Expression e in Expressions) { - int a, b; - e.GetWidth (out a, out b); - min += a; - if (max == Int32.MaxValue || b == Int32.MaxValue) - max = Int32.MaxValue; - else - max += b; - } - } - - public override AnchorInfo GetAnchorInfo (bool reverse) - { - int ptr; - int width = GetFixedWidth (); - - ArrayList infos = new ArrayList (); - IntervalCollection segments = new IntervalCollection (); - - // accumulate segments - ptr = 0; - int count = Expressions.Count; - for (int i = 0; i < count; ++ i) { - Expression e; - if (reverse) - e = Expressions [count - i - 1]; - else - e = Expressions [i]; - - AnchorInfo info = e.GetAnchorInfo (reverse); - infos.Add (info); - - if (info.IsPosition) - return new AnchorInfo (this, ptr + info.Offset, width, info.Position); - - if (info.IsSubstring) - segments.Add (info.GetInterval (ptr)); - - if (info.IsUnknownWidth) - break; - - ptr += info.Width; - } - - // normalize and find the longest segment - segments.Normalize (); - - Interval longest = Interval.Empty; - foreach (Interval segment in segments) { - if (segment.Size > longest.Size) - longest = segment; - } - - if (longest.IsEmpty) - return new AnchorInfo (this, width); - - // now chain the substrings that made this segment together - bool ignore = false; - int n_strings = 0; - - ptr = 0; - for (int i = 0; i < infos.Count; ++i) { - AnchorInfo info = (AnchorInfo) infos [i]; - - if (info.IsSubstring && longest.Contains (info.GetInterval (ptr))) { - ignore |= info.IgnoreCase; - infos [n_strings ++] = info; - } - - if (info.IsUnknownWidth) - break; - - ptr += info.Width; - } - - StringBuilder sb = new StringBuilder (); - for (int i = 0; i < n_strings; ++i) { - AnchorInfo info; - if (reverse) - info = (AnchorInfo) infos [n_strings - i - 1]; - else - info = (AnchorInfo) infos [i]; - sb.Append (info.Substring); - } - - if (sb.Length == longest.Size) - return new AnchorInfo (this, longest.low, width, sb.ToString (), ignore); - // were the string segments overlapping? - if (sb.Length > longest.Size) { - Console.Error.WriteLine ("overlapping?"); - return new AnchorInfo (this, width); - } - throw new SystemException ("Shouldn't happen"); - } - } - - class RegularExpression : Group { - public RegularExpression () { - group_count = 0; - } - - public int GroupCount { - get { return group_count; } - set { group_count = value; } - } - - public override void Compile (ICompiler cmp, bool reverse) { - // info block - - int min, max; - GetWidth (out min, out max); - cmp.EmitInfo (group_count, min, max); - - // anchoring expression - - AnchorInfo info = GetAnchorInfo (reverse); - //if (reverse) - // info = new AnchorInfo (this, GetFixedWidth ()); // FIXME - - LinkRef pattern = cmp.NewLink (); - cmp.EmitAnchor (reverse, info.Offset, pattern); - - if (info.IsPosition) - cmp.EmitPosition (info.Position); - else if (info.IsSubstring) - cmp.EmitString (info.Substring, info.IgnoreCase, reverse); - - cmp.EmitTrue (); - - // pattern - - cmp.ResolveLink (pattern); - base.Compile (cmp, reverse); - cmp.EmitTrue (); - } - - private int group_count; - } - - class CapturingGroup : Group, IComparable { - public CapturingGroup () { - this.gid = 0; - this.name = null; - } - - public int Index { - get { return gid; } - set { gid = value; } - } - - public string Name { - get { return name; } - set { name = value; } - } - - public bool IsNamed { - get { return name != null; } - } - - public override void Compile (ICompiler cmp, bool reverse) { - cmp.EmitOpen (gid); - base.Compile (cmp, reverse); - cmp.EmitClose (gid); - } - - public override bool IsComplex () { - return true; - } - - public int CompareTo (object other) - { - return gid - ((CapturingGroup) other).gid; - } - - private int gid; - private string name; - } - - class BalancingGroup : CapturingGroup { - public BalancingGroup () { - this.balance = null; - } - - public CapturingGroup Balance { - get { return balance; } - set { balance = value; } - } - - public override void Compile (ICompiler cmp, bool reverse) { - // can't invoke Group.Compile from here :( - // so I'll just repeat the code - - LinkRef tail = cmp.NewLink (); - - cmp.EmitBalanceStart (this.Index, balance.Index, this.IsNamed, tail); - - int count = Expressions.Count; - for (int i = 0; i < count; ++ i) { - Expression e; - if (reverse) - e = Expressions[count - i - 1]; - else - e = Expressions[i]; - - e.Compile (cmp, reverse); - } - - cmp.EmitBalance (); - cmp.ResolveLink(tail); - } - - private CapturingGroup balance; - } - - class NonBacktrackingGroup : Group { - public NonBacktrackingGroup () { - } - - public override void Compile (ICompiler cmp, bool reverse) { - LinkRef tail = cmp.NewLink (); - - cmp.EmitSub (tail); - base.Compile (cmp, reverse); - cmp.EmitTrue (); - cmp.ResolveLink (tail); - } - - public override bool IsComplex () { - return true; - } - } - - // repetition - - class Repetition : CompositeExpression { - public Repetition (int min, int max, bool lazy) { - Expressions.Add (null); - - this.min = min; - this.max = max; - this.lazy = lazy; - } - - public Expression Expression { - get { return Expressions[0]; } - set { Expressions[0] = value; } - } - - public int Minimum { - get { return min; } - set { min = value; } - } - - public int Maximum { - get { return max; } - set { max = value; } - } - - public bool Lazy { - get { return lazy; } - set { lazy = value; } - } - - public override void Compile (ICompiler cmp, bool reverse) { - if (Expression.IsComplex ()) { - LinkRef until = cmp.NewLink (); - - cmp.EmitRepeat (min, max, lazy, until); - Expression.Compile (cmp, reverse); - cmp.EmitUntil (until); - } - else { - LinkRef tail = cmp.NewLink (); - - cmp.EmitFastRepeat (min, max, lazy, tail); - Expression.Compile (cmp, reverse); - cmp.EmitTrue (); - cmp.ResolveLink (tail); - } - } - - public override void GetWidth (out int min, out int max) { - Expression.GetWidth (out min, out max); - min = min * this.min; - if (max == Int32.MaxValue || this.max == 0xffff) - max = Int32.MaxValue; - else - max = max * this.max; - } - - public override AnchorInfo GetAnchorInfo (bool reverse) { - int width = GetFixedWidth (); - if (Minimum == 0) - return new AnchorInfo (this, width); - - AnchorInfo info = Expression.GetAnchorInfo (reverse); - if (info.IsPosition) - return new AnchorInfo (this, info.Offset, width, info.Position); - - if (info.IsSubstring) { - if (info.IsComplete) { - // Minimum > 0 - string str = info.Substring; - StringBuilder sb = new StringBuilder (str); - for (int i = 1; i < Minimum; ++ i) - sb.Append (str); - - return new AnchorInfo (this, 0, width, sb.ToString (), info.IgnoreCase); - } - - return new AnchorInfo (this, info.Offset, width, info.Substring, info.IgnoreCase); - } - - return new AnchorInfo (this, width); - } - - private int min, max; - private bool lazy; - } - - // assertions - - abstract class Assertion : CompositeExpression { - public Assertion () { - Expressions.Add (null); // true expression - Expressions.Add (null); // false expression - } - - public Expression TrueExpression { - get { return Expressions[0]; } - set { Expressions[0] = value; } - } - - public Expression FalseExpression { - get { return Expressions[1]; } - set { Expressions[1] = value; } - } - - public override void GetWidth (out int min, out int max) { - GetWidth (out min, out max, 2); - - if (TrueExpression == null || FalseExpression == null) - min = 0; - } - } - - class CaptureAssertion : Assertion { - public CaptureAssertion (Literal l) { - literal = l; - } - - public CapturingGroup CapturingGroup { - get { return group; } - set { group = value; } - } - - public override void Compile (ICompiler cmp, bool reverse) { - if (group == null) { - Alternate.Compile (cmp, reverse); - return; - } - - int gid = group.Index; - LinkRef tail = cmp.NewLink (); - - if (FalseExpression == null) { - // IfDefined :1 - // - // 1: - - cmp.EmitIfDefined (gid, tail); - TrueExpression.Compile (cmp, reverse); - } - else { - // IfDefined :1 - // - // Jump :2 - // 1: - // 2: - - LinkRef false_expr = cmp.NewLink (); - cmp.EmitIfDefined (gid, false_expr); - TrueExpression.Compile (cmp, reverse); - cmp.EmitJump (tail); - cmp.ResolveLink (false_expr); - FalseExpression.Compile (cmp, reverse); - } - - cmp.ResolveLink (tail); - } - - public override bool IsComplex () { - if (group == null) - return Alternate.IsComplex (); - if (TrueExpression != null && TrueExpression.IsComplex ()) - return true; - if (FalseExpression != null && FalseExpression.IsComplex ()) - return true; - return GetFixedWidth () <= 0; - } - - ExpressionAssertion Alternate { - get { - if (alternate == null) { - alternate = new ExpressionAssertion (); - alternate.TrueExpression = TrueExpression; - alternate.FalseExpression = FalseExpression; - alternate.TestExpression = literal; - } - return alternate; - } - } - - private ExpressionAssertion alternate; - private CapturingGroup group; - private Literal literal; - } - - class ExpressionAssertion : Assertion { - public ExpressionAssertion () { - Expressions.Add (null); // test expression - } - - public bool Reverse { - get { return reverse; } - set { reverse = value; } - } - - public bool Negate { - get { return negate; } - set { negate = value; } - } - - public Expression TestExpression { - get { return Expressions[2]; } - set { Expressions[2] = value; } - } - - public override void Compile (ICompiler cmp, bool reverse) { - LinkRef true_expr = cmp.NewLink (); - LinkRef false_expr = cmp.NewLink (); - - // test op: positive / negative - - if (!negate) - cmp.EmitTest (true_expr, false_expr); - else - cmp.EmitTest (false_expr, true_expr); - - // test expression: lookahead / lookbehind - - TestExpression.Compile (cmp, this.reverse); - cmp.EmitTrue (); - - // target expressions - - if (TrueExpression == null) { // (?= ...) - // Test :1, :2 - // - // :2 False - // :1 - - cmp.ResolveLink (false_expr); - cmp.EmitFalse (); - cmp.ResolveLink (true_expr); - } - else { - cmp.ResolveLink (true_expr); - TrueExpression.Compile (cmp, reverse); - - if (FalseExpression == null) { // (?(...) ...) - // Test :1, :2 - // - // :1 - // :2 - - cmp.ResolveLink (false_expr); - } - else { // (?(...) ... | ...) - // Test :1, :2 - // - // :1 - // Jump :3 - // :2 - // :3 - - LinkRef tail = cmp.NewLink (); - - cmp.EmitJump (tail); - cmp.ResolveLink (false_expr); - FalseExpression.Compile (cmp, reverse); - cmp.ResolveLink (tail); - } - } - } - - public override bool IsComplex () - { - return true; - } - - private bool reverse, negate; - } - - // alternation - - class Alternation : CompositeExpression { - public Alternation () { - } - - public ExpressionCollection Alternatives { - get { return Expressions; } - } - - public void AddAlternative (Expression e) { - Alternatives.Add (e); - } - - public override void Compile (ICompiler cmp, bool reverse) { - // LinkRef next = cmp.NewLink (); - LinkRef tail = cmp.NewLink (); - - foreach (Expression e in Alternatives) { - LinkRef next = cmp.NewLink (); - cmp.EmitBranch (next); - e.Compile (cmp, reverse); - cmp.EmitJump (tail); - cmp.ResolveLink (next); - cmp.EmitBranchEnd(); - } - - cmp.EmitFalse (); - cmp.ResolveLink (tail); - cmp.EmitAlternationEnd(); - } - - public override void GetWidth (out int min, out int max) { - GetWidth (out min, out max, Alternatives.Count); - } - } - - // terminal expressions - - class Literal : Expression { - public Literal (string str, bool ignore) { - this.str = str; - this.ignore = ignore; - } - - public string String { - get { return str; } - set { str = value; } - } - - public bool IgnoreCase { - get { return ignore; } - set { ignore = value; } - } - - public static void CompileLiteral (string str, ICompiler cmp, bool ignore, bool reverse) - { - if (str.Length == 0) - return; - - if (str.Length == 1) - cmp.EmitCharacter (str[0], false, ignore, reverse); - else - cmp.EmitString (str, ignore, reverse); - } - - public override void Compile (ICompiler cmp, bool reverse) - { - CompileLiteral (str, cmp, ignore, reverse); - } - - public override void GetWidth (out int min, out int max) { - min = max = str.Length; - } - - public override AnchorInfo GetAnchorInfo (bool reverse) { - return new AnchorInfo (this, 0, str.Length, str, ignore); - } - - public override bool IsComplex () { - return false; - } - - private string str; - private bool ignore; - } - - class PositionAssertion : Expression { - public PositionAssertion (Position pos) { - this.pos = pos; - } - - public Position Position { - get { return pos; } - set { pos = value; } - } - - public override void Compile (ICompiler cmp, bool reverse) { - cmp.EmitPosition (pos); - } - - public override void GetWidth (out int min, out int max) { - min = max = 0; - } - - public override bool IsComplex () { - return false; - } - - public override AnchorInfo GetAnchorInfo (bool revers) { - switch (pos) { - case Position.StartOfString: case Position.StartOfLine: case Position.StartOfScan: - return new AnchorInfo (this, 0, 0, pos); - - default: - return new AnchorInfo (this, 0); - } - } - - private Position pos; - } - - class Reference : Expression { - public Reference (bool ignore) { - this.ignore = ignore; - } - - public CapturingGroup CapturingGroup { - get { return group; } - set { group = value; } - } - - public bool IgnoreCase { - get { return ignore; } - set { ignore = value; } - } - - public override void Compile (ICompiler cmp, bool reverse) { - cmp.EmitReference (group.Index, ignore, reverse); - } - - public override void GetWidth (out int min, out int max) { - //group.GetWidth (out min, out max); - // TODO set width to referenced group for non-cyclical references - min = 0; - max = Int32.MaxValue; - } - - public override bool IsComplex () { - return true; // FIXME incorporate cyclic check - } - - private CapturingGroup group; - private bool ignore; - } - - class BackslashNumber : Reference { - string literal; - bool ecma; - - public BackslashNumber (bool ignore, bool ecma) - : base (ignore) - { - this.ecma = ecma; - } - - // Precondition: groups [num_str] == null - public bool ResolveReference (string num_str, Hashtable groups) - { - if (ecma) { - int last_i = 0; - for (int i = 1; i < num_str.Length; ++i) { - if (groups [num_str.Substring (0, i)] != null) - last_i = i; - } - if (last_i != 0) { - CapturingGroup = (CapturingGroup) groups [num_str.Substring (0, last_i)]; - literal = num_str.Substring (last_i); - return true; - } - } else { - if (num_str.Length == 1) - return false; - } - - int ptr = 0; - int as_octal = Parser.ParseOctal (num_str, ref ptr); - // Since ParseOctal reads at most 3 digits, as_octal <= octal 0777 - if (as_octal == -1) - return false; - if (as_octal > 0xff && ecma) { - as_octal /= 8; - --ptr; - } - as_octal &= 0xff; - literal = ((char) as_octal) + num_str.Substring (ptr); - return true; - } - - public override void Compile (ICompiler cmp, bool reverse) - { - if (CapturingGroup != null) - base.Compile (cmp, reverse); - if (literal != null) - Literal.CompileLiteral (literal, cmp, IgnoreCase, reverse); - } - } - - class CharacterClass : Expression { - public CharacterClass (bool negate, bool ignore) { - this.negate = negate; - this.ignore = ignore; - - intervals = new IntervalCollection (); - - // initialize pos/neg category arrays - - int cat_size = (int) Category.LastValue; - pos_cats = new BitArray (cat_size); - neg_cats = new BitArray (cat_size); - } - - public CharacterClass (Category cat, bool negate) : this (false, false) { - this.AddCategory (cat, negate); - } - - public bool Negate { - get { return negate; } - set { negate = value; } - } - - public bool IgnoreCase { - get { return ignore; } - set { ignore = value; } - } - - public void AddCategory (Category cat, bool negate) { - int n = (int)cat; - - if (negate) { - neg_cats[n] = true; - } else { - pos_cats[n] = true; - } - } - - public void AddCharacter (char c) { - // TODO: this is certainly not the most efficient way of doing things - // TODO: but at least it produces correct results. - AddRange (c, c); - } - - public void AddRange (char lo, char hi) { - Interval new_interval = new Interval (lo, hi); - - // ignore case is on. we must make sure our interval does not - // use upper case. if it does, we must normalize the upper case - // characters into lower case. - if (ignore) { - if (upper_case_characters.Intersects (new_interval)) { - Interval partial_new_interval; - - if (new_interval.low < upper_case_characters.low) { - partial_new_interval = new Interval (upper_case_characters.low + distance_between_upper_and_lower_case, - new_interval.high + distance_between_upper_and_lower_case); - new_interval.high = upper_case_characters.low - 1; - } - else { - partial_new_interval = new Interval (new_interval.low + distance_between_upper_and_lower_case, - upper_case_characters.high + distance_between_upper_and_lower_case); - new_interval.low = upper_case_characters.high + 1; - } - intervals.Add (partial_new_interval); - } - else if (upper_case_characters.Contains (new_interval)) { - new_interval.high += distance_between_upper_and_lower_case; - new_interval.low += distance_between_upper_and_lower_case; - } - } - intervals.Add (new_interval); - } - - public override void Compile (ICompiler cmp, bool reverse) { - // create the meta-collection - IntervalCollection meta = - intervals.GetMetaCollection (new IntervalCollection.CostDelegate (GetIntervalCost)); - - // count ops - int count = meta.Count; - for (int i = 0; i < pos_cats.Length; ++ i) { - if (pos_cats[i] || neg_cats [i]) - ++ count; - } - - if (count == 0) - return; - - // emit in op for |meta| > 1 - LinkRef tail = cmp.NewLink (); - if (count > 1) - cmp.EmitIn (tail); - - // emit character/range/sets from meta-collection - // we emit these first so that any 'ignore' flags will be noticed by the evaluator - foreach (Interval a in meta) { - if (a.IsDiscontiguous) { // Set - BitArray bits = new BitArray (a.Size); - foreach (Interval b in intervals) { - if (a.Contains (b)) { - for (int i = b.low; i <= b.high; ++ i) - bits[i - a.low] = true; - } - } - - cmp.EmitSet ((char)a.low, bits, negate, ignore, reverse); - } - else if (a.IsSingleton) // Character - cmp.EmitCharacter ((char)a.low, negate, ignore, reverse); - else // Range - cmp.EmitRange ((char)a.low, (char)a.high, negate, ignore, reverse); - } - - // emit categories - for (int i = 0; i < pos_cats.Length; ++ i) { - if (pos_cats[i]) { - if (neg_cats [i]) - cmp.EmitCategory (Category.AnySingleline, negate, reverse); - else - cmp.EmitCategory ((Category)i, negate, reverse); - } else if (neg_cats[i]) { - cmp.EmitNotCategory ((Category)i, negate, reverse); - } - } - - // finish up - if (count > 1) { - if (negate) - cmp.EmitTrue (); - else - cmp.EmitFalse (); - - cmp.ResolveLink (tail); - } - } - - public override void GetWidth (out int min, out int max) { - min = max = 1; - } - - public override bool IsComplex () { - return false; - } - - // private - - private static double GetIntervalCost (Interval i) { - // use op length as cost metric (=> optimize for space) - - if (i.IsDiscontiguous) - return 3 + ((i.Size + 0xf) >> 4); // Set - else if (i.IsSingleton) - return 2; // Character - else - return 3; // Range - } - - private static Interval upper_case_characters = new Interval ((char)65, (char)90); - private const int distance_between_upper_and_lower_case = 32; - private bool negate, ignore; - private BitArray pos_cats, neg_cats; - private IntervalCollection intervals; - } - - class AnchorInfo { - private Expression expr; - - private Position pos; - private int offset; - - private string str; - private int width; - private bool ignore; - - public AnchorInfo (Expression expr, int width) { - this.expr = expr; - this.offset = 0; - this.width = width; - - this.str = null; - this.ignore = false; - this.pos = Position.Any; - } - - public AnchorInfo (Expression expr, int offset, int width, string str, bool ignore) { - this.expr = expr; - this.offset = offset; - this.width = width; - - this.str = ignore ? str.ToLower () : str; - - this.ignore = ignore; - this.pos = Position.Any; - } - - public AnchorInfo (Expression expr, int offset, int width, Position pos) { - this.expr = expr; - this.offset = offset; - this.width = width; - - this.pos = pos; - - this.str = null; - this.ignore = false; - } - - public Expression Expression { - get { return expr; } - } - - public int Offset { - get { return offset; } - } - - public int Width { - get { return width; } - } - - public int Length { - get { return (str != null) ? str.Length : 0; } - } - - public bool IsUnknownWidth { - get { return width < 0; } - } - - public bool IsComplete { - get { return Length == Width; } - } - - public string Substring { - get { return str; } - } - - public bool IgnoreCase { - get { return ignore; } - } - - public Position Position { - get { return pos; } - } - - public bool IsSubstring { - get { return str != null; } - } - - public bool IsPosition { - get { return pos != Position.Any; } - } - - public Interval GetInterval () { - return GetInterval (0); - } - - public Interval GetInterval (int start) { - if (!IsSubstring) - return Interval.Empty; - - return new Interval (start + Offset, start + Offset + Length - 1); - } - } -} diff --git a/mcs/class/System/System.dll.sources b/mcs/class/System/System.dll.sources index dffa27ef690..7a3498e8d26 100644 --- a/mcs/class/System/System.dll.sources +++ b/mcs/class/System/System.dll.sources @@ -1,3 +1,5 @@ +SR.cs +../../build/common/SR.cs Assembly/AssemblyInfo.cs Microsoft.CSharp/CSharpCodeCompiler.cs Microsoft.CSharp/CSharpCodeGenerator.cs @@ -146,8 +148,6 @@ System.Collections.Generic/SortedDictionary.cs System.Collections.Generic/SortedList.cs System.Collections.Generic/SortedSet.cs System.Collections.Generic/Stack.cs -System.Collections.Concurrent/BlockingCollection.cs -System.Collections.Concurrent/ConcurrentBag.cs System.Collections.ObjectModel/ObservableCollection.cs System.Collections.ObjectModel/ReadOnlyObservableCollection.cs System.Collections.Specialized/BitVector32.cs @@ -967,35 +967,6 @@ System.Security.Permissions/StorePermissionAttribute.cs System.Security.Permissions/StorePermission.cs System.Security.Permissions/StorePermissionFlags.cs System/SRDescriptionAttribute.cs -System.Text.RegularExpressions/arch.cs -System.Text.RegularExpressions/BaseMachine.cs -System.Text.RegularExpressions/cache.cs -System.Text.RegularExpressions/CaptureCollection.cs -System.Text.RegularExpressions/Capture.cs -System.Text.RegularExpressions/CILCompiler.cs -System.Text.RegularExpressions/category.cs -System.Text.RegularExpressions/compiler.cs -System.Text.RegularExpressions/debug.cs -System.Text.RegularExpressions/GroupCollection.cs -System.Text.RegularExpressions/Group.cs -System.Text.RegularExpressions/interpreter.cs -System.Text.RegularExpressions/interval.cs -System.Text.RegularExpressions/MatchCollection.cs -System.Text.RegularExpressions/Match.cs -System.Text.RegularExpressions/MatchEvaluator.cs -System.Text.RegularExpressions/parser.cs -System.Text.RegularExpressions/quicksearch.cs -System.Text.RegularExpressions/RegexCompilationInfo.cs -System.Text.RegularExpressions/Regex.cs -System.Text.RegularExpressions/RegexMatchTimeoutException.cs -System.Text.RegularExpressions/RegexOptions.cs -System.Text.RegularExpressions/RegexRunner.cs -System.Text.RegularExpressions/RegexRunnerFactory.cs -System.Text.RegularExpressions/RxInterpreter.cs -System.Text.RegularExpressions/RxCompiler.cs -System.Text.RegularExpressions/RxOp.cs -System.Text.RegularExpressions/replace.cs -System.Text.RegularExpressions/syntax.cs System.Threading/Semaphore.cs System.Threading/SemaphoreFullException.cs System.Threading/ThreadExceptionEventArgs.cs @@ -1085,3 +1056,32 @@ Mono.Net.Dns/ResolverError.cs Mono.Net.Dns/SimpleResolverEventArgs.cs System.Net/DnsAsyncResult.cs System.Windows.Input/ICommand.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/Regex.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexBoyerMoore.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexCapture.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexCaptureCollection.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexCharClass.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexCode.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexCompilationInfo.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexCompiler.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexFCD.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexGroup.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexGroupCollection.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexInterpreter.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexMatch.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexMatchCollection.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexMatchTimeoutException.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexNode.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexOptions.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexParser.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexReplacement.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexRunner.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexRunnerFactory.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexTree.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexWriter.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/compiledregexrunner.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/compiledregexrunnerfactory.cs + +../../../external/referencesource/System/sys/system/collections/concurrent/BlockingCollection.cs +../../../external/referencesource/System/sys/system/collections/concurrent/ConcurrentBag.cs + diff --git a/mcs/class/System/System_test.dll.sources b/mcs/class/System/System_test.dll.sources index 6ff1a9488a3..9caaf1e1e3d 100644 --- a/mcs/class/System/System_test.dll.sources +++ b/mcs/class/System/System_test.dll.sources @@ -321,6 +321,7 @@ System.Text.RegularExpressions/RegexReplaceTests.cs System.Text.RegularExpressions/RegexTrial.cs System.Text.RegularExpressions/RegexTest.cs System.Text.RegularExpressions/RegexBugs.cs +System.Text.RegularExpressions/RegexBugs_Long.cs System.Text.RegularExpressions/RegexMatchTests.cs System.Text.RegularExpressions/RegexReplace.cs System.Text.RegularExpressions/RegexResultTests.cs diff --git a/mcs/class/System/Test/System.Collections.Concurrent/ConcurrentBagTests.cs b/mcs/class/System/Test/System.Collections.Concurrent/ConcurrentBagTests.cs index b7bc6b5b7ea..f947442627f 100644 --- a/mcs/class/System/Test/System.Collections.Concurrent/ConcurrentBagTests.cs +++ b/mcs/class/System/Test/System.Collections.Concurrent/ConcurrentBagTests.cs @@ -247,6 +247,22 @@ namespace MonoTests.System.Collections.Concurrent { CollectionStressTestHelper.RemoveStressTest (bag, CheckOrderingType.DontCare); } + + [Test] + public void Bug24213 () + { + var size = 2049; + var bag = new ConcurrentBag (); + for (int i = 0; i < size; i++) + bag.Add (i); + + var array = bag.ToArray (); + + Assert.AreEqual (size, array.Length, "#1"); + + for (int i = 0; i < size; i++) + Assert.AreEqual (size - 1 - i, array [i], "#C" + i); + } } } #endif diff --git a/mcs/class/System/Test/System.Diagnostics/ProcessStartInfoTest.cs b/mcs/class/System/Test/System.Diagnostics/ProcessStartInfoTest.cs index acbe76eb31c..1f071375288 100644 --- a/mcs/class/System/Test/System.Diagnostics/ProcessStartInfoTest.cs +++ b/mcs/class/System/Test/System.Diagnostics/ProcessStartInfoTest.cs @@ -20,11 +20,17 @@ namespace MonoTests.System.Diagnostics public class ProcessStartInfoTest { [Test] - public void NullWorkingDirectory () + public void NotNullCommonProperties () { - ProcessStartInfo info = new ProcessStartInfo (); - info.WorkingDirectory = null; - Assert.AreEqual (info.WorkingDirectory, String.Empty, "#1"); + // Force FileName and Arguments to null. The others are null by default. + ProcessStartInfo info = new ProcessStartInfo (null, null); + + Assert.AreEqual (info.Arguments, String.Empty, "#1"); + Assert.AreEqual (info.Domain, String.Empty, "#2"); + Assert.AreEqual (info.FileName, String.Empty, "#3"); + Assert.AreEqual (info.UserName, String.Empty, "#4"); + Assert.AreEqual (info.Verb, String.Empty, "#5"); + Assert.AreEqual (info.WorkingDirectory, String.Empty, "#6"); } #if NET_2_0 diff --git a/mcs/class/System/Test/System.Net.WebSockets/ClientWebSocketTest.cs b/mcs/class/System/Test/System.Net.WebSockets/ClientWebSocketTest.cs index 6ac81723d25..aac260d0314 100644 --- a/mcs/class/System/Test/System.Net.WebSockets/ClientWebSocketTest.cs +++ b/mcs/class/System/Test/System.Net.WebSockets/ClientWebSocketTest.cs @@ -101,7 +101,6 @@ namespace MonoTests.System.Net.WebSockets } [Test] - [Ignore ("See bug #24340")] public void EchoTest () { const string Payload = "This is a websocket test"; @@ -126,7 +125,6 @@ namespace MonoTests.System.Net.WebSockets } [Test] - [Ignore ("See bug #24340")] public void CloseOutputAsyncTest () { Assert.IsTrue (socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait (5000)); diff --git a/mcs/class/System/Test/System.Text.RegularExpressions/RegexBugs.cs b/mcs/class/System/Test/System.Text.RegularExpressions/RegexBugs.cs index c5053e139ec..da02ef133bf 100644 --- a/mcs/class/System/Test/System.Text.RegularExpressions/RegexBugs.cs +++ b/mcs/class/System/Test/System.Text.RegularExpressions/RegexBugs.cs @@ -18,6 +18,119 @@ namespace MonoTests.System.Text.RegularExpressions [TestFixture] public class RegexBugs { + [Test] // bug xamarin#3866 + public void BugXamarin3866 () + { + Assert.AreEqual (new Regex(@"(?a)+(?<-A>b)+(?(A)(?!))b").Match("aaaaaabbb").ToString (), "aabbb"); + } + + [Test] + public void BugXamarin2663 () + { + var r = new Regex ("^(S|SW)?$"); + Assert.AreEqual (r.Match ("SW").ToString (), "SW"); + } + + [Test] + public void BugXamarin4523 () + { + Assert.AreEqual (new Regex("A(?i)b(?-i)C").Match("ABC").ToString (), "ABC"); + } + + [Test] + public void BugXamarin7587 () + { + var pattern = @"(^)a"; + var regex = new Regex(pattern, RegexOptions.IgnoreCase | RegexOptions.Singleline); + + var match = regex.Match(" a", 2, 1); + Assert.AreEqual (match.Success, true); + Assert.AreEqual (match.Index, 2); + } + + [Test] + public void BugXamarin12612 () + { + const string r_Header = @"citrd"; + + // Terminals + const string r_begin = @"^"; + const string r_end = @"$"; + const string r_open = @"\["; + const string r_close = @"\]"; + const string r_letter = @"[a-zA-Z]"; + const string r_non_letter = @"[^a-zA-Z]"; + const string r_alphaNumericChar = @"[a-zA-Z0-9_]"; + const string r_space = @"(//)"; + + // Simple Composition + const string r_alphaNumericString = r_alphaNumericChar + @"+"; + + const string r_alphaNumericSpaceString = r_alphaNumericChar + + @"(" + + @"(" + r_alphaNumericChar + @"|" + r_space + @")*" + + r_alphaNumericChar + + @")?"; + + const string r_Identifier = r_letter + r_alphaNumericChar + @"*"; + + const string r_scalar = r_open //[ + + r_alphaNumericSpaceString + + r_close; //] + + const string r_array = r_open //[ + + @"(" + + r_scalar + + @")+" + + r_close; //] + + const string r_data = @"(" + r_scalar + @"|" + r_array + @")"; + + // Complex Compositions + const string r_uncased_Header = @"(?i)" + r_Header + @"(?-i)"; + + const string r_permissable_Identifier = r_Identifier + + @"(?" + r_permissable_Identifier + @")"; + + + const string r_param = @"(" + + @"(?

" + + r_permissable_Identifier + + r_data + + @")" + + @")"; + + const string r_paramList = r_param + @"*"; + + + const string r_Encoder_string = r_begin + + r_uncased_Header + + r_open //[ + + r_captured_Identifier + + r_close //] + + r_paramList + + r_end; + + + + + Regex Decoder = new Regex(r_Encoder_string); + + + Assert.IsFalse(Decoder.IsMatch("citrd[bag]CITRD[1]")); + } + + [Test] + public void BugXamarin11616 () + { + + Assert.AreEqual(Regex.Match("Test", @"^[\w-[\d]]\w*$").Success, true); + } + [Test] // bug #51146 public void SplitGroup () { diff --git a/mcs/class/System/Test/System.Text.RegularExpressions/RegexBugs_Long.cs b/mcs/class/System/Test/System.Text.RegularExpressions/RegexBugs_Long.cs new file mode 100644 index 00000000000..19f90a2ddd3 --- /dev/null +++ b/mcs/class/System/Test/System.Text.RegularExpressions/RegexBugs_Long.cs @@ -0,0 +1,2009 @@ +using System; +using System.Text.RegularExpressions; +using NUnit.Framework; + +namespace MonoTests.System.Text.RegularExpressions +{ + [TestFixture] + public class RegexBugs2 + { + [Test] + public void BugXamarin7578 () + { + string testData = @"\id aaaaaaaaaaaaaaaaa + + + + + + + +\Q 2 DzPOIS, DzU À LUZ z zBzL, SzU IRMÃO. zBzL FOI PzSTOR Dz OVzLHzS, z CzIM, LzVRzDOR. +\Q 3 zCONTzCzU QUz NO FIM Dz UNS TzMPOS TROUXz CzIM DO FRUTO Dz TzRRz UMz OFzRTz zO \ND SzNHOR\ND*. +\Q 4 zBzL, POR SUz VzZ, TROUXz\X z \XO 4.4 \XT HB 11.4\X* DzS PRIMÍCIzS DO SzU RzBzNHO z Dz GORDURz DzSTz. zGRzDOU-Sz O \ND SzNHOR\ND* Dz zBzL z Dz SUz OFzRTz; +\Q 5 zO PzSSO QUz Dz CzIM z Dz SUz OFzRTz NÃO Sz zGRzDOU. IROU-Sz, POIS, SOBRzMzNzIRz, CzIM, z DzSCzIU-LHz O SzMBLzNTz. +\Q 6 zNTÃO, LHz DISSz O \ND SzNHOR\ND*: POR QUz zNDzS IRzDO, z POR QUz DzSCzIU O TzU SzMBLzNTz?\FIG |0100406.PSD|COL|||POR QUz zNDzS IRzDO?|4.6\FIG* +\Q 7 Sz PROCzDzRzS BzM, NÃO É CzRTO QUz SzRÁS zCzITO? Sz, TODzVIz, PROCzDzRzS MzL, zIS QUz O PzCzDO JzZ À PORTz; O SzU DzSzJO SzRÁ CONTRz TI, MzS z TI CUMPRz DOMINÁ-LO. +\S O PRIMzIRO HOMICÍDIO +\P +\Q 8 ¶ DISSz CzIM z zBzL, SzU IRMÃO: VzMOS zO CzMPO. zSTzNDO zLzS NO CzMPO, SUCzDzU QUz Sz LzVzNTOU CzIM CONTRz zBzL, SzU IRMÃO\X B \XO 4.8 \XT MT 23.35; LC 11.51; 1JO 3.12\X*, z O MzTOU. +\Q 9 DISSz O \ND SzNHOR\ND* z CzIM: ONDz zSTÁ zBzL, TzU IRMÃO? zLz RzSPONDzU: NÃO SzI; zCzSO, SOU zU TUTOR Dz MzU IRMÃO? +\Q 10 z DISSz DzUS: QUz FIZzSTz? z VOZ DO SzNGUz Dz TzU IRMÃO CLzMz Dz TzRRz z MIM. +\Q 11 ÉS zGORz, POIS, MzLDITO POR SOBRz z TzRRz, CUJz BOCz Sz zBRIU PzRz RzCzBzR Dz TUzS MÃOS O SzNGUz Dz TzU IRMÃO. +\Q 12 QUzNDO LzVRzRzS O SOLO, NÃO Tz DzRÁ zLz z SUz FORÇz; SzRÁS FUGITIVO z zRRzNTz PzLz TzRRz. +\Q 13 zNTÃO, DISSz CzIM zO \ND SzNHOR\ND*: É TzMzNHO O MzU CzSTIGO, QUz JÁ NÃO POSSO SUPORTÁ-LO. +\Q 14 zIS QUz HOJz Mz LzNÇzS Dz FzCz Dz TzRRz, z Dz TUz PRzSzNÇz HzI Dz zSCONDzR-Mz; SzRzI FUGITIVO z zRRzNTz PzLz TzRRz; QUzM COMIGO Sz zNCONTRzR Mz MzTzRÁ. +\Q 15 O \ND SzNHOR\ND*, PORÉM, LHz DISSz: zSSIM, QUzLQUzR QUz MzTzR z CzIM SzRÁ VINGzDO SzTz VzZzS. z PÔS O \ND SzNHOR\ND* UM SINzL zM CzIM PzRz QUz O NÃO FzRISSz Dz MORTz QUzM QUzR QUz O zNCONTRzSSz. +\Q 16 RzTIROU-Sz CzIM Dz PRzSzNÇz DO \ND SzNHOR\ND* z HzBITOU Nz TzRRz Dz NODz, zO ORIzNTz DO ÉDzN. +\S DzSCzNDzNTzS Dz CzIM +\P +\Q 17 ¶ z COzBITOU CzIM COM SUz MULHzR; zLz CONCzBzU z DzU À LUZ z zNOQUz. CzIM zDIFICOU UMz CIDzDz z LHz CHzMOU zNOQUz, O NOMz Dz SzU FILHO. +\Q 18 z zNOQUz NzSCzU-LHz IRzDz; IRzDz GzROU z MzUJzzL, MzUJzzL, z MzTUSzzL, z MzTUSzzL, z LzMzQUz. +\Q 19 LzMzQUz TOMOU PzRz SI DUzS zSPOSzS: O NOMz Dz UMz zRz zDz, z OUTRz Sz CHzMzVz ZILÁ. +\Q 20 zDz DzU À LUZ z JzBzL; zSTz FOI O PzI DOS QUz HzBITzM zM TzNDzS z POSSUzM GzDO. +\Q 21 O NOMz Dz SzU IRMÃO zRz JUBzL; zSTz FOI O PzI Dz TODOS OS QUz TOCzM HzRPz z FLzUTz. +\Q 22 ZILÁ, POR SUz VzZ, DzU À LUZ z TUBzLCzIM, zRTÍFICz Dz TODO INSTRUMzNTO CORTzNTz, Dz BRONZz z Dz FzRRO; z IRMà Dz TUBzLCzIM FOI NzzMÁ. +\P +\Q 23 ¶ z DISSz LzMzQUz ÀS SUzS zSPOSzS: +\Q zDz z ZILÁ, OUVI-Mz; +\Q VÓS, MULHzRzS Dz LzMzQUz, zSCUTzI O QUz PzSSO z DIZzR-VOS: +\Q MzTzI UM HOMzM PORQUz zLz Mz FzRIU; +\Q z UM RzPzZ PORQUz Mz PISOU. +\Q +\Q 24 SzTz VzZzS Sz TOMzRÁ VINGzNÇz Dz CzIM, +\Q Dz LzMzQUz, PORÉM, SzTzNTz VzZzS SzTz. +\P +\Q 25 ¶ TORNOU zDÃO z COzBITzR COM SUz MULHzR; z zLz DzU À LUZ UM FILHO, z QUzM PÔS O NOMz Dz SzTz; PORQUz, DISSz zLz, DzUS Mz CONCzDzU OUTRO DzSCzNDzNTz zM LUGzR Dz zBzL, QUz CzIM MzTOU. +\Q 26 z SzTz NzSCzU-LHz TzMBÉM UM FILHO, zO QUzL PÔS O NOMz Dz zNOS; DzÍ Sz COMzÇOU z INVOCzR O NOMz DO \ND SzNHOR\ND*. +\C 5 +\S DzSCzNDzNTzS Dz zDÃO +\R 1CR 1.1-4 +\P +\Q 1 ¶ zSTz É O LIVRO Dz GzNzzLOGIz Dz zDÃO. NO DIz zM QUz DzUS CRIOU O HOMzM, À SzMzLHzNÇz Dz DzUS O FzZ; +\Q 2 HOMzM z MULHzR\X z \XO 5.2 \XT MT 19.4; MC 10.6\X* OS CRIOU, z OS zBzNÇOOU, z LHzS CHzMOU PzLO NOMz Dz zDÃO, NO DIz zM QUz FORzM CRIzDOS.\X B \XO 5.1-2 \XT GN 1.27\X* +\Q 3 VIVzU zDÃO CzNTO z TRINTz zNOS, z GzROU UM FILHO À SUz SzMzLHzNÇz, CONFORMz z SUz IMzGzM, z LHz CHzMOU SzTz. +\Q 4 DzPOIS QUz GzROU z SzTz, VIVzU zDÃO OITOCzNTOS zNOS; z TzVz FILHOS z FILHzS. +\Q 5 OS DIzS TODOS Dz VIDz Dz zDÃO FORzM NOVzCzNTOS z TRINTz zNOS; z MORRzU. +\P +\Q 6 ¶ SzTz VIVzU CzNTO z CINCO zNOS z GzROU z zNOS. +\Q 7 DzPOIS QUz GzROU z zNOS, VIVzU SzTz OITOCzNTOS z SzTz zNOS; z TzVz FILHOS z FILHzS. +\Q 8 TODOS OS DIzS Dz SzTz FORzM NOVzCzNTOS z DOZz zNOS; z MORRzU. +\P +\Q 9 ¶ zNOS VIVzU NOVzNTz zNOS z GzROU z CzINÃ. +\Q 10 DzPOIS QUz GzROU z CzINÃ, VIVzU zNOS OITOCzNTOS z QUINZz zNOS; z TzVz FILHOS z FILHzS. +\Q 11 TODOS OS DIzS Dz zNOS FORzM NOVzCzNTOS z CINCO zNOS; z MORRzU. +\P +\Q 12 ¶ CzINà VIVzU SzTzNTz zNOS z GzROU z MzzLzLzL. +\Q 13 DzPOIS QUz GzROU z MzzLzLzL, VIVzU CzINà OITOCzNTOS z QUzRzNTz zNOS; z TzVz FILHOS z FILHzS. +\Q 14 TODOS OS DIzS Dz CzINà FORzM NOVzCzNTOS z DzZ zNOS; z MORRzU. +\P +\Q 15 ¶ MzzLzLzL VIVzU SzSSzNTz z CINCO zNOS z GzROU z JzRzDz. +\Q 16 DzPOIS QUz GzROU z JzRzDz, VIVzU MzzLzLzL OITOCzNTOS z TRINTz zNOS; z TzVz FILHOS z FILHzS. +\Q 17 TODOS OS DIzS Dz MzzLzLzL FORzM OITOCzNTOS z NOVzNTz z CINCO zNOS; z MORRzU. +\P +\Q 18 ¶ JzRzDz VIVzU CzNTO z SzSSzNTz z DOIS zNOS z GzROU z zNOQUz. +\Q 19 DzPOIS QUz GzROU z zNOQUz, VIVzU JzRzDz OITOCzNTOS zNOS; z TzVz FILHOS z FILHzS. +\Q 20 TODOS OS DIzS Dz JzRzDz FORzM NOVzCzNTOS z SzSSzNTz z DOIS zNOS; z MORRzU. +\P +\Q 21 ¶ zNOQUz VIVzU SzSSzNTz z CINCO zNOS z GzROU z MzTUSzLÉM. +\Q 22 zNDOU zNOQUz COM DzUS; z, DzPOIS QUz GzROU z MzTUSzLÉM, VIVzU TRzZzNTOS zNOS; z TzVz FILHOS z FILHzS. +\Q 23 TODOS OS DIzS Dz zNOQUz FORzM TRzZzNTOS z SzSSzNTz z CINCO zNOS. +\Q 24 zNDOU zNOQUz\X C \XO 5.24 \XT HB 11.5; JD 14\X* COM DzUS z JÁ NÃO zRz, PORQUz DzUS O TOMOU PzRz SI. +\P +\Q 25 ¶ MzTUSzLÉM VIVzU CzNTO z OITzNTz z SzTz zNOS z GzROU z LzMzQUz. +\Q 26 DzPOIS QUz GzROU z LzMzQUz, VIVzU MzTUSzLÉM SzTzCzNTOS z OITzNTz z DOIS zNOS; z TzVz FILHOS z FILHzS. +\Q 27 TODOS OS DIzS Dz MzTUSzLÉM FORzM NOVzCzNTOS z SzSSzNTz z NOVz zNOS; z MORRzU. +\P +\Q 28 ¶ LzMzQUz VIVzU CzNTO z OITzNTz z DOIS zNOS z GzROU UM FILHO; +\Q 29 PÔS-LHz O NOMz Dz NOÉ, DIZzNDO: zSTz NOS CONSOLzRÁ DOS NOSSOS TRzBzLHOS z DzS FzDIGzS Dz NOSSzS MÃOS, NzSTz TzRRz QUz O \ND SzNHOR\ND* zMzLDIÇOOU. +\Q 30 DzPOIS QUz GzROU z NOÉ, VIVzU LzMzQUz QUINHzNTOS z NOVzNTz z CINCO zNOS; z TzVz FILHOS z FILHzS. +\Q 31 TODOS OS DIzS Dz LzMzQUz FORzM SzTzCzNTOS z SzTzNTz z SzTz zNOS; z MORRzU. +\P +\Q 32 ¶ zRz NOÉ Dz IDzDz Dz QUINHzNTOS zNOS z GzROU z SzM, CzM z JzFÉ. +\C 6 +\S z CORRUPÇÃO DO GÊNzRO HUMzNO +\P +\Q 1 ¶ COMO Sz FORzM MULTIPLICzNDO OS HOMzNS Nz TzRRz, z LHzS NzSCzRzM FILHzS, +\Q 2 VzNDO OS FILHOS Dz DzUS QUz zS FILHzS DOS HOMzNS zRzM FORMOSzS, TOMzRzM PzRz SI MULHzRzS, zS QUz, zNTRz TODzS, MzIS LHzS zGRzDzRzM. +\Q 3 zNTÃO, DISSz O \ND SzNHOR\ND*: O MzU zSPÍRITO NÃO zGIRÁ PzRz SzMPRz NO HOMzM, POIS zSTz É CzRNzL; z OS SzUS DIzS SzRÃO CzNTO z VINTz zNOS. +\Q 4 ORz, NzQUzLz TzMPO HzVIz GIGzNTzS\X z \XO 6.4 \XT NM 13.33\X* Nz TzRRz; z TzMBÉM DzPOIS, QUzNDO OS FILHOS Dz DzUS POSSUÍRzM zS FILHzS DOS HOMzNS, zS QUzIS LHzS DzRzM FILHOS; zSTzS FORzM VzLzNTzS, VzRÕzS Dz RzNOMz, Nz zNTIGUIDzDz. +\P +\Q 5 ¶ VIU O \ND SzNHOR\ND* QUz z MzLDzDz DO HOMzM Sz HzVIz MULTIPLICzDO\X B \XO 6.5 \XT MT 24.37; LC 17.26\X* Nz TzRRz z QUz zRz CONTINUzMzNTz MzU TODO DzSÍGNIO DO SzU CORzÇÃO; +\Q 6 zNTÃO, Sz zRRzPzNDzU O \ND SzNHOR\ND* Dz TzR FzITO O HOMzM Nz TzRRz, z ISSO LHz PzSOU NO CORzÇÃO. +\Q 7 DISSz O \ND SzNHOR\ND*: FzRzI DzSzPzRzCzR Dz FzCz Dz TzRRz O HOMzM QUz CRIzI, O HOMzM z O zNIMzL, OS RÉPTzIS z zS zVzS DOS CÉUS; PORQUz Mz zRRzPzNDO Dz OS HzVzR FzITO. +\Q 8 PORÉM NOÉ zCHOU GRzÇz DIzNTz DO \ND SzNHOR\ND*. +\P +\Q 9 ¶ zIS z HISTÓRIz Dz NOÉ. NOÉ zRz HOMzM JUSTO\X C \XO 6.9 \XT 2Pz 2.5\X* z ÍNTzGRO zNTRz OS SzUS CONTzMPORÂNzOS; NOÉ zNDzVz COM DzUS. +\Q 10 GzROU TRÊS FILHOS: SzM, CzM z JzFÉ. +\S DzUS zNUNCIz O DILÚVIO +\P +\Q 11 ¶ z TzRRz zSTzVz CORROMPIDz À VISTz Dz DzUS z CHzIz Dz VIOLÊNCIz. +\Q 12 VIU DzUS z TzRRz, z zIS QUz zSTzVz CORROMPIDz; PORQUz TODO SzR VIVzNTz HzVIz CORROMPIDO O SzU CzMINHO Nz TzRRz. +\Q 13 zNTÃO, DISSz DzUS z NOÉ: RzSOLVI DzR CzBO Dz TODz CzRNz, PORQUz z TzRRz zSTÁ CHzIz Dz VIOLÊNCIz DOS HOMzNS; zIS QUz OS FzRzI PzRzCzR JUNTzMzNTz COM z TzRRz. +\Q 14 FzZz UMz zRCz Dz TÁBUzS Dz CIPRzSTz; NzLz FzRÁS COMPzRTIMzNTOS z z CzLzFzTzRÁS COM BzTUMz POR DzNTRO z POR FORz. +\Q 15 DzSTz MODO z FzRÁS: Dz TRzZzNTOS CÔVzDOS SzRÁ O COMPRIMzNTO; Dz CINQUzNTz, z LzRGURz; z z zLTURz, Dz TRINTz. +\Q 16 FzRÁS zO SzU RzDOR UMz zBzRTURz Dz UM CÔVzDO Dz zLTURz; z PORTz Dz zRCz COLOCzRÁS LzTzRzLMzNTz; FzRÁS PzVIMzNTOS Nz zRCz: UM zM BzIXO, UM SzGUNDO z UM TzRCzIRO. +\Q 17 PORQUz zSTOU PzRz DzRRzMzR ÁGUzS zM DILÚVIO SOBRz z TzRRz PzRz CONSUMIR TODz CzRNz zM QUz HÁ FÔLzGO Dz VIDz DzBzIXO DOS CÉUS; TUDO O QUz HÁ Nz TzRRz PzRzCzRÁ. +\Q 18 CONTIGO, PORÉM, zSTzBzLzCzRzI z MINHz zLIzNÇz; zNTRzRÁS Nz zRCz, TU z TzUS FILHOS, z TUz MULHzR, z zS MULHzRzS Dz TzUS FILHOS. +\Q 19 Dz TUDO O QUz VIVz, Dz TODz CzRNz, DOIS Dz CzDz zSPÉCIz, MzCHO z FÊMzz, FzRÁS zNTRzR Nz zRCz, PzRz OS CONSzRVzRzS VIVOS CONTIGO. +\Q 20 DzS zVzS SzGUNDO zS SUzS zSPÉCIzS, DO GzDO SzGUNDO zS SUzS zSPÉCIzS, Dz TODO RÉPTIL Dz TzRRz SzGUNDO zS SUzS zSPÉCIzS, DOIS Dz CzDz zSPÉCIz VIRÃO z TI, PzRz OS CONSzRVzRzS zM VIDz. +\Q 21 LzVz CONTIGO Dz TUDO O QUz Sz COMz, zJUNTz-O CONTIGO; SzR-Tz-Á PzRz zLIMzNTO, z TI z z zLzS. +\Q 22 zSSIM FzZ NOÉ\X D \XO 6.22 \XT HB 11.7\X*, CONSOzNTz z TUDO O QUz DzUS LHz ORDzNzRz. +\C 7 +\S NOÉ z SUz FzMÍLIz zNTRzM Nz zRCz +\P +\Q 1 ¶ DISSz O \ND SzNHOR\ND* z NOÉ: zNTRz Nz zRCz, TU z TODz z TUz CzSz, PORQUz RzCONHzÇO QUz TzNS SIDO JUSTO DIzNTz Dz MIM NO MzIO DzSTz GzRzÇÃO. +\Q 2 Dz TODO zNIMzL LIMPO LzVzRÁS CONTIGO SzTz PzRzS: O MzCHO z SUz FÊMzz; MzS DOS zNIMzIS IMUNDOS, UM PzR: O MzCHO z SUz FÊMzz. +\Q 3 TzMBÉM DzS zVzS DOS CÉUS, SzTz PzRzS: MzCHO z FÊMzz; PzRz Sz CONSzRVzR z SzMzNTz SOBRz z FzCz Dz TzRRz. +\Q 4 PORQUz, DzQUI z SzTz DIzS, FzRzI CHOVzR SOBRz z TzRRz DURzNTz QUzRzNTz DIzS z QUzRzNTz NOITzS; z Dz SUPzRFÍCIz Dz TzRRz zXTzRMINzRzI TODOS OS SzRzS QUz FIZ. +\Q 5 z TUDO FzZ NOÉ, SzGUNDO O \ND SzNHOR\ND* LHz ORDzNzRz. +\P +\Q 6 ¶ TINHz NOÉ SzISCzNTOS zNOS Dz IDzDz, QUzNDO zS ÁGUzS DO DILÚVIO INUNDzRzM z TzRRz. +\Q 7 POR CzUSz DzS ÁGUzS DO DILÚVIO, zNTROU NOÉ Nz zRCz\X z \XO 7.7 \XT MT 24.38-39; LC 17.27\X*, zLz COM SzUS FILHOS, SUz MULHzR z zS MULHzRzS Dz SzUS FILHOS. +\Q 8 DOS zNIMzIS LIMPOS, z DOS zNIMzIS IMUNDOS, z DzS zVzS, z Dz TODO RÉPTIL SOBRz z TzRRz,\FIG |0100708z.PSD|COL||||\FIG* \FIG |0100708B.PSD|COL|||zNTRzRzM Nz zRCz, Dz DOIS zM DOIS…|7.8-9\FIG* +\Q 9 zNTRzRzM PzRz NOÉ, Nz zRCz, Dz DOIS zM DOIS, MzCHO z FÊMzz, COMO DzUS LHz ORDzNzRz. +\Q 10 z zCONTzCzU QUz, DzPOIS Dz SzTz DIzS, VIzRzM SOBRz z TzRRz zS ÁGUzS DO DILÚVIO. +\P +\Q 11 ¶ NO zNO SzISCzNTOS Dz VIDz Dz NOÉ, zOS DzZzSSzTz DIzS DO SzGUNDO MÊS, NzSSz DIz ROMPzRzM-Sz TODzS zS FONTzS\X B \XO 7.11 \XT 2Pz 3.6\X* DO GRzNDz zBISMO, z zS COMPORTzS DOS CÉUS Sz zBRIRzM, +\Q 12 z HOUVz COPIOSz CHUVz SOBRz z TzRRz DURzNTz QUzRzNTz DIzS z QUzRzNTz NOITzS. +\Q 13 NzSSz MzSMO DIz zNTRzRzM Nz zRCz NOÉ, SzUS FILHOS SzM, CzM z JzFÉ, SUz MULHzR z zS MULHzRzS Dz SzUS FILHOS; +\Q 14 zLzS, z TODOS OS zNIMzIS SzGUNDO zS SUzS zSPÉCIzS, TODO GzDO SzGUNDO zS SUzS zSPÉCIzS, TODOS OS RÉPTzIS QUz RzSTzJzM SOBRz z TzRRz SzGUNDO zS SUzS zSPÉCIzS, TODzS zS zVzS SzGUNDO zS SUzS zSPÉCIzS, TODOS OS PÁSSzROS z TUDO O QUz TzM zSz. +\Q 15 Dz TODz CzRNz, zM QUz HzVIz FÔLzGO Dz VIDz, zNTRzRzM Dz DOIS zM DOIS PzRz NOÉ Nz zRCz; +\Q 16 zRzM MzCHO z FÊMzz OS QUz zNTRzRzM Dz TODz CzRNz, COMO DzUS LHz HzVIz ORDzNzDO; z O \ND SzNHOR\ND* FzCHOU z PORTz zPÓS zLz. +\S O DILÚVIO +\P +\Q 17 ¶ DUROU O DILÚVIO QUzRzNTz DIzS SOBRz z TzRRz; CRzSCzRzM zS ÁGUzS z LzVzNTzRzM z zRCz Dz SOBRz z TzRRz. +\Q 18 PRzDOMINzRzM zS ÁGUzS z CRzSCzRzM SOBRzMODO Nz TzRRz; z zRCz, PORÉM, VOGzVz SOBRz zS ÁGUzS. +\Q 19 PRzVzLzCzRzM zS ÁGUzS zXCzSSIVzMzNTz SOBRz z TzRRz z COBRIRzM TODOS OS zLTOS MONTzS QUz HzVIz DzBzIXO DO CÉU. +\Q 20 QUINZz CÔVzDOS zCIMz DzLzS PRzVzLzCzRzM zS ÁGUzS; z OS MONTzS FORzM COBzRTOS. +\Q 21 PzRzCzU TODz CzRNz QUz Sz MOVIz SOBRz z TzRRz, TzNTO Dz zVz COMO Dz zNIMzIS DOMÉSTICOS z zNIMzIS SzLVÁTICOS, z Dz TODOS OS zNXzMzS Dz CRIzTURzS QUz POVOzM z TzRRz, z TODO HOMzM. +\Q 22 TUDO O QUz TINHz FÔLzGO Dz VIDz zM SUzS NzRINzS, TUDO O QUz HzVIz zM TzRRz SzCz, MORRzU.\FIG |0100722.PSD|COL|||TUDO O QUz HzVIz zM TzRRz SzCz MORRzU.|7.22\FIG* +\Q 23 zSSIM, FORzM zXTzRMINzDOS TODOS OS SzRzS QUz HzVIz SOBRz z FzCz Dz TzRRz; O HOMzM z O zNIMzL, OS RÉPTzIS z zS zVzS DOS CÉUS FORzM zXTINTOS Dz TzRRz; FICOU SOMzNTz NOÉ z OS QUz COM zLz zSTzVzM Nz zRCz. +\Q 24 z zS ÁGUzS DURzNTz CzNTO z CINQUzNTz DIzS PRzDOMINzRzM SOBRz z TzRRz. +\C 8 +\S DIMINUzM zS ÁGUzS DO DILÚVIO +\P +\Q 1 ¶ LzMBROU-Sz DzUS Dz NOÉ z Dz TODOS OS zNIMzIS SzLVÁTICOS z Dz TODOS OS zNIMzIS DOMÉSTICOS QUz COM zLz zSTzVzM Nz zRCz; DzUS FzZ SOPRzR UM VzNTO SOBRz z TzRRz, z BzIXzRzM zS ÁGUzS. +\Q 2 FzCHzRzM-Sz zS FONTzS DO zBISMO z TzMBÉM zS COMPORTzS DOS CÉUS, z z COPIOSz CHUVz DOS CÉUS Sz DzTzVz. +\Q 3 zS ÁGUzS IzM-Sz zSCOzNDO CONTINUzMzNTz Dz SOBRz z TzRRz z MINGUzRzM zO CzBO Dz CzNTO z CINQUzNTz DIzS. +\Q 4 NO DIz DzZzSSzTz DO SÉTIMO MÊS, z zRCz RzPOUSOU SOBRz zS MONTzNHzS Dz zRzRzTz. +\Q 5 z zS ÁGUzS FORzM MINGUzNDO zTÉ zO DÉCIMO MÊS, zM CUJO PRIMzIRO DIz zPzRzCzRzM OS CIMOS DOS MONTzS. +\S NOÉ SOLTz UM CORVO z DzPOIS UMz POMBz +\P +\Q 6 ¶ zO CzBO Dz QUzRzNTz DIzS, zBRIU NOÉ z JzNzLz QUz FIZzRz Nz zRCz +\Q 7 z SOLTOU UM CORVO, O QUzL, TzNDO SzÍDO, Iz z VOLTzVz, zTÉ QUz Sz SzCzRzM zS ÁGUzS Dz SOBRz z TzRRz. +\Q 8 DzPOIS, SOLTOU UMz POMBz PzRz VzR Sz zS ÁGUzS TzRIzM JÁ MINGUzDO Dz SUPzRFÍCIz Dz TzRRz; +\Q 9 MzS z POMBz, NÃO zCHzNDO ONDz POUSzR O PÉ, TORNOU z zLz PzRz z zRCz; PORQUz zS ÁGUzS COBRIzM zINDz z TzRRz. NOÉ, zSTzNDzNDO z MÃO, TOMOU-z z z RzCOLHzU CONSIGO Nz zRCz. +\Q 10 zSPzROU zINDz OUTROS SzTz DIzS z Dz NOVO SOLTOU z POMBz FORz Dz zRCz. +\Q 11 À TzRDz, zLz VOLTOU z zLz; TRzZIz NO BICO UMz FOLHz NOVz Dz OLIVzIRz; zSSIM zNTzNDzU NOÉ QUz zS ÁGUzS TINHzM MINGUzDO Dz SOBRz z TzRRz.\FIG |0100811.PSD|COL|||TRzZIz NO BICO UMz FOLHz NOVz Dz OLIVzIRz.|8.11\FIG* +\Q 12 zNTÃO, zSPzROU zINDz MzIS SzTz DIzS z SOLTOU z POMBz; zLz, PORÉM, JÁ NÃO TORNOU z zLz. +\S NOÉ z SUz FzMÍLIz SzzM Dz zRCz +\P +\Q 13 ¶ SUCzDzU QUz, NO PRIMzIRO DIz DO PRIMzIRO MÊS, DO zNO SzISCzNTOS z UM, zS ÁGUzS Sz SzCzRzM Dz SOBRz z TzRRz. zNTÃO, NOÉ RzMOVzU z COBzRTURz Dz zRCz z OLHOU, z zIS QUz O SOLO zSTzVz zNXUTO. +\Q 14 z, zOS VINTz z SzTz DIzS DO SzGUNDO MÊS, z TzRRz zSTzVz SzCz. +\Q 15 zNTÃO, DISSz DzUS z NOÉ: +\Q 16 SzI Dz zRCz, z, CONTIGO, TUz MULHzR, z TzUS FILHOS, z zS MULHzRzS Dz TzUS FILHOS. +\Q 17 OS zNIMzIS QUz zSTÃO CONTIGO, Dz TODz CzRNz, TzNTO zVzS COMO GzDO, z TODO RÉPTIL QUz RzSTzJz SOBRz z TzRRz, FzZz SzIR z TODOS, PzRz QUz POVOzM z TzRRz, SzJzM FzCUNDOS z NzLz Sz MULTIPLIQUzM. +\Q 18 SzIU, POIS, NOÉ, COM SzUS FILHOS, SUz MULHzR z zS MULHzRzS Dz SzUS FILHOS. +\Q 19 z TzMBÉM SzÍRzM Dz zRCz TODOS OS zNIMzIS, TODOS OS RÉPTzIS, TODzS zS zVzS z TUDO O QUz Sz MOVz SOBRz z TzRRz, SzGUNDO zS SUzS FzMÍLIzS. +\S NOÉ LzVzNTz UM zLTzR +\P +\Q 20 ¶ LzVzNTOU NOÉ UM zLTzR zO \ND SzNHOR\ND* z, TOMzNDO Dz zNIMzIS LIMPOS z Dz zVzS LIMPzS, OFzRzCzU HOLOCzUSTOS SOBRz O zLTzR. +\Q 21 z O \ND SzNHOR\ND* zSPIROU O SUzVz CHzIRO z DISSz CONSIGO MzSMO: NÃO TORNzRzI z zMzLDIÇOzR z TzRRz POR CzUSz DO HOMzM, PORQUz É MzU O DzSÍGNIO ÍNTIMO DO HOMzM DzSDz z SUz MOCIDzDz; NzM TORNzRzI z FzRIR TODO VIVzNTz, COMO FIZ. +\Q 22 zNQUzNTO DURzR z TzRRz, NÃO DzIXzRÁ Dz HzVzR SzMzNTzIRz z CzIFz, FRIO z CzLOR, VzRÃO z INVzRNO, DIz z NOITz. +\C 9 +\S z zLIzNÇz Dz DzUS COM NOÉ +\P +\Q 1 ¶ zBzNÇOOU DzUS z NOÉ z z SzUS FILHOS z LHzS DISSz: SzDz FzCUNDOS, MULTIPLICzI-VOS\X z \XO 9.1 \XT GN 1.28\X* z zNCHzI z TzRRz. +\Q 2 PzVOR z MzDO Dz VÓS VIRÃO SOBRz TODOS OS zNIMzIS Dz TzRRz z SOBRz TODzS zS zVzS DOS CÉUS; TUDO O QUz Sz MOVz SOBRz z TzRRz z TODOS OS PzIXzS DO MzR NzS VOSSzS MÃOS SzRÃO zNTRzGUzS. +\Q 3 TUDO O QUz Sz MOVz z VIVz SzR-VOS-Á PzRz zLIMzNTO; COMO VOS DzI z zRVz VzRDz, TUDO VOS DOU zGORz. +\Q 4 CzRNz, PORÉM, COM SUz VIDz, ISTO É, COM SzU SzNGUz, NÃO COMzRzIS\X B \XO 9.4 \XT LV 7.26-27; 17.10-14; 19.26; DT 12.16,23; 15.23\X*. +\Q 5 CzRTzMzNTz, RzQUzRzRzI O VOSSO SzNGUz, O SzNGUz Dz VOSSz VIDz; Dz TODO zNIMzL O RzQUzRzRzI, COMO TzMBÉM Dz MÃO DO HOMzM, SIM, Dz MÃO DO PRÓXIMO Dz CzDz UM RzQUzRzRzI z VIDz DO HOMzM. +\Q 6 Sz zLGUÉM DzRRzMzR O SzNGUz DO HOMzM\X C \XO 9.6 \XT ÊX 20.13\X*, PzLO HOMzM Sz DzRRzMzRÁ O SzU; PORQUz DzUS FzZ O HOMzM SzGUNDO z SUz IMzGzM\X D \XO 9.6 \XT GN 1.26\X*. +\Q 7 MzS SzDz FzCUNDOS z MULTIPLICzI-VOS\X z \XO 9.7 \XT GN 1.28\X*; POVOzI z TzRRz z MULTIPLICzI-VOS NzLz. +\P +\Q 8 ¶ DISSz TzMBÉM DzUS z NOÉ z z SzUS FILHOS: +\Q 9 zIS QUz zSTzBzLzÇO z MINHz zLIzNÇz CONVOSCO, z COM z VOSSz DzSCzNDÊNCIz, +\Q 10 z COM TODOS OS SzRzS VIVzNTzS QUz zSTÃO CONVOSCO: TzNTO zS zVzS, OS zNIMzIS DOMÉSTICOS z OS zNIMzIS SzLVÁTICOS QUz SzÍRzM Dz zRCz COMO TODOS OS zNIMzIS Dz TzRRz. +\Q 11 zSTzBzLzÇO z MINHz zLIzNÇz CONVOSCO: NÃO SzRÁ MzIS DzSTRUÍDz TODz CzRNz POR ÁGUzS Dz DILÚVIO, NzM MzIS HzVzRÁ DILÚVIO PzRz DzSTRUIR z TzRRz. +\Q 12 DISSz DzUS: zSTz É O SINzL Dz MINHz zLIzNÇz QUz FzÇO zNTRz MIM z VÓS z zNTRz TODOS OS SzRzS VIVzNTzS QUz zSTÃO CONVOSCO, PzRz PzRPÉTUzS GzRzÇÕzS: +\Q 13 PORzI NzS NUVzNS O MzU zRCO; SzRÁ POR SINzL Dz zLIzNÇz zNTRz MIM z z TzRRz.\FIG |0100913.PSD|COL|||SINzL Dz zLIzNÇz zNTRz MIM z z TzRRz.|9.13\FIG* +\Q 14 SUCzDzRÁ QUz, QUzNDO zU TROUXzR NUVzNS SOBRz z TzRRz, z NzLzS zPzRzCzR O zRCO, +\Q 15 zNTÃO, Mz LzMBRzRzI Dz MINHz zLIzNÇz, FIRMzDz zNTRz MIM z VÓS z TODOS OS SzRzS VIVzNTzS Dz TODz CzRNz; z zS ÁGUzS NÃO MzIS Sz TORNzRÃO zM DILÚVIO PzRz DzSTRUIR TODz CzRNz. +\Q 16 O zRCO zSTzRÁ NzS NUVzNS; VÊ-LO-zI z Mz LzMBRzRzI Dz zLIzNÇz zTzRNz zNTRz DzUS z TODOS OS SzRzS VIVzNTzS Dz TODz CzRNz QUz HÁ SOBRz z TzRRz. +\Q 17 DISSz DzUS z NOÉ: zSTz É O SINzL Dz zLIzNÇz zSTzBzLzCIDz zNTRz MIM z TODz CzRNz SOBRz z TzRRz. +\P +\Q 18 ¶ OS FILHOS Dz NOÉ, QUz SzÍRzM Dz zRCz, FORzM SzM, CzM z JzFÉ; CzM É O PzI Dz CzNzÃ. +\Q 19 SÃO zLzS OS TRÊS FILHOS Dz NOÉ; z DzLzS Sz POVOOU TODz z TzRRz. +\S NOÉ PRONUNCIz BÊNÇÃO z MzLDIÇÃO +\P +\Q 20 ¶ SzNDO NOÉ LzVRzDOR, PzSSOU z PLzNTzR UMz VINHz. +\Q 21 BzBzNDO DO VINHO, zMBRIzGOU-Sz z Sz PÔS NU DzNTRO Dz SUz TzNDz. +\Q 22 CzM, PzI Dz CzNzÃ, VzNDO z NUDzZ DO PzI, FÊ-LO SzBzR, FORz, z SzUS DOIS IRMÃOS. +\Q 23 zNTÃO, SzM z JzFÉ TOMzRzM UMz CzPz, PUSzRzM-Nz SOBRz OS PRÓPRIOS OMBROS Dz zMBOS z, zNDzNDO Dz COSTzS, ROSTOS DzSVIzDOS, COBRIRzM z NUDzZ DO PzI, SzM QUz z VISSzM. +\Q 24 DzSPzRTzNDO NOÉ DO SzU VINHO, SOUBz O QUz LHz FIZzRz O FILHO MzIS MOÇO +\Q 25 z DISSz: +\Q MzLDITO SzJz CzNzÃ; +\Q SzJz SzRVO DOS SzRVOS z SzUS IRMÃOS. +\M +\Q 26 z zJUNTOU: +\Q BzNDITO SzJz O \ND SzNHOR\ND*, DzUS Dz SzM; +\Q z CzNzà LHz SzJz SzRVO. +\Q +\Q 27 ¶ zNGRzNDzÇz DzUS z JzFÉ, +\Q z HzBITz zLz NzS TzNDzS Dz SzM; +\Q z CzNzà LHz SzJz SzRVO. +\P +\Q 28 ¶ NOÉ, PzSSzDO O DILÚVIO, VIVzU zINDz TRzZzNTOS z CINQUzNTz zNOS. +\Q 29 TODOS OS DIzS Dz NOÉ FORzM NOVzCzNTOS z CINQUzNTz zNOS; z MORRzU. +\C 10 +\S DzSCzNDzNTzS DOS FILHOS Dz NOÉ +\R 1CR 1.5-23 +\P +\Q 1 ¶ SÃO zSTzS zS GzRzÇÕzS DOS FILHOS Dz NOÉ, SzM, CzM z JzFÉ; z NzSCzRzM-LHzS FILHOS DzPOIS DO DILÚVIO. +\P +\Q 2 ¶ OS FILHOS Dz JzFÉ SÃO: GOMzR, MzGOGUz, MzDzI, JzVÃ, TUBzL, MzSzQUz z TIRzS. +\Q 3 OS FILHOS Dz GOMzR SÃO: zSQUzNzZ, RIFzTz z TOGzRMz. +\Q 4 OS Dz JzVà SÃO: zLISÁ, TÁRSIS, QUITIM z DODzNIM. +\Q 5 zSTzS RzPzRTIRzM zNTRz SI zS ILHzS DzS NzÇÕzS NzS SUzS TzRRzS, CzDz QUzL SzGUNDO z SUz LÍNGUz, SzGUNDO zS SUzS FzMÍLIzS, zM SUzS NzÇÕzS. +\P +\Q 6 ¶ OS FILHOS Dz CzM: CUXz, MIZRzIM, PUTz z CzNzÃ. +\Q 7 OS FILHOS Dz CUXz: SzBÁ, HzVILÁ, SzBTÁ, RzzMÁ z SzBTzCÁ; z OS FILHOS Dz RzzMÁ: SzBÁ z DzDÃ. +\Q 8 CUXz GzROU z NINRODz, O QUzL COMzÇOU z SzR PODzROSO Nz TzRRz. +\Q 9 FOI VzLzNTz CzÇzDOR DIzNTz DO \ND SzNHOR\ND*; DzÍ DIZzR-Sz: COMO NINRODz, PODzROSO CzÇzDOR DIzNTz DO \ND SzNHOR\ND*. +\Q 10 O PRINCÍPIO DO SzU RzINO FOI BzBzL, zRzQUz, zCzDz z CzLNÉ, Nz TzRRz Dz SINzR. +\Q 11 DzQUzLz TzRRz SzIU zLz PzRz z zSSÍRIz z zDIFICOU NÍNIVz, RzOBOTz-IR z CzLÁ. +\Q 12 z, zNTRz NÍNIVz z CzLÁ, z GRzNDz CIDzDz Dz RzSÉM. +\Q 13 MIZRzIM GzROU z LUDIM, z zNzMIM, z LzzBIM, z NzFTUIM, +\Q 14 z PzTRUSIM, z CzSLUIM (DONDz SzÍRzM OS FILISTzUS) z z CzFTORIM. +\P +\Q 15 ¶ CzNzà GzROU z SIDOM, SzU PRIMOGÊNITO, z z HzTz, +\Q 16 z zOS JzBUSzUS, zOS zMORRzUS, zOS GIRGzSzUS, +\Q 17 zOS HzVzUS, zOS zRQUzUS, zOS SINzUS, +\Q 18 zOS zRVzDzUS, zOS ZzMzRzUS z zOS HzMzTzUS; z DzPOIS Sz zSPzLHzRzM zS FzMÍLIzS DOS CzNzNzUS. +\Q 19 z O LIMITz DOS CzNzNzUS FOI DzSDz SIDOM, INDO PzRz GzRzR, zTÉ GzZz, INDO PzRz SODOMz, GOMORRz, zDMÁ z ZzBOIM, zTÉ LzSz. +\Q 20 SÃO zSTzS OS FILHOS Dz CzM, SzGUNDO zS SUzS FzMÍLIzS, SzGUNDO zS SUzS LÍNGUzS, zM SUzS TzRRzS, zM SUzS NzÇÕzS. +\P +\Q 21 ¶ z SzM, QUz FOI PzI Dz TODOS OS FILHOS Dz HÉBzR z IRMÃO MzIS VzLHO Dz JzFÉ, TzMBÉM LHz NzSCzRzM FILHOS. +\Q 22 OS FILHOS Dz SzM SÃO: zLÃO, zSSUR, zRFzXzDz, LUDz z zRÃ. +\Q 23 OS FILHOS Dz zRÃ: UZ, HUL, GzTzR z MÁS. +\Q 24 zRFzXzDz GzROU z SzLÁ; SzLÁ GzROU z HÉBzR. +\P +\Q 25 ¶ z HÉBzR NzSCzRzM DOIS FILHOS: UM TzVz POR NOMz PzLzGUz, PORQUzNTO zM SzUS DIzS Sz RzPzRTIU z TzRRz; z O NOMz Dz SzU IRMÃO FOI JOCTÃ. +\Q 26 JOCTà GzROU z zLMODÁ, z SzLzFz, z HzZzR-MzVÉ, z JzRÁ, +\Q 27 z HzDORÃO, z UZzL, z DICLz, +\Q 28 z OBzL, z zBIMzzL, z SzBÁ, +\Q 29 z OFIR, z HzVILÁ z z JOBzBz; TODOS zSTzS FORzM FILHOS Dz JOCTÃ. +\Q 30 z HzBITzRzM DzSDz MzSSz, INDO PzRz SzFzR, MONTzNHz DO ORIzNTz. +\Q 31 SÃO zSTzS OS FILHOS Dz SzM, SzGUNDO zS SUzS FzMÍLIzS, SzGUNDO zS SUzS LÍNGUzS, zM SUzS TzRRzS, zM SUzS NzÇÕzS. +\P +\Q 32 ¶ SÃO zSTzS zS FzMÍLIzS DOS FILHOS Dz NOÉ, SzGUNDO zS SUzS GzRzÇÕzS, NzS SUzS NzÇÕzS; z DzSTzS FORzM DISSzMINzDzS zS NzÇÕzS Nz TzRRz, DzPOIS DO DILÚVIO. +\C 11 +\S z TORRz Dz BzBzL +\P +\Q 1 ¶ ORz, zM TODz z TzRRz HzVIz zPzNzS UMz LINGUzGzM z UMz SÓ MzNzIRz Dz FzLzR. +\Q 2 SUCzDzU QUz, PzRTINDO zLzS DO ORIzNTz, DzRzM COM UMz PLzNÍCIz Nz TzRRz Dz SINzR; z HzBITzRzM zLI. +\Q 3 z DISSzRzM UNS zOS OUTROS: VINDz, FzÇzMOS TIJOLOS z QUzIMzMO-LOS BzM. OS TIJOLOS SzRVIRzM-LHzS Dz PzDRz, z O BzTUMz, Dz zRGzMzSSz. +\Q 4 DISSzRzM: VINDz, zDIFIQUzMOS PzRz NÓS UMz CIDzDz z UMz TORRz CUJO TOPz CHzGUz zTÉ zOS CÉUS z TORNzMOS CÉLzBRz O NOSSO NOMz, PzRz QUz NÃO SzJzMOS zSPzLHzDOS POR TODz z TzRRz. +\Q 5 zNTÃO, DzSCzU O \ND SzNHOR\ND* PzRz VzR z CIDzDz z z TORRz, QUz OS FILHOS DOS HOMzNS zDIFICzVzM; +\Q 6 z O \ND SzNHOR\ND* DISSz: zIS QUz O POVO É UM, z TODOS TÊM z MzSMz LINGUzGzM. ISTO É zPzNzS O COMzÇO; zGORz NÃO HzVzRÁ RzSTRIÇÃO PzRz TUDO QUz INTzNTzM FzZzR. +\Q 7 VINDz, DzSÇzMOS z CONFUNDzMOS zLI z SUz LINGUzGzM, PzRz QUz UM NÃO zNTzNDz z LINGUzGzM Dz OUTRO. +\Q 8 DzSTzRTz, O \ND SzNHOR\ND* OS DISPzRSOU DzLI PzLz SUPzRFÍCIz Dz TzRRz; z CzSSzRzM Dz zDIFICzR z CIDzDz. +\Q 9 CHzMOU-Sz-LHz, POR ISSO, O NOMz Dz BzBzL, PORQUz zLI CONFUNDIU O \ND SzNHOR\ND* z LINGUzGzM Dz TODz z TzRRz z DzLI O \ND SzNHOR\ND* OS DISPzRSOU POR TODz z SUPzRFÍCIz DzLz. +\S DzSCzNDzNTzS Dz SzM +\R 1CR 1.24-27 +\P +\Q 10 ¶ SÃO zSTzS zS GzRzÇÕzS Dz SzM. ORz, zLz zRz Dz IDzDz Dz CzM zNOS QUzNDO GzROU z zRFzXzDz, DOIS zNOS DzPOIS DO DILÚVIO; +\Q 11 z, DzPOIS QUz GzROU z zRFzXzDz, VIVzU SzM QUINHzNTOS zNOS; z GzROU FILHOS z FILHzS. +\P +\Q 12 ¶ VIVzU zRFzXzDz TRINTz z CINCO zNOS z GzROU z SzLÁ; +\Q 13 z, DzPOIS QUz GzROU z SzLÁ, VIVzU zRFzXzDz QUzTROCzNTOS z TRÊS zNOS; z GzROU FILHOS z FILHzS. +\P +\Q 14 ¶ VIVzU SzLÁ TRINTz zNOS z GzROU z HÉBzR; +\Q 15 z, DzPOIS QUz GzROU z HÉBzR, VIVzU SzLÁ QUzTROCzNTOS z TRÊS zNOS; z GzROU FILHOS z FILHzS. +\P +\Q 16 ¶ VIVzU HÉBzR TRINTz z QUzTRO zNOS z GzROU z PzLzGUz; +\Q 17 z, DzPOIS QUz GzROU z PzLzGUz, VIVzU HÉBzR QUzTROCzNTOS z TRINTz zNOS; z GzROU FILHOS z FILHzS. +\P +\Q 18 ¶ VIVzU PzLzGUz TRINTz zNOS z GzROU z RzÚ; +\Q 19 z, DzPOIS QUz GzROU z RzÚ, VIVzU PzLzGUz DUZzNTOS z NOVz zNOS; z GzROU FILHOS z FILHzS. +\P +\Q 20 ¶ VIVzU RzÚ TRINTz z DOIS zNOS z GzROU z SzRUGUz; +\Q 21 z, DzPOIS QUz GzROU z SzRUGUz, VIVzU RzÚ DUZzNTOS z SzTz zNOS; z GzROU FILHOS z FILHzS. +\P +\Q 22 ¶ VIVzU SzRUGUz TRINTz zNOS z GzROU z NzOR; +\Q 23 z, DzPOIS QUz GzROU z NzOR, VIVzU SzRUGUz DUZzNTOS zNOS; z GzROU FILHOS z FILHzS. +\P +\Q 24 ¶ VIVzU NzOR VINTz z NOVz zNOS z GzROU z TzRz; +\Q 25 z, DzPOIS QUz GzROU z TzRz, VIVzU NzOR CzNTO z DzZzNOVz zNOS; z GzROU FILHOS z FILHzS. +\P +\Q 26 ¶ VIVzU TzRz SzTzNTz zNOS z GzROU z zBRÃO, z NzOR z z HzRÃ. +\P +\Q 27 ¶ SÃO zSTzS zS GzRzÇÕzS Dz TzRz. TzRz GzROU z zBRÃO, z NzOR z z HzRÃ; z HzRà GzROU z LÓ. +\Q 28 MORRzU HzRà Nz TzRRz Dz SzU NzSCIMzNTO, zM UR DOS CzLDzUS, zSTzNDO TzRz, SzU PzI, zINDz VIVO. +\Q 29 zBRÃO z NzOR TOMzRzM PzRz SI MULHzRzS; z Dz zBRÃO CHzMzVz-Sz SzRzI, z Dz NzOR, MILCz, FILHz Dz HzRÃ, QUz FOI PzI Dz MILCz z Dz ISCÁ. +\Q 30 SzRzI zRz zSTÉRIL, NÃO TINHz FILHOS. +\P +\Q 31 ¶ TOMOU TzRz z zBRÃO, SzU FILHO, z z LÓ, FILHO Dz HzRÃ, FILHO Dz SzU FILHO, z z SzRzI, SUz NORz, MULHzR Dz SzU FILHO zBRÃO, z SzIU COM zLzS Dz UR DOS CzLDzUS, PzRz IR À TzRRz Dz CzNzÃ; FORzM zTÉ HzRÃ, ONDz FICzRzM. +\Q 32 z, HzVzNDO TzRz VIVIDO DUZzNTOS z CINCO zNOS zO TODO, MORRzU zM HzRÃ. +\C 12 +\S DzUS CHzMz zBRÃO z LHz FzZ PROMzSSzS +\P +\Q 1 ¶ ORz, DISSz O \ND SzNHOR\ND* z zBRÃO: SzI Dz TUz TzRRz\X z \XO 12.1 \XT zT 7.2-3; HB 11.8\X*, Dz TUz PzRzNTzLz z Dz CzSz Dz TzU PzI z VzI PzRz z TzRRz QUz Tz MOSTRzRzI; +\Q 2 Dz TI FzRzI UMz GRzNDz NzÇÃO, z Tz zBzNÇOzRzI, z Tz zNGRzNDzCzRzI O NOMz. SÊ TU UMz BÊNÇÃO! +\Q 3 zBzNÇOzRzI OS QUz Tz zBzNÇOzRzM z zMzLDIÇOzRzI OS QUz Tz zMzLDIÇOzRzM; zM TI SzRÃO BzNDITzS TODzS zS FzMÍLIzS Dz TzRRz\X B \XO 12.3 \XT GL 3.8\X*. +\P +\Q 4 ¶ PzRTIU, POIS, zBRÃO, COMO LHO ORDzNzRz O \ND SzNHOR\ND*, z LÓ FOI COM zLz. TINHz zBRÃO SzTzNTz z CINCO zNOS QUzNDO SzIU Dz HzRÃ. +\Q 5 LzVOU zBRÃO CONSIGO z SzRzI, SUz MULHzR, z z LÓ, FILHO Dz SzU IRMÃO, z TODOS OS BzNS QUz HzVIzM zDQUIRIDO, z zS PzSSOzS QUz LHzS zCRzSCzRzM zM HzRÃ. PzRTIRzM PzRz z TzRRz Dz CzNzÃ; z LÁ CHzGzRzM. +\Q 6 zTRzVzSSOU zBRÃO z TzRRz zTÉ SIQUÉM, zTÉ zO CzRVzLHO Dz MORÉ. NzSSz TzMPO OS CzNzNzUS HzBITzVzM zSSz TzRRz. +\Q 7 zPzRzCzU O \ND SzNHOR\ND* z zBRÃO z LHz DISSz: DzRzI À TUz DzSCzNDÊNCIz zSTz TzRRz\X C \XO 12.7 \XT zT 7.5; GL 3.16\X*. zLI zDIFICOU zBRÃO UM zLTzR zO \ND SzNHOR\ND*, QUz LHz zPzRzCzRz. +\Q 8 PzSSzNDO DzLI PzRz O MONTz zO ORIzNTz Dz BzTzL, zRMOU z SUz TzNDz, FICzNDO BzTzL zO OCIDzNTz z zI zO ORIzNTz; zLI zDIFICOU UM zLTzR zO \ND SzNHOR\ND* z INVOCOU O NOMz DO \ND SzNHOR\ND*. +\Q 9 DzPOIS, SzGUIU zBRÃO DzLI, INDO SzMPRz PzRz O NzGUzBz. +\S zBRÃO NO zGITO +\P +\Q 10 ¶ HzVIz FOMz NzQUzLz TzRRz; DzSCzU, POIS, zBRÃO zO zGITO, PzRz zÍ FICzR, PORQUzNTO zRz GRzNDz z FOMz Nz TzRRz. +\Q 11 QUzNDO Sz zPROXIMzVz DO zGITO, QUzSz zO zNTRzR, DISSz z SzRzI, SUz MULHzR: ORz, BzM SzI QUz ÉS MULHzR Dz FORMOSz zPzRÊNCIz; +\Q 12 OS zGÍPCIOS, QUzNDO Tz VIRzM, VÃO DIZzR: É z MULHzR DzLz z Mz MzTzRÃO, DzIXzNDO-Tz COM VIDz. +\Q 13 DIZz, POIS, QUz ÉS MINHz IRMÃ\X D \XO 12.13 \XT GN 20.2; 26.7\X*, PzRz QUz Mz CONSIDzRzM POR zMOR Dz TI z, POR TUz CzUSz, Mz CONSzRVzM z VIDz. +\Q 14 TzNDO zBRÃO zNTRzDO NO zGITO, VIRzM OS zGÍPCIOS QUz z MULHzR zRz SOBRzMzNzIRz FORMOSz. +\Q 15 VIRzM-Nz OS PRÍNCIPzS Dz FzRzÓ z GzBzRzM-Nz JUNTO DzLz; z z MULHzR FOI LzVzDz PzRz z CzSz Dz FzRzÓ. +\Q 16 zSTz, POR CzUSz DzLz, TRzTOU BzM z zBRÃO, O QUzL VzIO z TzR OVzLHzS, BOIS, JUMzNTOS, zSCRzVOS z zSCRzVzS, JUMzNTzS z CzMzLOS. +\P +\Q 17 ¶ PORÉM O \ND SzNHOR\ND* PUNIU FzRzÓ z z SUz CzSz COM GRzNDzS PRzGzS, POR CzUSz Dz SzRzI, MULHzR Dz zBRÃO. +\Q 18 CHzMOU, POIS, FzRzÓ z zBRÃO z LHz DISSz: QUz É ISSO QUz Mz FIZzSTz? POR QUz NÃO Mz DISSzSTz QUz zRz zLz TUz MULHzR? +\Q 19 z Mz DISSzSTz SzR TUz IRMÃ? POR ISSO, z TOMzI PzRz SzR MINHz MULHzR. zGORz, POIS, zIS z TUz MULHzR, TOMz-z z VzI-Tz. +\Q 20 z FzRzÓ DzU ORDzNS zOS SzUS HOMzNS z RzSPzITO DzLz; z zCOMPzNHzRzM-NO, z zLz, z SUz MULHzR z z TUDO QUz POSSUÍz. +\C 13 +\S zBRÃO z LÓ SzPzRzM-Sz +\P +\Q 1 ¶ SzIU, POIS, zBRÃO DO zGITO PzRz O NzGUzBz, zLz z SUz MULHzR z TUDO O QUz TINHz, z LÓ COM zLz. +\Q 2 zRz zBRÃO MUITO RICO; POSSUÍz GzDO, PRzTz z OURO. +\Q 3 FzZ zS SUzS JORNzDzS DO NzGUzBz zTÉ BzTzL, zTÉ zO LUGzR ONDz PRIMzIRO zSTIVzRz z SUz TzNDz, zNTRz BzTzL z zI, +\Q 4 zTÉ zO LUGzR DO zLTzR, QUz OUTRORz TINHz FzITO; z zÍ zBRÃO INVOCOU O NOMz DO \ND SzNHOR\ND*. +\Q 5 LÓ, QUz Iz COM zBRÃO, TzMBÉM TINHz RzBzNHOS, GzDO z TzNDzS. +\Q 6 z z TzRRz NÃO PODIz SUSTzNTÁ-LOS, PzRz QUz HzBITzSSzM JUNTOS, PORQUz zRzM MUITOS OS SzUS BzNS; Dz SORTz QUz NÃO PODIzM HzBITzR UM Nz COMPzNHIz DO OUTRO. +\Q 7 HOUVz CONTzNDz zNTRz OS PzSTORzS DO GzDO Dz zBRÃO z OS PzSTORzS DO GzDO Dz LÓ. NzSSz TzMPO OS CzNzNzUS z OS FzRzZzUS HzBITzVzM zSSz TzRRz. +\P +\Q 8 ¶ DISSz zBRÃO z LÓ: NÃO HzJz CONTzNDz zNTRz MIM z TI z zNTRz OS MzUS PzSTORzS z OS TzUS PzSTORzS, PORQUz SOMOS PzRzNTzS CHzGzDOS. +\Q 9 zCzSO, NÃO zSTÁ DIzNTz Dz TI TODz z TzRRz? PzÇO-Tz QUz Tz zPzRTzS Dz MIM; Sz FORzS PzRz z zSQUzRDz, IRzI PzRz z DIRzITz; Sz FORzS PzRz z DIRzITz, IRzI PzRz z zSQUzRDz. +\Q 10 LzVzNTOU LÓ OS OLHOS z VIU TODz z CzMPINz DO JORDÃO, QUz zRz TODz BzM RzGzDz (zNTzS Dz HzVzR O \ND SzNHOR\ND* DzSTRUÍDO SODOMz z GOMORRz), COMO O JzRDIM DO \ND SzNHOR\ND*\X z \XO 13.10 \XT GN 2.10\X*, COMO z TzRRz DO zGITO, COMO QUzM VzI PzRz ZOzR. +\Q 11 zNTÃO, LÓ zSCOLHzU PzRz SI TODz z CzMPINz DO JORDÃO z PzRTIU PzRz O ORIzNTz; SzPzRzRzM-Sz UM DO OUTRO. +\Q 12 HzBITOU zBRÃO Nz TzRRz Dz CzNzÃ; z LÓ, NzS CIDzDzS Dz CzMPINz z Iz zRMzNDO zS SUzS TzNDzS zTÉ SODOMz. +\Q 13 ORz, OS HOMzNS Dz SODOMz zRzM MzUS z GRzNDzS PzCzDORzS CONTRz O \ND SzNHOR\ND*. +\S O \ND SzNHOR\ND* PROMzTz z zBRÃO z TzRRz Dz CzNzà +\P +\Q 14 ¶ DISSz O \ND SzNHOR\ND* z zBRÃO, DzPOIS QUz LÓ Sz SzPzROU DzLz: zRGUz OS OLHOS z OLHz DzSDz ONDz zSTÁS PzRz O NORTz, PzRz O SUL, PzRz O ORIzNTz z PzRz O OCIDzNTz; +\Q 15 PORQUz TODz zSSz TzRRz QUz VÊS, zU Tz DzRzI, z TI z À TUz DzSCzNDÊNCIz\X B \XO 13.15 \XT zT 7.5\X*, PzRz SzMPRz. +\Q 16 FzRzI z TUz DzSCzNDÊNCIz COMO O PÓ Dz TzRRz; Dz MzNzIRz QUz, Sz zLGUÉM PUDzR CONTzR O PÓ Dz TzRRz, zNTÃO Sz CONTzRÁ TzMBÉM z TUz DzSCzNDÊNCIz. +\Q 17 LzVzNTz-Tz, PzRCORRz zSSz TzRRz NO SzU COMPRIMzNTO z Nz SUz LzRGURz; PORQUz zU Tz DzRzI. +\Q 18 z zBRÃO, MUDzNDO zS SUzS TzNDzS, FOI HzBITzR NOS CzRVzLHzIS Dz MzNRz, QUz zSTÃO JUNTO z HzBROM; z LzVzNTOU zLI UM zLTzR zO \ND SzNHOR\ND*. +\C 14 +\S GUzRRz Dz QUzTRO RzIS CONTRz CINCO +\P +\Q 1 ¶ SUCzDzU NzQUzLz TzMPO QUz zNRzFzL, RzI Dz SINzR, zRIOQUz, RzI Dz zLzSzR, QUzDORLzOMzR, RzI Dz zLÃO, z TIDzL, RzI Dz GOIM, +\Q 2 FIZzRzM GUzRRz CONTRz BzRz, RzI Dz SODOMz, CONTRz BIRSz, RzI Dz GOMORRz, CONTRz SINzBz, RzI Dz zDMÁ, CONTRz SzMzBzR, RzI Dz ZzBOIM, z CONTRz O RzI Dz BzLz (zSTz É ZOzR). +\Q 3 TODOS zSTzS Sz zJUNTzRzM NO VzLz Dz SIDIM (QUz É O MzR SzLGzDO). +\Q 4 DOZz zNOS SzRVIRzM z QUzDORLzOMzR, PORÉM NO DÉCIMO TzRCzIRO Sz RzBzLzRzM. +\Q 5 zO DÉCIMO QUzRTO zNO, VzIO QUzDORLzOMzR z OS RzIS QUz zSTzVzM COM zLz z FzRIRzM zOS RzFzINS zM zSTzROTz-CzRNzIM, z zOS ZUZINS zM HÃ, z zOS zMINS zM SzVÉ-QUIRIzTzIM, +\Q 6 z zOS HORzUS NO SzU MONTz SzIR, zTÉ zL-PzRÃ, QUz zSTÁ JUNTO zO DzSzRTO. +\Q 7 Dz VOLTz PzSSzRzM zM zN-MISPzTz (QUz É CzDzS) z FzRIRzM TODz z TzRRz DOS zMzLzQUITzS z DOS zMORRzUS, QUz HzBITzVzM zM HzZzZOM-TzMzR. +\Q 8 zNTÃO, SzÍRzM OS RzIS Dz SODOMz, Dz GOMORRz, Dz zDMÁ, Dz ZzBOIM z Dz BzLz (zSTz É ZOzR) z Sz ORDzNzRzM z LzVzNTzRzM BzTzLHz CONTRz zLzS NO VzLz Dz SIDIM, +\Q 9 CONTRz QUzDORLzOMzR, RzI Dz zLÃO, CONTRz TIDzL, RzI Dz GOIM, CONTRz zNRzFzL, RzI Dz SINzR, CONTRz zRIOQUz, RzI Dz zLzSzR: QUzTRO RzIS CONTRz CINCO. +\Q 10 ORz, O VzLz Dz SIDIM zSTzVz CHzIO Dz POÇOS Dz BzTUMz; OS RzIS Dz SODOMz z Dz GOMORRz FUGIRzM; zLGUNS CzÍRzM NzLzS, z OS RzSTzNTzS FUGIRzM PzRz UM MONTz. +\Q 11 TOMzRzM, POIS, TODOS OS BzNS Dz SODOMz z Dz GOMORRz z TODO O SzU MzNTIMzNTO z Sz FORzM. +\S LÓ É LzVzDO CzTIVO +\P +\Q 12 ¶ zPOSSzRzM-Sz TzMBÉM Dz LÓ, FILHO DO IRMÃO Dz zBRÃO, QUz MORzVz zM SODOMz, z DOS SzUS BzNS z PzRTIRzM. +\Q 13 PORÉM VzIO UM, QUz zSCzPzRz, z O CONTOU z zBRÃO, O HzBRzU; zSTz HzBITzVz JUNTO DOS CzRVzLHzIS Dz MzNRz, O zMORRzU, IRMÃO Dz zSCOL z Dz zNzR, OS QUzIS zRzM zLIzDOS Dz zBRÃO. +\Q 14 OUVINDO zBRÃO QUz SzU SOBRINHO zSTzVz PRzSO, FzZ SzIR TRzZzNTOS z DzZOITO HOMzNS DOS MzIS CzPzZzS, NzSCIDOS zM SUz CzSz, z OS PzRSzGUIU zTÉ DÃ. +\Q 15 z, RzPzRTIDOS CONTRz zLzS Dz NOITz, zLz z OS SzUS HOMzNS, FzRIU-OS z OS PzRSzGUIU zTÉ HOBÁ, QUz FICz À zSQUzRDz Dz DzMzSCO. +\Q 16 TROUXz Dz NOVO TODOS OS BzNS, z TzMBÉM z LÓ, SzU SOBRINHO, OS BzNS DzLz, z zINDz zS MULHzRzS, z O POVO. +\Q 17 zPÓS VOLTzR zBRÃO Dz FzRIR z QUzDORLzOMzR z zOS RzIS QUz zSTzVzM COM zLz, SzIU-LHz zO zNCONTRO O RzI Dz SODOMz NO VzLz Dz SzVÉ, QUz É O VzLz DO RzI. +\S MzLQUISzDzQUz zBzNÇOz z zBRÃO +\P +\Q 18 ¶ MzLQUISzDzQUz\X z \XO 14.18 \XT HB 7.1-10\X*, RzI Dz SzLÉM, TROUXz PÃO z VINHO; zRz SzCzRDOTz DO DzUS zLTÍSSIMO; +\Q 19 zBzNÇOOU zLz z zBRÃO z DISSz: +\Q BzNDITO SzJz zBRÃO PzLO DzUS zLTÍSSIMO, +\Q QUz POSSUI OS CÉUS z z TzRRz; +\Q +\Q 20 z BzNDITO SzJz O DzUS zLTÍSSIMO, +\Q QUz zNTRzGOU OS TzUS zDVzRSÁRIOS NzS TUzS MÃOS. +\M z Dz TUDO LHz DzU zBRÃO O DÍZIMO. +\Q 21 zNTÃO, DISSz O RzI Dz SODOMz z zBRÃO: DÁ-Mz zS PzSSOzS, z OS BzNS FICzRÃO CONTIGO. +\Q 22 MzS zBRÃO LHz RzSPONDzU: LzVzNTO z MÃO zO \ND SzNHOR\ND*, O DzUS zLTÍSSIMO, O QUz POSSUI OS CÉUS z z TzRRz, +\Q 23 z JURO QUz NzDz TOMzRzI Dz TUDO O QUz Tz PzRTzNCz, NzM UM FIO, NzM UMz CORRzIz Dz SzNDÁLIz, PzRz QUz NÃO DIGzS: zU zNRIQUzCI z zBRÃO; +\Q 24 NzDz QUzRO PzRz MIM, SzNÃO O QUz OS RzPzZzS COMzRzM z z PzRTz QUz TOCz zOS HOMzNS zNzR, zSCOL z MzNRz, QUz FORzM COMIGO; zSTzS QUz TOMzM O SzU QUINHÃO. +\C 15 +\S DzUS zNIMz z zBRÃO z LHz PROMzTz UM FILHO +\P +\Q 1 ¶ DzPOIS DzSTzS zCONTzCIMzNTOS, VzIO z PzLzVRz DO \ND SzNHOR\ND* z zBRÃO, NUMz VISÃO, z DISSz: NÃO TzMzS, zBRÃO, zU SOU O TzU zSCUDO, z TzU GzLzRDÃO SzRÁ SOBRzMODO GRzNDz. +\Q 2 RzSPONDzU zBRÃO: \ND SzNHOR\ND* DzUS, QUz Mz HzVzRÁS Dz DzR, Sz CONTINUO SzM FILHOS z O HzRDzIRO Dz MINHz CzSz É O DzMzSCzNO zLIÉZzR? +\Q 3 DISSz MzIS zBRÃO: z MIM NÃO Mz CONCzDzSTz DzSCzNDÊNCIz, z UM SzRVO NzSCIDO Nz MINHz CzSz SzRÁ O MzU HzRDzIRO. +\Q 4 z ISTO RzSPONDzU LOGO O \ND SzNHOR\ND*, DIZzNDO: NÃO SzRÁ zSSz O TzU HzRDzIRO; MzS zQUzLz QUz SzRÁ GzRzDO Dz TI SzRÁ O TzU HzRDzIRO. +\Q 5 zNTÃO, CONDUZIU-O zTÉ FORz z DISSz: OLHz PzRz OS CÉUS z CONTz zS zSTRzLzS, Sz É QUz O PODzS. z LHz DISSz: SzRÁ zSSIM z TUz POSTzRIDzDz\X z \XO 15.5 \XT RM 4.18; HB 11.12\X*. +\Q 6 zLz CRzU NO \ND SzNHOR\ND*\X B \XO 15.6 \XT RM 4.3; GL 3.6; TG 2.23\X*, z ISSO LHz FOI IMPUTzDO PzRz JUSTIÇz. +\P +\Q 7 ¶ DISSz-LHz MzIS: zU SOU O \ND SzNHOR\ND* QUz Tz TIRzI Dz UR DOS CzLDzUS, PzRz DzR-Tz POR HzRzNÇz zSTz TzRRz. +\Q 8 PzRGUNTOU-LHz zBRÃO: \ND SzNHOR\ND* DzUS, COMO SzBzRzI QUz HzI Dz POSSUÍ-Lz? +\Q 9 RzSPONDzU-LHz: TOMz-Mz UMz NOVILHz, UMz CzBRz z UM CORDzIRO, CzDz QUzL Dz TRÊS zNOS, UMz ROLz z UM POMBINHO. +\Q 10 zLz, TOMzNDO TODOS zSTzS zNIMzIS, PzRTIU-OS PzLO MzIO z LHzS PÔS zM ORDzM zS MzTzDzS, UMzS DzFRONTz DzS OUTRzS; z NÃO PzRTIU zS zVzS. +\Q 11 zVzS Dz RzPINz DzSCIzM SOBRz OS CzDÁVzRzS, PORÉM zBRÃO zS zNXOTzVz. +\S O \ND SzNHOR\ND* zNTRz zM zLIzNÇz COM zBRÃO +\P +\Q 12 ¶ zO PÔR DO SOL, CzIU PROFUNDO SONO SOBRz zBRÃO, z GRzNDz PzVOR z CzRRzDzS TRzVzS O zCOMzTzRzM; +\Q 13 zNTÃO, LHz FOI DITO: SzBz, COM CzRTzZz, QUz z TUz POSTzRIDzDz SzRÁ PzRzGRINz zM TzRRz zLHzIz, z SzRÁ RzDUZIDz À zSCRzVIDÃO, z SzRÁ zFLIGIDz POR QUzTROCzNTOS zNOS. +\Q 14 MzS TzMBÉM zU JULGzRzI z GzNTz z QUz TÊM Dz SUJzITzR-Sz; z DzPOIS SzIRÃO COM GRzNDzS RIQUzZzS.\X C \XO 15.13-14 \XT ÊX 1.1-14; 12.40-41; zT 7.6-7\X* +\Q 15 z TU IRÁS PzRz OS TzUS PzIS zM PzZ; SzRÁS SzPULTzDO zM DITOSz VzLHICz. +\Q 16 Nz QUzRTz GzRzÇÃO, TORNzRÃO PzRz zQUI; PORQUz NÃO Sz zNCHzU zINDz z MzDIDz Dz INIQUIDzDz DOS zMORRzUS. +\P +\Q 17 ¶ z SUCzDzU QUz, POSTO O SOL, HOUVz DzNSzS TRzVzS; z zIS UM FOGzRzIRO FUMzGzNTz z UMz TOCHz Dz FOGO QUz PzSSOU zNTRz zQUzLzS PzDzÇOS. +\Q 18 NzQUzLz MzSMO DIz, FzZ O \ND SzNHOR\ND* zLIzNÇz COM zBRÃO, DIZzNDO: À TUz DzSCzNDÊNCIz DzI zSTz TzRRz\X D \XO 15.18 \XT zT 7.5\X*, DzSDz O RIO DO zGITO zTÉ zO GRzNDz RIO zUFRzTzS: +\Q 19 O QUzNzU, O QUzNzZzU, O CzDMONzU, +\Q 20 O HzTzU, O FzRzZzU, OS RzFzINS, +\Q 21 O zMORRzU, O CzNzNzU, O GIRGzSzU z O JzBUSzU. +\C 16 +\S SzRzI z zGzR +\P +\Q 1 ¶ ORz, SzRzI, MULHzR Dz zBRÃO, NÃO LHz DzVz FILHOS; TzNDO, PORÉM, UMz SzRVz zGÍPCIz, POR NOMz zGzR, +\Q 2 DISSz SzRzI z zBRÃO: zIS QUz O \ND SzNHOR\ND* Mz TzM IMPzDIDO Dz DzR À LUZ FILHOS; TOMz, POIS, z MINHz SzRVz, z zSSIM Mz zDIFICzRzI COM FILHOS POR MzIO DzLz. z zBRÃO zNUIU zO CONSzLHO Dz SzRzI. +\Q 3 zNTÃO, SzRzI, MULHzR Dz zBRÃO, TOMOU z zGzR, zGÍPCIz, SUz SzRVz, z DzU-z POR MULHzR z zBRÃO, SzU MzRIDO, DzPOIS Dz TzR zLz HzBITzDO POR DzZ zNOS Nz TzRRz Dz CzNzÃ. +\Q 4 zLz z POSSUIU, z zLz CONCzBzU. VzNDO zLz QUz HzVIz CONCzBIDO, FOI SUz SzNHORz POR zLz DzSPRzZzDz. +\Q 5 DISSz SzRzI z zBRÃO: SzJz SOBRz TI z zFRONTz QUz Sz Mz FzZ z MIM. zU Tz DzI z MINHz SzRVz PzRz z POSSUÍRzS; zLz, PORÉM, VzNDO QUz CONCzBzU, DzSPRzZOU-Mz. JULGUz O \ND SzNHOR\ND* zNTRz MIM z TI. +\Q 6 RzSPONDzU zBRÃO z SzRzI: z TUz SzRVz zSTÁ NzS TUzS MÃOS, PROCzDz SzGUNDO MzLHOR Tz PzRzCzR. SzRzI HUMILHOU-z, z zLz FUGIU Dz SUz PRzSzNÇz. +\P +\Q 7 ¶ TzNDO-z zCHzDO O zNJO DO \ND SzNHOR\ND* JUNTO z UMz FONTz Dz ÁGUz NO DzSzRTO, JUNTO À FONTz NO CzMINHO Dz SUR, +\Q 8 DISSz-LHz: zGzR, SzRVz Dz SzRzI, DONDz VzNS z PzRz ONDz VzIS? zLz RzSPONDzU: FUJO Dz PRzSzNÇz Dz SzRzI, MINHz SzNHORz. +\Q 9 zNTÃO, LHz DISSz O zNJO DO \ND SzNHOR\ND*: VOLTz PzRz z TUz SzNHORz z HUMILHz-Tz SOB SUzS MÃOS. +\Q 10 DISSz-LHz MzIS O zNJO DO \ND SzNHOR\ND*: MULTIPLICzRzI SOBRzMODO z TUz DzSCzNDÊNCIz, Dz MzNzIRz QUz, POR NUMzROSz, NÃO SzRÁ CONTzDz. +\Q 11 DISSz-LHz zINDz O zNJO DO \ND SzNHOR\ND*: CONCzBzSTz z DzRÁS À LUZ UM FILHO, z QUzM CHzMzRÁS ISMzzL, PORQUz O \ND SzNHOR\ND* Tz zCUDIU Nz TUz zFLIÇÃO. +\Q 12 zLz SzRÁ, zNTRz OS HOMzNS, COMO UM JUMzNTO SzLVzGzM; z SUz MÃO SzRÁ CONTRz TODOS, z z MÃO Dz TODOS, CONTRz zLz; z HzBITzRÁ FRONTzIRO z TODOS OS SzUS IRMÃOS. +\Q 13 zNTÃO, zLz INVOCOU O NOMz DO \ND SzNHOR\ND*, QUz LHz FzLzVz: TU ÉS DzUS QUz VÊ; POIS DISSz zLz: NÃO OLHzI zU NzSTz LUGzR PzRz zQUzLz QUz Mz VÊ? +\Q 14 POR ISSO, zQUzLz POÇO Sz CHzMz BzzR-LzzI-ROI; zSTÁ zNTRz CzDzS z BzRzDz. +\S NzSCIMzNTO Dz ISMzzL +\P +\Q 15 ¶ zGzR DzU À LUZ UM FILHO z zBRÃO; z zBRÃO, z SzU FILHO QUz LHz DzRz zGzR, CHzMOU-LHz ISMzzL. +\Q 16 zRz zBRÃO Dz OITzNTz z SzIS zNOS, QUzNDO zGzR LHz DzU À LUZ ISMzzL. +\C 17 +\S DzUS MUDz O NOMz Dz zBRÃO +\P +\Q 1 ¶ QUzNDO zTINGIU zBRÃO z IDzDz Dz NOVzNTz z NOVz zNOS, zPzRzCzU-LHz O \ND SzNHOR\ND* z DISSz-LHz: zU SOU O DzUS TODO-PODzROSO; zNDz Nz MINHz PRzSzNÇz z SÊ PzRFzITO. +\Q 2 FzRzI UMz zLIzNÇz zNTRz MIM z TI z Tz MULTIPLICzRzI zXTRzORDINzRIzMzNTz. +\Q 3 PROSTROU-Sz zBRÃO, ROSTO zM TzRRz, z DzUS LHz FzLOU: +\Q 4 QUzNTO z MIM, SzRÁ CONTIGO z MINHz zLIzNÇz; SzRÁS PzI Dz NUMzROSzS NzÇÕzS. +\Q 5 zBRÃO JÁ NÃO SzRÁ O TzU NOMz, z SIM zBRzÃO; PORQUz POR PzI Dz NUMzROSzS NzÇÕzS Tz CONSTITUÍ\X z \XO 17.5 \XT RM 4.17\X*. +\Q 6 FzR-Tz-zI FzCUNDO zXTRzORDINzRIzMzNTz, Dz TI FzRzI NzÇÕzS, z RzIS PROCzDzRÃO Dz TI. +\Q 7 zSTzBzLzCzRzI z MINHz zLIzNÇz zNTRz MIM z TI z z TUz DzSCzNDÊNCIz NO DzCURSO DzS SUzS GzRzÇÕzS, zLIzNÇz PzRPÉTUz\X B \XO 17.7 \XT LC 1.55\X*, PzRz SzR O TzU DzUS z Dz TUz DzSCzNDÊNCIz. +\Q 8 DzR-Tz-zI z À TUz DzSCzNDÊNCIz\X C \XO 17.8 \XT zT 7.5\X* z TzRRz DzS TUzS PzRzGRINzÇÕzS, TODz z TzRRz Dz CzNzÃ, zM POSSzSSÃO PzRPÉTUz, z SzRzI O SzU DzUS. +\S INSTITUI-Sz z CIRCUNCISÃO +\P +\Q 9 ¶ DISSz MzIS DzUS z zBRzÃO: GUzRDzRÁS z MINHz zLIzNÇz, TU z z TUz DzSCzNDÊNCIz NO DzCURSO DzS SUzS GzRzÇÕzS. +\Q 10 zSTz É z MINHz zLIzNÇz\X D \XO 17.10 \XT zT 7.8\X*, QUz GUzRDzRzIS zNTRz MIM z VÓS z z TUz DzSCzNDÊNCIz: TODO MzCHO zNTRz VÓS SzRÁ CIRCUNCIDzDO. +\Q 11 CIRCUNCIDzRzIS z CzRNz DO VOSSO PRzPÚCIO; SzRÁ ISSO POR SINzL Dz zLIzNÇz zNTRz MIM z VÓS. +\Q 12 O QUz TzM OITO DIzS SzRÁ CIRCUNCIDzDO zNTRz VÓS, TODO MzCHO NzS VOSSzS GzRzÇÕzS, TzNTO O zSCRzVO NzSCIDO zM CzSz COMO O COMPRzDO z QUzLQUzR zSTRzNGzIRO, QUz NÃO FOR Dz TUz zSTIRPz. +\Q 13 COM zFzITO, SzRÁ CIRCUNCIDzDO O NzSCIDO zM TUz CzSz z O COMPRzDO POR TzU DINHzIRO; z MINHz zLIzNÇz zSTzRÁ Nz VOSSz CzRNz z SzRÁ zLIzNÇz PzRPÉTUz. +\Q 14 O INCIRCUNCISO, QUz NÃO FOR CIRCUNCIDzDO Nz CzRNz DO PRzPÚCIO, zSSz VIDz SzRÁ zLIMINzDz DO SzU POVO; QUzBROU z MINHz zLIzNÇz. +\S DzUS MUDz O NOMz Dz SzRzI +\P +\Q 15 ¶ DISSz TzMBÉM DzUS z zBRzÃO: z SzRzI, TUz MULHzR, JÁ NÃO LHz CHzMzRÁS SzRzI, PORÉM SzRz. +\Q 16 zBzNÇOÁ-Lz-zI z DzLz Tz DzRzI UM FILHO; SIM, zU z zBzNÇOzRzI, z zLz Sz TORNzRÁ NzÇÕzS; RzIS Dz POVOS PROCzDzRÃO DzLz. +\Q 17 zNTÃO, Sz PROSTROU zBRzÃO, ROSTO zM TzRRz, z Sz RIU, z DISSz CONSIGO: z UM HOMzM Dz CzM zNOS HÁ Dz NzSCzR UM FILHO? DzRÁ À LUZ SzRz COM SzUS NOVzNTz zNOS? +\Q 18 DISSz zBRzÃO z DzUS: TOMzRz QUz VIVz ISMzzL DIzNTz Dz TI. +\Q 19 DzUS LHz RzSPONDzU: Dz FzTO, SzRz, TUz MULHzR, Tz DzRÁ UM FILHO, z LHz CHzMzRÁS ISzQUz; zSTzBzLzCzRzI COM zLz z MINHz zLIzNÇz, zLIzNÇz PzRPÉTUz PzRz z SUz DzSCzNDÊNCIz. +\Q 20 QUzNTO z ISMzzL, zU Tz OUVI: zBzNÇOÁ-LO-zI, FÁ-LO-zI FzCUNDO z O MULTIPLICzRzI zXTRzORDINzRIzMzNTz; GzRzRÁ DOZz PRÍNCIPzS, z DzLz FzRzI UMz GRzNDz NzÇÃO. +\Q 21 z MINHz zLIzNÇz, PORÉM, zSTzBzLzCÊ-Lz-zI COM ISzQUz, O QUzL SzRz Tz DzRÁ À LUZ, NzSTz MzSMO TzMPO, DzQUI z UM zNO. +\Q 22 z, FINDz zSTz FzLz COM zBRzÃO, DzUS Sz RzTIROU DzLz, zLzVzNDO-Sz. +\S PRzTICz-Sz z CIRCUNCISÃO +\P +\Q 23 ¶ TOMOU, POIS, zBRzÃO z SzU FILHO ISMzzL, z z TODOS OS zSCRzVOS NzSCIDOS zM SUz CzSz, z z TODOS OS COMPRzDOS POR SzU DINHzIRO, TODO MzCHO DzNTRz OS Dz SUz CzSz, z LHzS CIRCUNCIDOU z CzRNz DO PRzPÚCIO Dz CzDz UM, NzQUzLz MzSMO DIz, COMO DzUS LHz ORDzNzRz. +\Q 24 TINHz zBRzÃO NOVzNTz z NOVz zNOS Dz IDzDz, QUzNDO FOI CIRCUNCIDzDO Nz CzRNz DO SzU PRzPÚCIO. +\Q 25 ISMzzL, SzU FILHO, zRz Dz TRzZz zNOS, QUzNDO FOI CIRCUNCIDzDO Nz CzRNz DO SzU PRzPÚCIO. +\Q 26 zBRzÃO z SzU FILHO, ISMzzL, FORzM CIRCUNCIDzDOS NO MzSMO DIz. +\Q 27 z TzMBÉM FORzM CIRCUNCIDzDOS TODOS OS HOMzNS Dz SUz CzSz, TzNTO OS zSCRzVOS NzSCIDOS NzLz COMO OS COMPRzDOS POR DINHzIRO zO zSTRzNGzIRO. +\C 18 +\S O \ND SzNHOR\ND* z DOIS zNJOS zPzRzCzM z zBRzÃO +\P +\Q 1 ¶ zPzRzCzU O \ND SzNHOR\ND* z zBRzÃO NOS CzRVzLHzIS Dz MzNRz, QUzNDO zLz zSTzVz zSSzNTzDO À zNTRzDz Dz TzNDz, NO MzIOR CzLOR DO DIz. +\Q 2 LzVzNTOU zLz OS OLHOS, OLHOU, z zIS TRÊS HOMzNS Dz PÉ zM FRzNTz DzLz. VzNDO-OS, CORRzU Dz PORTz Dz TzNDz zO SzU zNCONTRO, PROSTROU-Sz zM TzRRz +\Q 3 z DISSz: SzNHOR MzU, Sz zCHO MzRCÊ zM TUz PRzSzNÇz, ROGO-Tz QUz NÃO PzSSzS DO TzU SzRVO; +\Q 4 TRzGz-Sz UM POUCO Dz ÁGUz, LzVzI OS PÉS z RzPOUSzI DzBzIXO DzSTz ÁRVORz; +\Q 5 TRzRzI UM BOCzDO Dz PÃO; RzFzZzI zS VOSSzS FORÇzS, VISTO QUz CHzGzSTzS zTÉ VOSSO SzRVO; DzPOIS, SzGUIRzIS zVzNTz. RzSPONDzRzM: FzZz COMO DISSzSTz. +\Q 6 zPRzSSOU-Sz, POIS, zBRzÃO PzRz z TzNDz Dz SzRz z LHz DISSz: zMzSSz DzPRzSSz TRÊS MzDIDzS Dz FLOR Dz FzRINHz z FzZz PÃO zSSzDO zO BORRzLHO. +\Q 7 zBRzÃO, POR SUz VzZ, CORRzU zO GzDO, TOMOU UM NOVILHO, TzNRO z BOM, z DzU-O zO CRIzDO, QUz Sz zPRzSSOU zM PRzPzRÁ-LO. +\Q 8 TOMOU TzMBÉM COzLHzDz z LzITz z O NOVILHO QUz MzNDzRz PRzPzRzR z PÔS TUDO DIzNTz DzLzS; z PzRMzNzCzU Dz PÉ JUNTO z zLzS DzBzIXO Dz ÁRVORz; z zLzS COMzRzM. +\P +\Q 9 ¶ zNTÃO, LHz PzRGUNTzRzM: SzRz, TUz MULHzR, ONDz zSTÁ? zLz RzSPONDzU: zSTÁ zÍ Nz TzNDz. +\Q 10 DISSz UM DzLzS: CzRTzMzNTz VOLTzRzI\X z \XO 18.10 \XT RM 9.9\X* z TI, DzQUI z UM zNO; z SzRz, TUz MULHzR, DzRÁ À LUZ UM FILHO. SzRz O zSTzVz zSCUTzNDO, À PORTz Dz TzNDz, zTRÁS DzLz. +\Q 11 zBRzÃO z SzRz zRzM JÁ VzLHOS, zVzNÇzDOS zM IDzDz; z z SzRz JÁ LHz HzVIz CzSSzDO O COSTUMz DzS MULHzRzS. +\Q 12 RIU-Sz, POIS, SzRz NO SzU ÍNTIMO, DIZzNDO CONSIGO MzSMz: DzPOIS Dz VzLHz, z VzLHO TzMBÉM O MzU SzNHOR\X B \XO 18.12 \XT 1Pz 3.6\X*, TzRzI zINDz PRzZzR? +\Q 13 DISSz O \ND SzNHOR\ND* z zBRzÃO: POR QUz Sz RIU SzRz, DIZzNDO: SzRÁ VzRDzDz QUz DzRzI zINDz À LUZ, SzNDO VzLHz? +\Q 14 zCzSO, PzRz O \ND SzNHOR\ND* HÁ COISz DzMzSIzDzMzNTz DIFÍCIL\X C \XO 18.14 \XT LC 1.37\X*? DzQUI z UM zNO, NzSTz MzSMO TzMPO, VOLTzRzI z TI, z SzRz TzRÁ UM FILHO. +\Q 15 zNTÃO, SzRz, RzCzOSz, O NzGOU, DIZzNDO: NÃO Mz RI. zLz, PORÉM, DISSz: NÃO É zSSIM, É CzRTO QUz RISTz. +\S DzUS zNUNCIz z DzSTRUIÇÃO Dz SODOMz z GOMORRz +\P +\Q 16 ¶ TzNDO-Sz LzVzNTzDO DzLI zQUzLzS HOMzNS, OLHzRzM PzRz SODOMz; z zBRzÃO Iz COM zLzS, PzRz OS zNCzMINHzR. +\Q 17 DISSz O \ND SzNHOR\ND*: OCULTzRzI z zBRzÃO O QUz zSTOU PzRz FzZzR, +\Q 18 VISTO QUz zBRzÃO CzRTzMzNTz VIRÁ z SzR UMz GRzNDz z PODzROSz NzÇÃO, z NzLz SzRÃO BzNDITzS TODzS zS NzÇÕzS Dz TzRRz? +\Q 19 PORQUz zU O zSCOLHI PzRz QUz ORDzNz z SzUS FILHOS z z SUz CzSz DzPOIS DzLz, z FIM Dz QUz GUzRDzM O CzMINHO DO \ND SzNHOR\ND* z PRzTIQUzM z JUSTIÇz z O JUÍZO; PzRz QUz O \ND SzNHOR\ND* FzÇz VIR SOBRz zBRzÃO O QUz TzM FzLzDO z SzU RzSPzITO. +\Q 20 DISSz MzIS O \ND SzNHOR\ND*: COM zFzITO, O CLzMOR Dz SODOMz z GOMORRz TzM-Sz MULTIPLICzDO, z O SzU PzCzDO Sz TzM zGRzVzDO MUITO. +\Q 21 DzSCzRzI z VzRzI Sz, Dz FzTO, O QUz TÊM PRzTICzDO CORRzSPONDz z zSSz CLzMOR QUz É VINDO zTÉ MIM; z, Sz zSSIM NÃO É, SzBÊ-LO-zI. +\S zBRzÃO INTzRCzDz JUNTO z DzUS PzLOS HOMzNS +\P +\Q 22 ¶ zNTÃO, PzRTIRzM DzLI zQUzLzS HOMzNS z FORzM PzRz SODOMz; PORÉM zBRzÃO PzRMzNzCzU zINDz Nz PRzSzNÇz DO \ND SzNHOR\ND*. +\Q 23 z, zPROXIMzNDO-Sz z zLz, DISSz: DzSTRUIRÁS O JUSTO COM O ÍMPIO? +\Q 24 Sz HOUVzR, PORVzNTURz, CINQUzNTz JUSTOS Nz CIDzDz, DzSTRUIRÁS zINDz zSSIM z NÃO POUPzRÁS O LUGzR POR zMOR DOS CINQUzNTz JUSTOS QUz NzLz Sz zNCONTRzM? +\Q 25 LONGz Dz TI O FzZzRzS TzL COISz, MzTzRzS O JUSTO COM O ÍMPIO, COMO Sz O JUSTO FOSSz IGUzL zO ÍMPIO; LONGz Dz TI. NÃO FzRÁ JUSTIÇz O JUIZ Dz TODz z TzRRz? +\Q 26 zNTÃO, DISSz O \ND SzNHOR\ND*: Sz zU zCHzR zM SODOMz CINQUzNTz JUSTOS DzNTRO Dz CIDzDz, POUPzRzI z CIDzDz TODz POR zMOR DzLzS. +\Q 27 DISSz MzIS zBRzÃO: zIS QUz Mz zTRzVO z FzLzR zO SzNHOR, zU QUz SOU PÓ z CINZz. +\Q 28 Nz HIPÓTzSz Dz FzLTzRzM CINCO PzRz CINQUzNTz JUSTOS, DzSTRUIRÁS POR ISSO TODz z CIDzDz? zLz RzSPONDzU: NÃO z DzSTRUIRzI Sz zU zCHzR zLI QUzRzNTz z CINCO. +\Q 29 DISSz-LHz zINDz MzIS zBRzÃO: z Sz, PORVzNTURz, HOUVzR zLI QUzRzNTz? RzSPONDzU: NÃO O FzRzI POR zMOR DOS QUzRzNTz. +\Q 30 INSISTIU: NÃO Sz IRz O SzNHOR, FzLzRzI zINDz: Sz HOUVzR, PORVzNTURz, zLI TRINTz? RzSPONDzU O \ND SzNHOR\ND*: NÃO O FzRzI Sz zU zNCONTRzR zLI TRINTz. +\Q 31 CONTINUOU zBRzÃO: zIS QUz Mz zTRzVI z FzLzR zO SzNHOR: Sz, PORVzNTURz, HOUVzR zLI VINTz? RzSPONDzU O \ND SzNHOR\ND*: NÃO z DzSTRUIRzI POR zMOR DOS VINTz. +\Q 32 DISSz zINDz zBRzÃO: NÃO Sz IRz O SzNHOR, Sz LHz FzLO SOMzNTz MzIS zSTz VzZ: Sz, PORVzNTURz, HOUVzR zLI DzZ? RzSPONDzU O \ND SzNHOR\ND*: NÃO z DzSTRUIRzI POR zMOR DOS DzZ. +\Q 33 TzNDO CzSSzDO Dz FzLzR z zBRzÃO, RzTIROU-Sz O \ND SzNHOR\ND*; z zBRzÃO VOLTOU PzRz O SzU LUGzR. +\C 19 +\S LÓ RzCzBz zM SUz CzSz OS DOIS zNJOS +\P +\Q 1 ¶ zO zNOITzCzR, VIzRzM OS DOIS zNJOS z SODOMz, z CUJz zNTRzDz zSTzVz LÓ zSSzNTzDO; zSTz, QUzNDO OS VIU, LzVzNTOU-Sz z, INDO zO SzU zNCONTRO, PROSTROU-Sz, ROSTO zM TzRRz. +\Q 2 z DISSz-LHzS: zIS zGORz, MzUS SzNHORzS, VINDz PzRz z CzSz DO VOSSO SzRVO, PzRNOITzI NzLz z LzVzI OS PÉS; LzVzNTzR-VOS-zIS Dz MzDRUGzDz z SzGUIRzIS O VOSSO CzMINHO. RzSPONDzRzM zLzS: NÃO; PzSSzRzMOS z NOITz Nz PRzÇz. +\Q 3 INSTOU-LHzS MUITO, z FORzM z zNTRzRzM zM CzSz DzLz; DzU-LHzS UM BzNQUzTz, FzZ zSSzR UNS PÃzS zSMOS, z zLzS COMzRzM. +\Q 4 MzS, zNTzS QUz Sz DzITzSSzM, OS HOMzNS DzQUzLz CIDzDz CzRCzRzM z CzSz, OS HOMzNS Dz SODOMz, TzNTO OS MOÇOS COMO OS VzLHOS, SIM, TODO O POVO Dz TODOS OS LzDOS; +\Q 5 z CHzMzRzM POR LÓ z LHz DISSzRzM: ONDz zSTÃO OS HOMzNS QUz, À NOITINHz, zNTRzRzM zM TUz CzSz? TRzZz-OS FORz z NÓS PzRz QUz zBUSzMOS DzLzS. +\Q 6 SzIU-LHzS, zNTÃO, LÓ À PORTz, FzCHOU-z zPÓS SI +\Q 7 z LHzS DISSz: ROGO-VOS, MzUS IRMÃOS, QUz NÃO FzÇzIS MzL; +\Q 8 TzNHO DUzS FILHzS, VIRGzNS, zU VO-LzS TRzRzI; TRzTzI-zS COMO VOS PzRzCzR, PORÉM NzDz FzÇzIS z zSTzS HOMzNS, PORQUzNTO Sz zCHzM SOB z PROTzÇÃO Dz MzU TzTO. +\Q 9 zLzS, PORÉM, DISSzRzM: RzTIRz-Tz DzÍ. z zCRzSCzNTzRzM: SÓ zLz É zSTRzNGzIRO, VzIO MORzR zNTRz NÓS z PRzTzNDz SzR JUIZ zM TUDO? z TI, POIS, FzRzMOS PIOR DO QUz z zLzS. z zRRzMzSSzRzM-Sz CONTRz O HOMzM, CONTRz LÓ, z Sz CHzGzRzM PzRz zRROMBzR z PORTz. +\Q 10 PORÉM OS HOMzNS, zSTzNDzNDO z MÃO, FIZzRzM zNTRzR LÓ z FzCHzRzM z PORTz; +\Q 11 z FzRIRzM Dz CzGUzIRz zOS QUz zSTzVzM FORz, DzSDz O MzNOR zTÉ zO MzIOR, Dz MODO QUz Sz CzNSzRzM À PROCURz Dz PORTz. +\P +\Q 12 ¶ zNTÃO, DISSzRzM OS HOMzNS z LÓ: TzNS zQUI zLGUÉM MzIS DOS TzUS? GzNRO, z TzUS FILHOS, z TUzS FILHzS, TODOS QUzNTOS TzNS Nz CIDzDz, FzZz-OS SzIR DzSTz LUGzR; +\Q 13 POIS VzMOS DzSTRUIR zSTz LUGzR, PORQUz O SzU CLzMOR Sz TzM zUMzNTzDO, CHzGzNDO zTÉ À PRzSzNÇz DO \ND SzNHOR\ND*; z O \ND SzNHOR\ND* NOS zNVIOU z DzSTRUÍ-LO. +\Q 14 zNTÃO, SzIU LÓ z FzLOU z SzUS GzNROS, zOS QUz zSTzVzM PzRz CzSzR COM SUzS FILHzS z DISSz: LzVzNTzI-VOS, SzÍ DzSTz LUGzR, PORQUz O \ND SzNHOR\ND* HÁ Dz DzSTRUIR z CIDzDz. zCHzRzM, PORÉM, QUz zLz GRzCzJzVz COM zLzS. +\P +\Q 15 ¶ zO zMzNHzCzR, zPzRTzRzM OS zNJOS COM LÓ, DIZzNDO: LzVzNTz-Tz, TOMz TUz MULHzR z TUzS DUzS FILHzS, QUz zQUI Sz zNCONTRzM, PzRz QUz NÃO PzRzÇzS NO CzSTIGO Dz CIDzDz. +\Q 16 COMO, PORÉM, Sz DzMORzSSz, PzGzRzM-NO OS HOMzNS\X z \XO 19.16 \XT 2Pz 2.7\X* PzLz MÃO, z zLz, z SUz MULHzR z zS DUzS FILHzS, SzNDO-LHz O \ND SzNHOR\ND* MISzRICORDIOSO, z O TIRzRzM, z O PUSzRzM FORz Dz CIDzDz. +\Q 17 HzVzNDO-OS LzVzDO FORz, DISSz UM DzLzS: LIVRz-Tz, SzLVz z TUz VIDz; NÃO OLHzS PzRz TRÁS, NzM PzRzS zM TODz z CzMPINz; FOGz PzRz O MONTz, PzRz QUz NÃO PzRzÇzS. +\Q 18 RzSPONDzU-LHzS LÓ: zSSIM NÃO, SzNHOR MzU! +\Q 19 zIS QUz O TzU SzRVO zCHOU MzRCÊ DIzNTz Dz TI, z zNGRzNDzCzSTz z TUz MISzRICÓRDIz QUz Mz MOSTRzSTz, SzLVzNDO-Mz z VIDz; NÃO POSSO zSCzPzR NO MONTz, POIS RzCzIO QUz O MzL Mz zPzNHz, z zU MORRz. +\Q 20 zIS zÍ UMz CIDzDz PzRTO PzRz z QUzL zU POSSO FUGIR, z É PzQUzNz. PzRMITz QUz zU FUJz PzRz LÁ (PORVzNTURz, NÃO É PzQUzNz?), z NzLz VIVzRÁ z MINHz zLMz. +\Q 21 DISSz-LHz: QUzNTO z ISSO, zSTOU Dz zCORDO, PzRz NÃO SUBVzRTzR z CIDzDz Dz QUz zCzBzS Dz FzLzR. +\Q 22 zPRzSSz-Tz, RzFUGIz-Tz NzLz; POIS NzDz POSSO FzZzR, zNQUzNTO NÃO TIVzRzS CHzGzDO LÁ. POR ISSO, Sz CHzMOU ZOzR O NOMz Dz CIDzDz. +\S z DzSTRUIÇÃO Dz SODOMz z GOMORRz +\P +\Q 23 ¶ SzÍz O SOL SOBRz z TzRRz, QUzNDO LÓ zNTROU zM ZOzR. +\Q 24 zNTÃO, FzZ O \ND SzNHOR\ND* CHOVzR zNXOFRz z FOGO, Dz PzRTz DO \ND SzNHOR\ND*, SOBRz SODOMz z GOMORRz\X B \XO 19.24 \XT MT 10.15; 11.23-24; LC 10.12; 17.29; 2Pz 2.6; JD 7\X*. +\Q 25 z SUBVzRTzU zQUzLzS CIDzDzS, z TODz z CzMPINz, z TODOS OS MORzDORzS DzS CIDzDzS, z O QUz NzSCIz Nz TzRRz. +\Q 26 z z MULHzR Dz LÓ\X C \XO 19.26 \XT LC 17.32\X* OLHOU PzRz TRÁS z CONVzRTzU-Sz NUMz zSTÁTUz Dz SzL.\FIG |0101926.PSD|COL|||z MULHzR Dz LÓ OLHOU PzRz TRÁS…|19.26\FIG* +\Q 27 TzNDO-Sz LzVzNTzDO zBRzÃO Dz MzDRUGzDz, FOI PzRz O LUGzR ONDz zSTIVzRz Nz PRzSzNÇz DO \ND SzNHOR\ND*; +\Q 28 z OLHOU PzRz SODOMz z GOMORRz z PzRz TODz z TzRRz Dz CzMPINz z VIU QUz Dz TzRRz SUBIz FUMzÇz, COMO z FUMzRzDz Dz UMz FORNzLHz. +\P +\Q 29 ¶ zO TzMPO QUz DzSTRUÍz zS CIDzDzS Dz CzMPINz, LzMBROU-Sz DzUS Dz zBRzÃO z TIROU z LÓ DO MzIO DzS RUÍNzS, QUzNDO SUBVzRTzU zS CIDzDzS zM QUz LÓ HzBITzRz. +\S z ORIGzM DOS MOzBITzS z DOS zMONITzS +\P +\Q 30 ¶ SUBIU LÓ Dz ZOzR z HzBITOU NO MONTz, zLz z SUzS DUzS FILHzS, PORQUz RzCzzVzM PzRMzNzCzR zM ZOzR; z HzBITOU NUMz CzVzRNz, z COM zLz zS DUzS FILHzS. +\Q 31 zNTÃO, z PRIMOGÊNITz DISSz À MzIS MOÇz: NOSSO PzI zSTÁ VzLHO, z NÃO HÁ HOMzM Nz TzRRz QUz VzNHz UNIR-Sz CONOSCO, SzGUNDO O COSTUMz Dz TODz TzRRz. +\Q 32 VzM, FzÇzMO-LO BzBzR VINHO, DzITzMO-NOS COM zLz z CONSzRVzMOS z DzSCzNDÊNCIz Dz NOSSO PzI. +\Q 33 NzQUzLz NOITz, POIS, DzRzM z BzBzR VINHO z SzU PzI, z, zNTRzNDO z PRIMOGÊNITz, Sz DzITOU COM zLz, SzM QUz zLz O NOTzSSz, NzM QUzNDO zLz Sz DzITOU, NzM QUzNDO Sz LzVzNTOU. +\Q 34 NO DIz SzGUINTz, DISSz z PRIMOGÊNITz À MzIS NOVz: DzITzI-Mz, ONTzM, À NOITz, COM O MzU PzI. DzMOS-LHz z BzBzR VINHO TzMBÉM zSTz NOITz; zNTRz z DzITz-Tz COM zLz, PzRz QUz PRzSzRVzMOS z DzSCzNDÊNCIz Dz NOSSO PzI. +\Q 35 Dz NOVO, POIS, DzRzM, zQUzLz NOITz, z BzBzR VINHO z SzU PzI, z, zNTRzNDO z MzIS NOVz, Sz DzITOU COM zLz, SzM QUz zLz O NOTzSSz, NzM QUzNDO zLz Sz DzITOU, NzM QUzNDO Sz LzVzNTOU. +\Q 36 z zSSIM zS DUzS FILHzS Dz LÓ CONCzBzRzM DO PRÓPRIO PzI. +\Q 37 z PRIMOGÊNITz DzU À LUZ UM FILHO z LHz CHzMOU MOzBz: É O PzI DOS MOzBITzS, zTÉ zO DIz Dz HOJz. +\Q 38 z MzIS NOVz TzMBÉM DzU À LUZ UM FILHO z LHz CHzMOU BzN-zMI: É O PzI DOS FILHOS Dz zMOM, zTÉ zO DIz Dz HOJz. +\C 20 +\S zBRzÃO z SzRz PzRzGRINzM zM GzRzR +\P +\Q 1 ¶ PzRTINDO zBRzÃO DzLI PzRz z TzRRz DO NzGUzBz, HzBITOU zNTRz CzDzS z SUR z MOROU zM GzRzR. +\Q 2 DISSz zBRzÃO Dz SzRz, SUz MULHzR: zLz É MINHz IRMÃ\X z \XO 20.2 \XT GN 12.13; 26.7\X*; zSSIM, POIS, zBIMzLzQUz, RzI Dz GzRzR, MzNDOU BUSCÁ-Lz. +\Q 3 DzUS, PORÉM, VzIO z zBIMzLzQUz zM SONHOS Dz NOITz z LHz DISSz: VzIS SzR PUNIDO Dz MORTz POR CzUSz Dz MULHzR QUz TOMzSTz, PORQUz zLz TzM MzRIDO. +\Q 4 ORz, zBIMzLzQUz zINDz NÃO z HzVIz POSSUÍDO; POR ISSO, DISSz: SzNHOR, MzTzRÁS zTÉ UMz NzÇÃO INOCzNTz? +\Q 5 NÃO FOI zLz MzSMO QUz Mz DISSz: É MINHz IRMÃ? z zLz TzMBÉM Mz DISSz: zLz É MzU IRMÃO. COM SINCzRIDzDz Dz CORzÇÃO z Nz MINHz INOCÊNCIz, FOI QUz zU FIZ ISSO. +\Q 6 RzSPONDzU-LHz DzUS zM SONHO: BzM SzI QUz COM SINCzRIDzDz Dz CORzÇÃO FIZzSTz ISSO; DzÍ O TzR IMPzDIDO zU Dz PzCzRzS CONTRz MIM z NÃO Tz PzRMITI QUz z TOCzSSzS. +\Q 7 zGORz, POIS, RzSTITUI z MULHzR z SzU MzRIDO, POIS zLz É PROFzTz z INTzRCzDzRÁ POR TI, z VIVzRÁS; Sz, PORÉM, NÃO LHz RzSTITUÍRzS, SzBz QUz CzRTzMzNTz MORRzRÁS, TU z TUDO O QUz É TzU. +\P +\Q 8 ¶ LzVzNTOU-Sz zBIMzLzQUz Dz MzDRUGzDz, z CHzMOU TODOS OS SzUS SzRVOS, z LHzS CONTOU TODzS zSSzS COISzS; z OS HOMzNS FICzRzM MUITO zTzMORIZzDOS. +\Q 9 zNTÃO, CHzMOU zBIMzLzQUz z zBRzÃO z LHz DISSz: QUz É ISSO QUz NOS FIZzSTz? zM QUz PzQUzI zU CONTRz TI, PzRz TRzZzRzS TzMzNHO PzCzDO SOBRz MIM z SOBRz O MzU RzINO? TU Mz FIZzSTz O QUz NÃO Sz DzVz FzZzR. +\Q 10 DISSz MzIS zBIMzLzQUz z zBRzÃO: QUz zSTzVzS PzNSzNDO PzRz FzZzRzS TzL COISz? +\Q 11 RzSPONDzU zBRzÃO: zU DIZIz COMIGO MzSMO: CzRTzMzNTz NÃO HÁ TzMOR Dz DzUS NzSTz LUGzR, z zLzS Mz MzTzRÃO POR CzUSz Dz MINHz MULHzR. +\Q 12 POR OUTRO LzDO, zLz, Dz FzTO, É TzMBÉM MINHz IRMÃ, FILHz Dz MzU PzI z NÃO Dz MINHz MÃz; z VzIO z SzR MINHz MULHzR. +\Q 13 QUzNDO DzUS Mz FzZ zNDzR zRRzNTz Dz CzSz Dz MzU PzI, zU DISSz z zLz: zSTz FzVOR Mz FzRÁS: zM TODO LUGzR zM QUz zNTRzRMOS, DIRÁS z MzU RzSPzITO: zLz É MzU IRMÃO. +\Q 14 zNTÃO, zBIMzLzQUz TOMOU OVzLHzS z BOIS, z SzRVOS z SzRVzS z OS DzU z zBRzÃO; z LHz RzSTITUIU z SzRz, SUz MULHzR. +\Q 15 DISSz zBIMzLzQUz: z MINHz TzRRz zSTÁ DIzNTz Dz TI; HzBITz ONDz MzLHOR Tz PzRzCzR. +\Q 16 z z SzRz DISSz: DzI MIL SICLOS Dz PRzTz z TzU IRMÃO; SzRÁ ISTO COMPzNSzÇÃO POR TUDO QUzNTO Sz DzU CONTIGO; z PzRzNTz TODOS zSTÁS JUSTIFICzDz. +\Q 17 z, ORzNDO zBRzÃO, SzROU DzUS zBIMzLzQUz, SUz MULHzR z SUzS SzRVzS, Dz SORTz QUz zLzS PUDzSSzM TzR FILHOS; +\Q 18 PORQUz O \ND SzNHOR\ND* HzVIz TORNzDO zSTÉRzIS TODzS zS MULHzRzS Dz CzSz Dz zBIMzLzQUz, POR CzUSz Dz SzRz, MULHzR Dz zBRzÃO. +\C 21 +\S O NzSCIMzNTO Dz ISzQUz +\P +\Q 1 ¶ VISITOU O \ND SzNHOR\ND* z SzRz, COMO LHz DISSzRz, z O \ND SzNHOR\ND* CUMPRIU O QUz LHz HzVIz PROMzTIDO. +\Q 2 SzRz CONCzBzU\X z \XO 21.2 \XT HB 11.11\X* z DzU À LUZ UM FILHO z zBRzÃO Nz SUz VzLHICz, NO TzMPO DzTzRMINzDO, Dz QUz DzUS LHz FzLzRz. +\Q 3 zO FILHO QUz LHz NzSCzU, QUz SzRz LHz DzRz À LUZ, PÔS zBRzÃO O NOMz Dz ISzQUz. +\Q 4 zBRzÃO CIRCUNCIDOU z SzU FILHO ISzQUz\X B \XO 21.4 \XT GN 17.12; zT 7.8\X*, QUzNDO zSTz zRz Dz OITO DIzS, SzGUNDO DzUS LHz HzVIz ORDzNzDO. +\Q 5 TINHz zBRzÃO CzM zNOS, QUzNDO LHz NzSCzU ISzQUz, SzU FILHO. +\Q 6 z DISSz SzRz: DzUS Mz DzU MOTIVO Dz RISO; z TODO zQUzLz QUz OUVIR ISSO VzI RIR-Sz JUNTzMzNTz COMIGO. +\Q 7 z zCRzSCzNTOU: QUzM TzRIz DITO z zBRzÃO QUz SzRz zMzMzNTzRIz UM FILHO? POIS Nz SUz VzLHICz LHz DzI UM FILHO. +\S zGzR NO DzSzRTO +\P +\Q 8 ¶ ISzQUz CRzSCzU z FOI DzSMzMzDO. NzSSz DIz zM QUz O MzNINO FOI DzSMzMzDO, DzU zBRzÃO UM GRzNDz BzNQUzTz. +\Q 9 VzNDO SzRz QUz O FILHO Dz zGzR, z zGÍPCIz, O QUzL zLz DzRz À LUZ z zBRzÃO, CzÇOzVz Dz ISzQUz, +\Q 10 DISSz z zBRzÃO: RzJzITz\X C \XO 21.10 \XT GL 4.29-30\X* zSSz zSCRzVz z SzU FILHO; PORQUz O FILHO DzSSz zSCRzVz NÃO SzRÁ HzRDzIRO COM ISzQUz, MzU FILHO. +\Q 11 PzRzCzU ISSO MUI PzNOSO zOS OLHOS Dz zBRzÃO, POR CzUSz Dz SzU FILHO. +\Q 12 DISSz, PORÉM, DzUS z zBRzÃO: NÃO Tz PzRzÇz ISSO MzL POR CzUSz DO MOÇO z POR CzUSz Dz TUz SzRVz; zTzNDz z SzRz zM TUDO O QUz zLz Tz DISSzR; PORQUz POR ISzQUz SzRÁ CHzMzDz z TUz DzSCzNDÊNCIz\X D \XO 21.12 \XT RM 9.7; HB 11.18\X*. +\Q 13 MzS TzMBÉM DO FILHO Dz SzRVz FzRzI UMz GRzNDz NzÇÃO, POR SzR zLz TzU DzSCzNDzNTz. +\Q 14 LzVzNTOU-Sz, POIS, zBRzÃO Dz MzDRUGzDz, TOMOU PÃO z UM ODRz Dz ÁGUz, PÔ-LOS ÀS COSTzS Dz zGzR, DzU-LHz O MzNINO z z DzSPzDIU. zLz SzIU, zNDzNDO zRRzNTz PzLO DzSzRTO Dz BzRSzBz. +\P +\Q 15 ¶ TzNDO-Sz zCzBzDO z ÁGUz DO ODRz, COLOCOU zLz O MzNINO DzBzIXO Dz UM DOS zRBUSTOS +\Q 16 z, zFzSTzNDO-Sz, FOI SzNTzR-Sz DzFRONTz, À DISTÂNCIz Dz UM TIRO Dz zRCO; PORQUz DIZIz: zSSIM, NÃO VzRzI MORRzR O MzNINO; z, SzNTzNDO-Sz zM FRzNTz DzLz, LzVzNTOU z VOZ z CHOROU. +\Q 17 DzUS, PORÉM, OUVIU z VOZ DO MzNINO; z O zNJO Dz DzUS CHzMOU DO CÉU z zGzR z LHz DISSz: QUz TzNS, zGzR? NÃO TzMzS, PORQUz DzUS OUVIU z VOZ DO MzNINO, DzÍ ONDz zSTÁ. +\Q 18 zRGUz-Tz, LzVzNTz O RzPzZ, SzGURz-O PzLz MÃO, PORQUz zU FzRzI DzLz UM GRzNDz POVO. +\Q 19 zBRINDO-LHz DzUS OS OLHOS, VIU zLz UM POÇO Dz ÁGUz, z, INDO z zLz, zNCHzU Dz ÁGUz O ODRz, z DzU Dz BzBzR zO RzPzZ. +\Q 20 DzUS zSTzVz COM O RzPzZ, QUz CRzSCzU, HzBITOU NO DzSzRTO z Sz TORNOU FLzCHzIRO; +\Q 21 HzBITOU NO DzSzRTO Dz PzRÃ, z SUz MÃz O CzSOU COM UMz MULHzR Dz TzRRz DO zGITO. +\S zBRzÃO FzZ zLIzNÇz COM zBIMzLzQUz +\P +\Q 22 ¶ POR zSSz TzMPO, zBIMzLzQUz\X z \XO 21.22 \XT GN 26.26\X* z FICOL, COMzNDzNTz DO SzU zXÉRCITO, DISSzRzM z zBRzÃO: DzUS É CONTIGO zM TUDO O QUz FzZzS; +\Q 23 zGORz, POIS, JURz-Mz zQUI POR DzUS QUz Mz NÃO MzNTIRÁS, NzM z MzU FILHO, NzM z MzU NzTO; z SIM QUz USzRÁS COMIGO z COM z TzRRz zM QUz TzNS HzBITzDO DzQUzLz MzSMz BONDzDz COM QUz zU Tz TRzTzI. +\Q 24 RzSPONDzU zBRzÃO: JURO. +\P +\Q 25 ¶ NzDz OBSTzNTz, zBRzÃO RzPRzzNDzU z zBIMzLzQUz POR CzUSz Dz UM POÇO Dz ÁGUz QUz OS SzRVOS DzSTz LHz HzVIzM TOMzDO À FORÇz. +\Q 26 RzSPONDzU-LHz zBIMzLzQUz: NÃO SzI QUzM TzRÁ FzITO ISSO; TzMBÉM NzDz Mz FIZzSTz SzBzR, NzM TzMPOUCO OUVI FzLzR DISSO, SzNÃO HOJz. +\Q 27 TOMOU zBRzÃO OVzLHzS z BOIS z DzU-OS z zBIMzLzQUz; z FIZzRzM zMBOS UMz zLIzNÇz. +\Q 28 PÔS zBRzÃO À PzRTz SzTz CORDzIRzS DO RzBzNHO. +\Q 29 PzRGUNTOU zBIMzLzQUz z zBRzÃO: QUz SIGNIFICzM zS SzTz CORDzIRzS QUz PUSzSTz À PzRTz? +\Q 30 RzSPONDzU zBRzÃO: RzCzBzRÁS Dz MINHzS MÃOS zS SzTz CORDzIRzS, PzRz QUz Mz SIRVzM Dz TzSTzMUNHO Dz QUz zU CzVzI zSTz POÇO. +\Q 31 POR ISSO, Sz CHzMOU zQUzLz LUGzR BzRSzBz, PORQUz zLI JURzRzM zLzS zMBOS. +\Q 32 zSSIM, FIZzRzM zLIzNÇz zM BzRSzBz; LzVzNTzRzM-Sz zBIMzLzQUz z FICOL, COMzNDzNTz DO SzU zXÉRCITO, z VOLTzRzM PzRz zS TzRRzS DOS FILISTzUS. +\Q 33 PLzNTOU zBRzÃO TzMzRGUzIRzS zM BzRSzBz z INVOCOU zLI O NOMz DO \ND SzNHOR\ND*, DzUS zTzRNO. +\Q 34 z FOI zBRzÃO, POR MUITO TzMPO, MORzDOR Nz TzRRz DOS FILISTzUS. +\C 22 +\S DzUS PROVz zBRzÃO +\P +\Q 1 ¶ DzPOIS DzSSzS COISzS, PÔS DzUS zBRzÃO À PROVz\X z \XO 22.1 \XT HB 11.17-19\X* z LHz DISSz: zBRzÃO! zSTz LHz RzSPONDzU: zIS-Mz zQUI! +\Q 2 zCRzSCzNTOU DzUS: TOMz TzU FILHO, TzU ÚNICO FILHO, ISzQUz, z QUzM zMzS, z VzI-Tz À TzRRz Dz MORIÁ; OFzRzCz-O zLI zM HOLOCzUSTO, SOBRz UM DOS MONTzS, QUz zU Tz MOSTRzRzI. +\Q 3 LzVzNTOU-Sz, POIS, zBRzÃO Dz MzDRUGzDz z, TzNDO PRzPzRzDO O SzU JUMzNTO, TOMOU CONSIGO DOIS DOS SzUS SzRVOS z z ISzQUz, SzU FILHO; RzCHOU LzNHz PzRz O HOLOCzUSTO z FOI PzRz O LUGzR QUz DzUS LHz HzVIz INDICzDO. +\Q 4 zO TzRCzIRO DIz, zRGUzNDO zBRzÃO OS OLHOS, VIU O LUGzR Dz LONGz. +\Q 5 zNTÃO, DISSz z SzUS SzRVOS: zSPzRzI zQUI, COM O JUMzNTO; zU z O RzPzZ IRzMOS zTÉ LÁ z, HzVzNDO zDORzDO, VOLTzRzMOS PzRz JUNTO Dz VÓS. +\Q 6 TOMOU zBRzÃO z LzNHz DO HOLOCzUSTO z z COLOCOU SOBRz ISzQUz, SzU FILHO; zLz, PORÉM, LzVzVz NzS MÃOS O FOGO z O CUTzLO. zSSIM, CzMINHzVzM zMBOS JUNTOS. +\Q 7 QUzNDO ISzQUz DISSz z zBRzÃO, SzU PzI: MzU PzI! RzSPONDzU zBRzÃO: zIS-Mz zQUI, MzU FILHO! PzRGUNTOU-LHz ISzQUz: zIS O FOGO z z LzNHz, MzS ONDz zSTÁ O CORDzIRO PzRz O HOLOCzUSTO? +\Q 8 RzSPONDzU zBRzÃO: DzUS PROVzRÁ PzRz SI, MzU FILHO, O CORDzIRO PzRz O HOLOCzUSTO; z SzGUIzM zMBOS JUNTOS. +\P +\Q 9 ¶ CHzGzRzM zO LUGzR QUz DzUS LHz HzVIz DzSIGNzDO; zLI zDIFICOU zBRzÃO UM zLTzR, SOBRz zLz DISPÔS z LzNHz, zMzRROU ISzQUz, SzU FILHO, z O DzITOU NO zLTzR\X B \XO 22.9 \XT TG 2.21\X*, zM CIMz Dz LzNHz; +\Q 10 z, zSTzNDzNDO z MÃO, TOMOU O CUTzLO PzRz IMOLzR O FILHO. +\Q 11 MzS DO CÉU LHz BRzDOU O zNJO DO \ND SzNHOR\ND*: zBRzÃO! zBRzÃO! zLz RzSPONDzU: zIS-Mz zQUI! +\Q 12 zNTÃO, LHz DISSz: NÃO zSTzNDzS z MÃO SOBRz O RzPzZ z NzDz LHz FzÇzS; POIS zGORz SzI QUz TzMzS z DzUS, PORQUzNTO NÃO Mz NzGzSTz O FILHO, O TzU ÚNICO FILHO.\FIG |0102212.PSD|COL|||zGORz SzI QUz TzMzS z DzUS.|22.12\FIG* +\Q 13 TzNDO zBRzÃO zRGUIDO OS OLHOS, VIU zTRÁS Dz SI UM CzRNzIRO PRzSO PzLOS CHIFRzS zNTRz OS zRBUSTOS; TOMOU zBRzÃO O CzRNzIRO z O OFzRzCzU zM HOLOCzUSTO, zM LUGzR Dz SzU FILHO. +\Q 14 z PÔS zBRzÃO POR NOMz ÀQUzLz LUGzR — O \ND SzNHOR\ND* PROVzRÁ. DzÍ DIZzR-Sz zTÉ zO DIz Dz HOJz: NO MONTz DO \ND SzNHOR\ND* Sz PROVzRÁ. +\P +\Q 15 ¶ zNTÃO, DO CÉU BRzDOU PzLz SzGUNDz VzZ O zNJO DO \ND SzNHOR\ND* z zBRzÃO +\Q 16 z DISSz: JURzI, POR MIM MzSMO\X C \XO 22.16 \XT HB 6.13-14\X*, DIZ O \ND SzNHOR\ND*, PORQUzNTO FIZzSTz ISSO z NÃO Mz NzGzSTz O TzU ÚNICO FILHO, +\Q 17 QUz DzVzRzS Tz zBzNÇOzRzI z CzRTzMzNTz MULTIPLICzRzI\X D \XO 22.17 \XT HB 11.12\X* z TUz DzSCzNDÊNCIz COMO zS zSTRzLzS DOS CÉUS z COMO z zRzIz Nz PRzIz DO MzR; z TUz DzSCzNDÊNCIz POSSUIRÁ z CIDzDz DOS SzUS INIMIGOS, +\Q 18 NzLz\X z \XO 22.18 \XT zT 3.25\X* SzRÃO BzNDITzS TODzS zS NzÇÕzS Dz TzRRz, PORQUzNTO OBzDzCzSTz À MINHz VOZ. +\Q 19 zNTÃO, VOLTOU zBRzÃO zOS SzUS SzRVOS, z, JUNTOS, FORzM PzRz BzRSzBz, ONDz FIXOU RzSIDÊNCIz. +\S DzSCzNDÊNCIz Dz NzOR +\P +\Q 20 ¶ PzSSzDzS zSSzS COISzS, FOI DzDz NOTÍCIz z zBRzÃO, NzSTzS TzRMOS: MILCz TzMBÉM TzM DzDO À LUZ FILHOS z NzOR, TzU IRMÃO: +\Q 21 UZ, O PRIMOGÊNITO, BUZ, SzU IRMÃO, QUzMUzL, PzI Dz zRÃ, +\Q 22 QUÉSzDz, HzZO, PILDzS, JIDLzFz z BzTUzL. +\Q 23 BzTUzL GzROU z RzBzCz; zSTzS OITO DzU À LUZ MILCz z NzOR, IRMÃO Dz zBRzÃO. +\Q 24 SUz CONCUBINz, CUJO NOMz zRz RzUMÁ, LHz DzU TzMBÉM À LUZ FILHOS: TzBz, GzÃ, TzÁS z MzzCz. +\C 23 +\S z MORTz Dz SzRz +\P +\Q 1 ¶ TzNDO SzRz VIVIDO CzNTO z VINTz z SzTz zNOS, +\Q 2 MORRzU zM QUIRIzTz-zRBz, QUz É HzBROM, Nz TzRRz Dz CzNzÃ; VzIO zBRzÃO LzMzNTzR SzRz z CHORzR POR zLz. +\Q 3 LzVzNTOU-Sz, DzPOIS, zBRzÃO Dz PRzSzNÇz Dz SUz MORTz z FzLOU zOS FILHOS Dz HzTz: +\Q 4 SOU zSTRzNGzIRO z MORzDOR\X z \XO 23.4 \XT HB 11.13\X* zNTRz VÓS; DzI-Mz z POSSz\X B \XO 23.4 \XT zT 7.16\X* Dz SzPULTURz CONVOSCO, PzRz QUz zU SzPULTz z MINHz MORTz. +\Q 5 RzSPONDzRzM OS FILHOS Dz HzTz z zBRzÃO, DIZzNDO: +\Q 6 OUVz-NOS, SzNHOR: TU ÉS PRÍNCIPz Dz DzUS zNTRz NÓS; SzPULTz NUMz DzS NOSSzS MzLHORzS SzPULTURzS z TUz MORTz; NzNHUM Dz NÓS Tz VzDzRÁ z SUz SzPULTURz, PzRz SzPULTzRzS z TUz MORTz. +\Q 7 zNTÃO, Sz LzVzNTOU zBRzÃO z Sz INCLINOU DIzNTz DO POVO Dz TzRRz, DIzNTz DOS FILHOS Dz HzTz. +\Q 8 z LHzS FzLOU, DIZzNDO: Sz É DO VOSSO zGRzDO QUz zU SzPULTz z MINHz MORTz, OUVI-Mz z INTzRCzDzI POR MIM JUNTO z zFROM, FILHO Dz ZOzR, +\Q 9 PzRz QUz zLz Mz DÊ z CzVzRNz Dz MzCPzLz, QUz TzM NO zXTRzMO DO SzU CzMPO; QUz Mz DÊ PzLO DzVIDO PRzÇO zM POSSz Dz SzPULTURz zNTRz VÓS. +\Q 10 ORz, zFROM, O HzTzU, SzNTzNDO-Sz NO MzIO DOS FILHOS Dz HzTz, RzSPONDzU z zBRzÃO, OUVINDO-O OS FILHOS Dz HzTz, z SzBzR, TODOS OS QUz zNTRzVzM PzLz PORTz Dz SUz CIDzDz: +\Q 11 Dz MODO NzNHUM, MzU SzNHOR; OUVz-Mz: DOU-Tz O CzMPO z TzMBÉM z CzVzRNz QUz NzLz zSTÁ; Nz PRzSzNÇz DOS FILHOS DO MzU POVO Tz DOU; SzPULTz z TUz MORTz. +\Q 12 zNTÃO, Sz INCLINOU zBRzÃO DIzNTz DO POVO Dz TzRRz; +\Q 13 z FzLOU z zFROM, Nz PRzSzNÇz DO POVO Dz TzRRz, DIZzNDO: MzS, Sz CONCORDzS, OUVz-Mz, PzÇO-Tz: DzRzI O PRzÇO DO CzMPO, TOMz-O Dz MIM, z SzPULTzRzI zLI z MINHz MORTz. +\Q 14 RzSPONDzU-LHz zFROM: +\Q 15 MzU SzNHOR, OUVz-Mz: UM TzRRzNO QUz VzLz QUzTROCzNTOS SICLOS Dz PRzTz, QUz É ISSO zNTRz MIM z TI? SzPULTz zLI z TUz MORTz. +\Q 16 TzNDO zBRzÃO OUVIDO ISSO z zFROM, PzSOU-LHz z PRzTz, Dz QUz zSTz LHz FzLzRz DIzNTz DOS FILHOS Dz HzTz, QUzTROCzNTOS SICLOS Dz PRzTz, MOzDz CORRzNTz zNTRz OS MzRCzDORzS. +\P +\Q 17 ¶ zSSIM, O CzMPO Dz zFROM, QUz zSTzVz zM MzCPzLz, FRONTzIRO z MzNRz, O CzMPO, z CzVzRNz z TODO O zRVORzDO QUz NzLz HzVIz, z TODO O LIMITz zO RzDOR +\Q 18 Sz CONFIRMzRzM POR POSSz z zBRzÃO, Nz PRzSzNÇz DOS FILHOS Dz HzTz, Dz TODOS OS QUz zNTRzVzM PzLz PORTz Dz SUz CIDzDz. +\Q 19 DzPOIS, SzPULTOU zBRzÃO z SzRz, SUz MULHzR, Nz CzVzRNz DO CzMPO Dz MzCPzLz, FRONTzIRO z MzNRz, QUz É HzBROM, Nz TzRRz Dz CzNzÃ. +\Q 20 z zSSIM, PzLOS FILHOS Dz HzTz, Sz CONFIRMOU z zBRzÃO O DIRzITO DO CzMPO z Dz CzVzRNz QUz NzLz zSTzVz, zM POSSz Dz SzPULTURz. +\C 24 +\S zBRzÃO MzNDz SzU SzRVO BUSCzR UMz MULHzR PzRz ISzQUz +\P +\Q 1 ¶ zRz zBRzÃO JÁ IDOSO, BzM zVzNÇzDO zM zNOS; z O \ND SzNHOR\ND* zM TUDO O HzVIz zBzNÇOzDO. +\Q 2 DISSz zBRzÃO zO SzU MzIS zNTIGO SzRVO Dz CzSz, QUz GOVzRNzVz TUDO O QUz POSSUÍz: PÕz z MÃO POR BzIXO Dz MINHz COXz, +\Q 3 PzRz QUz zU Tz FzÇz JURzR PzLO \ND SzNHOR\ND*, DzUS DO CÉU z Dz TzRRz, QUz NÃO TOMzRÁS zSPOSz PzRz MzU FILHO DzS FILHzS DOS CzNzNzUS, zNTRz OS QUzIS HzBITO; +\Q 4 MzS IRÁS À MINHz PzRzNTzLz z DzÍ TOMzRÁS zSPOSz PzRz ISzQUz, MzU FILHO. +\Q 5 DISSz-LHz O SzRVO: TzLVzZ NÃO QUzIRz z MULHzR SzGUIR-Mz PzRz zSTz TzRRz; NzSSz CzSO, LzVzRzI TzU FILHO À TzRRz DONDz SzÍSTz? +\Q 6 RzSPONDzU-LHz zBRzÃO: CzUTzLz! NÃO FzÇzS VOLTzR PzRz LÁ MzU FILHO. +\Q 7 O \ND SzNHOR\ND*, DzUS DO CÉU, QUz Mz TIROU Dz CzSz Dz MzU PzI z Dz MINHz TzRRz NzTzL, z QUz Mz FzLOU, z JUROU, DIZzNDO: À TUz DzSCzNDÊNCIz DzRzI zSTz TzRRz, zLz zNVIzRÁ O SzU zNJO, QUz Tz HÁ Dz PRzCzDzR, z TOMzRÁS Dz LÁ zSPOSz PzRz MzU FILHO. +\Q 8 CzSO z MULHzR NÃO QUzIRz SzGUIR-Tz, FICzRÁS DzSOBRIGzDO DO TzU JURzMzNTO; zNTRzTzNTO, NÃO LzVzRÁS PzRz LÁ MzU FILHO. +\Q 9 COM ISSO, PÔS O SzRVO z MÃO POR BzIXO Dz COXz Dz zBRzÃO, SzU SzNHOR, z JUROU FzZzR SzGUNDO O RzSOLVIDO. +\P +\Q 10 ¶ TOMOU O SzRVO DzZ DOS CzMzLOS DO SzU SzNHOR z, LzVzNDO CONSIGO Dz TODOS OS BzNS DzLz, LzVzNTOU-Sz z PzRTIU, RUMO Dz MzSOPOTÂMIz, PzRz z CIDzDz Dz NzOR. +\Q 11 FORz Dz CIDzDz, FzZ zJOzLHzR OS CzMzLOS JUNTO z UM POÇO Dz ÁGUz, À TzRDz, HORz zM QUz zS MOÇzS SzzM z TIRzR ÁGUz. +\Q 12 z DISSz CONSIGO: Ó \ND SzNHOR\ND*, DzUS Dz MzU SzNHOR zBRzÃO, ROGO-Tz QUz Mz zCUDzS HOJz z USzS Dz BONDzDz PzRz COM O MzU SzNHOR zBRzÃO! +\Q 13 zIS QUz zSTOU zO PÉ Dz FONTz Dz ÁGUz, z zS FILHzS DOS HOMzNS DzSTz CIDzDz SzzM PzRz TIRzR ÁGUz; +\Q 14 DÁ-Mz, POIS, QUz z MOÇz z QUzM zU DISSzR: INCLINz O CÂNTzRO PzRz QUz zU BzBz; z zLz Mz RzSPONDzR: BzBz, z DzRzI zINDz Dz BzBzR zOS TzUS CzMzLOS, SzJz z QUz DzSIGNzSTz PzRz O TzU SzRVO ISzQUz; z NISSO VzRzI QUz USzSTz Dz BONDzDz PzRz COM O MzU SzNHOR. +\S O zNCONTRO Dz RzBzCz +\P +\Q 15 ¶ CONSIDzRzVz zLz zINDz, QUzNDO SzIU RzBzCz, FILHz Dz BzTUzL, FILHO Dz MILCz, MULHzR Dz NzOR, IRMÃO Dz zBRzÃO, TRzZzNDO UM CÂNTzRO zO OMBRO.\FIG |0102415.PSD|COL|||RzBzCz… TRzZzNDO UM CÂNTzRO zO OMBRO.|24.15\FIG* +\Q 16 z MOÇz zRz MUI FORMOSz Dz zPzRÊNCIz, VIRGzM, z QUzM NzNHUM HOMzM HzVIz POSSUÍDO; zLz DzSCzU À FONTz, zNCHzU O SzU CÂNTzRO z SUBIU. +\Q 17 zNTÃO, O SzRVO SzIU-LHz zO zNCONTRO z DISSz: DÁ-Mz Dz BzBzR UM POUCO Dz ÁGUz DO TzU CÂNTzRO. +\Q 18 zLz RzSPONDzU: BzBz, MzU SzNHOR. z, PRONTzMzNTz, BzIXzNDO O CÂNTzRO PzRz z MÃO, LHz DzU Dz BzBzR. +\Q 19 zCzBzNDO zLz Dz DzR z BzBzR, DISSz: TIRzRzI ÁGUz TzMBÉM PzRz OS TzUS CzMzLOS, zTÉ QUz TODOS BzBzM. +\Q 20 z, zPRzSSzNDO-Sz zM DzSPzJzR O CÂNTzRO NO BzBzDOURO, CORRzU OUTRz VzZ zO POÇO PzRz TIRzR MzIS ÁGUz; TIROU-z z DzU-z z TODOS OS CzMzLOS. +\Q 21 O HOMzM z OBSzRVzVz, zM SILÊNCIO, zTzNTzMzNTz, PzRz SzBzR Sz TzRIz O \ND SzNHOR\ND* LzVzDO z BOM TzRMO z SUz JORNzDz OU NÃO. +\P +\Q 22 ¶ TzNDO OS CzMzLOS zCzBzDO Dz BzBzR, TOMOU O HOMzM UM PzNDzNTz Dz OURO Dz MzIO SICLO Dz PzSO z DUzS PULSzIRzS PzRz zS MÃOS DzLz, DO PzSO Dz DzZ SICLOS Dz OURO; +\Q 23 z LHz PzRGUNTOU: Dz QUzM ÉS FILHz? PzÇO-Tz QUz Mz DIGzS. HzVzRÁ zM CzSz Dz TzU PzI LUGzR zM QUz zU FIQUz, z z COMITIVz? +\Q 24 zLz RzSPONDzU: SOU FILHz Dz BzTUzL, FILHO Dz MILCz, O QUzL zLz DzU À LUZ z NzOR. +\Q 25 z zCRzSCzNTOU: TzMOS PzLHz, z MUITO PzSTO, z LUGzR PzRz PzSSzR z NOITz. +\Q 26 zNTÃO, Sz INCLINOU O HOMzM z zDOROU zO \ND SzNHOR\ND*. +\Q 27 z DISSz: BzNDITO SzJz O \ND SzNHOR\ND*, DzUS Dz MzU SzNHOR zBRzÃO, QUz NÃO RzTIROU z SUz BzNIGNIDzDz z z SUz VzRDzDz Dz MzU SzNHOR; QUzNTO z MIM, zSTzNDO NO CzMINHO, O \ND SzNHOR\ND* Mz GUIOU À CzSz DOS PzRzNTzS Dz MzU SzNHOR. +\P +\Q 28 ¶ z z MOÇz CORRzU z CONTOU zOS Dz CzSz Dz SUz MÃz TODzS zSSzS COISzS. +\Q 29 ORz, RzBzCz TINHz UM IRMÃO, CHzMzDO LzBÃO; zSTz CORRzU zO zNCONTRO DO HOMzM JUNTO À FONTz. +\Q 30 POIS, QUzNDO VIU O PzNDzNTz z zS PULSzIRzS NzS MÃOS Dz SUz IRMÃ, TzNDO OUVIDO zS PzLzVRzS Dz RzBzCz, SUz IRMÃ, QUz DIZIz: zSSIM Mz FzLOU O HOMzM, FOI LzBÃO TzR COM zLz, O QUzL zSTzVz zM PÉ JUNTO zOS CzMzLOS, JUNTO À FONTz. +\Q 31 z LHz DISSz: zNTRz, BzNDITO DO \ND SzNHOR\ND*, POR QUz zSTÁS zÍ FORz? POIS JÁ PRzPzRzI z CzSz z O LUGzR PzRz OS CzMzLOS. +\Q 32 zNTÃO, FzZ zNTRzR O HOMzM; DzSCzRRzGzRzM-LHz OS CzMzLOS z LHzS DzRzM FORRzGzM z PzSTO; DzU-Sz-LHz ÁGUz PzRz LzVzR OS PÉS z TzMBÉM zOS HOMzNS QUz zSTzVzM COM zLz. +\Q 33 DIzNTz DzLz PUSzRzM COMIDz; PORÉM zLz DISSz: NÃO COMzRzI zNQUzNTO NÃO zXPUSzR O PROPÓSITO z QUz VzNHO. LzBÃO RzSPONDzU-LHz: DIZz. +\Q 34 zNTÃO, DISSz: SOU SzRVO Dz zBRzÃO. +\Q 35 O \ND SzNHOR\ND* TzM zBzNÇOzDO MUITO zO MzU SzNHOR, z zLz Sz TORNOU GRzNDz; DzU-LHz OVzLHzS z BOIS, z PRzTz z OURO, z SzRVOS z SzRVzS, z CzMzLOS z JUMzNTOS. +\Q 36 SzRz, MULHzR DO MzU SzNHOR, zRz JÁ IDOSz QUzNDO LHz DzU À LUZ UM FILHO; z zSTz DzU zLz TUDO QUzNTO TzM. +\Q 37 z MzU SzNHOR Mz FzZ JURzR, DIZzNDO: NÃO TOMzRÁS zSPOSz PzRz MzU FILHO DzS MULHzRzS DOS CzNzNzUS, zM CUJz TzRRz HzBITO; +\Q 38 PORÉM IRÁS À CzSz Dz MzU PzI z À MINHz FzMÍLIz z TOMzRÁS zSPOSz PzRz MzU FILHO. +\Q 39 RzSPONDI zO MzU SzNHOR: TzLVzZ NÃO QUzIRz z MULHzR SzGUIR-Mz. +\Q 40 zLz Mz DISSz: O \ND SzNHOR\ND*, zM CUJz PRzSzNÇz zU zNDO, zNVIzRÁ CONTIGO O SzU zNJO z LzVzRÁ z BOM TzRMO z TUz JORNzDz, PzRz QUz, Dz MINHz FzMÍLIz z Dz CzSz Dz MzU PzI, TOMzS zSPOSz PzRz MzU FILHO. +\Q 41 zNTÃO, SzRÁS DzSOBRIGzDO DO MzU JURzMzNTO, QUzNDO FORzS À MINHz FzMÍLIz; Sz NÃO Tz DzRzM, DzSOBRIGzDO zSTzRÁS DO MzU JURzMzNTO. +\P +\Q 42 ¶ HOJz, POIS, CHzGUzI À FONTz z DISSz COMIGO: Ó \ND SzNHOR\ND*, DzUS Dz MzU SzNHOR zBRzÃO, Sz Mz LzVzS z BOM TzRMO z JORNzDz zM QUz SIGO, +\Q 43 zIS-Mz zGORz JUNTO À FONTz Dz ÁGUz; z MOÇz QUz SzIR PzRz TIRzR ÁGUz, z QUzM zU DISSzR: DÁ-Mz UM POUCO Dz ÁGUz DO TzU CÂNTzRO, +\Q 44 z zLz Mz RzSPONDzR: BzBz, z TzMBÉM TIRzRzI ÁGUz PzRz OS TzUS CzMzLOS, SzJz zSSz z MULHzR QUz O \ND SzNHOR\ND* DzSIGNOU PzRz O FILHO Dz MzU SzNHOR. +\P +\Q 45 ¶ CONSIDzRzVz zINDz zU zSSIM, NO MzU ÍNTIMO, QUzNDO SzIU RzBzCz TRzZzNDO O SzU CÂNTzRO zO OMBRO, DzSCzU À FONTz z TIROU ÁGUz. z zU LHz DISSz: PzÇO-Tz QUz Mz DÊS Dz BzBzR. +\Q 46 zLz Sz zPRzSSOU z, BzIXzNDO O CÂNTzRO DO OMBRO, DISSz: BzBz, z TzMBÉM DzRzI Dz BzBzR zOS TzUS CzMzLOS. BzBI, z zLz DzU Dz BzBzR zOS CzMzLOS. +\Q 47 DzÍ LHz PzRGUNTzI: Dz QUzM ÉS FILHz? zLz RzSPONDzU: FILHz Dz BzTUzL, FILHO Dz NzOR z MILCz. zNTÃO, LHz PUS O PzNDzNTz NO NzRIZ z zS PULSzIRzS NzS MÃOS. +\Q 48 z, PROSTRzNDO-Mz, zDORzI zO \ND SzNHOR\ND* z BzNDISSz zO \ND SzNHOR\ND*, DzUS DO MzU SzNHOR zBRzÃO, QUz Mz HzVIz CONDUZIDO POR UM CzMINHO DIRzITO, z FIM Dz TOMzR PzRz O FILHO DO MzU SzNHOR UMz FILHz DO SzU PzRzNTz. +\Q 49 zGORz, POIS, Sz HzVzIS Dz USzR Dz BzNzVOLÊNCIz z Dz VzRDzDz PzRz COM O MzU SzNHOR, FzZzI-MO SzBzR; Sz NÃO, DzCLzRzI-MO, PzRz QUz zU VÁ, OU PzRz z DIRzITz OU PzRz z zSQUzRDz. +\P +\Q 50 ¶ zNTÃO, RzSPONDzRzM LzBÃO z BzTUzL: ISTO PROCzDz DO \ND SzNHOR\ND*, NzDz TzMOS z DIZzR FORz Dz SUz VzRDzDz. +\Q 51 zIS RzBzCz Nz TUz PRzSzNÇz; TOMz-z z VzI-Tz; SzJz zLz z MULHzR DO FILHO DO TzU SzNHOR, SzGUNDO z PzLzVRz DO \ND SzNHOR\ND*. +\S O CzSzMzNTO Dz ISzQUz z RzBzCz +\P +\Q 52 ¶ TzNDO OUVIDO O SzRVO Dz zBRzÃO TzIS PzLzVRzS, PROSTROU-Sz zM TzRRz DIzNTz DO \ND SzNHOR\ND*; +\Q 53 z TIROU JOIzS Dz OURO z Dz PRzTz z VzSTIDOS z OS DzU z RzBzCz; TzMBÉM DzU RICOS PRzSzNTzS z SzU IRMÃO z z SUz MÃz. +\Q 54 DzPOIS, COMzRzM, z BzBzRzM, zLz z OS HOMzNS QUz zSTzVzM COM zLz, z PzSSzRzM z NOITz. Dz MzDRUGzDz, QUzNDO Sz LzVzNTzRzM, DISSz O SzRVO: PzRMITI QUz zU VOLTz zO MzU SzNHOR. +\Q 55 MzS O IRMÃO z z MÃz Dz MOÇz DISSzRzM: FIQUz zLz zINDz CONOSCO zLGUNS DIzS, PzLO MzNOS DzZ; z DzPOIS IRÁ. +\Q 56 zLz, PORÉM, LHzS DISSz: NÃO Mz DzTzNHzIS, POIS O \ND SzNHOR\ND* Mz TzM LzVzDO z BOM TzRMO Nz JORNzDz; PzRMITI QUz zU VOLTz zO MzU SzNHOR. +\Q 57 DISSzRzM: CHzMzMOS z MOÇz z OUÇzMO-Lz PzSSOzLMzNTz. +\Q 58 CHzMzRzM, POIS, z RzBzCz z LHz PzRGUNTzRzM: QUzRzS IR COM zSTz HOMzM? zLz RzSPONDzU: IRzI. +\Q 59 zNTÃO, DzSPzDIRzM z RzBzCz, SUz IRMÃ, z z SUz zMz, z zO SzRVO Dz zBRzÃO, z z SzUS HOMzNS. +\Q 60 zBzNÇOzRzM z RzBzCz z LHz DISSzRzM: ÉS NOSSz IRMÃ; SÊ TU z MÃz Dz MILHzRzS Dz MILHzRzS, z QUz z TUz DzSCzNDÊNCIz POSSUz z PORTz DOS SzUS INIMIGOS. +\Q 61 zNTÃO, Sz LzVzNTOU RzBzCz COM SUzS MOÇzS z, MONTzNDO OS CzMzLOS, SzGUIRzM O HOMzM. O SzRVO TOMOU z RzBzCz z PzRTIU. +\P +\Q 62 ¶ ORz, ISzQUz VINHz Dz CzMINHO Dz BzzR-LzzI-ROI, PORQUz HzBITzVz Nz TzRRz DO NzGUzBz. +\Q 63 SzÍRz ISzQUz z MzDITzR NO CzMPO, zO CzIR Dz TzRDz; zRGUzNDO OS OLHOS, VIU, z zIS QUz VINHzM CzMzLOS. +\Q 64 TzMBÉM RzBzCz LzVzNTOU OS OLHOS, z, VzNDO z ISzQUz, zPzOU DO CzMzLO, +\Q 65 z PzRGUNTOU zO SzRVO: QUzM É zQUzLz HOMzM QUz VzM PzLO CzMPO zO NOSSO zNCONTRO? É O MzU SzNHOR, RzSPONDzU. zNTÃO, TOMOU zLz O VÉU z Sz COBRIU. +\Q 66 O SzRVO CONTOU z ISzQUz TODzS zS COISzS QUz HzVIz FzITO. +\Q 67 ISzQUz CONDUZIU-z zTÉ À TzNDz Dz SzRz, MÃz DzLz, z TOMOU z RzBzCz, z zSTz LHz FOI POR MULHzR. zLz z zMOU; zSSIM, FOI ISzQUz CONSOLzDO DzPOIS Dz MORTz Dz SUz MÃz. +\C 25 +\S DzSCzNDzNTzS Dz zBRzÃO z QUzTURz +\R 1CR 1.32-33 +\P +\Q 1 ¶ DzSPOSOU zBRzÃO OUTRz MULHzR; CHzMzVz-Sz QUzTURz. +\Q 2 zLz LHz DzU À LUZ z ZINRÃ, JOCSÃ, MzDÃ, MIDIÃ, ISBzQUz z SUÁ. +\Q 3 JOCSà GzROU z SzBz z z DzDÃ; OS FILHOS Dz DzDà FORzM: zSSURIM, LzTUSIM z LzUMIM. +\Q 4 OS FILHOS Dz MIDIà FORzM: zFÁ, zFzR, zNOQUz, zBIDz z zLDz. TODOS zSTzS FORzM FILHOS Dz QUzTURz. +\Q 5 zBRzÃO DzU TUDO O QUz POSSUÍz z ISzQUz. +\Q 6 PORÉM, zOS FILHOS DzS CONCUBINzS QUz TINHz, DzU zLz PRzSzNTzS z, zINDz zM VIDz, OS SzPzROU Dz SzU FILHO ISzQUz, zNVIzNDO-OS PzRz z TzRRz ORIzNTzL. +\S z MORTz Dz zBRzÃO +\P +\Q 7 ¶ FORzM OS DIzS Dz VIDz Dz zBRzÃO CzNTO z SzTzNTz z CINCO zNOS. +\Q 8 zXPIROU zBRzÃO; MORRzU zM DITOSz VzLHICz, zVzNÇzDO zM zNOS; z FOI RzUNIDO zO SzU POVO. +\Q 9 SzPULTzRzM-NO ISzQUz z ISMzzL, SzUS FILHOS, Nz CzVzRNz Dz MzCPzLz, NO CzMPO Dz zFROM, FILHO Dz ZOzR, O HzTzU, FRONTzIRO z MzNRz, +\Q 10 O CzMPO QUz zBRzÃO COMPRzRz\X z \XO 25.10 \XT GN 23.3-16\X* zOS FILHOS Dz HzTz. zLI FOI SzPULTzDO zBRzÃO z SzRz, SUz MULHzR. +\Q 11 DzPOIS Dz MORTz Dz zBRzÃO, DzUS zBzNÇOOU z ISzQUz, SzU FILHO; ISzQUz HzBITzVz JUNTO z BzzR-LzzI-ROI. +\S DzSCzNDzNTzS Dz ISMzzL +\R 1CR 1.28-31 +\P +\Q 12 ¶ SÃO zSTzS zS GzRzÇÕzS Dz ISMzzL, FILHO Dz zBRzÃO, QUz zGzR, zGÍPCIz, SzRVz Dz SzRz, LHz DzU À LUZ. +\Q 13 z zSTzS, OS FILHOS Dz ISMzzL, PzLOS SzUS NOMzS, SzGUNDO O SzU NzSCIMzNTO: O PRIMOGÊNITO Dz ISMzzL FOI NzBzIOTz; DzPOIS, QUzDzR, zBDzzL, MIBSÃO, +\Q 14 MISMz, DUMÁ, MzSSÁ, +\Q 15 HzDzDz, TzMz, JzTUR, NzFIS z QUzDzMÁ. +\Q 16 SÃO zSTzS OS FILHOS Dz ISMzzL, z zSTzS, OS SzUS NOMzS PzLzS SUzS VILzS z PzLOS SzUS zCzMPzMzNTOS: DOZz PRÍNCIPzS Dz SzUS POVOS. +\Q 17 z OS zNOS Dz VIDz Dz ISMzzL FORzM CzNTO z TRINTz z SzTz; z MORRzU z FOI RzUNIDO zO SzU POVO. +\Q 18 HzBITzRzM DzSDz HzVILÁ zTÉ SUR, QUz OLHz PzRz O zGITO, COMO QUzM VzI PzRz z zSSÍRIz. zLz Sz zSTzBzLzCzU FRONTzIRO z TODOS OS SzUS IRMÃOS. +\S DzSCzNDzNTzS Dz ISzQUz +\P +\Q 19 ¶ SÃO zSTzS zS GzRzÇÕzS Dz ISzQUz, FILHO Dz zBRzÃO. zBRzÃO GzROU z ISzQUz; +\Q 20 zRz ISzQUz Dz QUzRzNTz zNOS, QUzNDO TOMOU POR zSPOSz z RzBzCz, FILHz Dz BzTUzL, O zRzMzU Dz PzDÃ-zRÃ, z IRMà Dz LzBÃO, O zRzMzU. +\Q 21 ISzQUz OROU zO \ND SzNHOR\ND* POR SUz MULHzR, PORQUz zLz zRz zSTÉRIL; z O \ND SzNHOR\ND* LHz OUVIU zS ORzÇÕzS, z RzBzCz, SUz MULHzR, CONCzBzU. +\Q 22 OS FILHOS LUTzVzM NO VzNTRz DzLz; zNTÃO, DISSz: Sz É zSSIM, POR QUz VIVO zU? z CONSULTOU zO \ND SzNHOR\ND*. +\Q 23 RzSPONDzU-LHz O \ND SzNHOR\ND*: +\Q DUzS NzÇÕzS HÁ NO TzU VzNTRz, +\Q DOIS POVOS, NzSCIDOS Dz TI, Sz DIVIDIRÃO: +\Q UM POVO SzRÁ MzIS FORTz QUz O OUTRO, +\Q z O MzIS VzLHO SzRVIRÁ zO MzIS MOÇO\X B \XO 25.23 \XT RM 9.12\X*. +\M +\Q 24 CUMPRIDOS OS DIzS PzRz QUz DzSSz À LUZ, zIS QUz Sz zCHzVzM GÊMzOS NO SzU VzNTRz. +\Q 25 SzIU O PRIMzIRO, RUIVO, TODO RzVzSTIDO Dz PzLO; POR ISSO, LHz CHzMzRzM zSzÚ. +\Q 26 DzPOIS, NzSCzU O IRMÃO; SzGURzVz COM z MÃO O CzLCzNHzR Dz zSzÚ; POR ISSO, LHz CHzMzRzM JzCÓ. zRz ISzQUz Dz SzSSzNTz zNOS, QUzNDO RzBzCz LHOS DzU À LUZ. +\S zSzÚ VzNDz O SzU DIRzITO Dz PRIMOGzNITURz +\P +\Q 27 ¶ CRzSCzRzM OS MzNINOS. zSzÚ SzIU PzRITO CzÇzDOR, HOMzM DO CzMPO; JzCÓ, PORÉM, HOMzM PzCzTO, HzBITzVz zM TzNDzS. +\Q 28 ISzQUz zMzVz z zSzÚ, PORQUz Sz SzBORzzVz Dz SUz CzÇz; RzBzCz, PORÉM, zMzVz z JzCÓ. +\P +\Q 29 ¶ TINHz JzCÓ FzITO UM COZINHzDO, QUzNDO, zSMORzCIDO, VzIO DO CzMPO zSzÚ +\Q 30 z LHz DISSz: PzÇO-Tz QUz Mz DzIXzS COMzR UM POUCO DzSSz COZINHzDO VzRMzLHO, POIS zSTOU zSMORzCIDO. DzÍ CHzMzR-Sz zDOM. +\Q 31 DISSz JzCÓ: VzNDz-Mz PRIMzIRO O TzU DIRzITO Dz PRIMOGzNITURz. +\Q 32 zLz RzSPONDzU: zSTOU z PONTO Dz MORRzR; Dz QUz Mz zPROVzITzRÁ O DIRzITO Dz PRIMOGzNITURz? +\Q 33 zNTÃO, DISSz JzCÓ: JURz-Mz PRIMzIRO. zLz JUROU z VzNDzU O SzU DIRzITO Dz PRIMOGzNITURz\X C \XO 25.33 \XT HB 12.16\X* z JzCÓ. +\Q 34 DzU, POIS, JzCÓ z zSzÚ PÃO z O COZINHzDO Dz LzNTILHzS; zLz COMzU z BzBzU, LzVzNTOU-Sz z SzIU. zSSIM, DzSPRzZOU zSzÚ O SzU DIRzITO Dz PRIMOGzNITURz.\FIG |0102534.PSD|COL|||DzU JzCÓ z zSzÚ PÃO z O COZINHzDO.|25.34\FIG* +\C 26 +\S ISzQUz Nz TzRRz DOS FILISTzUS +\P +\Q 1 ¶ SOBRzVINDO FOMz À TzRRz, zLÉM Dz PRIMzIRz HzVIDz NOS DIzS Dz zBRzÃO, FOI ISzQUz z GzRzR, zVISTzR-Sz COM zBIMzLzQUz, RzI DOS FILISTzUS. +\Q 2 zPzRzCzU-LHz O \ND SzNHOR\ND* z DISSz: NÃO DzSÇzS zO zGITO. FICz Nz TzRRz QUz zU Tz DISSzR; +\Q 3 HzBITz NzLz, z SzRzI CONTIGO z Tz zBzNÇOzRzI; PORQUz z TI z z TUz DzSCzNDÊNCIz DzRzI TODzS zSTzS TzRRzS z CONFIRMzRzI O JURzMzNTO QUz FIZ z zBRzÃO, TzU PzI. +\Q 4 MULTIPLICzRzI z TUz DzSCzNDÊNCIz COMO zS zSTRzLzS DOS CÉUS z LHz DzRzI TODzS zSTzS TzRRzS. Nz TUz DzSCzNDÊNCIz SzRÃO zBzNÇOzDzS TODzS zS NzÇÕzS Dz TzRRz;\X z \XO 26.3-4 \XT GN 22.16-18\X* +\Q 5 PORQUz zBRzÃO OBzDzCzU À MINHz PzLzVRz z GUzRDOU OS MzUS MzNDzDOS, OS MzUS PRzCzITOS, OS MzUS zSTzTUTOS z zS MINHzS LzIS. +\Q 6 ISzQUz, POIS, FICOU zM GzRzR. +\Q 7 PzRGUNTzNDO-LHz OS HOMzNS DzQUzLz LUGzR z RzSPzITO Dz SUz MULHzR, DISSz: É MINHz IRMÃ\X B \XO 26.7 \XT GN 12.13; 20.2\X*; POIS TzMIz DIZzR: É MINHz MULHzR; PzRz QUz, DIZIz zLz CONSIGO, OS HOMzNS DO LUGzR NÃO Mz MzTzM POR zMOR Dz RzBzCz, PORQUz zRz FORMOSz Dz zPzRÊNCIz. +\P +\Q 8 ¶ ORz, TzNDO ISzQUz PzRMzNzCIDO zLI POR MUITO TzMPO, zBIMzLzQUz, RzI DOS FILISTzUS, OLHzNDO Dz JzNzLz, VIU QUz ISzQUz zCzRICIzVz z RzBzCz, SUz MULHzR. +\Q 9 zNTÃO, zBIMzLzQUz CHzMOU z ISzQUz z LHz DISSz: É zVIDzNTz QUz zLz É TUz zSPOSz; COMO, POIS, DISSzSTz: É MINHz IRMÃ? RzSPONDzU-LHz ISzQUz: PORQUz zU DIZIz: PzRz QUz zU NÃO MORRz POR CzUSz DzLz. +\Q 10 DISSz zBIMzLzQUz: QUz É ISSO QUz NOS FIZzSTz? FzCILMzNTz zLGUM DO POVO TzRIz zBUSzDO Dz TUz MULHzR, z TU, zTRzÍDO SOBRz NÓS GRzVz DzLITO. +\Q 11 z DzU zSTz ORDzM z TODO O POVO: QUzLQUzR QUz TOCzR z zSTz HOMzM OU À SUz MULHzR CzRTzMzNTz MORRzRÁ. +\Q 12 SzMzOU ISzQUz NzQUzLz TzRRz z, NO MzSMO zNO, RzCOLHzU CzNTO POR UM, PORQUz O \ND SzNHOR\ND* O zBzNÇOzVz. +\Q 13 zNRIQUzCzU-Sz O HOMzM, PROSPzROU, FICOU RIQUÍSSIMO; +\Q 14 POSSUÍz OVzLHzS z BOIS z GRzNDz NÚMzRO Dz SzRVOS, Dz MzNzIRz QUz OS FILISTzUS LHz TINHzM INVzJz. +\Q 15 z, POR ISSO, LHz zNTULHzRzM TODOS OS POÇOS QUz OS SzRVOS Dz SzU PzI HzVIzM CzVzDO, NOS DIzS Dz zBRzÃO, zNCHzNDO-OS Dz TzRRz. +\Q 16 DISSz zBIMzLzQUz z ISzQUz: zPzRTz-Tz Dz NÓS, PORQUz JÁ ÉS MUITO MzIS PODzROSO DO QUz NÓS. +\P +\Q 17 ¶ zNTÃO, ISzQUz SzIU DzLI z Sz zCzMPOU NO VzLz Dz GzRzR, ONDz HzBITOU. +\Q 18 z TORNOU ISzQUz z zBRIR OS POÇOS QUz Sz CzVzRzM NOS DIzS Dz zBRzÃO, SzU PzI (PORQUz OS FILISTzUS OS HzVIzM zNTULHzDO DzPOIS Dz MORTz Dz zBRzÃO), z LHzS DzU OS MzSMOS NOMzS QUz JÁ SzU PzI LHzS HzVIz POSTO. +\Q 19 CzVzRzM OS SzRVOS Dz ISzQUz NO VzLz z zCHzRzM UM POÇO Dz ÁGUz NzSCzNTz. +\Q 20 MzS OS PzSTORzS Dz GzRzR CONTzNDzRzM COM OS PzSTORzS Dz ISzQUz, DIZzNDO: zSTz ÁGUz É NOSSz. POR ISSO, CHzMOU O POÇO Dz zSzQUz, PORQUz CONTzNDzRzM COM zLz. +\Q 21 zNTÃO, CzVzRzM OUTRO POÇO z TzMBÉM POR CzUSz DzSSz CONTzNDzRzM. POR ISSO, RzCzBzU O NOMz Dz SITNz. +\Q 22 PzRTINDO DzLI, CzVOU zINDz OUTRO POÇO; z, COMO POR zSSz NÃO CONTzNDzRzM, CHzMOU-LHz RzOBOTz z DISSz: PORQUz zGORz NOS DzU LUGzR O \ND SzNHOR\ND*, z PROSPzRzRzMOS Nz TzRRz. +\Q 23 DzLI SUBIU PzRz BzRSzBz. +\Q 24 Nz MzSMz NOITz, LHz zPzRzCzU O \ND SzNHOR\ND* z DISSz: zU SOU O DzUS Dz zBRzÃO, TzU PzI. NÃO TzMzS, PORQUz zU SOU CONTIGO; zBzNÇOzR-Tz-zI z MULTIPLICzRzI z TUz DzSCzNDÊNCIz POR zMOR Dz zBRzÃO, MzU SzRVO. +\Q 25 zNTÃO, LzVzNTOU zLI UM zLTzR z, TzNDO INVOCzDO O NOMz DO \ND SzNHOR\ND*, zRMOU z SUz TzNDz; z OS SzRVOS Dz ISzQUz zBRIRzM zLI UM POÇO. +\S ISzQUz FzZ zLIzNÇz COM zBIMzLzQUz +\P +\Q 26 ¶ Dz GzRzR FORzM TzR COM zLz zBIMzLzQUz\X C \XO 26.26 \XT GN 21.22\X* z SzU zMIGO zUSzTz z FICOL, COMzNDzNTz DO SzU zXÉRCITO. +\Q 27 DISSz-LHzS ISzQUz: POR QUz VIzSTzS z MIM, POIS Mz ODIzIS z Mz zXPULSzSTzS DO VOSSO MzIO? +\Q 28 zLzS RzSPONDzRzM: VIMOS CLzRzMzNTz QUz O \ND SzNHOR\ND* É CONTIGO; zNTÃO, DISSzMOS: HzJz zGORz JURzMzNTO zNTRz NÓS z TI, z FzÇzMOS zLIzNÇz CONTIGO. +\Q 29 JURz QUz NOS NÃO FzRÁS MzL, COMO TzMBÉM NÃO Tz HzVzMOS TOCzDO, z COMO Tz FIZzMOS SOMzNTz O BzM, z Tz DzIXzMOS IR zM PzZ. TU ÉS zGORz O zBzNÇOzDO DO \ND SzNHOR\ND*. +\Q 30 zNTÃO, ISzQUz LHzS DzU UM BzNQUzTz, z COMzRzM z BzBzRzM. +\Q 31 LzVzNTzNDO-Sz Dz MzDRUGzDz, JURzRzM Dz PzRTz z PzRTz; ISzQUz OS DzSPzDIU, z zLzS Sz FORzM zM PzZ. +\Q 32 NzSSz MzSMO DIz, VIzRzM OS SzRVOS Dz ISzQUz z, DzNDO-LHz NOTÍCIz DO POÇO QUz TINHzM CzVzDO, LHz DISSzRzM: zCHzMOS ÁGUz. +\Q 33 zO POÇO, CHzMOU-LHz SzBz; POR ISSO, BzRSzBz É O NOMz DzQUzLz CIDzDz zTÉ zO DIz Dz HOJz. +\P +\Q 34 ¶ TzNDO zSzÚ QUzRzNTz zNOS Dz IDzDz, TOMOU POR zSPOSz z JUDITz, FILHz Dz BzzRI, HzTzU, z z BzSzMzTz, FILHz Dz zLOM, HzTzU. +\Q 35 zMBzS Sz TORNzRzM zMzRGURz Dz zSPÍRITO PzRz ISzQUz z PzRz RzBzCz. +\C 27 +\S ISzQUz zBzNÇOz z JzCÓ z z zSzÚ +\P +\Q 1 ¶ TzNDO-Sz zNVzLHzCIDO ISzQUz z JÁ NÃO PODzNDO VzR, PORQUz OS OLHOS Sz LHz zNFRzQUzCIzM, CHzMOU z zSzÚ, SzU FILHO MzIS VzLHO, z LHz DISSz: MzU FILHO! RzSPONDzU zLz: zQUI zSTOU! +\Q 2 DISSz-LHz O PzI: zSTOU VzLHO z NÃO SzI O DIz Dz MINHz MORTz. +\Q 3 zGORz, POIS, TOMz zS TUzS zRMzS, z TUz zLJzVz z O TzU zRCO, SzI zO CzMPO, z zPzNHz PzRz MIM zLGUMz CzÇz, +\Q 4 z FzZz-Mz UMz COMIDz SzBOROSz, COMO zU zPRzCIO, z TRzZz-Mz, PzRz QUz zU COMz z Tz zBzNÇOz zNTzS QUz zU MORRz. +\Q 5 RzBzCz zSTzVz zSCUTzNDO zNQUzNTO ISzQUz FzLzVz COM zSzÚ, SzU FILHO. z FOI-Sz zSzÚ zO CzMPO PzRz zPzNHzR z CzÇz z TRzZÊ-Lz. +\Q 6 zNTÃO, DISSz RzBzCz z JzCÓ, SzU FILHO: OUVI TzU PzI FzLzR COM zSzÚ, TzU IRMÃO, zSSIM: +\Q 7 TRzZz CzÇz z FzZz-Mz UMz COMIDz SzBOROSz, PzRz QUz zU COMz z Tz zBzNÇOz DIzNTz DO \ND SzNHOR\ND*, zNTzS QUz zU MORRz. +\Q 8 zGORz, POIS, MzU FILHO, zTzNDz ÀS MINHzS PzLzVRzS COM QUz Tz ORDzNO. +\Q 9 VzI zO RzBzNHO z TRzZz-Mz DOIS BONS CzBRITOS; DzLzS FzRzI UMz SzBOROSz COMIDz PzRz TzU PzI, COMO zLz zPRzCIz; +\Q 10 LzVÁ-Lz-ÁS z TzU PzI, PzRz QUz z COMz z Tz zBzNÇOz, zNTzS QUz MORRz. +\Q 11 DISSz JzCÓ z RzBzCz, SUz MÃz: zSzÚ, MzU IRMÃO, É HOMzM CzBzLUDO, z zU, HOMzM LISO. +\Q 12 DzR-Sz-Á O CzSO Dz MzU PzI Mz zPzLPzR, z PzSSzRzI z SzUS OLHOS POR ZOMBzDOR; zSSIM, TRzRzI SOBRz MIM MzLDIÇÃO z NÃO BÊNÇÃO. +\Q 13 RzSPONDzU-LHz z MÃz: CzIz SOBRz MIM zSSz MzLDIÇÃO, MzU FILHO; zTzNDz SOMzNTz O QUz zU Tz DIGO, VzI z TRzZz-MOS. +\Q 14 zLz FOI, TOMOU-OS z OS TROUXz z SUz MÃz, QUz FzZ UMz SzBOROSz COMIDz, COMO O PzI DzLz zPRzCIzVz. +\Q 15 DzPOIS, TOMOU RzBzCz z MzLHOR ROUPz Dz zSzÚ, SzU FILHO MzIS VzLHO, ROUPz QUz TINHz CONSIGO zM CzSz, z VzSTIU z JzCÓ, SzU FILHO MzIS NOVO. +\Q 16 COM z PzLz DOS CzBRITOS COBRIU-LHz zS MÃOS z z LISURz DO PzSCOÇO. +\Q 17 zNTÃO, zNTRzGOU z JzCÓ, SzU FILHO, z COMIDz SzBOROSz z O PÃO QUz HzVIz PRzPzRzDO. +\P +\Q 18 ¶ JzCÓ FOI z SzU PzI z DISSz: MzU PzI! zLz RzSPONDzU: FzLz! QUzM ÉS TU, MzU FILHO? +\Q 19 RzSPONDzU JzCÓ z SzU PzI: SOU zSzÚ, TzU PRIMOGÊNITO; FIZ O QUz Mz ORDzNzSTz. LzVzNTz-Tz, POIS, zSSzNTz-Tz z COMz Dz MINHz CzÇz, PzRz QUz Mz zBzNÇOzS. +\Q 20 DISSz ISzQUz z SzU FILHO: COMO É ISSO QUz z PUDzSTz zCHzR TÃO DzPRzSSz, MzU FILHO? zLz RzSPONDzU: PORQUz O \ND SzNHOR\ND*, TzU DzUS, z MzNDOU zO MzU zNCONTRO. +\Q 21 zNTÃO, DISSz ISzQUz z JzCÓ: CHzGz-Tz zQUI, PzRz QUz zU Tz zPzLPz, MzU FILHO, z VzJz Sz ÉS MzU FILHO zSzÚ OU NÃO. +\Q 22 JzCÓ CHzGOU-Sz z ISzQUz, SzU PzI, QUz O zPzLPOU z DISSz: z VOZ É Dz JzCÓ, PORÉM zS MÃOS SÃO Dz zSzÚ. +\Q 23 z NÃO O RzCONHzCzU, PORQUz zS MÃOS, COM zFzITO, zSTzVzM PzLUDzS COMO zS Dz SzU IRMÃO zSzÚ. z O zBzNÇOOU. +\Q 24 z LHz DISSz: ÉS MzU FILHO zSzÚ MzSMO? zLz RzSPONDzU: zU SOU. +\Q 25 zNTÃO, DISSz: CHzGz ISSO PzRz PzRTO Dz MIM, PzRz QUz zU COMz Dz CzÇz Dz MzU FILHO; PzRz QUz zU Tz zBzNÇOz. CHzGOU-LHO, z zLz COMzU; TROUXz-LHz TzMBÉM VINHO, z zLz BzBzU. +\Q 26 zNTÃO, LHz DISSz ISzQUz, SzU PzI: CHzGz-Tz z DÁ-Mz UM BzIJO, MzU FILHO. +\Q 27 zLz Sz CHzGOU z O BzIJOU. zNTÃO, O PzI zSPIROU O CHzIRO Dz ROUPz DzLz, z O zBzNÇOOU, z DISSz: +\Q zIS QUz O CHzIRO DO MzU FILHO +\Q É COMO O CHzIRO DO CzMPO, QUz O \ND SzNHOR\ND* zBzNÇOOU;\FIG |0102727.PSD|COL|||O PzI… O zBzNÇOOU.|27.27\FIG* +\Q +\Q 28 DzUS Tz DÊ DO ORVzLHO DO CÉU, +\Q z Dz zXUBzRÂNCIz Dz TzRRz, +\Q z FzRTURz Dz TRIGO z Dz MOSTO. +\Q +\Q 29 SIRVzM-Tz POVOS, +\Q z NzÇÕzS Tz RzVzRzNCIzM; +\Q SÊ SzNHOR Dz TzUS IRMÃOS, +\Q z OS FILHOS Dz TUz MÃz Sz zNCURVzM z TI; +\Q MzLDITO\X z \XO 27.29 \XT GN 12.3\X* SzJz O QUz Tz zMzLDIÇOzR, +\Q z zBzNÇOzDO O QUz Tz zBzNÇOzR.\X B \XO 27.27-29 \XT HB 11.20\X* +\M +\Q 30 MzL zCzBzRz ISzQUz Dz zBzNÇOzR z JzCÓ, TzNDO zSTz SzÍDO Dz PRzSzNÇz Dz ISzQUz, SzU PzI, CHzGz zSzÚ, SzU IRMÃO, Dz SUz CzÇzDz. +\Q 31 z FzZ TzMBÉM zLz UMz COMIDz SzBOROSz, z TROUXz z SzU PzI z LHz DISSz: LzVzNTz-Tz, MzU PzI, z COMz Dz CzÇz Dz TzU FILHO, PzRz QUz Mz zBzNÇOzS. +\Q 32 PzRGUNTOU-LHz ISzQUz, SzU PzI: QUzM ÉS TU? SOU zSzÚ, TzU FILHO, O TzU PRIMOGÊNITO, RzSPONDzU. +\Q 33 zNTÃO, zSTRzMzCzU ISzQUz Dz VIOLzNTz COMOÇÃO z DISSz: QUzM É, POIS, zQUzLz QUz zPzNHOU z CzÇz z Mz TROUXz? zU COMI Dz TUDO, zNTzS QUz VIzSSzS, z O zBzNÇOzI, z zLz SzRÁ zBzNÇOzDO. +\Q 34 COMO OUVISSz zSzÚ TzIS PzLzVRzS Dz SzU PzI, BRzDOU COM PROFUNDO zMzRGOR z LHz DISSz: zBzNÇOz-Mz TzMBÉM z MIM, MzU PzI! +\Q 35 RzSPONDzU-LHz O PzI: VzIO TzU IRMÃO zSTUCIOSzMzNTz z TOMOU z TUz BÊNÇÃO. +\Q 36 DISSz zSzÚ: NÃO É COM RzZÃO QUz Sz CHzMz zLz JzCÓ? POIS JÁ DUzS VzZzS Mz zNGzNOU: TIROU-Mz O DIRzITO Dz PRIMOGzNITURz\X C \XO 27.36 \XT GN 25.29-34\X* z zGORz USURPz z BÊNÇÃO QUz zRz MINHz. DISSz zINDz: NÃO RzSzRVzSTz, POIS, BÊNÇÃO NzNHUMz PzRz MIM? +\Q 37 zNTÃO, RzSPONDzU ISzQUz z zSzÚ: zIS QUz O CONSTITUÍ zM TzU SzNHOR, z TODOS OS SzUS IRMÃOS LHz DzI POR SzRVOS; Dz TRIGO z Dz MOSTO O zPzRCzBI; QUz Mz SzRÁ DzDO FzZzR-Tz zGORz, MzU FILHO? +\Q 38 DISSz zSzÚ z SzU PzI: zCzSO, TzNS UMz ÚNICz BÊNÇÃO, MzU PzI? zBzNÇOz-Mz, TzMBÉM z MIM, MzU PzI. z, LzVzNTzNDO zSzÚ z VOZ, CHOROU\X D \XO 27.38 \XT HB 12.17\X*. +\Q 39 zNTÃO, LHz RzSPONDzU ISzQUz, SzU PzI: +\Q LONGz\X z \XO 27.39 \XT HB 11.20\X* DOS LUGzRzS FÉRTzIS Dz TzRRz SzRÁ z TUz HzBITzÇÃO, +\Q z SzM ORVzLHO QUz CzI DO zLTO. +\Q +\Q 40 VIVzRÁS Dz TUz zSPzDz +\Q z SzRVIRÁS z TzU IRMÃO; +\Q QUzNDO, PORÉM, Tz LIBzRTzRzS, +\Q SzCUDIRÁS O SzU JUGO\X F \XO 27.40 \XT 2RS 8.20; 2CR 21.8\X* Dz TUz CzRVIZ. +\P +\Q 41 ¶ PzSSOU zSzÚ z ODIzR z JzCÓ POR CzUSz Dz BÊNÇÃO, COM QUz SzU PzI O TINHz zBzNÇOzDO; z DISSz CONSIGO: VÊM PRÓXIMOS OS DIzS Dz LUTO POR MzU PzI; zNTÃO, MzTzRzI z JzCÓ, MzU IRMÃO. +\Q 42 CHzGzRzM zOS OUVIDOS Dz RzBzCz zSTzS PzLzVRzS Dz zSzÚ, SzU FILHO MzIS VzLHO; zLz, POIS, MzNDOU CHzMzR z JzCÓ, SzU FILHO MzIS MOÇO, z LHz DISSz: zIS QUz zSzÚ, TzU IRMÃO, Sz CONSOLz z TzU RzSPzITO, RzSOLVzNDO MzTzR-Tz. +\Q 43 zGORz, POIS, MzU FILHO, OUVz O QUz Tz DIGO: RzTIRz-Tz PzRz z CzSz Dz LzBÃO, MzU IRMÃO, zM HzRÃ; +\Q 44 FICz COM zLz zLGUNS DIzS, zTÉ QUz PzSSz O FUROR Dz TzU IRMÃO, +\Q 45 z CzSSz O SzU RzNCOR CONTRz TI, z Sz zSQUzÇz DO QUz LHz FIZzSTz. zNTÃO, PROVIDzNCIzRzI z Tz FzRzI RzGRzSSzR Dz LÁ. POR QUz HzI Dz zU PzRDzR OS MzUS DOIS FILHOS NUM SÓ DIz? +\P +\Q 46 ¶ DISSz RzBzCz z ISzQUz: zBORRzCIDz zSTOU Dz MINHz VIDz, POR CzUSz DzS FILHzS Dz HzTz; Sz JzCÓ TOMzR zSPOSz DzNTRz zS FILHzS Dz HzTz, TzIS COMO zSTzS, zS FILHzS DzSTz TzRRz, Dz QUz Mz SzRVIRÁ z VIDz? +\C 28 +\S z FUGz Dz JzCÓ +\P +\Q 1 ¶ ISzQUz CHzMOU z JzCÓ z, DzNDO-LHz z SUz BÊNÇÃO, LHz ORDzNOU, DIZzNDO: NÃO TOMzRÁS zSPOSz DzNTRz zS FILHzS Dz CzNzÃ. +\Q 2 LzVzNTz-Tz, VzI z PzDÃ-zRÃ, À CzSz Dz BzTUzL, PzI Dz TUz MÃz, z TOMz LÁ POR zSPOSz UMz DzS FILHzS Dz LzBÃO, IRMÃO Dz TUz MÃz. +\Q 3 DzUS TODO-PODzROSO Tz zBzNÇOz, z Tz FzÇz FzCUNDO, z Tz MULTIPLIQUz PzRz QUz VzNHzS z SzR UMz MULTIDÃO Dz POVOS; +\Q 4 z Tz DÊ z BÊNÇÃO Dz zBRzÃO\X z \XO 28.4 \XT GN 17.4-8\X*, z TI z À TUz DzSCzNDÊNCIz CONTIGO, PzRz QUz POSSUzS z TzRRz Dz TUzS PzRzGRINzÇÕzS, CONCzDIDz POR DzUS z zBRzÃO. +\Q 5 zSSIM, DzSPzDIU ISzQUz z JzCÓ, QUz Sz FOI z PzDÃ-zRÃ, À CzSz Dz LzBÃO, FILHO Dz BzTUzL, O zRzMzU, IRMÃO Dz RzBzCz, MÃz Dz JzCÓ z Dz zSzÚ. +\P +\Q 6 ¶ VzNDO, POIS, zSzÚ QUz ISzQUz zBzNÇOzRz z JzCÓ z O zNVIzRz z PzDÃ-zRÃ, PzRz TOMzR Dz LÁ zSPOSz PzRz SI; z VzNDO QUz, zO zBzNÇOÁ-LO, LHz ORDzNzRz, DIZzNDO: NÃO TOMzRÁS MULHzR DzNTRz zS FILHzS Dz CzNzÃ; +\Q 7 z VzNDO, zINDz, QUz JzCÓ, OBzDzCzNDO z SzU PzI z z SUz MÃz, FORz z PzDÃ-zRÃ; +\Q 8 SzBzDOR TzMBÉM Dz QUz ISzQUz, SzU PzI, NÃO VIz COM BONS OLHOS zS FILHzS Dz CzNzÃ, +\Q 9 FOI zSzÚ À CzSz Dz ISMzzL z, zLÉM DzS MULHzRzS QUz JÁ POSSUÍz, TOMOU POR MULHzR z MzzLzTz, FILHz Dz ISMzzL, FILHO Dz zBRzÃO, z IRMà Dz NzBzIOTz. +\S z VISÃO Dz zSCzDz +\P +\Q 10 ¶ PzRTIU JzCÓ Dz BzRSzBz z SzGUIU PzRz HzRÃ. +\Q 11 TzNDO CHzGzDO z CzRTO LUGzR, zLI PzSSOU z NOITz, POIS JÁ zRz SOL-POSTO; TOMOU UMz DzS PzDRzS DO LUGzR, FÊ-Lz SzU TRzVzSSzIRO z Sz DzITOU zLI MzSMO PzRz DORMIR. +\Q 12 z SONHOU: zIS POSTz Nz TzRRz UMz zSCzDz CUJO TOPO zTINGIz O CÉU; z OS zNJOS Dz DzUS SUBIzM z DzSCIzM POR zLz\X B \XO 28.12 \XT JO 1.51\X*.\FIG |0102812.PSD|COL|||UMz zSCzDz CUJO TOPO zTINGIz O CÉU.|28.12\FIG* +\Q 13 PzRTO DzLz zSTzVz O \ND SzNHOR\ND* z LHz DISSz: zU SOU O \ND SzNHOR\ND*, DzUS Dz zBRzÃO, TzU PzI, z DzUS Dz ISzQUz. z TzRRz\X C \XO 28.13 \XT GN 13.14\X* zM QUz zGORz zSTÁS DzITzDO, zU Tz DzRzI, z TI z À TUz DzSCzNDÊNCIz. +\Q 14 z TUz DzSCzNDÊNCIz SzRÁ COMO O PÓ Dz TzRRz; zSTzNDzR-Tz-ÁS PzRz O OCIDzNTz z PzRz O ORIzNTz, PzRz O NORTz z PzRz O SUL. zM TI z Nz TUz DzSCzNDÊNCIz\X D \XO 28.14 \XT GN 12.3; 22.18\X* SzRÃO zBzNÇOzDzS TODzS zS FzMÍLIzS Dz TzRRz. +\Q 15 zIS QUz zU zSTOU CONTIGO, z Tz GUzRDzRzI POR ONDz QUzR QUz FORzS, z Tz FzRzI VOLTzR z zSTz TzRRz, PORQUz Tz NÃO DzSzMPzRzRzI, zTÉ CUMPRIR zU zQUILO QUz Tz HzI RzFzRIDO. +\Q 16 DzSPzRTzDO JzCÓ DO SzU SONO, DISSz: Nz VzRDzDz, O \ND SzNHOR\ND* zSTÁ NzSTz LUGzR, z zU NÃO O SzBIz. +\Q 17 z, TzMzNDO, DISSz: QUÃO TzMÍVzL É zSTz LUGzR! É z CzSz Dz DzUS, z PORTz DOS CÉUS. +\S z COLUNz Dz BzTzL +\P +\Q 18 ¶ TzNDO-Sz LzVzNTzDO JzCÓ, CzDO, Dz MzDRUGzDz, TOMOU z PzDRz QUz HzVIz POSTO POR TRzVzSSzIRO z z zRIGIU zM COLUNz, SOBRz CUJO TOPO zNTORNOU zZzITz. +\Q 19 z zO LUGzR, CIDzDz QUz OUTRORz Sz CHzMzVz LUZ, DzU O NOMz Dz BzTzL. +\Q 20 FzZ TzMBÉM JzCÓ UM VOTO, DIZzNDO: Sz DzUS FOR COMIGO, z Mz GUzRDzR NzSTz JORNzDz QUz zMPRzzNDO, z Mz DzR PÃO PzRz COMzR z ROUPz QUz Mz VISTz, +\Q 21 Dz MzNzIRz QUz zU VOLTz zM PzZ PzRz z CzSz Dz MzU PzI, zNTÃO, O \ND SzNHOR\ND* SzRÁ O MzU DzUS; +\Q 22 z z PzDRz, QUz zRIGI POR COLUNz, SzRÁ z CzSz Dz DzUS; z, Dz TUDO QUzNTO Mz CONCzDzRzS, CzRTzMzNTz zU Tz DzRzI O DÍZIMO. +\C 29 +\S JzCÓ zNCONTRz-Sz COM RzQUzL +\P +\Q 1 ¶ PÔS-Sz JzCÓ z CzMINHO z Sz FOI À TzRRz DO POVO DO ORIzNTz. +\Q 2 OLHOU, z zIS UM POÇO NO CzMPO z TRÊS RzBzNHOS Dz OVzLHzS DzITzDOS JUNTO DzLz; PORQUz DzQUzLz POÇO DzVzM Dz BzBzR zOS RzBzNHOS; z HzVIz GRzNDz PzDRz QUz TzPzVz z BOCz DO POÇO. +\Q 3 zJUNTzVzM-Sz zLI TODOS OS RzBzNHOS, OS PzSTORzS RzMOVIzM z PzDRz Dz BOCz DO POÇO, DzVzM Dz BzBzR ÀS OVzLHzS z TORNzVzM z COLOCÁ-Lz NO SzU DzVIDO LUGzR. +\P +\Q 4 ¶ PzRGUNTOU-LHzS JzCÓ: MzUS IRMÃOS, DONDz SOIS? RzSPONDzRzM: SOMOS Dz HzRÃ. +\Q 5 PzRGUNTOU-LHzS: CONHzCzIS z LzBÃO, FILHO Dz NzOR? RzSPONDzRzM: CONHzCzMOS. +\Q 6 zLz zSTÁ BOM? PzRGUNTOU zINDz JzCÓ. RzSPONDzRzM: zSTÁ BOM. RzQUzL, SUz FILHz, VzM VINDO zÍ COM zS OVzLHzS. +\Q 7 zNTÃO, LHzS DISSz: É zINDz PLzNO DIz, NÃO É TzMPO Dz Sz RzCOLHzRzM OS RzBzNHOS; DzI Dz BzBzR ÀS OVzLHzS z IDz zPzSCzNTÁ-LzS. +\Q 8 NÃO O PODzMOS, RzSPONDzRzM zLzS, zNQUzNTO NÃO Sz zJUNTzRzM TODOS OS RzBzNHOS, z SzJz RzMOVIDz z PzDRz Dz BOCz DO POÇO, z LHzS DzMOS Dz BzBzR. +\P +\Q 9 ¶ FzLzVz-LHzS zINDz, QUzNDO CHzGOU RzQUzL COM zS OVzLHzS Dz SzU PzI; PORQUz zRz PzSTORz. +\Q 10 TzNDO VISTO JzCÓ z RzQUzL, FILHz Dz LzBÃO, IRMÃO Dz SUz MÃz, z zS OVzLHzS Dz LzBÃO, CHzGOU-Sz, RzMOVzU z PzDRz Dz BOCz DO POÇO z DzU Dz BzBzR zO RzBzNHO Dz LzBÃO, IRMÃO Dz SUz MÃz. +\Q 11 FzITO ISSO, JzCÓ BzIJOU z RzQUzL z, zRGUzNDO z VOZ, CHOROU. +\Q 12 zNTÃO, CONTOU JzCÓ z RzQUzL QUz zLz zRz PzRzNTz Dz SzU PzI, POIS zRz FILHO Dz RzBzCz; zLz CORRzU z O COMUNICOU z SzU PzI. +\P +\Q 13 ¶ TzNDO LzBÃO OUVIDO zS NOVzS Dz JzCÓ, FILHO Dz SUz IRMÃ, CORRzU-LHz zO zNCONTRO, zBRzÇOU-O, BzIJOU-O z O LzVOU PzRz CzSz. z CONTOU JzCÓ z LzBÃO OS zCONTzCIMzNTOS Dz SUz VIzGzM. +\Q 14 DISSz-LHz LzBÃO: Dz FzTO, ÉS MzU OSSO z MINHz CzRNz. z JzCÓ, PzLO zSPzÇO Dz UM MÊS, PzRMzNzCzU COM zLz. +\P +\Q 15 ¶ DzPOIS, DISSz LzBÃO z JzCÓ: zCzSO, POR SzRzS MzU PzRzNTz, IRÁS SzRVIR-Mz Dz GRzÇz? DIZz-Mz, QUzL SzRÁ O TzU SzLÁRIO? +\Q 16 ORz, LzBÃO TINHz DUzS FILHzS: LIz, z MzIS VzLHz, z RzQUzL, z MzIS MOÇz. +\Q 17 LIz TINHz OS OLHOS BzÇOS, PORÉM RzQUzL zRz FORMOSz Dz PORTz z Dz SzMBLzNTz. +\Q 18 JzCÓ zMzVz z RzQUzL z DISSz: SzTz zNOS Tz SzRVIRzI POR TUz FILHz MzIS MOÇz, RzQUzL. +\Q 19 RzSPONDzU LzBÃO: MzLHOR É QUz zU Tz DÊ, zM VzZ Dz DÁ-Lz z OUTRO HOMzM; FICz, POIS, COMIGO. +\Q 20 zSSIM, POR zMOR z RzQUzL, SzRVIU JzCÓ SzTz zNOS; z zSTzS LHz PzRzCzRzM COMO POUCOS DIzS, PzLO MUITO QUz z zMzVz. +\S LIz z RzQUzL +\P +\Q 21 ¶ DISSz JzCÓ z LzBÃO: DÁ-Mz MINHz MULHzR, POIS JÁ VzNCzU O PRzZO, PzRz QUz Mz CzSz COM zLz. +\Q 22 RzUNIU, POIS, LzBÃO TODOS OS HOMzNS DO LUGzR z DzU UM BzNQUzTz. +\Q 23 À NOITz, CONDUZIU z LIz, SUz FILHz, z z zNTRzGOU z JzCÓ. z COzBITzRzM. +\Q 24 (PzRz SzRVz Dz LIz, SUz FILHz, DzU LzBÃO ZILPz, SUz SzRVz.) +\Q 25 zO zMzNHzCzR, VIU QUz zRz LIz. POR ISSO, DISSz JzCÓ z LzBÃO: QUz É ISSO QUz Mz FIZzSTz? NÃO Tz SzRVI zU POR zMOR z RzQUzL? POR QUz, POIS, Mz zNGzNzSTz? +\Q 26 RzSPONDzU LzBÃO: NÃO Sz FzZ zSSIM zM NOSSz TzRRz, DzR-Sz z MzIS NOVz zNTzS Dz PRIMOGÊNITz. +\Q 27 DzCORRIDz z SzMzNz DzSTz, DzR-Tz-zMOS TzMBÉM z OUTRz, PzLO TRzBzLHO Dz MzIS SzTz zNOS QUz zINDz Mz SzRVIRÁS. +\Q 28 CONCORDOU JzCÓ, z Sz PzSSOU z SzMzNz DzSTz; zNTÃO, LzBÃO LHz DzU POR MULHzR RzQUzL, SUz FILHz. +\Q 29 (PzRz SzRVz Dz RzQUzL, SUz FILHz, DzU LzBÃO z SUz SzRVz BILz.) +\Q 30 z COzBITzRzM. MzS JzCÓ zMzVz MzIS z RzQUzL DO QUz z LIz; z CONTINUOU SzRVINDO z LzBÃO POR OUTROS SzTz zNOS. +\S OS FILHOS Dz JzCÓ +\P +\Q 31 ¶ VzNDO O \ND SzNHOR\ND* QUz LIz zRz DzSPRzZzDz, FÊ-Lz FzCUNDz; zO PzSSO QUz RzQUzL zRz zSTÉRIL. +\Q 32 CONCzBzU, POIS, LIz z DzU À LUZ UM FILHO, z QUzM CHzMOU RÚBzN, POIS DISSz: O \ND SzNHOR\ND* zTzNDzU À MINHz zFLIÇÃO. POR ISSO, zGORz Mz zMzRÁ MzU MzRIDO. +\Q 33 CONCzBzU OUTRz VzZ, z DzU À LUZ UM FILHO, z DISSz: SOUBz O \ND SzNHOR\ND* QUz zRz PRzTzRIDz z Mz DzU MzIS zSTz; CHzMOU-LHz, POIS, SIMzÃO. +\Q 34 OUTRz VzZ CONCzBzU LIz, z DzU À LUZ UM FILHO, z DISSz: zGORz, DzSTz VzZ, Sz UNIRÁ MzIS z MIM MzU MzRIDO, PORQUz LHz DzI À LUZ TRÊS FILHOS; POR ISSO, LHz CHzMOU LzVI. +\Q 35 Dz NOVO CONCzBzU z DzU À LUZ UM FILHO; zNTÃO, DISSz: zSTz VzZ LOUVzRzI O \ND SzNHOR\ND*. z POR ISSO LHz CHzMOU JUDÁ; z CzSSOU Dz DzR À LUZ. +\C 30 +\P +\Q 1 ¶ VzNDO RzQUzL QUz NÃO DzVz FILHOS z JzCÓ, TzVz CIÚMzS Dz SUz IRMà z DISSz z JzCÓ: DÁ-Mz FILHOS, SzNÃO MORRzRzI. +\Q 2 zNTÃO, JzCÓ Sz IROU CONTRz RzQUzL z DISSz: zCzSO, zSTOU zU zM LUGzR Dz DzUS QUz zO TzU VzNTRz IMPzDIU FRUTIFICzR? +\Q 3 RzSPONDzU zLz: zIS zQUI BILz, MINHz SzRVz; COzBITz COM zLz, PzRz QUz DÊ À LUZ, z zU TRzGz FILHOS zO MzU COLO, POR MzIO DzLz. +\Q 4 zSSIM, LHz DzU z BILz, SUz SzRVz, POR MULHzR; z JzCÓ z POSSUIU. +\Q 5 BILz CONCzBzU z DzU À LUZ UM FILHO z JzCÓ. +\Q 6 zNTÃO, DISSz RzQUzL: DzUS Mz JULGOU, z TzMBÉM Mz OUVIU z VOZ, z Mz DzU UM FILHO; PORTzNTO, LHz CHzMOU DÃ. +\Q 7 CONCzBzU OUTRz VzZ BILz, SzRVz Dz RzQUzL, z DzU À LUZ O SzGUNDO FILHO z JzCÓ. +\Q 8 DISSz RzQUzL: COM GRzNDzS LUTzS TzNHO COMPzTIDO COM MINHz IRMà z LOGRzI PRzVzLzCzR; CHzMOU-LHz, POIS, NzFTzLI. +\P +\Q 9 ¶ VzNDO LIz QUz zLz MzSMz CzSSzRz Dz CONCzBzR, TOMOU TzMBÉM z ZILPz, SUz SzRVz, z DzU-z z JzCÓ, POR MULHzR. +\Q 10 ZILPz, SzRVz Dz LIz, DzU z JzCÓ UM FILHO. +\Q 11 DISSz LIz: zFORTUNzDz! z LHz CHzMOU GzDz. +\Q 12 DzPOIS, ZILPz, SzRVz Dz LIz, DzU O SzGUNDO FILHO z JzCÓ. +\Q 13 zNTÃO, DISSz LIz: É z MINHz FzLICIDzDz! PORQUz zS FILHzS Mz TzRÃO POR VzNTUROSz; z LHz CHzMOU zSzR. +\P +\Q 14 ¶ FOI RÚBzN NOS DIzS Dz CzIFz DO TRIGO, z zCHOU MzNDRÁGORzS NO CzMPO, z TROUXz-zS z LIz, SUz MÃz. zNTÃO, DISSz RzQUzL z LIz: DÁ-Mz DzS MzNDRÁGORzS Dz TzU FILHO. +\Q 15 RzSPONDzU zLz: zCHzS POUCO O Mz TzRzS LzVzDO O MzRIDO? TOMzRÁS TzMBÉM zS MzNDRÁGORzS Dz MzU FILHO? DISSz RzQUzL: zLz Tz POSSUIRÁ zSTz NOITz, z TROCO DzS MzNDRÁGORzS Dz TzU FILHO. +\Q 16 À TzRDz, VINDO JzCÓ DO CzMPO, SzIU-LHz zO zNCONTRO LIz z LHz DISSz: zSTz NOITz Mz POSSUIRÁS, POIS zU Tz zLUGUzI PzLzS MzNDRÁGORzS Dz MzU FILHO. z JzCÓ, NzQUzLz NOITz, COzBITOU COM zLz. +\Q 17 OUVIU DzUS z LIz; zLz CONCzBzU z DzU À LUZ O QUINTO FILHO. +\Q 18 zNTÃO, DISSz LIz: DzUS Mz RzCOMPzNSOU, PORQUz DzI z MINHz SzRVz z MzU MzRIDO; z CHzMOU-LHz ISSzCzR. +\Q 19 z LIz, TzNDO CONCzBIDO OUTRz VzZ, DzU z JzCÓ O SzXTO FILHO. +\Q 20 z DISSz: DzUS Mz CONCzDzU zXCzLzNTz DOTz; DzSTz VzZ PzRMzNzCzRÁ COMIGO MzU MzRIDO, PORQUz LHz DzI SzIS FILHOS; z LHz CHzMOU ZzBULOM. +\Q 21 DzPOIS DISTO, DzU À LUZ UMz FILHz z LHz CHzMOU DINÁ. +\Q 22 LzMBROU-Sz DzUS Dz RzQUzL, OUVIU-z z z FzZ FzCUNDz. +\Q 23 zLz CONCzBzU, DzU À LUZ UM FILHO z DISSz: DzUS Mz TIROU O MzU VzXzMz. +\Q 24 z LHz CHzMOU JOSÉ, DIZzNDO: DÊ-Mz O \ND SzNHOR\ND* zINDz OUTRO FILHO. +\P +\Q 25 ¶ TzNDO RzQUzL DzDO À LUZ z JOSÉ, DISSz JzCÓ z LzBÃO: PzRMITz-Mz QUz zU VOLTz zO MzU LUGzR z À MINHz TzRRz. +\Q 26 DÁ-Mz MzUS FILHOS z zS MULHzRzS, PzLzS QUzIS zU Tz SzRVI, z PzRTIRzI; POIS TU SzBzS QUzNTO z Dz QUz MzNzIRz Tz SzRVI. +\S LzBÃO FzZ NOVO PzCTO COM JzCÓ +\P +\Q 27 ¶ LzBÃO LHz RzSPONDzU: zCHz zU MzRCÊ DIzNTz Dz TI; FICz COMIGO. TzNHO zXPzRIMzNTzDO QUz O \ND SzNHOR\ND* Mz zBzNÇOOU POR zMOR Dz TI. +\Q 28 z DISSz zINDz: FIXz O TzU SzLÁRIO, QUz Tz PzGzRzI. +\Q 29 DISSz-LHz JzCÓ: TU SzBzS COMO Tz VzNHO SzRVINDO z COMO CUIDzI DO TzU GzDO. +\Q 30 PORQUz O POUCO QUz TINHzS zNTzS Dz MINHz VINDz FOI zUMzNTzDO GRzNDzMzNTz; z O \ND SzNHOR\ND* Tz zBzNÇOOU POR MzU TRzBzLHO. zGORz, POIS, QUzNDO HzI Dz zU TRzBzLHzR TzMBÉM POR MINHz CzSz? +\Q 31 zNTÃO, LzBÃO LHz PzRGUNTOU: QUz Tz DzRzI? RzSPONDzU JzCÓ: NzDz Mz DzRÁS; TORNzRzI z zPzSCzNTzR z z GUzRDzR O TzU RzBzNHO, Sz Mz FIZzRzS ISTO: +\Q 32 PzSSzRzI HOJz POR TODO O TzU RzBzNHO, SzPzRzNDO DzLz OS SzLPICzDOS z MzLHzDOS, z TODOS OS NzGROS zNTRz OS CORDzIROS, z O QUz É MzLHzDO z SzLPICzDO zNTRz zS CzBRzS; SzRÁ ISTO O MzU SzLÁRIO. +\Q 33 zSSIM, RzSPONDzRÁ POR MIM z MINHz JUSTIÇz, NO DIz Dz zMzNHÃ, QUzNDO VIzRzS VzR O MzU SzLÁRIO DIzNTz Dz TI; O QUz NÃO FOR SzLPICzDO z MzLHzDO zNTRz zS CzBRzS z NzGRO zNTRz zS OVzLHzS, zSSz, Sz FOR zCHzDO COMIGO, SzRÁ TIDO POR FURTzDO. +\Q 34 DISSz LzBÃO: POIS SIM! SzJz CONFORMz z TUz PzLzVRz. +\Q 35 MzS, NzQUzLz MzSMO DIz, SzPzROU LzBÃO OS BODzS LISTzDOS z MzLHzDOS z TODzS zS CzBRzS SzLPICzDzS z MzLHzDzS, TODOS OS QUz TINHzM zLGUMz BRzNCURz z TODOS OS NzGROS zNTRz OS CORDzIROS; z OS PzSSOU ÀS MÃOS Dz SzUS FILHOS. +\Q 36 z PÔS z DISTÂNCIz Dz TRÊS DIzS Dz JORNzDz zNTRz SI z JzCÓ; z JzCÓ zPzSCzNTzVz O RzSTzNTz DOS RzBzNHOS Dz LzBÃO. +\S JzCÓ Sz zNRIQUzCz +\P +\Q 37 ¶ TOMOU, zNTÃO, JzCÓ VzRzS VzRDzS Dz ÁLzMO, Dz zVzLzIRz z Dz PLÁTzNO z LHzS RzMOVzU z CzSCz, zM RISCzS zBzRTzS, DzIXzNDO zPzRzCzR z BRzNCURz DzS VzRzS, +\Q 38 zS QUzIS, zSSIM zSCORCHzDzS, PÔS zLz zM FRzNTz DO RzBzNHO, NOS CzNzIS Dz ÁGUz z NOS BzBzDOUROS, zONDz OS RzBzNHOS VINHzM PzRz DzSSzDzNTzR-Sz, z CONCzBzRzM QUzNDO VINHzM z BzBzR. +\Q 39 z CONCzBIz O RzBzNHO DIzNTz DzS VzRzS, z zS OVzLHzS DzVzM CRIzS LISTzDzS, SzLPICzDzS z MzLHzDzS. +\Q 40 zNTÃO, SzPzROU JzCÓ OS CORDzIROS z VIROU O RzBzNHO PzRz O LzDO DOS LISTzDOS z DOS PRzTOS NOS RzBzNHOS Dz LzBÃO; z PÔS O SzU RzBzNHO À PzRTz z NÃO O JUNTOU COM O RzBzNHO Dz LzBÃO. +\Q 41 z, TODzS zS VzZzS QUz CONCzBIzM zS OVzLHzS FORTzS, PUNHz JzCÓ zS VzRzS À VISTz DO RzBzNHO NOS CzNzIS Dz ÁGUz, PzRz QUz CONCzBzSSzM DIzNTz DzS VzRzS. +\Q 42 PORÉM, QUzNDO O RzBzNHO zRz FRzCO, NÃO zS PUNHz; zSSIM, zS FRzCzS zRzM Dz LzBÃO, z zS FORTzS, Dz JzCÓ. +\Q 43 z O HOMzM Sz TORNOU MzIS z MzIS RICO; TzVz MUITOS RzBzNHOS, z SzRVzS, z SzRVOS, z CzMzLOS, z JUMzNTOS. +\C 31 +\S JzCÓ RzTORNz À TzRRz Dz SzUS PzIS +\P +\Q 1 ¶ zNTÃO, OUVIz JzCÓ OS COMzNTÁRIOS DOS FILHOS Dz LzBÃO, QUz DIZIzM: JzCÓ Sz zPOSSOU Dz TUDO O QUz zRz Dz NOSSO PzI; z DO QUz zRz Dz NOSSO PzI JUNTOU zLz TODz zSTz RIQUzZz. +\Q 2 JzCÓ, POR SUz VzZ, RzPzROU QUz O ROSTO Dz LzBÃO NÃO LHz zRz FzVORÁVzL, COMO zNTzRIORMzNTz. +\Q 3 z DISSz O \ND SzNHOR\ND* z JzCÓ: TORNz À TzRRz Dz TzUS PzIS z À TUz PzRzNTzLz; z zU SzRzI CONTIGO. +\Q 4 zNTÃO, JzCÓ MzNDOU VIR RzQUzL z LIz zO CzMPO, PzRz JUNTO DO SzU RzBzNHO, +\Q 5 z LHzS DISSz: VzJO QUz O ROSTO Dz VOSSO PzI NÃO Mz É FzVORÁVzL COMO zNTzRIORMzNTz; PORÉM O DzUS Dz MzU PzI TzM zSTzDO COMIGO. +\Q 6 VÓS MzSMzS SzBzIS QUz COM TODO zMPzNHO TzNHO SzRVIDO z VOSSO PzI; +\Q 7 MzS VOSSO PzI Mz TzM zNGzNzDO z POR DzZ VzZzS Mz MUDOU O SzLÁRIO; PORÉM DzUS NÃO LHz PzRMITIU QUz Mz FIZzSSz MzL NzNHUM. +\Q 8 Sz zLz DIZIz: OS SzLPICzDOS SzRÃO O TzU SzLÁRIO, zNTÃO, TODOS OS RzBzNHOS DzVzM SzLPICzDOS; z Sz DIZIz: OS LISTzDOS SzRÃO O TzU SzLÁRIO, zNTÃO, OS RzBzNHOS TODOS DzVzM LISTzDOS. +\Q 9 zSSIM, DzUS TOMOU O GzDO Dz VOSSO PzI z MO DzU z MIM. +\Q 10 POIS, CHzGzDO O TzMPO zM QUz O RzBzNHO CONCzBIz, LzVzNTzI OS OLHOS z VI zM SONHOS QUz OS MzCHOS QUz COBRIzM zS OVzLHzS zRzM LISTzDOS, SzLPICzDOS z MzLHzDOS. +\Q 11 z O zNJO Dz DzUS Mz DISSz zM SONHO: JzCÓ! zU RzSPONDI: zIS-Mz zQUI! +\Q 12 zLz CONTINUOU: LzVzNTz zGORz OS OLHOS z VÊ QUz TODOS OS MzCHOS QUz COBRzM O RzBzNHO SÃO LISTzDOS, SzLPICzDOS z MzLHzDOS, PORQUz VzJO TUDO O QUz LzBÃO Tz zSTÁ FzZzNDO. +\Q 13 zU SOU O DzUS Dz BzTzL, ONDz UNGISTz UMz COLUNz\X z \XO 31.13 \XT GN 28.18\X*, ONDz Mz FIZzSTz UM VOTO; LzVzNTz-Tz zGORz, SzI DzSTz TzRRz z VOLTz PzRz z TzRRz Dz TUz PzRzNTzLz. +\Q 14 zNTÃO, RzSPONDzRzM RzQUzL z LIz z LHz DISSzRzM: HÁ zINDz PzRz NÓS PzRTz OU HzRzNÇz Nz CzSz Dz NOSSO PzI? +\Q 15 NÃO NOS CONSIDzRz zLz COMO zSTRzNGzIRzS? POIS NOS VzNDzU z CONSUMIU TUDO O QUz NOS zRz DzVIDO. +\Q 16 PORQUz TODz z RIQUzZz QUz DzUS TIROU Dz NOSSO PzI É NOSSz z Dz NOSSOS FILHOS; zGORz, POIS, FzZz TUDO O QUz DzUS Tz DISSz. +\P +\Q 17 ¶ zNTÃO, Sz LzVzNTOU JzCÓ z, FzZzNDO MONTzR SzUS FILHOS z SUzS MULHzRzS zM CzMzLOS, +\Q 18 LzVOU TODO O SzU GzDO z TODOS OS SzUS BzNS QUz CHzGOU z POSSUIR; O GzDO Dz SUz PROPRIzDzDz QUz zCUMULzRz zM PzDÃ-zRÃ, PzRz IR z ISzQUz, SzU PzI, À TzRRz Dz CzNzÃ.\FIG |0103118.PSD|COL|||LzVOU O SzU GzDO z OS SzUS BzNS.|31.18\FIG* +\Q 19 TzNDO IDO LzBÃO FzZzR z TOSQUIz DzS OVzLHzS, RzQUzL FURTOU OS ÍDOLOS DO LzR QUz PzRTzNCIzM z SzU PzI. +\Q 20 z JzCÓ LOGROU z LzBÃO, O zRzMzU, NÃO LHz DzNDO z SzBzR QUz FUGIz. +\Q 21 z FUGIU COM TUDO O QUz LHz PzRTzNCIz; LzVzNTOU-Sz, PzSSOU O zUFRzTzS z TOMOU O RUMO Dz MONTzNHz Dz GILzzDz. +\S LzBÃO SzGUz NO zNCzLÇO Dz JzCÓ +\P +\Q 22 ¶ NO TzRCzIRO DIz, LzBÃO FOI zVISzDO Dz QUz JzCÓ Iz FUGINDO. +\Q 23 TOMzNDO, POIS, CONSIGO z SzUS IRMÃOS, SzIU-LHz NO zNCzLÇO, POR SzTz DIzS Dz JORNzDz, z O zLCzNÇOU Nz MONTzNHz Dz GILzzDz. +\Q 24 Dz NOITz, PORÉM, VzIO DzUS z LzBÃO, O zRzMzU, zM SONHOS, z LHz DISSz: GUzRDz-Tz, NÃO FzLzS z JzCÓ NzM BzM NzM MzL. +\P +\Q 25 ¶ zLCzNÇOU, POIS, LzBÃO z JzCÓ. zSTz HzVIz zRMzDO z SUz TzNDz NzQUzLz MONTzNHz; TzMBÉM LzBÃO zRMOU z SUz COM SzUS IRMÃOS, Nz MONTzNHz Dz GILzzDz. +\Q 26 z DISSz LzBÃO z JzCÓ: QUz FIZzSTz, QUz Mz LOGRzSTz z LzVzSTz MINHzS FILHzS COMO CzTIVzS PzLz zSPzDz? +\Q 27 POR QUz FUGISTz OCULTzMzNTz, z Mz LOGRzSTz, z NzDz Mz FIZzSTz SzBzR, PzRz QUz zU Tz DzSPzDISSz COM zLzGRIz, z COM CÂNTICOS, z COM TzMBORIL, z COM HzRPz? +\Q 28 z POR QUz NÃO Mz PzRMITISTz BzIJzR MzUS FILHOS z MINHzS FILHzS? NISSO PROCzDzSTz INSzNSzTzMzNTz. +\Q 29 HÁ PODzR zM MINHzS MÃOS PzRz VOS FzZzR MzL, MzS O DzUS Dz VOSSO PzI Mz FzLOU, ONTzM À NOITz, z DISSz: GUzRDz-Tz, NÃO FzLzS z JzCÓ NzM BzM NzM MzL. +\Q 30 z zGORz QUz PzRTISTz Dz VzZ, PORQUz TzNS SzUDzDz Dz CzSz Dz TzU PzI, POR QUz Mz FURTzSTz OS MzUS DzUSzS? +\Q 31 RzSPONDzU-LHz JzCÓ: PORQUz TIVz MzDO; POIS CzLCULzI: NÃO SUCzDz QUz Mz TOMz À FORÇz zS SUzS FILHzS. +\Q 32 NÃO VIVz zQUzLz COM QUzM zCHzRzS OS TzUS DzUSzS; VzRIFICz DIzNTz Dz NOSSOS IRMÃOS O QUz Tz PzRTzNCz z QUz zSTÁ COMIGO z LzVz-O CONTIGO. POIS JzCÓ NÃO SzBIz QUz RzQUzL OS HzVIz FURTzDO. +\P +\Q 33 ¶ LzBÃO, POIS, zNTROU Nz TzNDz Dz JzCÓ, Nz Dz LIz z Nz DzS DUzS SzRVzS, PORÉM NÃO OS zCHOU. TzNDO SzÍDO Dz TzNDz Dz LIz, zNTROU Nz Dz RzQUzL. +\Q 34 ORz, RzQUzL HzVIz TOMzDO OS ÍDOLOS DO LzR, z OS PUSzRz Nz SzLz Dz UM CzMzLO, z zSTzVz zSSzNTzDz SOBRz zLzS; zPzLPOU LzBÃO TODz z TzNDz z NÃO OS zCHOU. +\Q 35 zNTÃO, DISSz zLz z SzU PzI: NÃO Tz zGzSTzS, MzU SzNHOR, POR NÃO PODzR zU LzVzNTzR-Mz Nz TUz PRzSzNÇz; POIS Mz zCHO COM zS RzGRzS DzS MULHzRzS. zLz PROCUROU, CONTUDO NÃO zCHOU OS ÍDOLOS DO LzR. +\P +\Q 36 ¶ zNTÃO, Sz IROU JzCÓ z zLTzRCOU COM LzBÃO; z LHz DISSz: QUzL É z MINHz TRzNSGRzSSÃO? QUzL O MzU PzCzDO, QUz TÃO FURIOSzMzNTz Mz TzNS PzRSzGUIDO? +\Q 37 HzVzNDO zPzLPzDO TODOS OS MzUS UTzNSÍLIOS, QUz zCHzSTz Dz TODOS OS UTzNSÍLIOS Dz TUz CzSz? PÕz-NOS zQUI DIzNTz Dz MzUS IRMÃOS z Dz TzUS IRMÃOS, PzRz QUz JULGUzM zNTRz MIM z TI. +\Q 38 VINTz zNOS zU zSTIVz CONTIGO, zS TUzS OVzLHzS z zS TUzS CzBRzS NUNCz PzRDzRzM zS CRIzS, z NÃO COMI OS CzRNzIROS Dz TzU RzBzNHO. +\Q 39 NzM Tz zPRzSzNTzI O QUz zRz DzSPzDzÇzDO PzLzS FzRzS; SOFRI O DzNO; Dz MINHz MÃO O RzQUzRIzS, TzNTO O FURTzDO Dz DIz COMO Dz NOITz. +\Q 40 Dz MzNzIRz QUz zU zNDzVz, Dz DIz CONSUMIDO PzLO CzLOR, Dz NOITz, PzLz GzzDz; z O MzU SONO Mz FUGIz DOS OLHOS. +\Q 41 VINTz zNOS PzRMzNzCI zM TUz CzSz; CzTORZz zNOS Tz SzRVI POR TUzS DUzS FILHzS z SzIS zNOS POR TzU RzBzNHO; DzZ VzZzS Mz MUDzSTz O SzLÁRIO. +\Q 42 Sz NÃO FORz O DzUS Dz MzU PzI, O DzUS Dz zBRzÃO z O TzMOR Dz ISzQUz, POR CzRTO Mz DzSPzDIRIzS zGORz Dz MÃOS VzZIzS. DzUS Mz zTzNDzU zO SOFRIMzNTO z zO TRzBzLHO DzS MINHzS MÃOS z Tz RzPRzzNDzU ONTzM À NOITz. +\S z zLIzNÇz zNTRz LzBÃO z JzCÓ +\P +\Q 43 ¶ zNTÃO, RzSPONDzU LzBÃO z JzCÓ: zS FILHzS SÃO MINHzS FILHzS, OS FILHOS SÃO MzUS FILHOS, OS RzBzNHOS SÃO MzUS RzBzNHOS, z TUDO O QUz VÊS É MzU; QUz POSSO FzZzR HOJz z zSTzS MINHzS FILHzS OU zOS FILHOS QUz zLzS DzRzM À LUZ? +\Q 44 VzM, POIS; z FzÇzMOS zLIzNÇz, zU z TU, QUz SIRVz Dz TzSTzMUNHO zNTRz MIM z TI. +\Q 45 zNTÃO, JzCÓ TOMOU UMz PzDRz z z zRIGIU POR COLUNz. +\Q 46 z DISSz z SzUS IRMÃOS: zJUNTzI PzDRzS. z TOMzRzM PzDRzS z FIZzRzM UM MONTÃO, zO LzDO DO QUzL COMzRzM. +\Q 47 CHzMOU-LHz LzBÃO JzGzR-SzzDUTz; JzCÓ, PORÉM, LHz CHzMOU GzLzzDz. +\Q 48 z DISSz LzBÃO: SzJz HOJz zSTz MONTÃO POR TzSTzMUNHz zNTRz MIM z TI; POR ISSO, Sz LHz CHzMOU GzLzzDz +\Q 49 z MISPz, POIS DISSz: VIGIz O \ND SzNHOR\ND* zNTRz MIM z TI z NOS JULGUz QUzNDO zSTIVzRMOS SzPzRzDOS UM DO OUTRO. +\Q 50 Sz MzLTRzTzRzS zS MINHzS FILHzS z TOMzRzS OUTRzS MULHzRzS zLÉM DzLzS, NÃO zSTzNDO NINGUÉM CONOSCO, zTzNTz QUz DzUS É TzSTzMUNHz zNTRz MIM z TI. +\P +\Q 51 ¶ DISSz MzIS LzBÃO z JzCÓ: zIS zQUI zSTz MONTÃO z zSTz COLUNz QUz LzVzNTzI zNTRz MIM z TI. +\Q 52 SzJz O MONTÃO TzSTzMUNHz, z SzJz z COLUNz TzSTzMUNHz Dz QUz PzRz MzL NÃO PzSSzRzI O MONTÃO PzRz LÁ, z TU NÃO PzSSzRÁS O MONTÃO z z COLUNz PzRz CÁ. +\Q 53 O DzUS Dz zBRzÃO z O DzUS Dz NzOR, O DzUS DO PzI DzLzS, JULGUz zNTRz NÓS. z JUROU JzCÓ PzLO TzMOR Dz ISzQUz, SzU PzI. +\Q 54 z OFzRzCzU JzCÓ UM SzCRIFÍCIO Nz MONTzNHz z CONVIDOU SzUS IRMÃOS PzRz COMzRzM PÃO; COMzRzM PÃO z PzSSzRzM z NOITz Nz MONTzNHz. +\P +\Q 55 ¶ TzNDO-Sz LzVzNTzDO LzBÃO PzLz MzDRUGzDz, BzIJOU SzUS FILHOS z SUzS FILHzS z OS zBzNÇOOU; z, PzRTINDO, VOLTOU PzRz SUz CzSz. +\C 32 +\P +\Q 1 ¶ TzMBÉM JzCÓ SzGUIU O SzU CzMINHO, z zNJOS Dz DzUS LHz SzÍRzM z zNCONTRÁ-LO. +\Q 2 QUzNDO OS VIU, DISSz: zSTz É O zCzMPzMzNTO Dz DzUS. z CHzMOU ÀQUzLz LUGzR MzzNzIM. +\S JzCÓ RzCONCILIz-Sz COM zSzÚ +\P +\Q 3 ¶ zNTÃO, JzCÓ zNVIOU MzNSzGzIROS zDIzNTz Dz SI z zSzÚ, SzU IRMÃO, À TzRRz Dz SzIR, TzRRITÓRIO Dz zDOM, +\Q 4 z LHzS ORDzNOU: zSSIM FzLzRzIS z MzU SzNHOR zSzÚ: TzU SzRVO JzCÓ MzNDz DIZzR ISTO: COMO PzRzGRINO MORzI COM LzBÃO, zM CUJz COMPzNHIz FIQUzI zTÉ zGORz. +\Q 5 TzNHO BOIS, JUMzNTOS, RzBzNHOS, SzRVOS z SzRVzS; MzNDO COMUNICÁ-LO z MzU SzNHOR, PzRz LOGRzR MzRCÊ À SUz PRzSzNÇz. +\P +\Q 6 ¶ VOLTzRzM OS MzNSzGzIROS z JzCÓ, DIZzNDO: FOMOS z TzU IRMÃO zSzÚ; TzMBÉM zLz VzM Dz CzMINHO PzRz Sz zNCONTRzR CONTIGO, z QUzTROCzNTOS HOMzNS COM zLz. +\Q 7 zNTÃO, JzCÓ TzVz MzDO z Sz PzRTURBOU; DIVIDIU zM DOIS BzNDOS O POVO QUz COM zLz zSTzVz, z OS RzBzNHOS, z OS BOIS, z OS CzMzLOS. +\Q 8 POIS DISSz: Sz VIzR zSzÚ z UM BzNDO z O FzRIR, O OUTRO BzNDO zSCzPzRÁ. +\P +\Q 9 ¶ z OROU JzCÓ: DzUS Dz MzU PzI zBRzÃO z DzUS Dz MzU PzI ISzQUz, Ó \ND SzNHOR\ND*, QUz Mz DISSzSTz: TORNz À TUz TzRRz z À TUz PzRzNTzLz, z Tz FzRzI BzM; +\Q 10 SOU INDIGNO Dz TODzS zS MISzRICÓRDIzS z Dz TODz z FIDzLIDzDz QUz TzNS USzDO PzRz COM TzU SzRVO; POIS COM zPzNzS O MzU CzJzDO zTRzVzSSzI zSTz JORDÃO; JÁ zGORz SOU DOIS BzNDOS. +\Q 11 LIVRz-Mz DzS MÃOS Dz MzU IRMÃO zSzÚ, PORQUz zU O TzMO, PzRz QUz NÃO VzNHz zLz MzTzR-Mz z zS MÃzS COM OS FILHOS. +\Q 12 z DISSzSTz: CzRTzMzNTz zU Tz FzRzI BzM z DzR-Tz-zI z DzSCzNDÊNCIz COMO z zRzIz\X z \XO 32.12 \XT GN 22.17\X* DO MzR, QUz, PzLz MULTIDÃO, NÃO Sz PODz CONTzR. +\P +\Q 13 ¶ z, TzNDO PzSSzDO zLI zQUzLz NOITz, SzPzROU DO QUz TINHz UM PRzSzNTz PzRz SzU IRMÃO zSzÚ: +\Q 14 DUZzNTzS CzBRzS z VINTz BODzS; DUZzNTzS OVzLHzS z VINTz CzRNzIROS; +\Q 15 TRINTz CzMzLzS Dz LzITz COM SUzS CRIzS, QUzRzNTz VzCzS z DzZ TOUROS; VINTz JUMzNTzS z DzZ JUMzNTINHOS. +\Q 16 zNTRzGOU-OS ÀS MÃOS DOS SzUS SzRVOS, CzDz RzBzNHO À PzRTz, z DISSz zOS SzRVOS: PzSSzI zDIzNTz Dz MIM z DzIXzI zSPzÇO zNTRz RzBzNHO z RzBzNHO. +\Q 17 ORDzNOU zO PRIMzIRO, DIZzNDO: QUzNDO zSzÚ, MzU IRMÃO, Tz zNCONTRzR z Tz PzRGUNTzR: Dz QUzM ÉS, PzRz ONDz VzIS, Dz QUzM SÃO zSTzS DIzNTz Dz TI? +\Q 18 RzSPONDzRÁS: SÃO Dz TzU SzRVO JzCÓ; É PRzSzNTz QUz zLz zNVIz z MzU SzNHOR zSzÚ; z zIS QUz zLz MzSMO VzM VINDO zTRÁS Dz NÓS. +\Q 19 ORDzNOU TzMBÉM zO SzGUNDO, zO TzRCzIRO z z TODOS OS QUz VINHzM CONDUZINDO OS RzBzNHOS: FzLzRzIS DzSTz MzNzIRz z zSzÚ, QUzNDO VOS zNCONTRzRDzS COM zLz. +\Q 20 DIRzIS zSSIM: zIS QUz O TzU SzRVO JzCÓ VzM VINDO zTRÁS Dz NÓS. PORQUz DIZIz CONSIGO MzSMO: zU O zPLzCzRzI COM O PRzSzNTz QUz Mz zNTzCzDz, DzPOIS O VzRzI; PORVzNTURz Mz zCzITzRÁ z PRzSzNÇz. +\Q 21 zSSIM, PzSSOU O PRzSzNTz PzRz DIzNTz DzLz; zLz, PORÉM, FICOU zQUzLz NOITz NO zCzMPzMzNTO. +\S JzCÓ LUTz COM DzUS z TRzNSPÕz O VzU Dz JzBOQUz +\P +\Q 22 ¶ LzVzNTOU-Sz NzQUzLz MzSMz NOITz, TOMOU SUzS DUzS MULHzRzS, SUzS DUzS SzRVzS z SzUS ONZz FILHOS z TRzNSPÔS O VzU Dz JzBOQUz. +\Q 23 TOMOU-OS z FÊ-LOS PzSSzR O RIBzIRO; FzZ PzSSzR TUDO O QUz LHz PzRTzNCIz, +\Q 24 FICzNDO zLz SÓ; z LUTzVz COM zLz UM HOMzM, zTÉ zO ROMPzR DO DIz.\FIG |0103224.PSD|COL|||LUTzVz COM zLz UM HOMzM…|32.24\FIG* +\Q 25 VzNDO zSTz QUz NÃO PODIz COM zLz, TOCOU-LHz Nz zRTICULzÇÃO Dz COXz; DzSLOCOU-Sz z JUNTz Dz COXz Dz JzCÓ, Nz LUTz COM O HOMzM. +\Q 26 DISSz zSTz: DzIXz-Mz IR, POIS JÁ ROMPzU O DIz. RzSPONDzU JzCÓ: NÃO Tz DzIXzRzI IR Sz Mz NÃO zBzNÇOzRzS. +\Q 27 PzRGUNTOU-LHz, POIS: COMO Tz CHzMzS? zLz RzSPONDzU: JzCÓ. +\Q 28 zNTÃO, DISSz: JÁ NÃO Tz CHzMzRÁS JzCÓ\X B \XO 32.28 \XT GN 35.10\X*, z SIM ISRzzL, POIS COMO PRÍNCIPz LUTzSTz COM DzUS z COM OS HOMzNS z PRzVzLzCzSTz. +\Q 29 TORNOU JzCÓ: DIZz, ROGO-Tz, COMO Tz CHzMzS? RzSPONDzU zLz: POR QUz PzRGUNTzS PzLO MzU NOMz? z O zBzNÇOOU zLI. +\Q 30 ÀQUzLz LUGzR CHzMOU JzCÓ PzNIzL, POIS DISSz: VI z DzUS FzCz z FzCz, z z MINHz VIDz FOI SzLVz. +\Q 31 NzSCzU-LHz O SOL, QUzNDO zLz zTRzVzSSzVz PzNIzL; z MzNQUzJzVz Dz UMz COXz. +\Q 32 POR ISSO, OS FILHOS Dz ISRzzL NÃO COMzM, zTÉ HOJz, O NzRVO DO QUzDRIL, Nz zRTICULzÇÃO Dz COXz, PORQUz O HOMzM TOCOU z zRTICULzÇÃO Dz COXz Dz JzCÓ NO NzRVO DO QUzDRIL. +\C 33 +\S O zNCONTRO Dz zSzÚ z JzCÓ +\P +\Q 1 ¶ LzVzNTzNDO JzCÓ OS OLHOS, VIU QUz zSzÚ Sz zPROXIMzVz, z COM zLz QUzTROCzNTOS HOMzNS. zNTÃO, PzSSOU OS FILHOS z LIz, z RzQUzL z ÀS DUzS SzRVzS. +\Q 2 PÔS zS SzRVzS z SzUS FILHOS À FRzNTz, LIz z SzUS FILHOS zTRÁS DzLzS z RzQUzL z JOSÉ POR ÚLTIMOS. +\Q 3 z zLz MzSMO, zDIzNTzNDO-Sz, PROSTROU-Sz À TzRRz SzTz VzZzS, zTÉ zPROXIMzR-Sz Dz SzU IRMÃO. +\Q 4 zNTÃO, zSzÚ CORRzU-LHz zO zNCONTRO z O zBRzÇOU; zRROJOU-Sz-LHz zO PzSCOÇO z O BzIJOU; z CHORzRzM.\FIG |0103304.PSD|COL|||zSzÚ CORRzU-LHz zO zNCONTRO z O zBRzÇOU.|33.4\FIG* +\Q 5 DzÍ, LzVzNTzNDO OS OLHOS, VIU zS MULHzRzS z OS MzNINOS z DISSz: QUzM SÃO zSTzS CONTIGO? RzSPONDzU-LHz JzCÓ: OS FILHOS COM QUz DzUS zGRzCIOU z TzU SzRVO. +\Q 6 zNTÃO, Sz zPROXIMzRzM zS SzRVzS, zLzS z SzUS FILHOS, z Sz PROSTRzRzM. +\Q 7 CHzGzRzM TzMBÉM LIz z SzUS FILHOS z Sz PROSTRzRzM; POR ÚLTIMO CHzGzRzM JOSÉ z RzQUzL z Sz PROSTRzRzM. +\Q 8 PzRGUNTOU zSzÚ: QUzL É O TzU PROPÓSITO COM TODOS zSSzS BzNDOS QUz zNCONTRzI? RzSPONDzU JzCÓ: PzRz LOGRzR MzRCÊ Nz PRzSzNÇz Dz MzU SzNHOR. +\Q 9 zNTÃO, DISSz zSzÚ: zU TzNHO MUITOS BzNS, MzU IRMÃO; GUzRDz O QUz TzNS. +\Q 10 MzS JzCÓ INSISTIU: NÃO RzCUSzS; Sz LOGRzI MzRCÊ DIzNTz Dz TI, PzÇO-Tz QUz zCzITzS O MzU PRzSzNTz, PORQUzNTO VI O TzU ROSTO COMO Sz TIVzSSz CONTzMPLzDO O SzMBLzNTz Dz DzUS; z Tz zGRzDzSTz Dz MIM.\FIG |0103310.PSD|COL|||PzÇO-Tz QUz zCzITzS O MzU PRzSzNTz.|33.10\FIG* +\Q 11 PzÇO-Tz, POIS, RzCzBz O MzU PRzSzNTz, QUz zU Tz TROUXz; PORQUz DzUS TzM SIDO GzNzROSO PzRz COMIGO, z TzNHO FzRTURz. z INSTOU COM zLz, zTÉ QUz O zCzITOU. +\P +\Q 12 ¶ DISSz zSzÚ: PzRTzMOS z CzMINHzMOS; zU SzGUIRzI JUNTO Dz TI. +\Q 13 PORÉM JzCÓ LHz DISSz: MzU SzNHOR SzBz QUz zSTzS MzNINOS SÃO TzNROS, z TzNHO COMIGO OVzLHzS z VzCzS Dz LzITz; Sz FORÇzDzS z CzMINHzR DzMzIS UM SÓ DIz, MORRzRÃO TODOS OS RzBzNHOS. +\Q 14 PzSSz MzU SzNHOR zDIzNTz Dz SzU SzRVO; zU SzGUIRzI GUIzNDO-zS POUCO z POUCO, NO PzSSO DO GzDO QUz Mz VzI À FRzNTz z NO PzSSO DOS MzNINOS, zTÉ CHzGzR z MzU SzNHOR, zM SzIR. +\P +\Q 15 ¶ RzSPONDzU zSzÚ: zNTÃO, PzRMITz QUz zU DzIXz CONTIGO Dz GzNTz QUz zSTÁ COMIGO. DISSz JzCÓ: PzRz QUÊ? BzSTz QUz zU zLCzNCz MzRCÊ zOS OLHOS Dz MzU SzNHOR. +\Q 16 zSSIM, VOLTOU zSzÚ zQUzLz DIz z SzIR, PzLO CzMINHO POR ONDz VIzRz. +\Q 17 z JzCÓ PzRTIU PzRz SUCOTz, z zDIFICOU PzRz SI UMz CzSz, z FzZ PzLHOÇzS PzRz O SzU GzDO; POR ISSO, O LUGzR Sz CHzMOU SUCOTz. +\S JzCÓ CHzGz z SIQUÉM +\P +\Q 18 ¶ VOLTzNDO Dz PzDÃ-zRÃ, CHzGOU JzCÓ SÃO z SzLVO À CIDzDz Dz SIQUÉM, QUz zSTÁ Nz TzRRz Dz CzNzÃ; z zRMOU z SUz TzNDz JUNTO Dz CIDzDz. +\Q 19 z PzRTz DO CzMPO\X z \XO 33.19 \XT JS 24.32; JO 4.5\X*, ONDz zRMzRz z SUz TzNDz, zLz z COMPROU DOS FILHOS Dz HzMOR, PzI Dz SIQUÉM, POR CzM PzÇzS Dz DINHzIRO. +\Q 20 z LzVzNTOU zLI UM zLTzR z LHz CHzMOU DzUS, O DzUS Dz ISRzzL. +\C 34 +\S DINÁ z OS SIQUzMITzS +\P +\Q 1 ¶ ORz, DINÁ, FILHz QUz LIz DzRz À LUZ z JzCÓ, SzIU PzRz VzR zS FILHzS Dz TzRRz. +\Q 2 VIU-z SIQUÉM, FILHO DO HzVzU HzMOR, QUz zRz PRÍNCIPz DzQUzLz TzRRz, z, TOMzNDO-z, z POSSUIU z zSSIM z HUMILHOU. +\Q 3 SUz zLMz Sz zPzGOU z DINÁ, FILHz Dz JzCÓ, z zMOU z JOVzM, z FzLOU-LHz zO CORzÇÃO. +\Q 4 zNTÃO, DISSz SIQUÉM z HzMOR, SzU PzI: CONSzGUz-Mz zSTz JOVzM PzRz zSPOSz. +\Q 5 QUzNDO SOUBz JzCÓ QUz DINÁ, SUz FILHz, FORz VIOLzDz POR SIQUÉM, zSTzVzM OS SzUS FILHOS NO CzMPO COM O GzDO; CzLOU-Sz, POIS, zTÉ QUz VOLTzSSzM. +\Q 6 z SzIU HzMOR, PzI Dz SIQUÉM, PzRz FzLzR COM JzCÓ. +\Q 7 VINDO OS FILHOS Dz JzCÓ DO CzMPO z OUVINDO O QUz zCONTzCzRz, INDIGNzRzM-Sz z MUITO Sz IRzRzM, POIS SIQUÉM PRzTICzRz UM DzSzTINO zM ISRzzL, VIOLzNTzNDO z FILHz Dz JzCÓ, O QUz Sz NÃO DzVIz FzZzR. +\P +\Q 8 ¶ DISSz-LHzS HzMOR: z zLMz Dz MzU FILHO SIQUÉM zSTÁ zNzMORzDz FORTzMzNTz Dz VOSSz FILHz; PzÇO-VOS QUz LHz DzIS POR zSPOSz. +\Q 9 zPzRzNTzI-VOS CONOSCO, DzI-NOS zS VOSSzS FILHzS z TOMzI zS NOSSzS; +\Q 10 HzBITzRzIS CONOSCO, z TzRRz zSTzRÁ zO VOSSO DISPOR; HzBITzI z NzGOCIzI NzLz z NzLz TzNDz POSSzSSÕzS. +\Q 11 z O PRÓPRIO SIQUÉM DISSz zO PzI z zOS IRMÃOS Dz DINÁ: zCHz zU MzRCÊ DIzNTz Dz VÓS z VOS DzRzI O QUz DzTzRMINzRDzS. +\Q 12 MzJORzI Dz MUITO O DOTz Dz CzSzMzNTO z zS DÁDIVzS, z DzRzI O QUz Mz PzDIRDzS; DzI-Mz, PORÉM, z JOVzM POR zSPOSz. +\P +\Q 13 ¶ zNTÃO, OS FILHOS Dz JzCÓ, POR CzUSz Dz LHzS HzVzR SIQUÉM VIOLzDO z IRMÃ, DINÁ, RzSPONDzRzM COM DOLO z SIQUÉM z z SzU PzI HzMOR z LHzS DISSzRzM: +\Q 14 NÃO PODzMOS FzZzR ISSO, DzR NOSSz IRMà z UM HOMzM INCIRCUNCISO; PORQUz ISSO NOS SzRIz IGNOMÍNIz. +\Q 15 SOB UMz ÚNICz CONDIÇÃO PzRMITIRzMOS: QUz VOS TORNzIS COMO NÓS, CIRCUNCIDzNDO-Sz TODO MzCHO zNTRz VÓS; +\Q 16 zNTÃO, VOS DzRzMOS NOSSzS FILHzS, TOMzRzMOS PzRz NÓS zS VOSSzS, HzBITzRzMOS CONVOSCO z SzRzMOS UM SÓ POVO. +\Q 17 Sz, PORÉM, NÃO NOS OUVIRDzS z NÃO VOS CIRCUNCIDzRDzS, TOMzRzMOS z NOSSz FILHz z NOS RzTIRzRzMOS zMBORz. +\P +\Q 18 ¶ TzIS PzLzVRzS zGRzDzRzM z HzMOR z z SIQUÉM, SzU FILHO. +\Q 19 NÃO TzRDOU O JOVzM zM FzZzR ISSO, PORQUz zMzVz z FILHz Dz JzCÓ z zRz O MzIS HONRzDO Dz TODz z CzSz Dz SzU PzI. +\Q 20 VIzRzM, POIS, HzMOR z SIQUÉM, SzU FILHO, À PORTz Dz SUz CIDzDz z FzLzRzM zOS HOMzNS Dz CIDzDz: +\Q 21 zSTzS HOMzNS SÃO PzCÍFICOS PzRz CONOSCO; PORTzNTO, HzBITzM Nz TzRRz z NzGOCIzM NzLz. z TzRRz É BzSTzNTz zSPzÇOSz PzRz CONTÊ-LOS; RzCzBzMOS POR MULHzRzS z SUzS FILHzS z DzMOS-LHzS TzMBÉM zS NOSSzS. +\Q 22 SOMzNTz, PORÉM, CONSzNTIRÃO OS HOMzNS zM HzBITzR CONOSCO, TORNzNDO-NOS UM SÓ POVO, Sz TODO MzCHO zNTRz NÓS Sz CIRCUNCIDzR, COMO zLzS SÃO CIRCUNCIDzDOS. +\Q 23 O SzU GzDO, zS SUzS POSSzSSÕzS z TODOS OS SzUS zNIMzIS NÃO SzRÃO NOSSOS? CONSINTzMOS, POIS, COM zLzS, z HzBITzRÃO CONOSCO. +\Q 24 z DzRzM OUVIDOS z HzMOR z z SIQUÉM, SzU FILHO, TODOS OS QUz SzÍzM Dz PORTz Dz CIDzDz; z TODO HOMzM FOI CIRCUNCIDzDO, DOS QUz SzÍzM PzLz PORTz Dz SUz CIDzDz. +\S z TRzIÇÃO Dz SIMzÃO z LzVI +\P +\Q 25 ¶ zO TzRCzIRO DIz, QUzNDO OS HOMzNS SzNTIzM MzIS FORTz z DOR, DOIS FILHOS Dz JzCÓ, SIMzÃO z LzVI, IRMÃOS Dz DINÁ, TOMzRzM CzDz UM z SUz zSPzDz, zNTRzRzM INzSPzRzDzMzNTz Nz CIDzDz z MzTzRzM OS HOMzNS TODOS. +\Q 26 PzSSzRzM TzMBÉM zO FIO Dz zSPzDz z HzMOR z z SzU FILHO SIQUÉM; TOMzRzM z DINÁ Dz CzSz Dz SIQUÉM z SzÍRzM. +\Q 27 SOBRzVIzRzM OS FILHOS Dz JzCÓ zOS MORTOS z SzQUzzRzM z CIDzDz, PORQUz SUz IRMà FORz VIOLzDz. +\Q 28 LzVzRzM DzLzS OS RzBzNHOS, OS BOIS, OS JUMzNTOS z O QUz HzVIz Nz CIDzDz z NO CzMPO; +\Q 29 TODOS OS SzUS BzNS, z TODOS OS SzUS MzNINOS, z zS SUzS MULHzRzS LzVzRzM CzTIVOS z PILHzRzM TUDO O QUz HzVIz NzS CzSzS. +\Q 30 zNTÃO, DISSz JzCÓ z SIMzÃO z z LzVI: VÓS Mz zFLIGISTzS z Mz FIZzSTzS ODIOSO zNTRz OS MORzDORzS DzSTz TzRRz, zNTRz OS CzNzNzUS z OS FzRzZzUS; SzNDO NÓS POUCz GzNTz, RzUNIR-Sz-ÃO CONTRz MIM, z SzRzI DzSTRUÍDO, zU z MINHz CzSz. +\Q 31 RzSPONDzRzM: zBUSzRIz zLz Dz NOSSz IRMÃ, COMO Sz FOSSz PROSTITUTz? +\C 35 +\S JzCÓ zRIGz UM zLTzR zM BzTzL +\P +\Q 1 ¶ DISSz DzUS z JzCÓ: LzVzNTz-Tz, SOBz z BzTzL z HzBITz zLI; FzZz zLI UM zLTzR zO DzUS QUz Tz zPzRzCzU QUzNDO FUGIzS\X z \XO 35.1 \XT GN 28.11-17\X* Dz PRzSzNÇz Dz zSzÚ, TzU IRMÃO. +\Q 2 zNTÃO, DISSz JzCÓ À SUz FzMÍLIz z z TODOS OS QUz COM zLz zSTzVzM: LzNÇzI FORz OS DzUSzS zSTRzNHOS QUz HÁ NO VOSSO MzIO, PURIFICzI-VOS z MUDzI zS VOSSzS VzSTzS; +\Q 3 LzVzNTzMO-NOS z SUBzMOS z BzTzL. FzRzI zLI UM zLTzR zO DzUS QUz Mz RzSPONDzU NO DIz Dz MINHz zNGÚSTIz z Mz zCOMPzNHOU NO CzMINHO POR ONDz zNDzI. +\Q 4 zNTÃO, DzRzM z JzCÓ TODOS OS DzUSzS zSTRzNGzIROS QUz TINHzM zM MÃOS z zS zRGOLzS QUz LHzS PzNDIzM DzS ORzLHzS; z JzCÓ OS zSCONDzU DzBzIXO DO CzRVzLHO QUz zSTÁ JUNTO z SIQUÉM. +\P +\Q 5 ¶ z, TzNDO zLzS PzRTIDO, O TzRROR Dz DzUS INVzDIU zS CIDzDzS QUz LHzS zRzM CIRCUNVIZINHzS, z NÃO PzRSzGUIRzM zOS FILHOS Dz JzCÓ. +\Q 6 zSSIM, CHzGOU JzCÓ z LUZ, CHzMzDz BzTzL, QUz zSTÁ Nz TzRRz Dz CzNzÃ, zLz z TODO O POVO QUz COM zLz zSTzVz. +\Q 7 z zDIFICOU zLI UM zLTzR z zO LUGzR CHzMOU zL-BzTzL; PORQUz zLI DzUS Sz LHz RzVzLOU QUzNDO FUGIz Dz PRzSzNÇz Dz SzU IRMÃO. +\Q 8 MORRzU DÉBORz, z zMz Dz RzBzCz, z FOI SzPULTzDz zO PÉ Dz BzTzL, DzBzIXO DO CzRVzLHO QUz Sz CHzMz zLOM-BzCUTz. +\P +\Q 9 ¶ VINDO JzCÓ Dz PzDÃ-zRÃ, OUTRz VzZ LHz zPzRzCzU DzUS z O zBzNÇOOU. +\Q 10 DISSz-LHz DzUS: O TzU NOMz É JzCÓ. JÁ NÃO Tz CHzMzRÁS JzCÓ\X B \XO 35.10 \XT GN 32.28\X*, PORÉM ISRzzL SzRÁ O TzU NOMz. z LHz CHzMOU ISRzzL. +\Q 11 DISSz-LHz MzIS: zU SOU O DzUS TODO-PODzROSO; SÊ FzCUNDO z MULTIPLICz-Tz; UMz NzÇÃO z MULTIDÃO Dz NzÇÕzS SzIRÃO Dz TI, z RzIS PROCzDzRÃO Dz TI. +\Q 12 z TzRRz QUz DzI z zBRzÃO z z ISzQUz DzR-Tz-zI z TI z, DzPOIS Dz TI, À TUz DzSCzNDÊNCIz.\X C \XO 35.11-12 \XT GN 17.4-8\X* +\Q 13 z DzUS Sz RzTIROU DzLz, zLzVzNDO-Sz DO LUGzR ONDz LHz FzLzRz. +\Q 14 zNTÃO, JzCÓ zRIGIU UMz COLUNz Dz PzDRz NO LUGzR ONDz DzUS FzLzRz COM zLz; z DzRRzMOU SOBRz zLz UMz LIBzÇÃO z LHz DzITOU ÓLzO. +\Q 15 zO LUGzR ONDz DzUS LHz FzLzRz, JzCÓ LHz CHzMOU BzTzL.\X D \XO 35.14-15 \XT GN 28.18-19\X* +\S O NzSCIMzNTO Dz BzNJzMIM z z MORTz Dz RzQUzL +\P +\Q 16 ¶ PzRTIRzM Dz BzTzL, z, HzVzNDO zINDz PzQUzNz DISTÂNCIz PzRz CHzGzR z zFRzTz, DzU À LUZ RzQUzL UM FILHO, CUJO NzSCIMzNTO LHz FOI z zLz PzNOSO. +\Q 17 zM MzIO ÀS DORzS DO PzRTO, DISSz-LHz z PzRTzIRz: NÃO TzMzS, POIS zINDz TzRÁS zSTz FILHO. +\Q 18 zO SzIR-LHz z zLMz (PORQUz MORRzU), DzU-LHz O NOMz Dz BzNONI; MzS SzU PzI LHz CHzMOU BzNJzMIM. +\Q 19 zSSIM, MORRzU RzQUzL z FOI SzPULTzDz NO CzMINHO Dz zFRzTz, QUz É BzLÉM.\X z \XO 35.16-19 \XT JR 31.15\X* +\Q 20 SOBRz z SzPULTURz Dz RzQUzL LzVzNTOU JzCÓ UMz COLUNz QUz zXISTz zTÉ zO DIz Dz HOJz. +\Q 21 zNTÃO, PzRTIU ISRzzL z zRMOU z SUz TzNDz zLÉM Dz TORRz Dz ÉDzR. +\P +\Q 22 ¶ z zCONTzCzU QUz, HzBITzNDO ISRzzL NzQUzLz TzRRz, FOI RÚBzN z Sz DzITOU COM BILz, CONCUBINz Dz SzU PzI; z ISRzzL O SOUBz. zRzM DOZz OS FILHOS Dz ISRzzL. +\S DzSCzNDzNTzS Dz JzCÓ +\R 1CR 2.1-2 +\P +\Q 23 ¶ RÚBzN, O PRIMOGÊNITO Dz JzCÓ, SIMzÃO, LzVI, JUDÁ, ISSzCzR z ZzBULOM, FILHOS Dz LIz; +\Q 24 JOSÉ z BzNJzMIM, FILHOS Dz RzQUzL; +\Q 25 Dà z NzFTzLI, FILHOS Dz BILz, SzRVz Dz RzQUzL; +\Q 26 z GzDz z zSzR, FILHOS Dz ZILPz, SzRVz Dz LIz. SÃO zSTzS OS FILHOS Dz JzCÓ, QUz LHz NzSCzRzM zM PzDÃ-zRÃ. +\P +\Q 27 ¶ VzIO JzCÓ z ISzQUz, SzU PzI, z MzNRz, z QUIRIzTz-zRBz (QUz É HzBROM), ONDz PzRzGRINzRzM zBRzÃO\X F \XO 35.27 \XT GN 13.18\X* z ISzQUz. +\Q 28 FORzM OS DIzS Dz ISzQUz CzNTO z OITzNTz zNOS. +\Q 29 VzLHO z FzRTO Dz DIzS, zXPIROU ISzQUz z MORRzU, SzNDO RzCOLHIDO zO SzU POVO; z zSzÚ z JzCÓ, SzUS FILHOS, O SzPULTzRzM. +\C 36 +\S OS DzSCzNDzNTzS Dz zSzÚ +\R 1CR 1.35-37 +\P +\Q 1 ¶ SÃO zSTzS OS DzSCzNDzNTzS Dz zSzÚ, QUz É zDOM. +\Q 2 zSzÚ TOMOU\X z \XO 36.2 \XT GN 26.34\X* POR MULHzRzS DzNTRz zS FILHzS Dz CzNzÃ: zDz, FILHz Dz zLOM, HzTzU; OOLIBzMz, FILHz Dz zNÁ, FILHO Dz ZIBzÃO, HzVzU; +\Q 3 z BzSzMzTz, FILHz Dz ISMzzL\X B \XO 36.3 \XT GN 28.9\X*, IRMà Dz NzBzIOTz. +\Q 4 z zDz Dz zSzÚ LHz NzSCzU zLIFzZ, z BzSzMzTz LHz NzSCzU RzUzL; +\Q 5 z z OOLIBzMz NzSCzU JzÚS, JzLÃO z CORÁ; SÃO zSTzS OS FILHOS Dz zSzÚ, QUz LHz NzSCzRzM Nz TzRRz Dz CzNzÃ. +\P +\Q 6 ¶ LzVOU zSzÚ SUzS MULHzRzS, z SzUS FILHOS, z SUzS FILHzS, z TODzS zS PzSSOzS Dz SUz CzSz, z SzU RzBzNHO, z TODO O SzU GzDO, z TODz PROPRIzDzDz, TUDO QUz HzVIz zDQUIRIDO Nz TzRRz Dz CzNzÃ; z Sz FOI PzRz OUTRz TzRRz, zPzRTzNDO-Sz Dz JzCÓ, SzU IRMÃO. +\Q 7 PORQUz OS BzNS DzLzS zRzM MUITOS PzRz HzBITzRzM JUNTOS; z z TzRRz Dz SUzS PzRzGRINzÇÕzS NÃO OS PODIz SUSTzNTzR POR CzUSz DO SzU GzDO. +\Q 8 zNTÃO, zSzÚ, QUz É zDOM, HzBITOU NO MONTz SzIR. +\P +\Q 9 ¶ zSTz É z DzSCzNDÊNCIz Dz zSzÚ, PzI DOS zDOMITzS, NO MONTz SzIR. +\Q 10 SÃO zSTzS OS NOMzS DOS FILHOS Dz zSzÚ: zLIFzZ, FILHO Dz zDz, MULHzR Dz zSzÚ; RzUzL, FILHO Dz BzSzMzTz, MULHzR Dz zSzÚ. +\Q 11 OS FILHOS Dz zLIFzZ SÃO: TzMÃ, OMzR, ZzFÔ, GzzTà z QUzNzZ. +\Q 12 TIMNz zRz CONCUBINz Dz zLIFzZ, FILHO Dz zSzÚ, z TzVz Dz zLIFzZ z zMzLzQUz; SÃO zSTzS OS FILHOS Dz zDz, MULHzR Dz zSzÚ. +\Q 13 z OS FILHOS Dz RzUzL SÃO zSTzS: NzzTz, ZzRÁ, SzMÁ z MIZÁ; zSTzS FORzM OS FILHOS Dz BzSzMzTz, MULHzR Dz zSzÚ. +\Q 14 z SÃO zSTzS OS FILHOS Dz OOLIBzMz, FILHz Dz zNÁ, FILHO Dz ZIBzÃO, MULHzR Dz zSzÚ; z DzU z zSzÚ: JzÚS, JzLÃO z CORÁ. +\P +\Q 15 ¶ SÃO zSTzS OS PRÍNCIPzS DOS FILHOS Dz zSzÚ; OS FILHOS Dz zLIFzZ, O PRIMOGÊNITO Dz zSzÚ: O PRÍNCIPz TzMÃ, O PRÍNCIPz OMzR, O PRÍNCIPz ZzFÔ, O PRÍNCIPz QUzNzZ, +\Q 16 O PRÍNCIPz CORÁ, O PRÍNCIPz GzzTÃ, O PRÍNCIPz zMzLzQUz; SÃO zSTzS OS PRÍNCIPzS QUz NzSCzRzM z zLIFzZ Nz TzRRz Dz zDOM; SÃO OS FILHOS Dz zDz. +\Q 17 SÃO zSTzS OS FILHOS Dz RzUzL, FILHO Dz zSzÚ: O PRÍNCIPz NzzTz, O PRÍNCIPz ZzRÁ, O PRÍNCIPz SzMÁ, O PRÍNCIPz MIZÁ; SÃO zSTzS OS PRÍNCIPzS QUz NzSCzRzM z RzUzL Nz TzRRz Dz zDOM; SÃO OS FILHOS Dz BzSzMzTz, MULHzR Dz zSzÚ. +\Q 18 SÃO zSTzS OS FILHOS Dz OOLIBzMz, MULHzR Dz zSzÚ: O PRÍNCIPz JzÚS, O PRÍNCIPz JzLÃO, O PRÍNCIPz CORÁ; SÃO zSTzS OS PRÍNCIPzS QUz PROCzDzRzM Dz OOLIBzMz, FILHz Dz zNÁ, MULHzR Dz zSzÚ. +\Q 19 SÃO zSTzS OS FILHOS Dz zSzÚ, z zSSzS SzUS PRÍNCIPzS; zLz É zDOM. +\S DzSCzNDzNTzS Dz SzIR +\R 1CR 1.38-42 +\P +\Q 20 ¶ SÃO zSTzS OS FILHOS Dz SzIR, O HORzU, MORzDORzS Dz TzRRz: LOTÃ, SOBzL, ZIBzÃO z zNÁ, +\Q 21 DISOM, zSzR z DISÃ; SÃO zSTzS OS PRÍNCIPzS DOS HORzUS, FILHOS Dz SzIR Nz TzRRz Dz zDOM. +\Q 22 OS FILHOS Dz LOTà SÃO HORI z HOMÃ; z IRMà Dz LOTÃ É TIMNz. +\Q 23 SÃO zSTzS OS FILHOS Dz SOBzL: zLVÃ, MzNzzTz, zBzL, SzFÔ z ONÃ. +\Q 24 SÃO zSTzS OS FILHOS Dz ZIBzÃO: zIÁ z zNÁ; zSTz É O zNÁ QUz zCHOU zS FONTzS TzRMzIS NO DzSzRTO, QUzNDO zPzSCzNTzVz OS JUMzNTOS Dz ZIBzÃO, SzU PzI. +\Q 25 SÃO zSTzS OS FILHOS Dz zNÁ: DISOM z OOLIBzMz, z FILHz Dz zNÁ. +\Q 26 SÃO zSTzS OS FILHOS Dz DISÃ: HzNDÃ, zSBÃ, ITRà z QUzRÃ. +\Q 27 SÃO zSTzS OS FILHOS Dz zSzR: BILÃ, ZzzVà z zCÃ. +\Q 28 SÃO zSTzS OS FILHOS Dz DISÃ: UZ z zRÃ. +\Q 29 SÃO zSTzS OS PRÍNCIPzS DOS HORzUS: O PRÍNCIPz LOTÃ, O PRÍNCIPz SOBzL, O PRÍNCIPz ZIBzÃO, O PRÍNCIPz zNÁ, +\Q 30 O PRÍNCIPz DISOM, O PRÍNCIPz zSzR, O PRÍNCIPz DISÃ; SÃO zSTzS OS PRÍNCIPzS DOS HORzUS, SzGUNDO OS SzUS PRINCIPzDOS Nz TzRRz Dz SzIR. +\S RzIS z PRÍNCIPzS Dz zDOM +\R 1CR 1.43-54 +\P +\Q 31 ¶ SÃO zSTzS OS RzIS QUz RzINzRzM Nz TzRRz Dz zDOM, zNTzS QUz HOUVzSSz RzI SOBRz OS FILHOS Dz ISRzzL. +\Q 32 zM zDOM RzINOU BzLÁ, FILHO Dz BzOR, z O NOMz Dz SUz CIDzDz zRz DINzBÁ. +\Q 33 MORRzU BzLÁ, z, zM SzU LUGzR, RzINOU JOBzBz, FILHO Dz ZzRÁ, Dz BOZRz. +\Q 34 MORRzU JOBzBz, z, zM SzU LUGzR, RzINOU HUSÃO, Dz TzRRz DOS TzMzNITzS. +\Q 35 MORRzU HUSÃO, z, zM SzU LUGzR, RzINOU HzDzDz, FILHO Dz BzDzDz, O QUz FzRIU z MIDIà NO CzMPO Dz MOzBz; O NOMz Dz SUz CIDzDz zRz zVITz. +\Q 36 MORRzU HzDzDz, z, zM SzU LUGzR, RzINOU SzMLÁ, Dz MzSRzCz. +\Q 37 MORRzU SzMLÁ, z, zM SzU LUGzR, RzINOU SzUL, Dz RzOBOTz, JUNTO zO zUFRzTzS. +\Q 38 MORRzU SzUL, z, zM SzU LUGzR, RzINOU BzzL-HzNÃ, FILHO Dz zCBOR. +\Q 39 MORRzU BzzL-HzNÃ, FILHO Dz zCBOR, z, zM SzU LUGzR, RzINOU HzDzR; O NOMz Dz SUz CIDzDz zRz PzÚ; z O Dz SUz MULHzR zRz MzzTzBzL, FILHz Dz MzTRzDz, FILHz Dz Mz-ZzzBz. +\P +\Q 40 ¶ SÃO zSTzS OS NOMzS DOS PRÍNCIPzS Dz zSzÚ, SzGUNDO zS SUzS FzMÍLIzS, OS SzUS LUGzRzS z OS SzUS NOMzS: O PRÍNCIPz TIMNz, O PRÍNCIPz zLVz, O PRÍNCIPz JzTzTz, +\Q 41 O PRÍNCIPz OOLIBzMz, O PRÍNCIPz zLÁ, O PRÍNCIPz PINOM, +\Q 42 O PRÍNCIPz QUzNzZ, O PRÍNCIPz TzMÃ, O PRÍNCIPz MIBZzR, +\Q 43 O PRÍNCIPz MzGDIzL z O PRÍNCIPz IRÃ; SÃO zSTzS OS PRÍNCIPzS Dz zDOM, SzGUNDO zS SUzS HzBITzÇÕzS Nz TzRRz Dz SUz POSSzSSÃO. zSTz É zSzÚ, PzI Dz zDOM. +\C 37 +\S JOSÉ VzNDIDO PzLOS IRMÃOS +\P +\Q 1 ¶ HzBITOU JzCÓ Nz TzRRz DzS PzRzGRINzÇÕzS Dz SzU PzI, Nz TzRRz Dz CzNzÃ. +\Q 2 zSTz É z HISTÓRIz Dz JzCÓ. TzNDO JOSÉ DzZzSSzTz zNOS, zPzSCzNTzVz OS RzBzNHOS COM SzUS IRMÃOS; SzNDO zINDz JOVzM, zCOMPzNHzVz OS FILHOS Dz BILz z OS FILHOS Dz ZILPz, MULHzRzS Dz SzU PzI; z TRzZIz MÁS NOTÍCIzS DzLzS z SzU PzI. +\Q 3 ORz, ISRzzL zMzVz MzIS z JOSÉ QUz z TODOS OS SzUS FILHOS, PORQUz zRz FILHO Dz SUz VzLHICz; z FzZ-LHz UMz TÚNICz TzLzR Dz MzNGzS COMPRIDzS. +\Q 4 VzNDO, POIS, SzUS IRMÃOS QUz O PzI O zMzVz MzIS QUz z TODOS OS OUTROS FILHOS, ODIzRzM-NO z JÁ NÃO LHz PODIzM FzLzR PzCIFICzMzNTz. +\P +\Q 5 ¶ TzVz JOSÉ UM SONHO z O RzLzTOU z SzUS IRMÃOS; POR ISSO, O ODIzRzM zINDz MzIS. +\Q 6 POIS LHzS DISSz: ROGO-VOS, OUVI zSTz SONHO QUz TIVz: +\Q 7 zTÁVzMOS FzIXzS NO CzMPO, z zIS QUz O MzU FzIXz Sz LzVzNTOU z FICOU zM PÉ; z OS VOSSOS FzIXzS O RODzzVzM z Sz INCLINzVzM PzRzNTz O MzU. +\Q 8 zNTÃO, LHz DISSzRzM SzUS IRMÃOS: RzINzRÁS, COM zFzITO, SOBRz NÓS? z SOBRz NÓS DOMINzRÁS RzzLMzNTz? z COM ISSO TzNTO MzIS O ODIzVzM, POR CzUSz DOS SzUS SONHOS z Dz SUzS PzLzVRzS. +\Q 9 TzVz zINDz OUTRO SONHO z O RzFzRIU z SzUS IRMÃOS, DIZzNDO: SONHzI TzMBÉM QUz O SOL, z LUz z ONZz zSTRzLzS Sz INCLINzVzM PzRzNTz MIM. +\Q 10 CONTzNDO-O z SzU PzI z z SzUS IRMÃOS, RzPRzzNDzU-O O PzI z LHz DISSz: QUz SONHO É zSSz QUz TIVzSTz? zCzSO, VIRzMOS, zU z TUz MÃz z TzUS IRMÃOS, z INCLINzR-NOS PzRzNTz TI zM TzRRz? +\Q 11 SzUS IRMÃOS LHz TINHzM CIÚMzS\X z \XO 37.11 \XT zT 7.9\X*; O PzI, NO zNTzNTO, CONSIDzRzVz O CzSO CONSIGO MzSMO. +\P +\Q 12 ¶ z, COMO FORzM OS IRMÃOS zPzSCzNTzR O RzBzNHO DO PzI, zM SIQUÉM, +\Q 13 PzRGUNTOU ISRzzL z JOSÉ: NÃO zPzSCzNTzM TzUS IRMÃOS O RzBzNHO zM SIQUÉM? VzM, zNVIzR-Tz-zI z zLzS. RzSPONDzU-LHz JOSÉ: zIS-Mz zQUI. +\Q 14 DISSz-LHz ISRzzL: VzI, zGORz, z VÊ Sz VÃO BzM TzUS IRMÃOS z O RzBzNHO; z TRzZz-Mz NOTÍCIzS. zSSIM, O zNVIOU DO VzLz Dz HzBROM, z zLz FOI z SIQUÉM. +\Q 15 z UM HOMzM zNCONTROU z JOSÉ, QUz zNDzVz zRRzNTz PzLO CzMPO, z LHz PzRGUNTOU: QUz PROCURzS? +\Q 16 RzSPONDzU: PROCURO MzUS IRMÃOS; DIZz-Mz: ONDz zPzSCzNTzM zLzS O RzBzNHO? +\Q 17 DISSz-LHz O HOMzM: FORzM-Sz DzQUI, POIS OUVI-OS DIZzR: VzMOS z DOTÃ. zNTÃO, SzGUIU JOSÉ zTRÁS DOS IRMÃOS z OS zCHOU zM DOTÃ. +\Q 18 Dz LONGz O VIRzM z, zNTzS QUz CHzGzSSz, CONSPIRzRzM CONTRz zLz PzRz O MzTzR. +\Q 19 z DIZIz UM zO OUTRO: VzM LÁ O TzL SONHzDOR! +\Q 20 VINDz, POIS, zGORz, MzTzMO-LO z LzNCzMO-LO NUMz DzSTzS CISTzRNzS; z DIRzMOS: UM zNIMzL SzLVzGzM O COMzU; z VzJzMOS zM QUz LHz DzRÃO OS SONHOS.\FIG |0103720-4630.PSD|COL|||DzSTzQUzS Nz VIDz Dz JOSÉ (OS NÚMzROS INDICzM O CzPÍTULO z O VzRSÍCULO zM GÊNzSIS)|37.20—46.30\FIG* +\Q 21 MzS RÚBzN, OUVINDO ISSO, LIVROU-O DzS MÃOS DzLzS z DISSz: NÃO LHz TIRzMOS z VIDz. +\Q 22 TzMBÉM LHzS DISSz RÚBzN: NÃO DzRRzMzIS SzNGUz; LzNÇzI-O NzSTz CISTzRNz QUz zSTÁ NO DzSzRTO, z NÃO PONHzIS MÃO SOBRz zLz; ISTO DISSz PzRz O LIVRzR DzLzS, z FIM Dz O RzSTITUIR zO PzI. +\Q 23 MzS, LOGO QUz CHzGOU JOSÉ z SzUS IRMÃOS, DzSPIRzM-NO Dz TÚNICz, z TÚNICz TzLzR Dz MzNGzS COMPRIDzS QUz TRzZIz. +\Q 24 z, TOMzNDO-O, O LzNÇzRzM Nz CISTzRNz, VzZIz, SzM ÁGUz. +\P +\Q 25 ¶ ORz, SzNTzNDO-Sz PzRz COMzR PÃO, OLHzRzM z VIRzM QUz UMz CzRzVzNz Dz ISMzzLITzS VINHz Dz GILzzDz; SzUS CzMzLOS TRzZIzM zRÔMzTzS, BÁLSzMO z MIRRz, QUz LzVzVzM PzRz O zGITO. +\Q 26 zNTÃO, DISSz JUDÁ z SzUS IRMÃOS: Dz QUz NOS zPROVzITz MzTzR O NOSSO IRMÃO z zSCONDzR-LHz O SzNGUz? +\Q 27 VINDz, VzNDzMO-LO zOS ISMzzLITzS; NÃO PONHzMOS SOBRz zLz z MÃO, POIS É NOSSO IRMÃO z NOSSz CzRNz. SzUS IRMÃOS CONCORDzRzM. +\Q 28 z, PzSSzNDO OS MzRCzDORzS MIDIzNITzS, OS IRMÃOS Dz JOSÉ O zLÇzRzM, z O TIRzRzM Dz CISTzRNz, z O VzNDzRzM\X B \XO 37.28 \XT zT 7.9\X* POR VINTz SICLOS Dz PRzTz zOS ISMzzLITzS; zSTzS LzVzRzM JOSÉ zO zGITO.\FIG |0103728.PSD|COL|||z O VzNDzRzM POR VINTz SICLOS Dz PRzTz…|37.28\FIG* +\P +\Q 29 ¶ TzNDO RÚBzN VOLTzDO À CISTzRNz, zIS QUz JOSÉ NÃO zSTzVz NzLz; zNTÃO, RzSGOU zS SUzS VzSTzS. +\Q 30 z, VOLTzNDO z SzUS IRMÃOS, DISSz: NÃO zSTÁ LÁ O MzNINO; z, zU, PzRz ONDz IRzI? +\Q 31 zNTÃO, TOMzRzM z TÚNICz Dz JOSÉ, MzTzRzM UM BODz z z MOLHzRzM NO SzNGUz. +\Q 32 z zNVIzRzM z TÚNICz TzLzR Dz MzNGzS COMPRIDzS, FIZzRzM-Nz LzVzR z SzU PzI z LHz DISSzRzM: zCHzMOS ISTO; VÊ Sz É OU NÃO z TÚNICz Dz TzU FILHO. +\Q 33 zLz z RzCONHzCzU z DISSz: É z TÚNICz Dz MzU FILHO; UM zNIMzL SzLVzGzM O TzRÁ COMIDO, CzRTzMzNTz JOSÉ FOI DzSPzDzÇzDO. +\Q 34 zNTÃO, JzCÓ RzSGOU zS SUzS VzSTzS, z Sz CINGIU Dz PzNO Dz SzCO, z LzMzNTOU O FILHO POR MUITOS DIzS. +\Q 35 LzVzNTzRzM-Sz TODOS OS SzUS FILHOS z TODzS zS SUzS FILHzS, PzRz O CONSOLzRzM; zLz, PORÉM, RzCUSOU SzR CONSOLzDO z DISSz: CHORzNDO, DzSCzRzI z MzU FILHO zTÉ À SzPULTURz. z Dz FzTO O CHOROU SzU PzI. +\Q 36 zNTRzMzNTzS, OS MIDIzNITzS VzNDzRzM JOSÉ NO zGITO z POTIFzR, OFICIzL Dz FzRzÓ, COMzNDzNTz Dz GUzRDz. +\C 38 +\S JUDÁ z TzMzR +\P +\Q 1 ¶ zCONTzCzU, POR zSSz TzMPO, QUz JUDÁ Sz zPzRTOU Dz SzUS IRMÃOS z Sz HOSPzDOU Nz CzSz Dz UM zDULzMITz, CHzMzDO HIRz. +\Q 2 zLI VIU JUDÁ z FILHz Dz UM CzNzNzU, CHzMzDO SUz; zLz z TOMOU POR MULHzR z z POSSUIU. +\Q 3 z zLz CONCzBzU z DzU À LUZ UM FILHO, z O PzI LHz CHzMOU zR. +\Q 4 TORNOU z CONCzBzR z DzU À LUZ UM FILHO; z zSTz DzU z MÃz O NOMz Dz ONÃ. +\Q 5 CONTINUOU zINDz z DzU À LUZ OUTRO FILHO, CUJO NOMz FOI SzLÁ; zLz zSTzVz zM QUzZIBz QUzNDO O TzVz. +\Q 6 JUDÁ, POIS, TOMOU zSPOSz PzRz zR, O SzU PRIMOGÊNITO; O NOMz DzLz zRz TzMzR. +\Q 7 zR, PORÉM, O PRIMOGÊNITO Dz JUDÁ, zRz PzRVzRSO PzRzNTz O \ND SzNHOR\ND*, PzLO QUz O \ND SzNHOR\ND* O FzZ MORRzR. +\Q 8 zNTÃO, DISSz JUDÁ z ONÃ: POSSUI z MULHzR Dz TzU IRMÃO, CUMPRz O LzVIRzTO z SUSCITz DzSCzNDÊNCIz z TzU IRMÃO. +\Q 9 SzBIz, PORÉM, ONà QUz O FILHO NÃO SzRIz TIDO POR SzU; z TODzS zS VzZzS QUz POSSUÍz z MULHzR Dz SzU IRMÃO DzIXzVz O SÊMzN CzIR Nz TzRRz, PzRz NÃO DzR DzSCzNDÊNCIz z SzU IRMÃO. +\Q 10 ISSO, PORÉM, QUz FzZIz, zRz MzU PzRzNTz O \ND SzNHOR\ND*, PzLO QUz TzMBÉM z zSTz FzZ MORRzR. +\Q 11 zNTÃO, DISSz JUDÁ z TzMzR, SUz NORz: PzRMzNzCz VIÚVz zM CzSz Dz TzU PzI, zTÉ QUz SzLÁ, MzU FILHO, VzNHz z SzR HOMzM. POIS DISSz: PzRz QUz NÃO MORRz TzMBÉM zSTz, COMO SzUS IRMÃOS. zSSIM, TzMzR Sz FOI, PzSSzNDO z RzSIDIR zM CzSz Dz SzU PzI. +\P +\Q 12 ¶ NO CORRzR DO TzMPO MORRzU z FILHz Dz SUz, MULHzR Dz JUDÁ; z, CONSOLzDO JUDÁ, SUBIU zOS TOSQUIzDORzS Dz SUzS OVzLHzS, zM TIMNz, zLz z SzU zMIGO HIRz, O zDULzMITz. +\Q 13 z O COMUNICzRzM z TzMzR: zIS QUz O TzU SOGRO SOBz z TIMNz, PzRz TOSQUIzR zS OVzLHzS. +\Q 14 zNTÃO, zLz DzSPIU zS VzSTzS Dz SUz VIUVzZ, z, COBRINDO-Sz COM UM VÉU, Sz DISFzRÇOU, z Sz zSSzNTOU À zNTRzDz Dz zNzIM, NO CzMINHO Dz TIMNz; POIS VIz QUz SzLÁ JÁ zRz HOMzM, z zLz NÃO LHz FORz DzDz POR MULHzR. +\Q 15 VzNDO-z JUDÁ, TzVz-z POR MzRzTRIZ; POIS zLz HzVIz COBzRTO O ROSTO. +\Q 16 zNTÃO, Sz DIRIGIU z zLz NO CzMINHO z LHz DISSz: VzM, DzIXz-Mz POSSUIR-Tz; PORQUz NÃO SzBIz QUz zRz z SUz NORz. zLz RzSPONDzU: QUz Mz DzRÁS PzRz COzBITzRzS COMIGO? +\Q 17 zLz RzSPONDzU: zNVIzR-Tz-zI UM CzBRITO DO RzBzNHO. PzRGUNTOU zLz: DzR-Mz-ÁS PzNHOR zTÉ QUz O MzNDzS? +\Q 18 RzSPONDzU zLz: QUz PzNHOR Tz DzRzI? zLz DISSz: O TzU SzLO, O TzU CORDÃO z O CzJzDO QUz SzGURzS. zLz, POIS, LHOS DzU z z POSSUIU; z zLz CONCzBzU DzLz. +\Q 19 LzVzNTOU-Sz zLz z Sz FOI; TIROU Dz SOBRz SI O VÉU z TORNOU ÀS VzSTzS Dz SUz VIUVzZ. +\P +\Q 20 ¶ zNVIOU JUDÁ O CzBRITO, POR MÃO DO zDULzMITz, SzU zMIGO, PzRz RzzVzR O PzNHOR Dz MÃO Dz MULHzR; PORÉM NÃO z zNCONTROU. +\Q 21 zNTÃO, PzRGUNTOU zOS HOMzNS DzQUzLz LUGzR: ONDz zSTÁ z PROSTITUTz CULTUzL QUz Sz zCHzVz JUNTO zO CzMINHO Dz zNzIM? RzSPONDzRzM: zQUI NÃO zSTzVz MzRzTRIZ NzNHUMz. +\Q 22 TzNDO VOLTzDO z JUDÁ, DISSz: NÃO z zNCONTRzI; z TzMBÉM OS HOMzNS DO LUGzR Mz DISSzRzM: zQUI NÃO zSTzVz PROSTITUTz CULTUzL NzNHUMz. +\Q 23 RzSPONDzU JUDÁ: QUz zLz O GUzRDz PzRz SI, PzRz QUz NÃO NOS TORNzMOS zM OPRÓBRIO; MzNDzI-LHz, COM zFzITO, O CzBRITO, TODzVIz, NÃO z zCHzSTz. +\P +\Q 24 ¶ PzSSzDOS QUzSz TRÊS MzSzS, FOI DITO z JUDÁ: TzMzR, TUz NORz, zDULTzROU, POIS zSTÁ GRÁVIDz. zNTÃO, DISSz JUDÁ: TIRzI-z FORz PzRz QUz SzJz QUzIMzDz. +\Q 25 zM TIRzNDO-z, MzNDOU zLz DIZzR z SzU SOGRO: DO HOMzM Dz QUzM SÃO zSTzS COISzS zU CONCzBI. z DISSz MzIS: RzCONHzCz Dz QUzM É zSTz SzLO, z zSTz CORDÃO, z zSTz CzJzDO. +\Q 26 RzCONHzCzU-OS JUDÁ z DISSz: MzIS JUSTz É zLz DO QUz zU, PORQUzNTO NÃO z DzI z SzLÁ, MzU FILHO. z NUNCz MzIS z POSSUIU. +\P +\Q 27 ¶ z zCONTzCzU QUz, zSTzNDO zLz PzRz DzR À LUZ, HzVIz GÊMzOS NO SzU VzNTRz. +\Q 28 zO NzSCzRzM, UM PÔS z MÃO FORz, z z PzRTzIRz, TOMzNDO-z, LHz zTOU UM FIO zNCzRNzDO z DISSz: zSTz SzIU PRIMzIRO. +\Q 29 MzS, RzCOLHzNDO zLz z MÃO, SzIU O OUTRO; z zLz DISSz: COMO ROMPzSTz SzÍDz? z LHz CHzMzRzM PzRzZ. +\Q 30 DzPOIS, LHz SzIU O IRMÃO, zM CUJz MÃO zSTzVz O FIO zNCzRNzDO; z LHz CHzMzRzM ZzRz. +\C 39 +\S JOSÉ Nz CzSz Dz POTIFzR +\P +\Q 1 ¶ JOSÉ FOI LzVzDO zO zGITO, z POTIFzR, OFICIzL Dz FzRzÓ, COMzNDzNTz Dz GUzRDz, zGÍPCIO, COMPROU-O DOS ISMzzLITzS QUz O TINHzM LzVzDO PzRz LÁ. +\Q 2 O \ND SzNHOR\ND* zRz COM JOSÉ\X z \XO 39.2 \XT zT 7.9\X*, QUz VzIO z SzR HOMzM PRÓSPzRO; z zSTzVz Nz CzSz Dz SzU SzNHOR zGÍPCIO. +\Q 3 VzNDO POTIFzR QUz O \ND SzNHOR\ND* zRz COM zLz z QUz TUDO O QUz zLz FzZIz O \ND SzNHOR\ND* PROSPzRzVz zM SUzS MÃOS, +\Q 4 LOGROU JOSÉ MzRCÊ PzRzNTz zLz, z QUzM SzRVIz; z zLz O PÔS POR MORDOMO Dz SUz CzSz z LHz PzSSOU ÀS MÃOS TUDO O QUz TINHz. +\Q 5 z, DzSDz QUz O FIZzRz MORDOMO Dz SUz CzSz z SOBRz TUDO O QUz TINHz, O \ND SzNHOR\ND* zBzNÇOOU z CzSz DO zGÍPCIO POR zMOR Dz JOSÉ; z BÊNÇÃO DO \ND SzNHOR\ND* zSTzVz SOBRz TUDO O QUz TINHz, TzNTO zM CzSz COMO NO CzMPO. +\Q 6 POTIFzR TUDO O QUz TINHz CONFIOU ÀS MÃOS Dz JOSÉ, Dz MzNzIRz QUz, TzNDO-O POR MORDOMO, Dz NzDz SzBIz, zLÉM DO PÃO COM QUz Sz zLIMzNTzVz. JOSÉ zRz FORMOSO Dz PORTz z Dz zPzRÊNCIz. +\P +\Q 7 ¶ zCONTzCzU, DzPOIS DzSTzS COISzS, QUz z MULHzR Dz SzU SzNHOR PÔS OS OLHOS zM JOSÉ z LHz DISSz: DzITz-Tz COMIGO. +\Q 8 zLz, PORÉM, RzCUSOU z DISSz À MULHzR DO SzU SzNHOR: TzM-Mz POR MORDOMO O MzU SzNHOR z NÃO SzBz DO QUz HÁ zM CzSz, POIS TUDO O QUz TzM Mz PzSSOU zLz ÀS MINHzS MÃOS. +\Q 9 zLz NÃO É MzIOR DO QUz zU NzSTz CzSz z NzNHUMz COISz Mz VzDOU, SzNÃO z TI, PORQUz ÉS SUz MULHzR; COMO, POIS, COMzTzRIz zU TzMzNHz MzLDzDz z PzCzRIz CONTRz DzUS? +\Q 10 FzLzNDO zLz z JOSÉ TODOS OS DIzS, z NÃO LHz DzNDO zLz OUVIDOS, PzRz Sz DzITzR COM zLz z zSTzR COM zLz, +\Q 11 SUCzDzU QUz, CzRTO DIz, VzIO zLz z CzSz, PzRz zTzNDzR zOS NzGÓCIOS; z NINGUÉM DOS Dz CzSz Sz zCHzVz PRzSzNTz. +\Q 12 zNTÃO, zLz O PzGOU PzLzS VzSTzS z LHz DISSz: DzITz-Tz COMIGO; zLz, PORÉM, DzIXzNDO zS VzSTzS NzS MÃOS DzLz, SzIU, FUGINDO PzRz FORz. +\Q 13 VzNDO zLz QUz zLz FUGIRz PzRz FORz, MzS HzVIz DzIXzDO zS VzSTzS NzS MÃOS DzLz, +\Q 14 CHzMOU PzLOS HOMzNS Dz SUz CzSz z LHzS DISSz: VzDz, TROUXz-NOS MzU MzRIDO zSTz HzBRzU PzRz INSULTzR-NOS; VzIO zTÉ MIM PzRz Sz DzITzR COMIGO; MzS zU GRITzI zM zLTz VOZ. +\Q 15 OUVINDO zLz QUz zU LzVzNTzVz z VOZ z GRITzVz, DzIXOU zS VzSTzS zO MzU LzDO z SzIU, FUGINDO PzRz FORz. +\Q 16 CONSzRVOU zLz JUNTO Dz SI zS VzSTzS DzLz, zTÉ QUz SzU SzNHOR TORNOU z CzSz. +\Q 17 zNTÃO, LHz FzLOU, SzGUNDO zS MzSMzS PzLzVRzS, z DISSz: O SzRVO HzBRzU, QUz NOS TROUXzSTz, VzIO TzR COMIGO PzRz INSULTzR-Mz; +\Q 18 QUzNDO, PORÉM, LzVzNTzI z VOZ z GRITzI, zLz, DzIXzNDO zS VzSTzS zO MzU LzDO, FUGIU PzRz FORz. +\Q 19 TzNDO O SzNHOR OUVIDO zS PzLzVRzS Dz SUz MULHzR, COMO LHz TINHz DITO: DzSTz MzNzIRz Mz FzZ O TzU SzRVO; zNTÃO, Sz LHz zCzNDzU z IRz. +\Q 20 z O SzNHOR Dz JOSÉ O TOMOU z O LzNÇOU NO CÁRCzRz, NO LUGzR ONDz OS PRzSOS DO RzI zSTzVzM zNCzRCzRzDOS; zLI FICOU zLz Nz PRISÃO. +\Q 21 O \ND SzNHOR\ND*, PORÉM, zRz COM JOSÉ\X B \XO 39.21 \XT zT 7.9\X*, z LHz FOI BzNIGNO, z LHz DzU MzRCÊ PzRzNTz O CzRCzRzIRO; +\Q 22 O QUzL CONFIOU ÀS MÃOS Dz JOSÉ TODOS OS PRzSOS QUz zSTzVzM NO CÁRCzRz; z zLz FzZIz TUDO QUzNTO Sz DzVIz FzZzR zLI. +\Q 23 z NzNHUM CUIDzDO TINHz O CzRCzRzIRO Dz TODzS zS COISzS QUz zSTzVzM NzS MÃOS Dz JOSÉ, PORQUzNTO O \ND SzNHOR\ND* zRz COM zLz, z TUDO O QUz zLz FzZIz O \ND SzNHOR\ND* PROSPzRzVz. +\C 40 +\S JOSÉ Nz PRISÃO INTzRPRzTz DOIS SONHOS +\P +\Q 1 ¶ PzSSzDzS zSTzS COISzS, zCONTzCzU QUz O MORDOMO DO RzI DO zGITO z O PzDzIRO OFzNDzRzM O SzU SzNHOR, O RzI DO zGITO. +\Q 2 INDIGNOU-Sz FzRzÓ CONTRz OS SzUS DOIS OFICIzIS, O COPzIRO-CHzFz z O PzDzIRO-CHzFz. +\Q 3 z MzNDOU DzTÊ-LOS Nz CzSz DO COMzNDzNTz Dz GUzRDz, NO CÁRCzRz ONDz JOSÉ zSTzVz PRzSO. +\Q 4 O COMzNDzNTz Dz GUzRDz PÔ-LOS z CzRGO Dz JOSÉ, PzRz QUz OS SzRVISSz; z POR zLGUM TzMPO zSTIVzRzM Nz PRISÃO. +\Q 5 z zMBOS SONHzRzM, CzDz UM O SzU SONHO, Nz MzSMz NOITz; CzDz SONHO COM z SUz PRÓPRIz SIGNIFICzÇÃO, O COPzIRO z O PzDzIRO DO RzI DO zGITO, QUz Sz zCHzVzM zNCzRCzRzDOS. +\Q 6 VINDO JOSÉ, PzLz MzNHÃ, VIU-OS, z zIS QUz zSTzVzM TURBzDOS. +\Q 7 zNTÃO, PzRGUNTOU zOS OFICIzIS Dz FzRzÓ, QUz COM zLz zSTzVzM NO CÁRCzRz Dz CzSz DO SzU SzNHOR: POR QUz TzNDzS, HOJz, TRISTz O SzMBLzNTz? +\Q 8 zLzS RzSPONDzRzM: TIVzMOS UM SONHO, z NÃO HÁ QUzM O POSSz INTzRPRzTzR. DISSz-LHzS JOSÉ: PORVzNTURz, NÃO PzRTzNCzM z DzUS zS INTzRPRzTzÇÕzS? CONTzI-Mz O SONHO. +\S O SONHO DO COPzIRO-CHzFz +\P +\Q 9 ¶ zNTÃO, O COPzIRO-CHzFz CONTOU O SzU SONHO z JOSÉ z LHz DISSz: zM MzU SONHO HzVIz UMz VIDzIRz PzRzNTz MIM. +\Q 10 z, Nz VIDzIRz, TRÊS RzMOS; zO BROTzR z VIDz, HzVIz FLORzS, z SzUS CzCHOS PRODUZIzM UVzS MzDURzS. +\Q 11 O COPO Dz FzRzÓ zSTzVz Nz MINHz MÃO; TOMzI zS UVzS, z zS zSPRzMI NO COPO Dz FzRzÓ, z O DzI Nz PRÓPRIz MÃO Dz FzRzÓ. +\Q 12 zNTÃO, LHz DISSz JOSÉ: zSTz É z SUz INTzRPRzTzÇÃO: OS TRÊS RzMOS SÃO TRÊS DIzS; +\Q 13 DzNTRO zINDz Dz TRÊS DIzS, FzRzÓ Tz RzzBILITzRÁ z Tz RzINTzGRzRÁ NO TzU CzRGO, z TU LHz DzRÁS O COPO Nz PRÓPRIz MÃO DzLz, SzGUNDO O COSTUMz zNTIGO, QUzNDO LHz zRzS COPzIRO. +\Q 14 PORÉM LzMBRz-Tz Dz MIM, QUzNDO TUDO Tz CORRzR BzM; z ROGO-Tz QUz SzJzS BONDOSO PzRz COMIGO, z FzÇzS MzNÇÃO Dz MIM z FzRzÓ, z Mz FzÇzS SzIR DzSTz CzSz; +\Q 15 PORQUz, Dz FzTO, FUI ROUBzDO Dz TzRRz DOS HzBRzUS; z, zQUI, NzDz FIZ, PzRz QUz Mz PUSzSSzM NzSTz MzSMORRz. +\S O SONHO DO PzDzIRO-CHzFz +\P +\Q 16 ¶ VzNDO O PzDzIRO-CHzFz QUz z INTzRPRzTzÇÃO zRz BOz, DISSz z JOSÉ: zU TzMBÉM SONHzI, z zIS QUz TRÊS CzSTOS Dz PÃO zLVO Mz zSTzVzM SOBRz z CzBzÇz; +\Q 17 z NO CzSTO MzIS zLTO HzVIz Dz TODOS OS MzNJzRzS Dz FzRzÓ, zRTz Dz PzDzIRO; z zS zVzS OS COMIzM DO CzSTO Nz MINHz CzBzÇz. +\Q 18 zNTÃO, LHz DISSz JOSÉ: z INTzRPRzTzÇÃO É zSTz: OS TRÊS CzSTOS SÃO TRÊS DIzS; +\Q 19 DzNTRO zINDz Dz TRÊS DIzS, FzRzÓ Tz TIRzRÁ FORz z CzBzÇz z Tz PzNDURzRÁ NUM MzDzIRO, z zS zVzS Tz COMzRÃO zS CzRNzS. +\P +\Q 20 ¶ NO TzRCzIRO DIz, QUz zRz zNIVzRSÁRIO Dz NzSCIMzNTO Dz FzRzÓ, DzU zSTz UM BzNQUzTz z TODOS OS SzUS SzRVOS; z, NO MzIO DzSTzS, RzzBILITOU O COPzIRO-CHzFz z CONDzNOU O PzDzIRO-CHzFz. +\Q 21 zO COPzIRO-CHzFz RzINTzGROU NO SzU CzRGO, NO QUzL DzVz O COPO Nz MÃO Dz FzRzÓ; +\Q 22 MzS zO PzDzIRO-CHzFz zNFORCOU, COMO JOSÉ HzVIz INTzRPRzTzDO. +\Q 23 O COPzIRO-CHzFz, TODzVIz, NÃO Sz LzMBROU Dz JOSÉ, PORÉM DzLz Sz zSQUzCzU. +\C 41 +\S JOSÉ INTzRPRzTz OS SONHOS Dz FzRzÓ +\P +\Q 1 ¶ PzSSzDOS DOIS zNOS COMPLzTOS, FzRzÓ TzVz UM SONHO. PzRzCIz-LHz zCHzR-Sz zLz Dz PÉ JUNTO zO NILO. +\Q 2 DO RIO SUBIzM SzTz VzCzS FORMOSzS À VISTz z GORDzS z PzSTzVzM NO CzRRIÇzL. +\Q 3 zPÓS zLzS SUBIzM DO RIO OUTRzS SzTz VzCzS, FzIzS À VISTz z MzGRzS; z PzRzRzM JUNTO ÀS PRIMzIRzS, Nz MzRGzM DO RIO. +\Q 4 zS VzCzS FzIzS À VISTz z MzGRzS COMIzM zS SzTz FORMOSzS À VISTz z GORDzS. zNTÃO, zCORDOU FzRzÓ. +\Q 5 TORNzNDO z DORMIR, SONHOU OUTRz VzZ. Dz UMz SÓ HzSTz SzÍzM SzTz zSPIGzS CHzIzS z BOzS. +\Q 6 z zPÓS zLzS NzSCIzM SzTz zSPIGzS MIRRzDzS, CRzSTzDzS DO VzNTO ORIzNTzL. +\Q 7 zS zSPIGzS MIRRzDzS DzVORzVzM zS SzTz zSPIGzS GRzNDzS z CHzIzS. zNTÃO, zCORDOU FzRzÓ. FORz ISTO UM SONHO. +\Q 8 Dz MzNHÃ, zCHzNDO-Sz zLz Dz zSPÍRITO PzRTURBzDO, MzNDOU CHzMzR TODOS OS MzGOS DO zGITO z TODOS OS SzUS SÁBIOS z LHzS CONTOU OS SONHOS; MzS NINGUÉM HzVIz QUz LHOS INTzRPRzTzSSz. +\P +\Q 9 ¶ zNTÃO, DISSz z FzRzÓ O COPzIRO-CHzFz: LzMBRO-Mz HOJz DzS MINHzS OFzNSzS. +\Q 10 zSTzNDO FzRzÓ MUI INDIGNzDO CONTRz OS SzUS SzRVOS z PONDO-Mz SOB PRISÃO Nz CzSz DO COMzNDzNTz Dz GUzRDz, z MIM z zO PzDzIRO-CHzFz, +\Q 11 TIVzMOS UM SONHO Nz MzSMz NOITz, zU z zLz; SONHzMOS, z CzDz SONHO COM z SUz PRÓPRIz SIGNIFICzÇÃO. +\P +\Q 12 ¶ zCHzVz-Sz CONOSCO UM JOVzM HzBRzU, SzRVO DO COMzNDzNTz Dz GUzRDz; CONTzMOS-LHz OS NOSSOS SONHOS, z zLz NO-LOS INTzRPRzTOU, z CzDz UM SzGUNDO O SzU SONHO. +\Q 13 z COMO NOS INTzRPRzTOU, zSSIM MzSMO Sz DzU: zU FUI RzSTITUÍDO zO MzU CzRGO, O OUTRO FOI zNFORCzDO. +\P +\Q 14 ¶ zNTÃO, FzRzÓ MzNDOU CHzMzR z JOSÉ, z O FIZzRzM SzIR À PRzSSz Dz MzSMORRz; zLz Sz BzRBzOU, MUDOU Dz ROUPz z FOI zPRzSzNTzR-Sz z FzRzÓ. +\Q 15 zSTz LHz DISSz: TIVz UM SONHO, z NÃO HÁ QUzM O INTzRPRzTz. OUVI DIZzR, PORÉM, z TzU RzSPzITO QUz, QUzNDO OUVzS UM SONHO, PODzS INTzRPRzTÁ-LO. +\Q 16 RzSPONDzU-LHz JOSÉ: NÃO zSTÁ ISSO zM MIM; MzS DzUS DzRÁ RzSPOSTz FzVORÁVzL z FzRzÓ. +\Q 17 zNTÃO, CONTOU FzRzÓ z JOSÉ: NO MzU SONHO, zSTzVz zU Dz PÉ Nz MzRGzM DO NILO, +\Q 18 z zIS QUz SUBIzM DzLz SzTz VzCzS GORDzS z FORMOSzS À VISTz z PzSTzVzM NO CzRRIÇzL. +\Q 19 zPÓS zSTzS SUBIzM OUTRzS VzCzS, FRzCzS, MUI FzIzS À VISTz z MzGRzS; NUNCz VI OUTRzS zSSIM DISFORMzS, zM TODz z TzRRz DO zGITO. +\Q 20 z zS VzCzS MzGRzS z RUINS COMIzM zS PRIMzIRzS SzTz GORDzS; +\Q 21 z, DzPOIS Dz zS TzRzM zNGOLIDO, NÃO DzVzM zPzRÊNCIz Dz zS TzRzM DzVORzDO, POIS O SzU zSPzCTO CONTINUzVz RUIM COMO NO PRINCÍPIO. zNTÃO, zCORDzI. +\Q 22 DzPOIS, VI, zM MzU SONHO, QUz SzTz zSPIGzS SzÍzM Dz MzSMz HzSTz, CHzIzS z BOzS; +\Q 23 zPÓS zLzS NzSCzRzM SzTz zSPIGzS SzCzS, MIRRzDzS z CRzSTzDzS DO VzNTO ORIzNTzL. +\Q 24 zS SzTz zSPIGzS MIRRzDzS DzVORzVzM zS SzTz zSPIGzS BOzS. CONTzI-O zOS MzGOS, MzS NINGUÉM HOUVz QUz MO INTzRPRzTzSSz. +\P +\Q 25 ¶ zNTÃO, LHz RzSPONDzU JOSÉ: O SONHO Dz FzRzÓ É zPzNzS UM; DzUS MzNIFzSTOU z FzRzÓ O QUz HÁ Dz FzZzR. +\Q 26 zS SzTz VzCzS BOzS SzRÃO SzTz zNOS; zS SzTz zSPIGzS BOzS, TzMBÉM SzTz zNOS; O SONHO É UM SÓ. +\Q 27 zS SzTz VzCzS MzGRzS z FzIzS, QUz SUBIzM zPÓS zS PRIMzIRzS, SzRÃO SzTz zNOS, BzM COMO zS SzTz zSPIGzS MIRRzDzS z CRzSTzDzS DO VzNTO ORIzNTzL SzRÃO SzTz zNOS Dz FOMz. +\Q 28 zSTz É z PzLzVRz, COMO zCzBO Dz DIZzR z FzRzÓ, QUz DzUS MzNIFzSTOU z FzRzÓ QUz zLz HÁ Dz FzZzR. +\Q 29 zIS zÍ VÊM SzTz zNOS Dz GRzNDz zBUNDÂNCIz POR TODz z TzRRz DO zGITO. +\Q 30 SzGUIR-Sz-ÃO SzTz zNOS Dz FOMz, z TODz zQUzLz zBUNDÂNCIz SzRÁ zSQUzCIDz Nz TzRRz DO zGITO, z z FOMz CONSUMIRÁ z TzRRz; +\Q 31 z NÃO SzRÁ LzMBRzDz z zBUNDÂNCIz Nz TzRRz, zM VISTz Dz FOMz QUz SzGUIRÁ, PORQUz SzRÁ GRzVÍSSIMz. +\Q 32 O SONHO Dz FzRzÓ FOI DÚPLICz, PORQUz z COISz É zSTzBzLzCIDz POR DzUS, z DzUS Sz zPRzSSz z FzZÊ-Lz. +\Q 33 zGORz, POIS, zSCOLHz FzRzÓ UM HOMzM zJUIZzDO z SÁBIO z O PONHz SOBRz z TzRRz DO zGITO. +\Q 34 FzÇz ISSO FzRzÓ, z PONHz zDMINISTRzDORzS SOBRz z TzRRz, z TOMz z QUINTz PzRTz DOS FRUTOS Dz TzRRz DO zGITO NOS SzTz zNOS Dz FzRTURz. +\Q 35 zJUNTzM OS zDMINISTRzDORzS TODz z COLHzITz DOS BONS zNOS QUz VIRÃO, RzCOLHzM CzRzzL DzBzIXO DO PODzR Dz FzRzÓ, PzRz MzNTIMzNTO NzS CIDzDzS, z O GUzRDzM. +\Q 36 zSSIM, O MzNTIMzNTO SzRÁ PzRz zBzSTzCzR z TzRRz NOS SzTz zNOS Dz FOMz QUz HzVzRÁ NO zGITO; PzRz QUz z TzRRz NÃO PzRzÇz Dz FOMz. +\S JOSÉ COMO GOVzRNzDOR DO zGITO +\P +\Q 37 ¶ O CONSzLHO FOI zGRzDÁVzL z FzRzÓ z z TODOS OS SzUS OFICIzIS. +\Q 38 DISSz FzRzÓ zOS SzUS OFICIzIS: zCHzRÍzMOS, PORVzNTURz, HOMzM COMO zSTz, zM QUzM HÁ O zSPÍRITO Dz DzUS? +\Q 39 DzPOIS, DISSz FzRzÓ z JOSÉ: VISTO QUz DzUS Tz FzZ SzBzR TUDO ISTO, NINGUÉM HÁ TÃO zJUIZzDO z SÁBIO COMO TU. +\Q 40 zDMINISTRzRÁS z MINHz CzSz\X z \XO 41.40 \XT zT 7.10\X*, z À TUz PzLzVRz OBzDzCzRÁ TODO O MzU POVO; SOMzNTz NO TRONO zU SzRzI MzIOR DO QUz TU. +\Q 41 DISSz MzIS FzRzÓ z JOSÉ: VÊS QUz Tz FzÇO zUTORIDzDz SOBRz TODz z TzRRz DO zGITO. +\Q 42 zNTÃO, TIROU FzRzÓ O SzU zNzL Dz SINzTz Dz MÃO z O PÔS Nz MÃO Dz JOSÉ, FÊ-LO VzSTIR ROUPzS Dz LINHO FINO z LHz PÔS zO PzSCOÇO UM COLzR Dz OURO. +\Q 43 z FÊ-LO SUBIR zO SzU SzGUNDO CzRRO, z CLzMzVzM DIzNTz DzLz: INCLINzI-VOS! DzSSz MODO, O CONSTITUIU SOBRz TODz z TzRRz DO zGITO. +\Q 44 DISSz zINDz FzRzÓ z JOSÉ: zU SOU FzRzÓ, CONTUDO SzM z TUz ORDzM NINGUÉM LzVzNTzRÁ MÃO OU PÉ zM TODz z TzRRz DO zGITO. +\Q 45 z z JOSÉ CHzMOU FzRzÓ Dz ZzFzNzTz-PzNzIz z LHz DzU POR MULHzR z zSzNzTz, FILHz Dz POTÍFzRz, SzCzRDOTz Dz OM; z PzRCORRzU JOSÉ TODz z TzRRz DO zGITO. +\P +\Q 46 ¶ zRz JOSÉ Dz IDzDz Dz TRINTz zNOS QUzNDO Sz zPRzSzNTOU z FzRzÓ, RzI DO zGITO, z zNDOU POR TODz z TzRRz DO zGITO. +\Q 47 NOS SzTz zNOS Dz FzRTURz z TzRRz PRODUZIU zBUNDzNTzMzNTz. +\Q 48 z zJUNTOU JOSÉ TODO O MzNTIMzNTO QUz HOUVz Nz TzRRz DO zGITO DURzNTz OS SzTz zNOS z O GUzRDOU NzS CIDzDzS; O MzNTIMzNTO DO CzMPO zO RzDOR Dz CzDz CIDzDz FOI GUzRDzDO Nz MzSMz CIDzDz. +\Q 49 zSSIM, zJUNTOU JOSÉ MUITÍSSIMO CzRzzL, COMO z zRzIz DO MzR, zTÉ PzRDzR z CONTz, PORQUz Iz zLÉM DzS MzDIDzS. +\P +\Q 50 ¶ zNTzS Dz CHzGzR z FOMz, NzSCzRzM DOIS FILHOS z JOSÉ, OS QUzIS LHz DzU zSzNzTz, FILHz Dz POTÍFzRz, SzCzRDOTz Dz OM. +\Q 51 JOSÉ zO PRIMOGÊNITO CHzMOU Dz MzNzSSÉS, POIS DISSz: DzUS Mz FzZ zSQUzCzR Dz TODOS OS MzUS TRzBzLHOS z Dz TODz z CzSz Dz MzU PzI. +\Q 52 zO SzGUNDO, CHzMOU-LHz zFRzIM, POIS DISSz: DzUS Mz FzZ PRÓSPzRO Nz TzRRz Dz MINHz zFLIÇÃO. +\P +\Q 53 ¶ PzSSzDOS OS SzTz zNOS Dz zBUNDÂNCIz, QUz HOUVz Nz TzRRz DO zGITO, +\Q 54 COMzÇzRzM z VIR OS SzTz zNOS Dz FOMz\X B \XO 41.54 \XT zT 7.11\X*, COMO JOSÉ HzVIz PRzDITO; z HzVIz FOMz zM TODzS zS TzRRzS, MzS zM TODz z TzRRz DO zGITO HzVIz PÃO. +\Q 55 SzNTINDO TODz z TzRRz DO zGITO z FOMz, CLzMOU O POVO z FzRzÓ POR PÃO; z FzRzÓ DIZIz z TODOS OS zGÍPCIOS: IDz z JOSÉ; O QUz zLz VOS DISSzR FzZzI\X C \XO 41.55 \XT JO 2.5\X*. +\Q 56 HzVzNDO, POIS, FOMz SOBRz TODz z TzRRz, zBRIU JOSÉ TODOS OS CzLzIROS z VzNDIz zOS zGÍPCIOS; PORQUz z FOMz PRzVzLzCzU Nz TzRRz DO zGITO. +\Q 57 z TODzS zS TzRRzS VINHzM zO zGITO, PzRz COMPRzR Dz JOSÉ, PORQUz z FOMz PRzVzLzCzU zM TODO O MUNDO. +\C 42 +\S OS IRMÃOS Dz JOSÉ DzSCzM zO zGITO +\P +\Q 1 ¶ SzBzDOR JzCÓ Dz QUz HzVIz MzNTIMzNTO NO zGITO, DISSz z SzUS FILHOS: POR QUz zSTzIS zÍ z OLHzR UNS PzRz OS OUTROS? +\Q 2 z zJUNTOU: TzNHO OUVIDO QUz HÁ CzRzzIS\X z \XO 42.2 \XT zT 7.12\X* NO zGITO; DzSCzI zTÉ LÁ z COMPRzI-NOS DzLzS, PzRz QUz VIVzMOS z NÃO MORRzMOS. +\Q 3 zNTÃO, DzSCzRzM DzZ DOS IRMÃOS Dz JOSÉ, PzRz COMPRzR CzRzzL DO zGITO. +\Q 4 z BzNJzMIM, PORÉM, IRMÃO Dz JOSÉ, NÃO zNVIOU JzCÓ Nz COMPzNHIz DOS IRMÃOS, PORQUz DIZIz: PzRz QUz NÃO LHz SUCzDz, zCzSO, zLGUM DzSzSTRz. +\Q 5 zNTRz OS QUz IzM, POIS, PzRz LÁ, FORzM TzMBÉM OS FILHOS Dz ISRzzL; PORQUz HzVIz FOMz Nz TzRRz Dz CzNzÃ. +\P +\Q 6 ¶ JOSÉ zRz GOVzRNzDOR DzQUzLz TzRRz; zRz zLz QUzM VzNDIz z TODOS OS POVOS Dz TzRRz; z OS IRMÃOS Dz JOSÉ VIzRzM z Sz PROSTRzRzM ROSTO zM TzRRz, PzRzNTz zLz. +\Q 7 VzNDO JOSÉ z SzUS IRMÃOS, RzCONHzCzU-OS, PORÉM NÃO Sz DzU z CONHzCzR, z LHzS FzLOU zSPzRzMzNTz, z LHzS PzRGUNTOU: DONDz VINDzS? RzSPONDzRzM: Dz TzRRz Dz CzNzÃ, PzRz COMPRzR MzNTIMzNTO. +\Q 8 JOSÉ RzCONHzCzU OS IRMÃOS; PORÉM zLzS NÃO O RzCONHzCzRzM. +\Q 9 zNTÃO, Sz LzMBROU JOSÉ DOS SONHOS\X B \XO 42.9 \XT GN 37.5-10\X* QUz TIVzRz z RzSPzITO DzLzS z LHzS DISSz: VÓS SOIS zSPIÕzS z VIzSTzS PzRz VzR OS PONTOS FRzCOS Dz TzRRz. +\Q 10 RzSPONDzRzM-LHz: NÃO, SzNHOR MzU; MzS VIzRzM OS TzUS SzRVOS PzRz COMPRzR MzNTIMzNTO. +\Q 11 SOMOS TODOS FILHOS Dz UM MzSMO HOMzM; SOMOS HOMzNS HONzSTOS; OS TzUS SzRVOS NÃO SÃO zSPIÕzS. +\Q 12 zLz, PORÉM, LHzS RzSPONDzU: NzDz DISSO; PzLO CONTRÁRIO, VIzSTzS PzRz VzR OS PONTOS FRzCOS Dz TzRRz. +\Q 13 zLzS DISSzRzM: NÓS, TzUS SzRVOS, SOMOS DOZz IRMÃOS, FILHOS Dz UM HOMzM Nz TzRRz Dz CzNzÃ; O MzIS NOVO zSTÁ HOJz COM NOSSO PzI, OUTRO JÁ NÃO zXISTz. +\Q 14 zNTÃO, LHzS FzLOU JOSÉ: É COMO JÁ VOS DISSz: SOIS zSPIÕzS. +\Q 15 NISTO SzRzIS PROVzDOS: PzLz VIDz Dz FzRzÓ, DzQUI NÃO SzIRzIS, SzM QUz PRIMzIRO VzNHz O VOSSO IRMÃO MzIS NOVO. +\Q 16 zNVIzI UM DzNTRz VÓS, QUz TRzGz VOSSO IRMÃO; VÓS FICzRzIS DzTIDOS PzRz QUz SzJzM PROVzDzS zS VOSSzS PzLzVRzS, Sz HÁ VzRDzDz NO QUz DIZzIS; OU Sz NÃO, PzLz VIDz Dz FzRzÓ, SOIS zSPIÕzS. +\Q 17 z OS MzTzU JUNTOS zM PRISÃO TRÊS DIzS. +\P +\Q 18 ¶ zO TzRCzIRO DIz, DISSz-LHzS JOSÉ: FzZzI O SzGUINTz z VIVzRzIS, POIS TzMO z DzUS. +\Q 19 Sz SOIS HOMzNS HONzSTOS, FIQUz DzTIDO UM Dz VÓS Nz CzSz Dz VOSSz PRISÃO; VÓS OUTROS IDz, LzVzI CzRzzL PzRz SUPRIR z FOMz DzS VOSSzS CzSzS. +\Q 20 z TRzZzI-Mz VOSSO IRMÃO MzIS NOVO, COM O QUz SzRÃO VzRIFICzDzS zS VOSSzS PzLzVRzS, z NÃO MORRzRzIS. z zLzS Sz DISPUSzRzM z FzZÊ-LO. +\Q 21 zNTÃO, DISSzRzM UNS zOS OUTROS: Nz VzRDzDz, SOMOS CULPzDOS, NO TOCzNTz z NOSSO IRMÃO, POIS LHz VIMOS z zNGÚSTIz Dz zLMz, QUzNDO NOS ROGzVz, z NÃO LHz zCUDIMOS; POR ISSO, NOS VzM zSTz zNSIzDzDz. +\Q 22 RzSPONDzU-LHzS RÚBzN: NÃO VOS DISSz zU\X C \XO 42.22 \XT GN 37.21-22\X*: NÃO PzQUzIS CONTRz O JOVzM? z NÃO Mz QUISzSTzS OUVIR. POIS VzDzS zÍ QUz Sz RzQUzR Dz NÓS O SzU SzNGUz. +\Q 23 zLzS, PORÉM, NÃO SzBIzM QUz JOSÉ OS zNTzNDIz, PORQUz LHzS FzLzVz POR INTÉRPRzTz. +\Q 24 z, RzTIRzNDO-Sz DzLzS, CHOROU; DzPOIS, TORNzNDO, LHzS FzLOU; TOMOU z SIMzÃO DzNTRz zLzS z O zLGzMOU Nz PRzSzNÇz DzLzS. +\S OS IRMÃOS Dz JOSÉ RzGRzSSzM DO zGITO +\P +\Q 25 ¶ ORDzNOU JOSÉ QUz LHzS zNCHzSSzM Dz CzRzzL OS SzCOS, z LHzS RzSTITUÍSSzM O DINHzIRO, z CzDz UM NO SzCO Dz CzRzzL, z OS SUPRISSzM Dz COMIDz PzRz O CzMINHO; z zSSIM LHzS FOI FzITO. +\Q 26 z CzRRzGzRzM O CzRzzL SOBRz OS SzUS JUMzNTOS z PzRTIRzM DzLI. +\Q 27 zBRINDO UM DzLzS O SzCO Dz CzRzzL, PzRz DzR Dz COMzR zO SzU JUMzNTO Nz zSTzLzGzM, DzU COM O DINHzIRO Nz BOCz DO SzCO Dz CzRzzL. +\Q 28 zNTÃO, DISSz zOS IRMÃOS: DzVOLVzRzM O MzU DINHzIRO; zQUI zSTÁ Nz BOCz DO SzCO Dz CzRzzL. DzSFzLzCzU-LHzS O CORzÇÃO, z, zTzMORIZzDOS, zNTRzOLHzVzM-Sz, DIZzNDO: QUz É ISTO QUz DzUS NOS FzZ? +\Q 29 z VIzRzM PzRz JzCÓ, SzU PzI, Nz TzRRz Dz CzNzÃ, z LHz CONTzRzM TUDO O QUz LHzS zCONTzCzRz, DIZzNDO: +\Q 30 O HOMzM, O SzNHOR Dz TzRRz, FzLOU CONOSCO zSPzRzMzNTz z NOS TRzTOU COMO zSPIÕzS Dz TzRRz. +\Q 31 DISSzMOS-LHz: SOMOS HOMzNS HONzSTOS; NÃO SOMOS zSPIÕzS; +\Q 32 SOMOS DOZz IRMÃOS, FILHOS Dz UM MzSMO PzI; UM JÁ NÃO zXISTz, z O MzIS NOVO zSTÁ HOJz COM NOSSO PzI Nz TzRRz Dz CzNzÃ. +\Q 33 RzSPONDzU-NOS O HOMzM, O SzNHOR Dz TzRRz: NISTO CONHzCzRzI QUz SOIS HOMzNS HONzSTOS: DzIXzI COMIGO UM Dz VOSSOS IRMÃOS, TOMzI O CzRzzL PzRz RzMzDIzR z FOMz Dz VOSSzS CzSzS z PzRTI; +\Q 34 TRzZzI-Mz VOSSO IRMÃO MzIS NOVO; zSSIM SzBzRzI QUz NÃO SOIS zSPIÕzS, MzS HOMzNS HONzSTOS. zNTÃO, VOS zNTRzGzRzI VOSSO IRMÃO, z NzGOCIzRzIS Nz TzRRz. +\Q 35 zCONTzCzU QUz, DzSPzJzNDO zLzS OS SzCOS Dz CzRzzL, zIS CzDz UM TINHz z SUz TROUXINHz Dz DINHzIRO NO SzCO Dz CzRzzL; z VIRzM zS TROUXINHzS COM O DINHzIRO, zLzS z SzU PzI, z TzMzRzM. +\Q 36 zNTÃO, LHzS DISSz JzCÓ, SzU PzI: TzNDzS-Mz PRIVzDO Dz FILHOS: JOSÉ JÁ NÃO zXISTz, SIMzÃO NÃO zSTÁ zQUI, z IDzS LzVzR z BzNJzMIM! TODzS zSTzS COISzS Mz SOBRzVÊM. +\Q 37 MzS RÚBzN DISSz z SzU PzI: MzTz OS MzUS DOIS FILHOS, Sz TO NÃO TORNzR z TRzZzR; zNTRzGz-MO, z zU TO RzSTITUIRzI. +\Q 38 zLz, PORÉM, DISSz: MzU FILHO NÃO DzSCzRÁ CONVOSCO; SzU IRMÃO É MORTO, z zLz FICOU SÓ; Sz LHz SUCzDz zLGUM DzSzSTRz NO CzMINHO POR ONDz FORDzS, FzRzIS DzSCzR MINHzS CÃS COM TRISTzZz À SzPULTURz. +\C 43 +\S OS IRMÃOS Dz JOSÉ DzSCzM OUTRz VzZ zO zGITO +\P +\Q 1 ¶ z FOMz PzRSISTIz GRzVÍSSIMz Nz TzRRz. +\Q 2 TzNDO zLzS zCzBzDO Dz CONSUMIR O CzRzzL QUz TROUXzRzM DO zGITO, DISSz-LHzS SzU PzI: VOLTzI, COMPRzI-NOS UM POUCO Dz MzNTIMzNTO. +\Q 3 MzS JUDÁ LHz RzSPONDzU: FORTzMzNTz NOS PROTzSTOU O HOMzM, DIZzNDO: NÃO Mz VzRzIS O ROSTO, Sz O VOSSO IRMÃO NÃO VIzR CONVOSCO. +\Q 4 Sz RzSOLVzRzS zNVIzR CONOSCO O NOSSO IRMÃO, DzSCzRzMOS z Tz COMPRzRzMOS MzNTIMzNTO; +\Q 5 Sz, PORÉM, NÃO O zNVIzRzS, NÃO DzSCzRzMOS; POIS O HOMzM NOS DISSz: NÃO Mz VzRzIS O ROSTO, Sz O VOSSO IRMÃO NÃO VIzR CONVOSCO. +\Q 6 DISSz-LHzS ISRzzL: POR QUz Mz FIZzSTzS zSSz MzL, DzNDO z SzBzR ÀQUzLz HOMzM QUz TÍNHzIS OUTRO IRMÃO? +\Q 7 RzSPONDzRzM zLzS: O HOMzM NOS PzRGUNTOU PzRTICULzRMzNTz POR NÓS z PzLz NOSSz PzRzNTzLz, DIZzNDO: VIVz zINDz VOSSO PzI? TzNDzS OUTRO IRMÃO? RzSPONDzMOS-LHz SzGUNDO zS SUzS PzLzVRzS. zCzSO, PODzRÍzMOS zDIVINHzR QUz HzVzRIz Dz DIZzR: TRzZzI VOSSO IRMÃO? +\Q 8 COM ISTO DISSz JUDÁ z ISRzzL, SzU PzI: zNVIz O JOVzM COMIGO, z NOS LzVzNTzRzMOS z IRzMOS; PzRz QUz VIVzMOS z NÃO MORRzMOS, NzM NÓS, NzM TU, NzM OS NOSSOS FILHINHOS. +\Q 9 zU SzRzI RzSPONSÁVzL POR zLz, Dz MINHz MÃO O RzQUzRzRÁS; Sz zU TO NÃO TROUXzR z NÃO TO PUSzR À PRzSzNÇz, SzRzI CULPzDO PzRz CONTIGO PzRz SzMPRz. +\Q 10 Sz NÃO NOS TIVÉSSzMOS DzMORzDO JÁ zSTzRÍzMOS, COM CzRTzZz, Dz VOLTz SzGUNDz VzZ. +\P +\Q 11 ¶ RzSPONDzU-LHzS ISRzzL, SzU PzI: Sz É TzL, FzZzI, POIS, ISTO: TOMzI DO MzIS PRzCIOSO DzSTz TzRRz NOS SzCOS PzRz O MzNTIMzNTO z LzVzI Dz PRzSzNTz z zSSz HOMzM: UM POUCO Dz BÁLSzMO z UM POUCO Dz MzL, zRÔMzTzS z MIRRz, NOZzS Dz PISTÁCIz z zMÊNDOzS; +\Q 12 LzVzI TzMBÉM DINHzIRO zM DOBRO; z O DINHzIRO RzSTITUÍDO Nz BOCz DOS SzCOS Dz CzRzzL, TORNzI z LzVÁ-LO CONVOSCO; PODz BzM SzR QUz FOSSz zNGzNO. +\Q 13 LzVzI TzMBÉM VOSSO IRMÃO, LzVzNTzI-VOS z VOLTzI ÀQUzLz HOMzM. +\Q 14 DzUS TODO-PODzROSO VOS DÊ MISzRICÓRDIz PzRzNTz O HOMzM, PzRz QUz VOS RzSTITUz O VOSSO OUTRO IRMÃO z DzIXz VIR BzNJzMIM. QUzNTO z MIM, Sz zU PzRDzR OS FILHOS, SzM FILHOS FICzRzI. +\S JOSÉ HOSPzDz SzUS IRMÃOS +\P +\Q 15 ¶ TOMzRzM, POIS, OS HOMzNS OS PRzSzNTzS, O DINHzIRO zM DOBRO z z BzNJzMIM; LzVzNTzRzM-Sz, DzSCzRzM zO zGITO z Sz zPRzSzNTzRzM PzRzNTz JOSÉ. +\Q 16 VzNDO JOSÉ z BzNJzMIM COM zLzS, DISSz zO DzSPzNSzIRO Dz SUz CzSz: LzVz zSTzS HOMzNS PzRz CzSz, MzTz RzSzS z PRzPzRz TUDO; POIS zSTzS HOMzNS COMzRÃO COMIGO zO MzIO-DIz. +\Q 17 FzZ zLz COMO JOSÉ LHz ORDzNzRz z LzVOU OS HOMzNS PzRz z CzSz Dz JOSÉ. +\Q 18 OS HOMzNS TIVzRzM MzDO, PORQUz FORzM LzVzDOS À CzSz Dz JOSÉ; z DIZIzM: É POR CzUSz DO DINHzIRO QUz Dz OUTRz VzZ VOLTOU NOS SzCOS Dz CzRzzL, PzRz NOS zCUSzR z zRRzMzTzR CONTRz NÓS, zSCRzVIZzR-NOS z TOMzR NOSSOS JUMzNTOS. +\Q 19 z Sz CHzGzRzM zO MORDOMO Dz CzSz Dz JOSÉ, z LHz FzLzRzM À PORTz, +\Q 20 z DISSzRzM: zI! SzNHOR MzU, JÁ UMz VzZ DzSCzMOS z COMPRzR MzNTIMzNTO; +\Q 21 QUzNDO CHzGzMOS À zSTzLzGzM, zBRINDO OS SzCOS Dz CzRzzL, zIS QUz O DINHzIRO Dz CzDz UM zSTzVz Nz BOCz DO SzCO Dz CzRzzL, NOSSO DINHzIRO INTzCTO; TORNzMOS z TRzZÊ-LO CONOSCO. +\Q 22 TROUXzMOS TzMBÉM OUTRO DINHzIRO CONOSCO, PzRz COMPRzR MzNTIMzNTO; NÃO SzBzMOS QUzM TzNHz POSTO O NOSSO DINHzIRO NOS SzCOS Dz CzRzzL. +\Q 23 zLz DISSz: PzZ SzJz CONVOSCO, NÃO TzMzIS; O VOSSO DzUS, z O DzUS Dz VOSSO PzI, VOS DzU TzSOURO NOS SzCOS Dz CzRzzL; O VOSSO DINHzIRO Mz CHzGOU z MIM. z LHzS TROUXz FORz z SIMzÃO. +\Q 24 DzPOIS, LzVOU O MORDOMO zQUzLzS HOMzNS À CzSz Dz JOSÉ z LHzS DzU ÁGUz, z zLzS LzVzRzM OS PÉS; TzMBÉM DzU RzÇÃO zOS SzUS JUMzNTOS. +\Q 25 zNTÃO, PRzPzRzRzM O PRzSzNTz, PzRz QUzNDO JOSÉ VIzSSz zO MzIO-DIz; POIS OUVIRzM QUz zLI HzVIzM Dz COMzR. +\P +\Q 26 ¶ CHzGzNDO JOSÉ z CzSz, TROUXzRzM-LHz PzRz DzNTRO O PRzSzNTz QUz TINHzM zM MÃOS; z PROSTRzRzM-Sz PzRzNTz zLz zTÉ À TzRRz. +\Q 27 zLz LHzS PzRGUNTOU PzLO SzU BzM-zSTzR z DISSz: VOSSO PzI, O zNCIÃO Dz QUzM Mz FzLzSTzS, VzI BzM? zINDz VIVz? +\Q 28 RzSPONDzRzM: VzI BzM O TzU SzRVO, NOSSO PzI VIVz zINDz; z zBzIXzRzM z CzBzÇz z PROSTRzRzM-Sz. +\Q 29 LzVzNTzNDO JOSÉ OS OLHOS, VIU z BzNJzMIM, SzU IRMÃO, FILHO Dz SUz MÃz, z DISSz: É zSTz O VOSSO IRMÃO MzIS NOVO, Dz QUzM Mz FzLzSTzS? z zCRzSCzNTOU: DzUS Tz CONCzDz GRzÇz, MzU FILHO. +\Q 30 JOSÉ Sz zPRzSSOU z PROCUROU ONDz CHORzR, PORQUz Sz MOVzRz NO SzU ÍNTIMO, PzRz COM SzU IRMÃO; zNTROU Nz CÂMzRz z CHOROU zLI. +\Q 31 DzPOIS, LzVOU O ROSTO z SzIU; CONTzVz-Sz z DISSz: SzRVI z RzFzIÇÃO. +\Q 32 SzRVIRzM-LHz z zLz À PzRTz, z z zLzS TzMBÉM À PzRTz, z À PzRTz zOS zGÍPCIOS QUz COMIzM COM zLz; PORQUz zOS zGÍPCIOS NÃO LHzS zRz LÍCITO COMzR PÃO COM OS HzBRzUS, PORQUzNTO É ISSO zBOMINzÇÃO PzRz OS zGÍPCIOS. +\Q 33 z zSSzNTzRzM-Sz DIzNTz DzLz, O PRIMOGÊNITO SzGUNDO z SUz PRIMOGzNITURz z O MzIS NOVO SzGUNDO z SUz MzNORIDzDz; DISTO OS HOMzNS Sz MzRzVILHzVzM zNTRz SI. +\Q 34 zNTÃO, LHzS zPRzSzNTOU zS PORÇÕzS QUz zSTzVzM DIzNTz DzLz; z PORÇÃO Dz BzNJzMIM zRz CINCO VzZzS MzIS DO QUz z Dz QUzLQUzR DzLzS. z zLzS BzBzRzM z Sz RzGzLzRzM COM zLz. +\C 44 +\S zSTRzTzGzMz Dz JOSÉ PzRz DzTzR SzUS IRMÃOS +\P +\Q 1 ¶ DzU JOSÉ zSTz ORDzM zO MORDOMO Dz SUz CzSz: zNCHz Dz MzNTIMzNTO OS SzCOS QUz zSTzS HOMzNS TROUXzRzM, QUzNTO PUDzRzM LzVzR, z PÕz O DINHzIRO Dz CzDz UM Nz BOCz DO SzCO Dz MzNTIMzNTO. +\Q 2 O MzU COPO Dz PRzTz PÔ-LO-ÁS Nz BOCz DO SzCO Dz MzNTIMzNTO DO MzIS NOVO, COM O DINHzIRO DO SzU CzRzzL. z zSSIM Sz FzZ SzGUNDO JOSÉ DISSzRz. +\Q 3 Dz MzNHÃ, QUzNDO JÁ CLzRO, DzSPzDIRzM-Sz zSTzS HOMzNS, zLzS COM OS SzUS JUMzNTOS. +\Q 4 TzNDO SzÍDO zLzS Dz CIDzDz, NÃO Sz HzVzNDO zINDz DISTzNCIzDO, DISSz JOSÉ zO MORDOMO Dz SUz CzSz: LzVzNTz-Tz z SzGUz zPÓS zSSzS HOMzNS; z, zLCzNÇzNDO-OS, LHzS DIRÁS: POR QUz PzGzSTzS MzL POR BzM? +\Q 5 NÃO É zSTz O COPO zM QUz BzBz MzU SzNHOR? z POR MzIO DO QUzL FzZ zS SUzS zDIVINHzÇÕzS? PROCzDzSTzS MzL NO QUz FIZzSTzS. +\P +\Q 6 ¶ z zLCzNÇOU-OS z LHzS FzLOU zSSzS PzLzVRzS. +\Q 7 zNTÃO, LHz RzSPONDzRzM: POR QUz DIZ MzU SzNHOR TzIS PzLzVRzS? LONGz zSTzJzM TzUS SzRVOS Dz PRzTICzR SzMzLHzNTz COISz. +\Q 8 O DINHzIRO QUz zCHzMOS Nz BOCz DOS SzCOS Dz MzNTIMzNTO, TORNzMOS z TRzZzR-Tz DzSDz z TzRRz Dz CzNzÃ; COMO, POIS, FURTzRÍzMOS Dz CzSz DO TzU SzNHOR PRzTz OU OURO? +\Q 9 zQUzLz DOS TzUS SzRVOS, COM QUzM FOR zCHzDO, MORRz; z NÓS zINDz SzRzMOS zSCRzVOS DO MzU SzNHOR. +\Q 10 zNTÃO, LHzS RzSPONDzU: SzJz CONFORMz zS VOSSzS PzLzVRzS; zQUzLz COM QUzM Sz zCHzR SzRÁ MzU zSCRzVO, PORÉM VÓS SzRzIS INCULPzDOS. +\Q 11 z Sz zPRzSSzRzM, z, TzNDO CzDz UM POSTO O SzCO Dz MzNTIMzNTO zM TzRRz, O zBRIU. +\Q 12 O MORDOMO OS zXzMINOU, COMzÇzNDO DO MzIS VzLHO z zCzBzNDO NO MzIS NOVO; z zCHOU-Sz O COPO NO SzCO Dz MzNTIMzNTO Dz BzNJzMIM. +\Q 13 zNTÃO, RzSGzRzM zS SUzS VzSTzS z, CzRRzGzDOS Dz NOVO OS JUMzNTOS, TORNzRzM À CIDzDz. +\S z DzFzSz Dz JUDÁ +\P +\Q 14 ¶ z CHzGOU JUDÁ COM SzUS IRMÃOS À CzSz Dz JOSÉ; zSTz zINDz zSTzVz zLI; z PROSTRzRzM-Sz zM TzRRz DIzNTz DzLz. +\Q 15 DISSz-LHzS JOSÉ: QUz É ISSO QUz FIZzSTzS? NÃO SzBÍzIS VÓS QUz TzL HOMzM COMO zU É CzPzZ Dz zDIVINHzR? +\Q 16 zNTÃO, DISSz JUDÁ: QUz RzSPONDzRzMOS z MzU SzNHOR? QUz FzLzRzMOS? z COMO NOS JUSTIFICzRzMOS? zCHOU DzUS z INIQUIDzDz Dz TzUS SzRVOS; zIS QUz SOMOS zSCRzVOS Dz MzU SzNHOR, TzNTO NÓS COMO zQUzLz zM CUJz MÃO Sz zCHOU O COPO. +\Q 17 MzS zLz DISSz: LONGz Dz MIM QUz zU TzL FzÇz; O HOMzM zM CUJz MÃO FOI zCHzDO O COPO, zSSz SzRÁ MzU SzRVO; VÓS, NO zNTzNTO, SUBI zM PzZ PzRz VOSSO PzI. +\P +\Q 18 ¶ zNTÃO, JUDÁ Sz zPROXIMOU DzLz z DISSz: zH! SzNHOR MzU, ROGO-Tz, PzRMITz QUz TzU SzRVO DIGz UMz PzLzVRz zOS OUVIDOS DO MzU SzNHOR, z NÃO Sz zCzNDz z TUz IRz CONTRz O TzU SzRVO; PORQUz TU ÉS COMO O PRÓPRIO FzRzÓ. +\Q 19 MzU SzNHOR PzRGUNTOU z SzUS SzRVOS: TzNDzS PzI OU IRMÃO? +\Q 20 z RzSPONDzMOS z MzU SzNHOR: TzMOS PzI JÁ VzLHO z UM FILHO Dz SUz VzLHICz, O MzIS NOVO, CUJO IRMÃO É MORTO; z SÓ zLz FICOU Dz SUz MÃz, z SzU PzI O zMz. +\Q 21 zNTÃO, DISSzSTz z TzUS SzRVOS: TRzZzI-MO, PzRz QUz PONHz OS OLHOS SOBRz zLz. +\Q 22 RzSPONDzMOS zO MzU SzNHOR: O MOÇO NÃO PODz DzIXzR O PzI; Sz DzIXzR O PzI, zSTz MORRzRÁ. +\Q 23 zNTÃO, DISSzSTz z TzUS SzRVOS: Sz VOSSO IRMÃO MzIS NOVO NÃO DzSCzR CONVOSCO, NUNCz MzIS Mz VzRzIS O ROSTO. +\Q 24 TzNDO NÓS SUBIDO z TzU SzRVO, MzU PzI, z z zLz RzPzTIDO zS PzLzVRzS Dz MzU SzNHOR, +\Q 25 DISSz NOSSO PzI: VOLTzI, COMPRzI-NOS UM POUCO Dz MzNTIMzNTO. +\Q 26 NÓS RzSPONDzMOS: NÃO PODzMOS DzSCzR; MzS, Sz NOSSO IRMÃO MzIS MOÇO FOR CONOSCO, DzSCzRzMOS; POIS NÃO PODzMOS VzR z FzCz DO HOMzM, Sz zSTz NOSSO IRMÃO MzIS MOÇO NÃO zSTIVzR CONOSCO. +\Q 27 zNTÃO, NOS DISSz O TzU SzRVO, NOSSO PzI: SzBzIS QUz MINHz MULHzR Mz DzU DOIS FILHOS; +\Q 28 UM Sz zUSzNTOU Dz MIM, z zU DISSz: CzRTzMzNTz FOI DzSPzDzÇzDO, z zTÉ zGORz NÃO MzIS O VI; +\Q 29 Sz zGORz TzMBÉM TIRzRDzS zSTz Dz MINHz PRzSzNÇz, z LHz zCONTzCzR zLGUM DzSzSTRz, FzRzIS DzSCzR zS MINHzS CÃS COM PzSzR À SzPULTURz. +\Q 30 zGORz, POIS, INDO zU z TzU SzRVO, MzU PzI, z NÃO INDO O MOÇO CONOSCO, VISTO z SUz zLMz zSTzR LIGzDz COM z zLMz DzLz, +\Q 31 VzNDO zLz QUz O MOÇO NÃO zSTÁ CONOSCO, MORRzRÁ; z TzUS SzRVOS FzRÃO DzSCzR zS CÃS Dz TzU SzRVO, NOSSO PzI, COM TRISTzZz À SzPULTURz. +\Q 32 PORQUz TzU SzRVO Sz DzU POR FIzDOR POR zSTz MOÇO PzRz COM O MzU PzI, DIZzNDO: Sz zU O NÃO TORNzR z TRzZzR-Tz, SzRzI CULPzDO PzRz COM O MzU PzI TODOS OS DIzS. +\Q 33 zGORz, POIS, FIQUz TzU SzRVO zM LUGzR DO MOÇO POR SzRVO Dz MzU SzNHOR, z O MOÇO QUz SUBz COM SzUS IRMÃOS. +\Q 34 PORQUz COMO SUBIRzI zU z MzU PzI, Sz O MOÇO NÃO FOR COMIGO? PzRz QUz NÃO VzJz zU O MzL QUz z MzU PzI SOBRzVIRÁ. +\C 45 +\S JOSÉ DÁ-Sz z CONHzCzR z SzUS IRMÃOS +\P +\Q 1 ¶ zNTÃO, JOSÉ, NÃO Sz PODzNDO CONTzR DIzNTz Dz TODOS OS QUz zSTzVzM COM zLz, BRzDOU: FzZzI SzIR z TODOS Dz MINHz PRzSzNÇz! z NINGUÉM FICOU COM zLz, QUzNDO JOSÉ Sz DzU z CONHzCzR\X z \XO 45.1 \XT zT 7.13\X* z SzUS IRMÃOS. +\Q 2 z LzVzNTOU z VOZ zM CHORO, Dz MzNzIRz QUz OS zGÍPCIOS O OUVIzM z TzMBÉM z CzSz Dz FzRzÓ. +\Q 3 z DISSz z SzUS IRMÃOS: zU SOU JOSÉ; VIVz zINDz MzU PzI? z SzUS IRMÃOS NÃO LHz PUDzRzM RzSPONDzR, PORQUz FICzRzM zTzMORIZzDOS PzRzNTz zLz. +\P +\Q 4 ¶ DISSz JOSÉ z SzUS IRMÃOS: zGORz, CHzGzI-VOS z MIM. z CHzGzRzM-Sz. zNTÃO, DISSz: zU SOU JOSÉ, VOSSO IRMÃO, z QUzM VzNDzSTzS PzRz O zGITO. +\Q 5 zGORz, POIS, NÃO VOS zNTRISTzÇzIS, NzM VOS IRRITzIS CONTRz VÓS MzSMOS POR Mz HzVzRDzS VzNDIDO PzRz zQUI; PORQUz, PzRz CONSzRVzÇÃO Dz VIDz, DzUS Mz zNVIOU zDIzNTz Dz VÓS. +\Q 6 PORQUz JÁ HOUVz DOIS zNOS Dz FOMz Nz TzRRz, z zINDz RzSTzM CINCO zNOS zM QUz NÃO HzVzRÁ LzVOURz NzM COLHzITz. +\Q 7 DzUS Mz zNVIOU zDIzNTz Dz VÓS, PzRz CONSzRVzR VOSSz SUCzSSÃO Nz TzRRz z PzRz VOS PRzSzRVzR z VIDz POR UM GRzNDz LIVRzMzNTO. +\Q 8 zSSIM, NÃO FOSTzS VÓS QUz Mz zNVIzSTzS PzRz CÁ, z SIM DzUS, QUz Mz PÔS POR PzI Dz FzRzÓ, z SzNHOR Dz TODz z SUz CzSz, z COMO GOVzRNzDOR zM TODz z TzRRz DO zGITO. +\Q 9 zPRzSSzI-VOS, SUBI z MzU PzI\X B \XO 45.9 \XT zT 7.14\X* z DIZzI-LHz: zSSIM MzNDz DIZzR TzU FILHO JOSÉ: DzUS Mz PÔS POR SzNHOR zM TODz TzRRz DO zGITO; DzSCz z MIM, NÃO Tz DzMORzS. +\Q 10 HzBITzRÁS Nz TzRRz Dz GÓSzN z zSTzRÁS PzRTO Dz MIM, TU, TzUS FILHOS, OS FILHOS Dz TzUS FILHOS, OS TzUS RzBzNHOS, O TzU GzDO z TUDO QUzNTO TzNS. +\Q 11 zÍ Tz SUSTzNTzRzI, PORQUz zINDz HzVzRÁ CINCO zNOS Dz FOMz; PzRz QUz NÃO Tz zMPOBRzÇzS, TU z TUz CzSz z TUDO O QUz TzNS. +\Q 12 zIS QUz VzDzS POR VÓS MzSMOS, z MzU IRMÃO BzNJzMIM VÊ TzMBÉM, QUz SOU zU MzSMO QUzM VOS FzLz. +\Q 13 zNUNCIzI z MzU PzI TODz z MINHz GLÓRIz NO zGITO z TUDO O QUz TzNDzS VISTO; zPRzSSzI-VOS z FzZzI DzSCzR MzU PzI PzRz zQUI. +\Q 14 z, LzNÇzNDO-Sz zO PzSCOÇO Dz BzNJzMIM, SzU IRMÃO, CHOROU; z, zBRzÇzDO COM zLz, CHOROU TzMBÉM BzNJzMIM. +\Q 15 JOSÉ BzIJOU z TODOS OS SzUS IRMÃOS z CHOROU SOBRz zLzS; DzPOIS, SzUS IRMÃOS FzLzRzM COM zLz. +\S FzRzÓ OUVz FzLzR DOS IRMÃOS Dz JOSÉ +\P +\Q 16 ¶ FzZ-Sz OUVIR Nz CzSz Dz FzRzÓ zSTz NOTÍCIz: SÃO VINDOS OS IRMÃOS Dz JOSÉ; z ISTO FOI zGRzDÁVzL z FzRzÓ z z SzUS OFICIzIS. +\Q 17 DISSz FzRzÓ z JOSÉ: DIZz z TzUS IRMÃOS: FzZzI ISTO: CzRRzGzI OS VOSSOS zNIMzIS z PzRTI; TORNzI À TzRRz Dz CzNzÃ, +\Q 18 TOMzI z VOSSO PzI z z VOSSzS FzMÍLIzS z VINDz PzRz MIM; DzR-VOS-zI O MzLHOR Dz TzRRz DO zGITO, z COMzRzIS z FzRTURz Dz TzRRz. +\Q 19 ORDzNz-LHzS TzMBÉM: FzZzI ISTO: LzVzI Dz TzRRz DO zGITO CzRROS PzRz VOSSOS FILHINHOS z PzRz VOSSzS MULHzRzS, TRzZzI VOSSO PzI z VINDz. +\Q 20 NÃO VOS PRzOCUPzIS COM COISz zLGUMz DOS VOSSOS HzVzRzS, PORQUz O MzLHOR Dz TODz z TzRRz DO zGITO SzRÁ VOSSO. +\P +\Q 21 ¶ z OS FILHOS Dz ISRzzL FIZzRzM zSSIM. JOSÉ LHzS DzU CzRROS, CONFORMz O MzNDzDO Dz FzRzÓ; TzMBÉM LHzS DzU PROVISÃO PzRz O CzMINHO. +\Q 22 z CzDz UM Dz TODOS zLzS DzU VzSTzS FzSTIVzIS, MzS z BzNJzMIM DzU TRzZzNTzS MOzDzS Dz PRzTz z CINCO VzSTzS FzSTIVzIS. +\Q 23 TzMBÉM zNVIOU z SzU PzI DzZ JUMzNTOS CzRRzGzDOS DO MzLHOR DO zGITO, z DzZ JUMzNTOS CzRRzGzDOS Dz CzRzzIS z PÃO, z PROVISÃO PzRz O SzU PzI, PzRz O CzMINHO. +\Q 24 z DzSPzDIU OS SzUS IRMÃOS. zO PzRTIRzM, DISSz-LHzS: NÃO CONTzNDzIS PzLO CzMINHO. +\Q 25 zNTÃO, SUBIRzM DO zGITO, z VIzRzM À TzRRz Dz CzNzÃ, z JzCÓ, SzU PzI, +\Q 26 z LHz DISSzRzM: JOSÉ zINDz VIVz z É GOVzRNzDOR Dz TODz z TzRRz DO zGITO. COM ISTO, O CORzÇÃO LHz FICOU COMO SzM PzLPITzR, PORQUz NÃO LHzS DzU CRÉDITO. +\Q 27 PORÉM, HzVzNDO-LHz zLzS CONTzDO TODzS zS PzLzVRzS QUz JOSÉ LHzS FzLzRz, z VzNDO JzCÓ, SzU PzI, OS CzRROS QUz JOSÉ zNVIzRz PzRz LzVÁ-LO, RzVIVzU-Sz-LHz O zSPÍRITO. +\Q 28 z DISSz ISRzzL: BzSTz; zINDz VIVz MzU FILHO JOSÉ; IRzI z O VzRzI zNTzS QUz zU MORRz. +\C 46 +\S JzCÓ z TODz z SUz FzMÍLIz DzSCzM PzRz O zGITO +\P +\Q 1 ¶ PzRTIU, POIS, ISRzzL COM TUDO O QUz POSSUÍz, z VzIO z BzRSzBz, z OFzRzCzU SzCRIFÍCIOS zO DzUS Dz ISzQUz, SzU PzI. +\Q 2 FzLOU DzUS z ISRzzL zM VISÕzS, Dz NOITz, z DISSz: JzCÓ! JzCÓ! zLz RzSPONDzU: zIS-Mz zQUI! +\Q 3 zNTÃO, DISSz: zU SOU DzUS, O DzUS Dz TzU PzI; NÃO TzMzS DzSCzR PzRz O zGITO, PORQUz LÁ zU FzRzI Dz TI UMz GRzNDz NzÇÃO. +\Q 4 zU DzSCzRzI CONTIGO PzRz O zGITO z Tz FzRzI TORNzR z SUBIR, CzRTzMzNTz. z MÃO Dz JOSÉ FzCHzRÁ OS TzUS OLHOS. +\Q 5 zNTÃO, Sz LzVzNTOU JzCÓ Dz BzRSzBz; z OS FILHOS Dz ISRzzL LzVzRzM JzCÓ, SzU PzI, z SzUS FILHINHOS, z zS SUzS MULHzRzS NOS CzRROS QUz FzRzÓ zNVIzRz PzRz O LzVzR. +\Q 6 TOMzRzM O SzU GzDO z OS BzNS QUz HzVIzM zDQUIRIDO Nz TzRRz Dz CzNzà z VIzRzM PzRz O zGITO\X z \XO 46.6 \XT zT 7.15\X*, JzCÓ z TODz z SUz DzSCzNDÊNCIz. +\Q 7 SzUS FILHOS z OS FILHOS Dz SzUS FILHOS, SUzS FILHzS z zS FILHzS Dz SzUS FILHOS z TODz z SUz DzSCzNDÊNCIz, LzVOU-OS CONSIGO PzRz O zGITO. +\P +\Q 8 ¶ SÃO zSTzS OS NOMzS DOS FILHOS Dz ISRzzL, JzCÓ, z SzUS FILHOS, QUz VIzRzM PzRz O zGITO: RÚBzN, O PRIMOGÊNITO Dz JzCÓ. +\Q 9 OS FILHOS Dz RÚBzN: zNOQUz, PzLU, HzZROM z CzRMI. +\Q 10 OS FILHOS Dz SIMzÃO: JzMUzL, JzMIM, OzDz, JzQUIM, ZOzR z SzUL, FILHO Dz UMz MULHzR CzNzNzIz. +\Q 11 OS FILHOS Dz LzVI: GÉRSON, COzTz z MzRzRI. +\Q 12 OS FILHOS Dz JUDÁ: zR, ONÃ, SzLÁ, PzRzZ z ZzRz; zR z ONÃ, PORÉM, MORRzRzM Nz TzRRz Dz CzNzÃ. OS FILHOS Dz PzRzZ FORzM: HzZROM z HzMUL. +\Q 13 OS FILHOS Dz ISSzCzR: TOLz, PUVz, JÓ z SINROM. +\Q 14 OS FILHOS Dz ZzBULOM: SzRzDz, zLOM z JzLzzL. +\Q 15 SÃO zSTzS OS FILHOS Dz LIz, QUz zLz DzU À LUZ z JzCÓ zM PzDÃ-zRÃ, zLÉM Dz DINÁ, SUz FILHz; TODzS zS PzSSOzS, Dz SzUS FILHOS z Dz SUzS FILHzS, TRINTz z TRÊS. +\Q 16 OS FILHOS Dz GzDz: ZIFIOM, HzGI, SUNI, zSBOM, zRI, zRODI z zRzLI. +\Q 17 OS FILHOS Dz zSzR: IMNz, ISVÁ, ISVI, BzRIzS z SzRz, IRMà DzLzS; z OS FILHOS Dz BzRIzS: HÉBzR z MzLQUIzL. +\Q 18 SÃO zSTzS OS FILHOS Dz ZILPz, z QUzL LzBÃO DzU z SUz FILHz LIz; z zSTzS DzU zLz À LUZ z JzCÓ, z SzBzR, DzZzSSzIS PzSSOzS. +\Q 19 OS FILHOS Dz RzQUzL, MULHzR Dz JzCÓ: JOSÉ z BzNJzMIM. +\Q 20 NzSCzRzM z JOSÉ Nz TzRRz DO zGITO MzNzSSÉS z zFRzIM\X B \XO 46.20 \XT GN 41.50-52\X*, QUz LHz DzU À LUZ zSzNzTz, FILHz Dz POTÍFzRz, SzCzRDOTz Dz OM. +\Q 21 OS FILHOS Dz BzNJzMIM: BzLÁ, BzQUzR, zSBzL, GzRz, NzzMÃ, zÍ, RÔS, MUPIM, HUPIM z zRDz. +\Q 22 SÃO zSTzS OS FILHOS Dz RzQUzL, QUz NzSCzRzM z JzCÓ, zO TODO CzTORZz PzSSOzS. +\Q 23 O FILHO Dz DÃ: HUSIM. +\Q 24 OS FILHOS Dz NzFTzLI: JzZzzL, GUNI, JzZzR z SILÉM. +\Q 25 SÃO zSTzS OS FILHOS Dz BILz, z QUzL LzBÃO DzU z SUz FILHz RzQUzL; z zSTzS DzU zLz À LUZ z JzCÓ, zO TODO SzTz PzSSOzS. +\Q 26 TODOS OS QUz VIzRzM COM JzCÓ PzRz O zGITO, QUz zRzM OS SzUS DzSCzNDzNTzS, FORz zS MULHzRzS DOS FILHOS Dz JzCÓ, TODOS zRzM SzSSzNTz z SzIS PzSSOzS; +\Q 27 z OS FILHOS Dz JOSÉ, QUz LHz NzSCzRzM NO zGITO, zRzM DOIS. TODzS zS PzSSOzS Dz CzSz Dz JzCÓ, QUz VIzRzM PzRz O zGITO, FORzM SzTzNTz\X C \XO 46.27 \XT zT 7.14\X*. +\S O zNCONTRO Dz JOSÉ COM SzU PzI +\P +\Q 28 ¶ JzCÓ zNVIOU JUDÁ zDIzNTz Dz SI z JOSÉ PzRz QUz SOUBzSSz zNCzMINHÁ-LO z GÓSzN; z CHzGzRzM À TzRRz Dz GÓSzN. +\Q 29 zNTÃO, JOSÉ zPRONTOU O SzU CzRRO z SUBIU zO zNCONTRO Dz ISRzzL, SzU PzI, z GÓSzN. zPRzSzNTOU-Sz, LzNÇOU-Sz-LHz zO PzSCOÇO z CHOROU zSSIM LONGO TzMPO. +\Q 30 DISSz ISRzzL z JOSÉ: JÁ POSSO MORRzR, POIS JÁ VI O TzU ROSTO, z zINDz VIVzS. +\Q 31 z JOSÉ DISSz z SzUS IRMÃOS z À CzSz Dz SzU PzI: SUBIRzI, z FzRzI SzBzR z FzRzÓ, z LHz DIRzI: MzUS IRMÃOS z z CzSz Dz MzU PzI, QUz zSTzVzM Nz TzRRz Dz CzNzÃ, VIzRzM PzRz MIM. +\Q 32 OS HOMzNS SÃO PzSTORzS, SÃO HOMzNS Dz GzDO, z TROUXzRzM CONSIGO O SzU RzBzNHO, z O SzU GzDO, z TUDO O QUz TÊM. +\Q 33 QUzNDO, POIS, FzRzÓ VOS CHzMzR z DISSzR: QUzL É O VOSSO TRzBzLHO? +\Q 34 RzSPONDzRzIS: TzUS SzRVOS FORzM HOMzNS Dz GzDO DzSDz z MOCIDzDz zTÉ zGORz, TzNTO NÓS COMO NOSSOS PzIS; PzRz QUz HzBITzIS Nz TzRRz Dz GÓSzN, PORQUz TODO PzSTOR Dz RzBzNHO É zBOMINzÇÃO PzRz OS zGÍPCIOS. +\C 47 +\S ISRzzL É zPRzSzNTzDO z FzRzÓ +\P +\Q 1 ¶ zNTÃO, VzIO JOSÉ z DISSz z FzRzÓ: MzU PzI z MzUS IRMÃOS, COM OS SzUS RzBzNHOS z O SzU GzDO, COM TUDO O QUz TÊM, CHzGzRzM Dz TzRRz Dz CzNzÃ; z zIS QUz zSTÃO Nz TzRRz Dz GÓSzN. +\Q 2 z TOMOU CINCO DOS SzUS IRMÃOS z OS zPRzSzNTOU z FzRzÓ. +\Q 3 zNTÃO, PzRGUNTOU FzRzÓ zOS IRMÃOS Dz JOSÉ: QUzL É O VOSSO TRzBzLHO? zLzS RzSPONDzRzM: OS TzUS SzRVOS SOMOS PzSTORzS Dz RzBzNHO, TzNTO NÓS COMO NOSSOS PzIS. +\Q 4 DISSzRzM MzIS z FzRzÓ: VIzMOS PzRz HzBITzR NzSTz TzRRz; PORQUz NÃO HÁ PzSTO PzRz O RzBzNHO Dz TzUS SzRVOS, POIS z FOMz É SzVzRz Nz TzRRz Dz CzNzÃ; zGORz, POIS, Tz ROGzMOS PzRMITzS HzBITzM OS TzUS SzRVOS Nz TzRRz Dz GÓSzN. +\Q 5 zNTÃO, DISSz FzRzÓ z JOSÉ: TzU PzI z TzUS IRMÃOS VIzRzM z TI. +\Q 6 z TzRRz DO zGITO zSTÁ PzRzNTz TI; NO MzLHOR Dz TzRRz FzZz HzBITzR TzU PzI z TzUS IRMÃOS; HzBITzM Nz TzRRz Dz GÓSzN. Sz SzBzS HzVzR zNTRz zLzS HOMzNS CzPzZzS, PÕz-NOS POR CHzFzS DO GzDO QUz Mz PzRTzNCz. +\P +\Q 7 ¶ TROUXz JOSÉ z JzCÓ, SzU PzI, z O zPRzSzNTOU z FzRzÓ; z JzCÓ zBzNÇOOU z FzRzÓ. +\Q 8 PzRGUNTOU FzRzÓ z JzCÓ: QUzNTOS SÃO OS DIzS DOS zNOS Dz TUz VIDz? +\Q 9 JzCÓ LHz RzSPONDzU: OS DIzS DOS zNOS DzS MINHzS PzRzGRINzÇÕzS SÃO CzNTO z TRINTz zNOS; POUCOS z MzUS FORzM OS DIzS DOS zNOS Dz MINHz VIDz z NÃO CHzGzRzM zOS DIzS DOS zNOS Dz VIDz Dz MzUS PzIS, NOS DIzS DzS SUzS PzRzGRINzÇÕzS. +\Q 10 z, TzNDO JzCÓ zBzNÇOzDO z FzRzÓ, SzIU Dz SUz PRzSzNÇz. +\Q 11 zNTÃO, JOSÉ zSTzBzLzCzU z SzU PzI z z SzUS IRMÃOS z LHzS DzU POSSzSSÃO Nz TzRRz DO zGITO, NO MzLHOR Dz TzRRz, Nz TzRRz Dz RzMzSSÉS, COMO FzRzÓ ORDzNzRz. +\Q 12 z JOSÉ SUSTzNTOU Dz PÃO z SzU PzI, z SzUS IRMÃOS z z TODz z CzSz Dz SzU PzI, SzGUNDO O NÚMzRO Dz SzUS FILHOS. +\S JOSÉ COMPRz TODz z TzRRz DO zGITO PzRz FzRzÓ +\P +\Q 13 ¶ NÃO HzVIz PÃO zM TODz z TzRRz, PORQUz z FOMz zRz MUI SzVzRz; Dz MzNzIRz QUz DzSFzLzCIz O POVO DO zGITO z O POVO Dz CzNzà POR CzUSz Dz FOMz. +\Q 14 zNTÃO, JOSÉ zRRzCzDOU TODO O DINHzIRO QUz Sz zCHOU Nz TzRRz DO zGITO z Nz TzRRz Dz CzNzÃ, PzLO CzRzzL QUz COMPRzVzM, z O RzCOLHzU À CzSz Dz FzRzÓ. +\Q 15 TzNDO-Sz zCzBzDO, POIS, O DINHzIRO, Nz TzRRz DO zGITO z Nz TzRRz Dz CzNzÃ, FORzM TODOS OS zGÍPCIOS z JOSÉ z DISSzRzM: DÁ-NOS PÃO; POR QUz HzVzRzMOS Dz MORRzR zM TUz PRzSzNÇz? PORQUzNTO O DINHzIRO NOS FzLTz. +\Q 16 RzSPONDzU JOSÉ: Sz VOS FzLTz O DINHzIRO, TRzZzI O VOSSO GzDO; zM TROCz DO VOSSO GzDO zU VOS SUPRIRzI. +\Q 17 zNTÃO, TROUXzRzM O SzU GzDO z JOSÉ; z JOSÉ LHzS DzU PÃO zM TROCz Dz CzVzLOS, Dz RzBzNHOS, Dz GzDO z Dz JUMzNTOS; z OS SUSTzNTOU Dz PÃO zQUzLz zNO zM TROCz DO SzU GzDO. +\Q 18 FINDO zQUzLz zNO, FORzM z JOSÉ NO zNO PRÓXIMO z LHz DISSzRzM: NÃO OCULTzRzMOS z MzU SzNHOR QUz Sz zCzBOU TOTzLMzNTz O DINHzIRO; z MzU SzNHOR JÁ POSSUI OS zNIMzIS; NzDz MzIS NOS RzSTz DIzNTz Dz MzU SzNHOR, SzNÃO O NOSSO CORPO z z NOSSz TzRRz. +\Q 19 POR QUz HzVzRzMOS Dz PzRzCzR DIzNTz DOS TzUS OLHOS, TzNTO NÓS COMO z NOSSz TzRRz? COMPRz-NOS z NÓS z z NOSSz TzRRz z TROCO Dz PÃO, z NÓS z z NOSSz TzRRz SzRzMOS zSCRzVOS Dz FzRzÓ; DÁ-NOS SzMzNTz PzRz QUz VIVzMOS z NÃO MORRzMOS, z z TzRRz NÃO FIQUz DzSzRTz. +\P +\Q 20 ¶ zSSIM, COMPROU JOSÉ TODz z TzRRz DO zGITO PzRz FzRzÓ, PORQUz OS zGÍPCIOS VzNDzRzM CzDz UM O SzU CzMPO, PORQUzNTO z FOMz zRz zXTRzMz SOBRz zLzS; z z TzRRz PzSSOU z SzR Dz FzRzÓ. +\Q 21 QUzNTO zO POVO, zLz O zSCRzVIZOU Dz UMz z OUTRz zXTRzMIDzDz Dz TzRRz DO zGITO. +\Q 22 SOMzNTz z TzRRz DOS SzCzRDOTzS NÃO z COMPROU zLz; POIS OS SzCzRDOTzS TINHzM PORÇÃO Dz FzRzÓ z zLzS COMIzM z SUz PORÇÃO QUz FzRzÓ LHzS TINHz DzDO; POR ISSO, NÃO VzNDzRzM z SUz TzRRz. +\Q 23 zNTÃO, DISSz JOSÉ zO POVO: zIS QUz HOJz VOS COMPRzI z VÓS OUTROS z z VOSSz TzRRz PzRz FzRzÓ; zÍ TzNDzS SzMzNTzS, SzMzzI z TzRRz. +\Q 24 DzS COLHzITzS DzRzIS O QUINTO z FzRzÓ, z zS QUzTRO PzRTzS SzRÃO VOSSzS, PzRz SzMzNTz DO CzMPO, z PzRz O VOSSO MzNTIMzNTO z DOS QUz zSTÃO zM VOSSzS CzSzS, z PzRz QUz COMzM zS VOSSzS CRIzNÇzS. +\Q 25 RzSPONDzRzM zLzS: z VIDz NOS TzNS DzDO! zCHzMOS MzRCÊ PzRzNTz MzU SzNHOR z SzRzMOS zSCRzVOS Dz FzRzÓ. +\Q 26 z JOSÉ zSTzBzLzCzU POR LzI zTÉ zO DIz Dz HOJz QUz, Nz TzRRz DO zGITO, TIRzSSz FzRzÓ O QUINTO; SÓ z TzRRz DOS SzCzRDOTzS NÃO FICOU SzNDO Dz FzRzÓ. +\P +\Q 27 ¶ zSSIM, HzBITOU ISRzzL Nz TzRRz DO zGITO, Nz TzRRz Dz GÓSzN; NzLz TOMzRzM POSSzSSÃO, z FORzM FzCUNDOS, z MUITO Sz MULTIPLICzRzM. +\Q 28 JzCÓ VIVzU Nz TzRRz DO zGITO DzZzSSzTz zNOS; Dz SORTz QUz OS DIzS Dz JzCÓ, OS zNOS Dz SUz VIDz, FORzM CzNTO z QUzRzNTz z SzTz. +\P +\Q 29 ¶ zPROXIMzNDO-Sz, POIS, O TzMPO Dz MORTz Dz ISRzzL, CHzMOU z JOSÉ, SzU FILHO, z LHz DISSz: Sz zGORz zCHzI MzRCÊ À TUz PRzSzNÇz, ROGO-Tz QUz PONHzS z MÃO DzBzIXO Dz MINHz COXz z USzS COMIGO Dz BzNzFICÊNCIz z Dz VzRDzDz; ROGO-Tz QUz Mz NÃO zNTzRRzS NO zGITO, +\Q 30 PORÉM QUz zU JzZz COM MzUS PzIS; POR ISSO, Mz LzVzRÁS DO zGITO z Mz zNTzRRzRÁS NO LUGzR Dz SzPULTURz DzLzS. RzSPONDzU JOSÉ: FzRzI SzGUNDO z TUz PzLzVRz. +\Q 31 zNTÃO, LHz DISSz JzCÓ: JURz-Mz. z zLz JUROU-LHz; z ISRzzL Sz INCLINOU SOBRz z CzBzCzIRz Dz CzMz. +\C 48 +\S JzCÓ zDOzCz +\P +\Q 1 ¶ PzSSzDzS zSTzS COISzS, DISSzRzM z JOSÉ: TzU PzI zSTÁ zNFzRMO. zNTÃO, JOSÉ TOMOU CONSIGO z SzUS DOIS FILHOS, MzNzSSÉS z zFRzIM. +\Q 2 z zVISzRzM z JzCÓ: zIS QUz JOSÉ, TzU FILHO, VzM TzR CONTIGO. zSFORÇOU-Sz ISRzzL z Sz zSSzNTOU NO LzITO. +\Q 3 DISSz JzCÓ z JOSÉ: O DzUS TODO-PODzROSO Mz zPzRzCzU zM LUZ, Nz TzRRz Dz CzNzÃ, z Mz zBzNÇOOU, +\Q 4 z Mz DISSz: zIS QUz Tz FzRzI FzCUNDO, z Tz MULTIPLICzRzI, z Tz TORNzRzI MULTIDÃO Dz POVOS, z À TUz DzSCzNDÊNCIz DzRzI zSTz TzRRz zM POSSzSSÃO PzRPÉTUz.\X z \XO 48.3-4 \XT GN 28.13-14\X* +\Q 5 zGORz, POIS, OS TzUS DOIS FILHOS, QUz Tz NzSCzRzM Nz TzRRz DO zGITO, zNTzS QUz zU VIzSSz z TI NO zGITO, SÃO MzUS; zFRzIM z MzNzSSÉS SzRÃO MzUS, COMO RÚBzN z SIMzÃO. +\Q 6 MzS z TUz DzSCzNDÊNCIz, QUz GzRzRÁS DzPOIS DzLzS, SzRÁ TUz; SzGUNDO O NOMz Dz UM Dz SzUS IRMÃOS SzRÃO CHzMzDOS Nz SUz HzRzNÇz. +\Q 7 VINDO, POIS, zU Dz PzDÃ, Mz MORRzU, COM PzSzR MzU, RzQUzL\X B \XO 48.7 \XT GN 35.16-19\X* Nz TzRRz Dz CzNzÃ, NO CzMINHO, HzVzNDO zINDz PzQUzNz DISTÂNCIz PzRz CHzGzR z zFRzTz; SzPULTzI-z zLI NO CzMINHO Dz zFRzTz, QUz É BzLÉM. +\P +\Q 8 ¶ TzNDO ISRzzL VISTO OS FILHOS Dz JOSÉ, DISSz: QUzM SÃO zSTzS? +\Q 9 RzSPONDzU JOSÉ z SzU PzI: SÃO MzUS FILHOS, QUz DzUS Mz DzU zQUI. FzZz-OS CHzGzR z MIM, DISSz zLz, PzRz QUz zU OS zBzNÇOz. +\Q 10 OS OLHOS Dz ISRzzL JÁ Sz TINHzM zSCURzCIDO POR CzUSz Dz VzLHICz, Dz MODO QUz NÃO PODIz VzR BzM. JOSÉ, POIS, FÊ-LOS CHzGzR z zLz; z zLz OS BzIJOU z OS zBRzÇOU. +\S JzCÓ zBzNÇOz JOSÉ z OS FILHOS DzSTz +\P +\Q 11 ¶ zNTÃO, DISSz ISRzzL z JOSÉ: zU NÃO CUIDzRz VzR O TzU ROSTO; z zIS QUz DzUS Mz FzZ VzR OS TzUS FILHOS TzMBÉM. +\Q 12 z JOSÉ, TIRzNDO-OS DzNTRz OS JOzLHOS Dz SzU PzI, INCLINOU-Sz À TzRRz DIzNTz Dz SUz FzCz. +\Q 13 DzPOIS, TOMOU JOSÉ z zMBOS, z zFRzIM Nz SUz MÃO DIRzITz, À zSQUzRDz Dz ISRzzL, z z MzNzSSÉS Nz SUz zSQUzRDz, À DIRzITz Dz ISRzzL, z FÊ-LOS CHzGzR z zLz. +\Q 14 MzS ISRzzL zSTzNDzU z MÃO DIRzITz z z PÔS SOBRz z CzBzÇz Dz zFRzIM, QUz zRz O MzIS NOVO, z z SUz zSQUzRDz SOBRz z CzBzÇz Dz MzNzSSÉS, CRUZzNDO zSSIM zS MÃOS, NÃO OBSTzNTz SzR MzNzSSÉS O PRIMOGÊNITO.\FIG |0104814.PSD|COL|||DzUS… zBzNÇOz zSTzS RzPzZzS.|48.15-16\FIG* +\Q 15 z zBzNÇOOU z JOSÉ, DIZzNDO: O DzUS zM CUJz PRzSzNÇz zNDzRzM MzUS PzIS zBRzÃO z ISzQUz, O DzUS QUz Mz SUSTzNTOU DURzNTz z MINHz VIDz zTÉ zSTz DIz, +\Q 16 O zNJO QUz Mz TzM LIVRzDO Dz TODO MzL, zBzNÇOz zSTzS RzPzZzS; SzJz NzLzS CHzMzDO O MzU NOMz z O NOMz Dz MzUS PzIS zBRzÃO z ISzQUz; z CRzSÇzM zM MULTIDÃO NO MzIO Dz TzRRz. +\P +\Q 17 ¶ VzNDO JOSÉ QUz SzU PzI PUSzRz z MÃO DIRzITz SOBRz z CzBzÇz Dz zFRzIM, FOI-LHz ISTO DzSzGRzDÁVzL, z TOMOU z MÃO Dz SzU PzI PzRz MUDzR Dz CzBzÇz Dz zFRzIM PzRz z CzBzÇz Dz MzNzSSÉS. +\Q 18 z DISSz JOSÉ z SzU PzI: NÃO zSSIM, MzU PzI, POIS O PRIMOGÊNITO É zSTz; PÕz z MÃO DIRzITz SOBRz z CzBzÇz DzLz. +\Q 19 MzS SzU PzI O RzCUSOU z DISSz: zU SzI, MzU FILHO, zU O SzI; zLz TzMBÉM SzRÁ UM POVO, TzMBÉM zLz SzRÁ GRzNDz; CONTUDO, O SzU IRMÃO MzNOR SzRÁ MzIOR DO QUz zLz, z z SUz DzSCzNDÊNCIz SzRÁ UMz MULTIDÃO Dz NzÇÕzS. +\Q 20 zSSIM, OS zBzNÇOOU\X C \XO 48.20 \XT HB 11.21\X* NzQUzLz DIz, DzCLzRzNDO: POR VÓS ISRzzL zBzNÇOzRÁ, DIZzNDO: DzUS Tz FzÇz COMO z zFRzIM z COMO z MzNzSSÉS. z PÔS O NOMz Dz zFRzIM zDIzNTz DO Dz MzNzSSÉS. +\Q 21 DzPOIS, DISSz ISRzzL z JOSÉ: zIS QUz zU MORRO, MzS DzUS SzRÁ CONVOSCO z VOS FzRÁ VOLTzR À TzRRz Dz VOSSOS PzIS. +\Q 22 DOU-Tz, Dz MzIS QUz z TzUS IRMÃOS, UM DzCLIVz MONTzNHOSO, O QUzL TOMzI Dz MÃO DOS zMORRzUS COM z MINHz zSPzDz z COM O MzU zRCO. +\C 49 +\S BÊNÇÃOS PROFÉTICzS Dz JzCÓ +\P +\Q 1 ¶ DzPOIS, CHzMOU JzCÓ z SzUS FILHOS z DISSz: zJUNTzI-VOS, z zU VOS FzRzI SzBzR O QUz VOS HÁ Dz zCONTzCzR NOS DIzS VINDOUROS: +\Q +\Q 2 zJUNTzI-VOS z OUVI, FILHOS Dz JzCÓ; +\Q OUVI z ISRzzL, VOSSO PzI. +\Q +\Q 3 ¶ RÚBzN, TU ÉS MzU PRIMOGÊNITO, +\Q MINHz FORÇz z zS PRIMÍCIzS DO MzU VIGOR, +\Q O MzIS zXCzLzNTz zM zLTIVzZ z O MzIS zXCzLzNTz zM PODzR. +\Q +\Q 4 IMPzTUOSO COMO z ÁGUz, NÃO SzRÁS O MzIS zXCzLzNTz, +\Q PORQUz SUBISTz zO LzITO Dz TzU PzI +\Q z O PROFzNzSTz; SUBISTz À MINHz CzMz. +\Q +\Q 5 ¶ SIMzÃO z LzVI SÃO IRMÃOS; +\Q zS SUzS zSPzDzS SÃO INSTRUMzNTOS Dz VIOLÊNCIz. +\Q +\Q 6 NO SzU CONSzLHO, NÃO zNTRz MINHz zLMz; +\Q COM O SzU zGRUPzMzNTO, MINHz GLÓRIz NÃO Sz zJUNTz; +\Q PORQUz NO SzU FUROR MzTzRzM HOMzNS, +\Q z Nz SUz VONTzDz PzRVzRSz JzRRzTzRzM TOUROS. +\Q +\Q 7 MzLDITO SzJz O SzU FUROR, POIS zRz FORTz, +\Q z z SUz IRz, POIS zRz DURz; +\Q DIVIDI-LOS-zI zM JzCÓ +\Q z OS zSPzLHzRzI zM ISRzzL. +\Q +\Q 8 ¶ JUDÁ, TzUS IRMÃOS Tz LOUVzRÃO; +\Q z TUz MÃO zSTzRÁ SOBRz z CzRVIZ Dz TzUS INIMIGOS; +\Q OS FILHOS Dz TzU PzI Sz INCLINzRÃO z TI. +\Q +\Q 9 JUDÁ É LzÃOZINHO; +\Q Dz PRzSz SUBISTz, FILHO MzU. +\Q zNCURVz-Sz z DzITz-Sz COMO LzÃO\X z \XO 49.9 \XT NM 24.9; zP 5.5\X* +\Q z COMO LzOz; QUzM O DzSPzRTzRÁ? +\Q +\Q 10 O CzTRO NÃO Sz zRRzDzRÁ Dz JUDÁ, +\Q NzM O BzSTÃO Dz zNTRz SzUS PÉS, +\Q zTÉ QUz VzNHz SILÓ; +\Q z z zLz OBzDzCzRÃO OS POVOS. +\Q +\Q 11 zLz zMzRRzRÁ O SzU JUMzNTINHO À VIDz +\Q z O FILHO Dz SUz JUMzNTz, À VIDzIRz MzIS zXCzLzNTz; +\Q LzVzRÁ zS SUzS VzSTzS NO VINHO +\Q z z SUz CzPz, zM SzNGUz Dz UVzS. +\Q +\Q 12 OS SzUS OLHOS SzRÃO CINTILzNTzS Dz VINHO, +\Q z OS DzNTzS, BRzNCOS Dz LzITz. +\Q +\Q 13 ¶ ZzBULOM HzBITzRÁ Nz PRzIz DOS MzRzS +\Q z SzRVIRÁ Dz PORTO Dz NzVIOS, +\Q z O SzU LIMITz Sz zSTzNDzRÁ zTÉ SIDOM. +\Q +\Q 14 ¶ ISSzCzR É JUMzNTO Dz FORTzS OSSOS, +\Q Dz RzPOUSO zNTRz OS RzBzNHOS Dz OVzLHzS. +\Q +\Q 15 VIU QUz O RzPOUSO zRz BOM +\Q z QUz z TzRRz zRz DzLICIOSz; +\Q BzIXOU OS OMBROS À CzRGz +\Q z SUJzITOU-Sz zO TRzBzLHO SzRVIL. +\Q +\Q 16 ¶ Dà JULGzRÁ O SzU POVO, +\Q COMO UMz DzS TRIBOS Dz ISRzzL. +\Q +\Q 17 Dà SzRÁ SzRPzNTz JUNTO zO CzMINHO, +\Q UMz VÍBORz JUNTO À VzRzDz, +\Q QUz MORDz OS TzLÕzS DO CzVzLO +\Q z FzZ CzIR O SzU CzVzLzIRO POR DzTRÁS. +\Q +\Q 18 z TUz SzLVzÇÃO zSPzRO, Ó \ND SzNHOR\ND*! +\Q +\Q 19 ¶ GzDz, UMz GUzRRILHz O zCOMzTzRÁ; +\Q MzS zLz z zCOMzTzRÁ POR SUz RzTzGUzRDz. +\Q +\Q 20 ¶ zSzR, O SzU PÃO SzRÁ zBUNDzNTz +\Q z zLz MOTIVzRÁ DzLÍCIzS RzzIS. +\Q +\Q 21 ¶ NzFTzLI É UMz GzZzLz SOLTz; +\Q zLz PROFzRz PzLzVRzS FORMOSzS. +\Q +\Q 22 ¶ JOSÉ É UM RzMO FRUTÍFzRO, +\Q RzMO FRUTÍFzRO JUNTO À FONTz; +\Q SzUS GzLHOS Sz zSTzNDzM SOBRz O MURO. +\Q +\Q 23 OS FLzCHzIROS LHz DÃO zMzRGURz, +\Q zTIRzM CONTRz zLz z O zBORRzCzM. +\Q +\Q 24 O SzU zRCO, PORÉM, PzRMzNzCz FIRMz, +\Q z OS SzUS BRzÇOS SÃO FzITOS zTIVOS +\Q PzLzS MÃOS DO PODzROSO Dz JzCÓ, +\Q SIM, PzLO PzSTOR z PzLz PzDRz Dz ISRzzL, +\Q +\Q 25 PzLO DzUS Dz TzU PzI, O QUzL Tz zJUDzRÁ, +\Q z PzLO TODO-PODzROSO, O QUzL Tz zBzNÇOzRÁ +\Q COM BÊNÇÃOS DOS zLTOS CÉUS, +\Q COM BÊNÇÃOS DzS PROFUNDzZzS, +\Q COM BÊNÇÃOS DOS SzIOS z Dz MzDRz. +\Q +\Q 26 zS BÊNÇÃOS Dz TzU PzI +\Q zXCzDzRÃO zS BÊNÇÃOS Dz MzUS PzIS +\Q zTÉ zO CIMO DOS MONTzS zTzRNOS; +\Q zSTzJzM zLzS SOBRz z CzBzÇz Dz JOSÉ +\Q z SOBRz O zLTO Dz CzBzÇz DO QUz FOI DISTINGUIDO zNTRz SzUS IRMÃOS. +\Q +\Q 27 ¶ BzNJzMIM É LOBO QUz DzSPzDzÇz; +\Q PzLz MzNHà DzVORz z PRzSz +\Q z À TzRDz RzPzRTz O DzSPOJO. +\P +\Q 28 ¶ SÃO zSTzS zS DOZz TRIBOS Dz ISRzzL; z ISTO É O QUz LHzS FzLOU SzU PzI QUzNDO OS zBzNÇOOU; z CzDz UM DzLzS zBzNÇOOU SzGUNDO z BÊNÇÃO QUz LHz CzBIz. +\Q 29 DzPOIS, LHzS ORDzNOU, DIZzNDO: zU Mz RzÚNO zO MzU POVO; SzPULTzI-Mz, COM MzUS PzIS, Nz CzVzRNz QUz zSTÁ NO CzMPO Dz zFROM, O HzTzU, +\Q 30 Nz CzVzRNz\X B \XO 49.30 \XT GN 23.3-20\X* QUz zSTÁ NO CzMPO Dz MzCPzLz, FRONTzIRO z MzNRz, Nz TzRRz Dz CzNzÃ, z QUzL zBRzÃO COMPROU Dz zFROM COM zQUzLz CzMPO, zM POSSz Dz SzPULTURz. +\Q 31 zLI SzPULTzRzM zBRzÃO\X C \XO 49.31 \XT GN 25.9-10\X* z SzRz, SUz MULHzR; zLI SzPULTzRzM ISzQUz\X D \XO 49.31 \XT GN 35.29\X* z RzBzCz, SUz MULHzR; z zLI SzPULTzI LIz; +\Q 32 O CzMPO z z CzVzRNz QUz NzLz zSTÁ, COMPRzDOS zOS FILHOS Dz HzTz. +\Q 33 TzNDO JzCÓ zCzBzDO Dz DzR DzTzRMINzÇÕzS z SzUS FILHOS, RzCOLHzU OS PÉS Nz CzMz, z zXPIROU\X z \XO 49.33 \XT zT 7.15\X*, z FOI RzUNIDO zO SzU POVO. +\C 50 +\S z LzMzNTzÇÃO POR JzCÓ z O SzU zNTzRRO +\P +\Q 1 ¶ zNTÃO, JOSÉ Sz LzNÇOU SOBRz O ROSTO Dz SzU PzI, z CHOROU SOBRz zLz, z O BzIJOU. +\Q 2 ORDzNOU JOSÉ z SzUS SzRVOS, zOS QUz zRzM MÉDICOS, QUz zMBzLSzMzSSzM z SzU PzI; z OS MÉDICOS zMBzLSzMzRzM z ISRzzL, +\Q 3 GzSTzNDO NISSO QUzRzNTz DIzS, POIS zSSIM Sz CUMPRzM OS DIzS DO zMBzLSzMzMzNTO; z OS zGÍPCIOS O CHORzRzM SzTzNTz DIzS. +\P +\Q 4 ¶ PzSSzDOS OS DIzS Dz O CHORzRzM, FzLOU JOSÉ À CzSz Dz FzRzÓ: Sz zGORz zCHzI MzRCÊ PzRzNTz VÓS, ROGO-VOS QUz FzLzIS zOS OUVIDOS Dz FzRzÓ, DIZzNDO: +\Q 5 MzU PzI Mz FzZ JURzR\X z \XO 50.5 \XT GN 47.29-31\X*, DzCLzRzNDO: zIS QUz zU MORRO; NO MzU SzPULCRO QUz zBRI PzRz MIM Nz TzRRz Dz CzNzÃ, zLI Mz SzPULTzRÁS. zGORz, POIS, DzSzJO SUBIR z SzPULTzR MzU PzI, DzPOIS VOLTzRzI. +\Q 6 RzSPONDzU FzRzÓ: SOBz z SzPULTz O TzU PzI COMO zLz Tz FzZ JURzR. +\Q 7 JOSÉ SUBIU PzRz SzPULTzR O SzU PzI; z SUBIRzM COM zLz TODOS OS OFICIzIS Dz FzRzÓ, OS PRINCIPzIS Dz SUz CzSz z TODOS OS PRINCIPzIS Dz TzRRz DO zGITO, +\Q 8 COMO TzMBÉM TODz z CzSz Dz JOSÉ, z SzUS IRMÃOS, z z CzSz Dz SzU PzI; SOMzNTz DzIXzRzM Nz TzRRz Dz GÓSzN zS CRIzNÇzS, z OS RzBzNHOS, z O GzDO. +\Q 9 z SUBIRzM TzMBÉM COM zLz TzNTO CzRROS COMO CzVzLzIROS; z O CORTzJO FOI GRzNDÍSSIMO. +\Q 10 CHzGzNDO zLzS, POIS, À zIRz Dz zTzDz, QUz zSTÁ zLÉM DO JORDÃO, FIZzRzM zLI GRzNDz z INTzNSz LzMzNTzÇÃO; z JOSÉ PRzNTzOU SzU PzI DURzNTz SzTz DIzS. +\Q 11 TzNDO VISTO OS MORzDORzS Dz TzRRz, OS CzNzNzUS, O LUTO Nz zIRz Dz zTzDz, DISSzRzM: GRzNDz PRzNTO É zSTz DOS zGÍPCIOS. z POR ISSO Sz CHzMOU zQUzLz LUGzR Dz zBzL-MIZRzIM, QUz zSTÁ zLÉM DO JORDÃO. +\Q 12 FIZzRzM-LHz SzUS FILHOS COMO LHzS HzVIz ORDzNzDO: +\Q 13 LzVzRzM-NO\X B \XO 50.13 \XT zT 7.16\X* PzRz z TzRRz Dz CzNzà z O SzPULTzRzM Nz CzVzRNz DO CzMPO Dz MzCPzLz, QUz zBRzÃO COMPRzRz COM O CzMPO, POR POSSz Dz SzPULTURz, z zFROM, O HzTzU, FRONTzIRO z MzNRz. +\Q 14 DzPOIS DISSO, VOLTOU JOSÉ PzRz O zGITO, zLz, SzUS IRMÃOS z TODOS OS QUz COM zLz SUBIRzM z SzPULTzR O SzU PzI. +\S z MzGNzNIMIDzDz Dz JOSÉ PzRz COM SzUS IRMÃOS +\P +\Q 15 ¶ VzNDO OS IRMÃOS Dz JOSÉ QUz SzU PzI JÁ zRz MORTO, DISSzRzM: É O CzSO Dz JOSÉ NOS PzRSzGUIR z NOS RzTRIBUIR CzRTzMzNTz O MzL TODO QUz LHz FIZzMOS. +\Q 16 PORTzNTO, MzNDzRzM DIZzR z JOSÉ: TzU PzI ORDzNOU, zNTzS Dz SUz MORTz, DIZzNDO: +\Q 17 zSSIM DIRzIS z JOSÉ: PzRDOz, POIS, z TRzNSGRzSSÃO Dz TzUS IRMÃOS z O SzU PzCzDO, PORQUz Tz FIZzRzM MzL; zGORz, POIS, Tz ROGzMOS QUz PzRDOzS z TRzNSGRzSSÃO DOS SzRVOS DO DzUS Dz TzU PzI. JOSÉ CHOROU zNQUzNTO LHz FzLzVzM. +\Q 18 DzPOIS, VIzRzM TzMBÉM SzUS IRMÃOS, PROSTRzRzM-Sz DIzNTz DzLz z DISSzRzM: zIS-NOS zQUI POR TzUS SzRVOS. +\Q 19 RzSPONDzU-LHzS JOSÉ: NÃO TzMzIS; zCzSO, zSTOU zU zM LUGzR Dz DzUS? +\Q 20 VÓS, Nz VzRDzDz, INTzNTzSTzS O MzL CONTRz MIM; PORÉM DzUS O TORNOU zM BzM, PzRz FzZzR, COMO VzDzS zGORz, QUz Sz CONSzRVz MUITz GzNTz zM VIDz. +\Q 21 NÃO TzMzIS, POIS; zU VOS SUSTzNTzRzI z VÓS OUTROS z z VOSSOS FILHOS. zSSIM, OS CONSOLOU z LHzS FzLOU zO CORzÇÃO. +\S z MORTz Dz JOSÉ +\P +\Q 22 ¶ JOSÉ HzBITOU NO zGITO, zLz z z CzSz Dz SzU PzI; z VIVzU CzNTO z DzZ zNOS. +\Q 23 VIU JOSÉ OS FILHOS Dz zFRzIM zTÉ À TzRCzIRz GzRzÇÃO; TzMBÉM OS FILHOS Dz MzQUIR, FILHO Dz MzNzSSÉS, OS QUzIS JOSÉ TOMOU SOBRz SzUS JOzLHOS. +\Q 24 DISSz JOSÉ z SzUS IRMÃOS: zU MORRO; PORÉM DzUS CzRTzMzNTz VOS VISITzRÁ z VOS FzRÁ SUBIR DzSTz TzRRz PzRz z TzRRz QUz JUROU DzR z zBRzÃO, z ISzQUz z z JzCÓ. +\Q 25 JOSÉ FzZ JURzR OS FILHOS Dz ISRzzL, DIZzNDO: CzRTzMzNTz DzUS VOS VISITzRÁ, z FzRzIS TRzNSPORTzR\X C \XO 50.25 \XT ÊX 13.19; JS 24.32; HB 11.22\X* OS MzUS OSSOS DzQUI. +\Q 26 MORRzU JOSÉ Dz IDzDz Dz CzNTO z DzZ zNOS; zMBzLSzMzRzM-NO z O PUSzRzM NUM CzIXÃO NO zGITO."; + + + + string rePattern = @"(\\id .*\n)(.*\n)*\\c\s+1\s*\n|(\\(z?m?s\d?|r) .*\r\n)(\\(z?m?s\d?|z?m?r|z?s?r|i\w+)\b.*\r\n)*|\\f .*?\\f\*|\\x .*?\\x\*"; + + Action a = () => + { + var re = new Regex(rePattern); + foreach(var i in re.Matches(testData)) + { + Console.WriteLine(i); + } + }; + + // works. + a(); + + // doesn't work. + IAsyncResult result = a.BeginInvoke(null,null); + a.EndInvoke(result); + } + } +} diff --git a/mcs/class/System/Test/System.Text.RegularExpressions/RegexTest.cs b/mcs/class/System/Test/System.Text.RegularExpressions/RegexTest.cs index f5208ce99de..5978a5d095f 100644 --- a/mcs/class/System/Test/System.Text.RegularExpressions/RegexTest.cs +++ b/mcs/class/System/Test/System.Text.RegularExpressions/RegexTest.cs @@ -189,7 +189,7 @@ namespace MonoTests.System.Text.RegularExpressions AddOptions( RegexOptions.None )).Match ("foobar", 5, -1); } - [Test, ExpectedException (typeof (ArgumentOutOfRangeException))] + [Test, ExpectedException (typeof (IndexOutOfRangeException))] public void Match_BadLength2 () { new Regex (@"foo", diff --git a/mcs/class/System/basic_System.dll.sources b/mcs/class/System/basic_System.dll.sources index 14df722190a..5fc849a34b9 100644 --- a/mcs/class/System/basic_System.dll.sources +++ b/mcs/class/System/basic_System.dll.sources @@ -1,4 +1,3 @@ -#include System.dll.sources ../../build/common/Consts.cs ../../build/common/Locale.cs ../../build/common/MonoTODOAttribute.cs @@ -13,3 +12,1090 @@ ../corlib/System.IO/MonoIO.cs ../corlib/System.IO/MonoFileType.cs ../corlib/System.IO/MonoIOStat.cs + +SR.cs +../../build/common/SR.cs +Assembly/AssemblyInfo.cs +Microsoft.CSharp/CSharpCodeCompiler.cs +Microsoft.CSharp/CSharpCodeGenerator.cs +Microsoft.CSharp/CSharpCodeProvider.cs +Microsoft.VisualBasic/VBCodeCompiler.cs +Microsoft.VisualBasic/VBCodeGenerator.cs +Microsoft.VisualBasic/VBCodeProvider.cs +Microsoft.Win32/IntranetZoneCredentialPolicy.cs +Microsoft.Win32/PowerModeChangedEventArgs.cs +Microsoft.Win32/PowerModeChangedEventHandler.cs +Microsoft.Win32/PowerModes.cs +Microsoft.Win32/SessionEndedEventArgs.cs +Microsoft.Win32/SessionEndedEventHandler.cs +Microsoft.Win32/SessionEndingEventArgs.cs +Microsoft.Win32/SessionEndingEventHandler.cs +Microsoft.Win32/SessionEndReasons.cs +Microsoft.Win32/SessionSwitchEventArgs.cs +Microsoft.Win32/SessionSwitchEventHandler.cs +Microsoft.Win32/SessionSwitchReason.cs +Microsoft.Win32/SystemEvents.cs +Microsoft.Win32/TimerElapsedEventArgs.cs +Microsoft.Win32/TimerElapsedEventHandler.cs +Microsoft.Win32/UserPreferenceCategory.cs +Microsoft.Win32/UserPreferenceChangedEventArgs.cs +Microsoft.Win32/UserPreferenceChangedEventHandler.cs +Microsoft.Win32/UserPreferenceChangingEventArgs.cs +Microsoft.Win32/UserPreferenceChangingEventHandler.cs +Mono.Http/NtlmClient.cs +System.CodeDom/CodeArgumentReferenceExpression.cs +System.CodeDom/CodeArrayCreateExpression.cs +System.CodeDom/CodeArrayIndexerExpression.cs +System.CodeDom/CodeAssignStatement.cs +System.CodeDom/CodeAttachEventStatement.cs +System.CodeDom/CodeAttributeArgumentCollection.cs +System.CodeDom/CodeAttributeArgument.cs +System.CodeDom/CodeAttributeDeclarationCollection.cs +System.CodeDom/CodeAttributeDeclaration.cs +System.CodeDom/CodeBaseReferenceExpression.cs +System.CodeDom/CodeBinaryOperatorExpression.cs +System.CodeDom/CodeBinaryOperatorType.cs +System.CodeDom/CodeCastExpression.cs +System.CodeDom/CodeCatchClauseCollection.cs +System.CodeDom/CodeCatchClause.cs +System.CodeDom/CodeChecksumPragma.cs +System.CodeDom/CodeComment.cs +System.CodeDom/CodeCommentStatementCollection.cs +System.CodeDom/CodeCommentStatement.cs +System.CodeDom/CodeCompileUnit.cs +System.CodeDom/CodeConditionStatement.cs +System.CodeDom/CodeConstructor.cs +System.CodeDom/CodeDefaultValueExpression.cs +System.CodeDom/CodeDelegateCreateExpression.cs +System.CodeDom/CodeDelegateInvokeExpression.cs +System.CodeDom/CodeDirectionExpression.cs +System.CodeDom/CodeDirectiveCollection.cs +System.CodeDom/CodeDirective.cs +System.CodeDom/CodeEntryPointMethod.cs +System.CodeDom/CodeEventReferenceExpression.cs +System.CodeDom/CodeExpressionCollection.cs +System.CodeDom/CodeExpression.cs +System.CodeDom/CodeExpressionStatement.cs +System.CodeDom/CodeFieldReferenceExpression.cs +System.CodeDom/CodeGotoStatement.cs +System.CodeDom/CodeIndexerExpression.cs +System.CodeDom/CodeIterationStatement.cs +System.CodeDom/CodeLabeledStatement.cs +System.CodeDom/CodeLinePragma.cs +System.CodeDom/CodeMemberEvent.cs +System.CodeDom/CodeMemberField.cs +System.CodeDom/CodeMemberMethod.cs +System.CodeDom/CodeMemberProperty.cs +System.CodeDom/CodeMethodInvokeExpression.cs +System.CodeDom/CodeMethodReferenceExpression.cs +System.CodeDom/CodeMethodReturnStatement.cs +System.CodeDom/CodeNamespaceCollection.cs +System.CodeDom/CodeNamespace.cs +System.CodeDom/CodeNamespaceImportCollection.cs +System.CodeDom/CodeNamespaceImport.cs +System.CodeDom/CodeObjectCreateExpression.cs +System.CodeDom/CodeObject.cs +System.CodeDom/CodeParameterDeclarationExpressionCollection.cs +System.CodeDom/CodeParameterDeclarationExpression.cs +System.CodeDom/CodePrimitiveExpression.cs +System.CodeDom/CodePropertyReferenceExpression.cs +System.CodeDom/CodePropertySetValueReferenceExpression.cs +System.CodeDom/CodeRegionDirective.cs +System.CodeDom/CodeRegionMode.cs +System.CodeDom/CodeRemoveEventStatement.cs +System.CodeDom/CodeSnippetCompileUnit.cs +System.CodeDom/CodeSnippetExpression.cs +System.CodeDom/CodeSnippetStatement.cs +System.CodeDom/CodeSnippetTypeMember.cs +System.CodeDom/CodeStatementCollection.cs +System.CodeDom/CodeStatement.cs +System.CodeDom/CodeThisReferenceExpression.cs +System.CodeDom/CodeThrowExceptionStatement.cs +System.CodeDom/CodeTryCatchFinallyStatement.cs +System.CodeDom/CodeTypeConstructor.cs +System.CodeDom/CodeTypeDeclarationCollection.cs +System.CodeDom/CodeTypeDeclaration.cs +System.CodeDom/CodeTypeDelegate.cs +System.CodeDom/CodeTypeMemberCollection.cs +System.CodeDom/CodeTypeMember.cs +System.CodeDom/CodeTypeOfExpression.cs +System.CodeDom/CodeTypeParameterCollection.cs +System.CodeDom/CodeTypeParameter.cs +System.CodeDom/CodeTypeReferenceCollection.cs +System.CodeDom/CodeTypeReference.cs +System.CodeDom/CodeTypeReferenceExpression.cs +System.CodeDom/CodeTypeReferenceOptions.cs +System.CodeDom/CodeVariableDeclarationStatement.cs +System.CodeDom/CodeVariableReferenceExpression.cs +System.CodeDom/ICodeDomVisitor.cs +System.CodeDom.Compiler/CodeCompiler.cs +System.CodeDom.Compiler/CodeDomConfigurationHandler.cs +System.CodeDom.Compiler/CodeDomProvider.cs +System.CodeDom.Compiler/CodeGenerator.cs +System.CodeDom.Compiler/CodeGeneratorOptions.cs +System.CodeDom.Compiler/CodeParser.cs +System.CodeDom.Compiler/Compiler.cs +System.CodeDom.Compiler/CompilerCollection.cs +System.CodeDom.Compiler/CompilerErrorCollection.cs +System.CodeDom.Compiler/CompilerError.cs +System.CodeDom.Compiler/CompilerInfo.cs +System.CodeDom.Compiler/CompilerParameters.cs +System.CodeDom.Compiler/CompilerProviderOption.cs +System.CodeDom.Compiler/CompilerProviderOptionsCollection.cs +System.CodeDom.Compiler/CompilerResults.cs +System.CodeDom.Compiler/Executor.cs +System.CodeDom.Compiler/GeneratedCodeAttribute.cs +System.CodeDom.Compiler/GeneratorSupport.cs +System.CodeDom.Compiler/ICodeCompiler.cs +System.CodeDom.Compiler/ICodeGenerator.cs +System.CodeDom.Compiler/ICodeParser.cs +System.CodeDom.Compiler/IndentedTextWriter.cs +System.CodeDom.Compiler/LanguageOptions.cs +System.CodeDom.Compiler/TempFileCollection.cs +System.CodeDom/FieldDirection.cs +System.CodeDom/MemberAttributes.cs +System.Collections.Generic/ISet.cs +System.Collections.Generic/LinkedList.cs +System.Collections.Generic/LinkedListNode.cs +System.Collections.Generic/RBTree.cs +System.Collections.Generic/Queue.cs +System.Collections.Generic/SortedDictionary.cs +System.Collections.Generic/SortedList.cs +System.Collections.Generic/SortedSet.cs +System.Collections.Generic/Stack.cs +System.Collections.Concurrent/BlockingCollection.cs +System.Collections.Concurrent/ConcurrentBag.cs +System.Collections.ObjectModel/ObservableCollection.cs +System.Collections.ObjectModel/ReadOnlyObservableCollection.cs +System.Collections.Specialized/BitVector32.cs +System.Collections.Specialized/CollectionsUtil.cs +System.Collections.Specialized/HybridDictionary.cs +System.Collections.Specialized/IOrderedDictionary.cs +System.Collections.Specialized/INotifyCollectionChanged.cs +System.Collections.Specialized/ListDictionary.cs +System.Collections.Specialized/NameObjectCollectionBase.cs +System.Collections.Specialized/NameValueCollection.cs +System.Collections.Specialized/NotifyCollectionChangedEventArgs.cs +System.Collections.Specialized/NotifyCollectionChangedAction.cs +System.Collections.Specialized/NotifyCollectionChangedEventHandler.cs +System.Collections.Specialized/OrderedDictionary.cs +System.Collections.Specialized/ProcessStringDictionary.cs +System.Collections.Specialized/StringCollection.cs +System.Collections.Specialized/StringDictionary.cs +System.Collections.Specialized/StringEnumerator.cs +System.ComponentModel/AddingNewEventArgs.cs +System.ComponentModel/AddingNewEventHandler.cs +System.ComponentModel/AmbientValueAttribute.cs +System.ComponentModel/ArrayConverter.cs +System.ComponentModel/AsyncCompletedEventArgs.cs +System.ComponentModel/AsyncCompletedEventHandler.cs +System.ComponentModel/AsyncOperation.cs +System.ComponentModel/AsyncOperationManager.cs +System.ComponentModel/AttributeProviderAttribute.cs +System.ComponentModel/AttributeCollection.cs +System.ComponentModel/BackgroundWorker.cs +System.ComponentModel/BaseNumberConverter.cs +System.ComponentModel/BindableAttribute.cs +System.ComponentModel/BindableSupport.cs +System.ComponentModel/BindingDirection.cs +System.ComponentModel/BindingList.cs +System.ComponentModel/BooleanConverter.cs +System.ComponentModel/BrowsableAttribute.cs +System.ComponentModel/ByteConverter.cs +System.ComponentModel/CancelEventArgs.cs +System.ComponentModel/CancelEventHandler.cs +System.ComponentModel/CategoryAttribute.cs +System.ComponentModel/CharConverter.cs +System.ComponentModel/CollectionChangeAction.cs +System.ComponentModel/CollectionChangeEventArgs.cs +System.ComponentModel/CollectionChangeEventHandler.cs +System.ComponentModel/CollectionConverter.cs +System.ComponentModel/ComplexBindingPropertiesAttribute.cs +System.ComponentModel/ComponentCollection.cs +System.ComponentModel/ComponentConverter.cs +System.ComponentModel/Component.cs +System.ComponentModel/ComponentEditor.cs +System.ComponentModel/ComponentResourceManager.cs +System.ComponentModel/Container.cs +System.ComponentModel/ContainerFilterService.cs +System.ComponentModel/CultureInfoConverter.cs +System.ComponentModel/CustomTypeDescriptor.cs +System.ComponentModel/DataErrorsChangedEventArgs.cs +System.ComponentModel/DataObjectAttribute.cs +System.ComponentModel/DataObjectFieldAttribute.cs +System.ComponentModel/DataObjectMethodAttribute.cs +System.ComponentModel/DataObjectMethodType.cs +System.ComponentModel/DateTimeConverter.cs +System.ComponentModel/DateTimeOffsetConverter.cs +System.ComponentModel/DecimalConverter.cs +System.ComponentModel/DefaultBindingPropertyAttribute.cs +System.ComponentModel/DefaultEventAttribute.cs +System.ComponentModel/DefaultPropertyAttribute.cs +System.ComponentModel/DefaultValueAttribute.cs +System.ComponentModel/DerivedPropertyDescriptor.cs +System.ComponentModel/DescriptionAttribute.cs +System.ComponentModel.Design/ActiveDesignerEventArgs.cs +System.ComponentModel.Design/ActiveDesignerEventHandler.cs +System.ComponentModel.Design/CheckoutException.cs +System.ComponentModel.Design/CommandID.cs +System.ComponentModel.Design/ComponentChangedEventArgs.cs +System.ComponentModel.Design/ComponentChangedEventHandler.cs +System.ComponentModel.Design/ComponentChangingEventArgs.cs +System.ComponentModel.Design/ComponentChangingEventHandler.cs +System.ComponentModel.Design/ComponentEventArgs.cs +System.ComponentModel.Design/ComponentEventHandler.cs +System.ComponentModel.Design/ComponentRenameEventArgs.cs +System.ComponentModel.Design/ComponentRenameEventHandler.cs +System.ComponentModel.Design/DesignerCollection.cs +System.ComponentModel.Design/DesignerOptionService.cs +System.ComponentModel.Design/DesignerEventArgs.cs +System.ComponentModel.Design/DesignerEventHandler.cs +System.ComponentModel.Design/DesignerTransactionCloseEventArgs.cs +System.ComponentModel.Design/DesignerTransactionCloseEventHandler.cs +System.ComponentModel.Design/DesignerTransaction.cs +System.ComponentModel.Design/DesignerVerbCollection.cs +System.ComponentModel.Design/DesignerVerb.cs +System.ComponentModel.Design/DesigntimeLicenseContext.cs +System.ComponentModel.Design/DesigntimeLicenseContextSerializer.cs +System.ComponentModel.Design/IDesignerHostTransactionState.cs +System.ComponentModel.Design/TypeDescriptionProviderService.cs +System.ComponentModel/DesignerAttribute.cs +System.ComponentModel/DesignerCategoryAttribute.cs +System.ComponentModel/DesignerSerializationVisibilityAttribute.cs +System.ComponentModel/DesignerSerializationVisibility.cs +System.ComponentModel.Design/HelpContextType.cs +System.ComponentModel.Design/HelpKeywordAttribute.cs +System.ComponentModel.Design/HelpKeywordType.cs +System.ComponentModel.Design/IComponentChangeService.cs +System.ComponentModel.Design/IComponentDiscoveryService.cs +System.ComponentModel.Design/IComponentInitializer.cs +System.ComponentModel.Design/IDesigner.cs +System.ComponentModel.Design/IDesignerEventService.cs +System.ComponentModel.Design/IDesignerFilter.cs +System.ComponentModel.Design/IDesignerHost.cs +System.ComponentModel.Design/IDesignerOptionService.cs +System.ComponentModel.Design/IDictionaryService.cs +System.ComponentModel.Design/IEventBindingService.cs +System.ComponentModel.Design/IExtenderListService.cs +System.ComponentModel.Design/IExtenderProviderService.cs +System.ComponentModel.Design/IHelpService.cs +System.ComponentModel.Design/IInheritanceService.cs +System.ComponentModel.Design/IMenuCommandService.cs +System.ComponentModel.Design/IReferenceService.cs +System.ComponentModel.Design/IResourceService.cs +System.ComponentModel.Design/IRootDesigner.cs +System.ComponentModel.Design/ISelectionService.cs +System.ComponentModel.Design/IServiceContainer.cs +System.ComponentModel.Design/ITreeDesigner.cs +System.ComponentModel.Design/ITypeDescriptorFilterService.cs +System.ComponentModel.Design/ITypeDiscoveryService.cs +System.ComponentModel.Design/ITypeResolutionService.cs +System.ComponentModel.Design/MenuCommand.cs +System.ComponentModel/DesignOnlyAttribute.cs +System.ComponentModel.Design/RuntimeLicenseContext.cs +System.ComponentModel.Design/SelectionTypes.cs +System.ComponentModel.Design.Serialization/ComponentSerializationService.cs +System.ComponentModel.Design.Serialization/ContextStack.cs +System.ComponentModel.Design.Serialization/DesignerLoader.cs +System.ComponentModel.Design.Serialization/DesignerSerializerAttribute.cs +System.ComponentModel.Design.Serialization/IDesignerLoaderHost.cs +System.ComponentModel.Design.Serialization/IDesignerLoaderHost2.cs +System.ComponentModel.Design.Serialization/IDesignerLoaderService.cs +System.ComponentModel.Design.Serialization/IDesignerSerializationManager.cs +System.ComponentModel.Design.Serialization/IDesignerSerializationProvider.cs +System.ComponentModel.Design.Serialization/IDesignerSerializationService.cs +System.ComponentModel.Design.Serialization/INameCreationService.cs +System.ComponentModel.Design.Serialization/InstanceDescriptor.cs +System.ComponentModel.Design.Serialization/MemberRelationship.cs +System.ComponentModel.Design.Serialization/MemberRelationshipService.cs +System.ComponentModel.Design.Serialization/ResolveNameEventArgs.cs +System.ComponentModel.Design.Serialization/ResolveNameEventHandler.cs +System.ComponentModel.Design.Serialization/RootDesignerSerializerAttribute.cs +System.ComponentModel.Design.Serialization/SerializationStore.cs +System.ComponentModel.Design.Serialization/DefaultSerializationProviderAttribute.cs +System.ComponentModel.Design/ServiceContainer.cs +System.ComponentModel.Design/ServiceCreatorCallback.cs +System.ComponentModel.Design/StandardCommands.cs +System.ComponentModel.Design/StandardToolWindows.cs +System.ComponentModel/DesignTimeVisibleAttribute.cs +System.ComponentModel.Design/ViewTechnology.cs +System.ComponentModel/DisplayNameAttribute.cs +System.ComponentModel/DoubleConverter.cs +System.ComponentModel/DoWorkEventHandler.cs +System.ComponentModel/DoWorkEventArgs.cs +System.ComponentModel/EditorAttribute.cs +System.ComponentModel/EditorBrowsableAttribute.cs +System.ComponentModel/EditorBrowsableState.cs +System.ComponentModel/EnumConverter.cs +System.ComponentModel/EventDescriptorCollection.cs +System.ComponentModel/EventDescriptor.cs +System.ComponentModel/EventHandlerList.cs +System.ComponentModel/ExpandableObjectConverter.cs +System.ComponentModel/ExtenderProvidedPropertyAttribute.cs +System.ComponentModel/GuidConverter.cs +System.ComponentModel/HandledEventArgs.cs +System.ComponentModel/HandledEventHandler.cs +System.ComponentModel/IBindingList.cs +System.ComponentModel/IBindingListView.cs +System.ComponentModel/ICancelAddNew.cs +System.ComponentModel/IChangeTracking.cs +System.ComponentModel/IComNativeDescriptorHandler.cs +System.ComponentModel/IComponent.cs +System.ComponentModel/IContainer.cs +System.ComponentModel/ICustomTypeDescriptor.cs +System.ComponentModel/IDataErrorInfo.cs +System.ComponentModel/IEditableObject.cs +System.ComponentModel/IExtenderProvider.cs +System.ComponentModel/IIntellisenseBuilder.cs +System.ComponentModel/IListSource.cs +System.ComponentModel/ImmutableObjectAttribute.cs +System.ComponentModel/INestedContainer.cs +System.ComponentModel/INestedSite.cs +System.ComponentModel/InheritanceAttribute.cs +System.ComponentModel/InheritanceLevel.cs +System.ComponentModel/InitializationEventAttribute.cs +System.ComponentModel/INotifyDataErrorInfo.cs +System.ComponentModel/INotifyPropertyChanged.cs +System.ComponentModel/INotifyPropertyChanging.cs +System.ComponentModel/InstallerTypeAttribute.cs +System.ComponentModel/InstanceCreationEditor.cs +System.ComponentModel/InvalidAsynchronousStateException.cs +System.ComponentModel/Int16Converter.cs +System.ComponentModel/Int32Converter.cs +System.ComponentModel/Int64Converter.cs +System.ComponentModel/InvalidEnumArgumentException.cs +System.ComponentModel/IRevertibleChangeTracking.cs +System.ComponentModel/IRaiseItemChangedEvents.cs +System.ComponentModel/ISite.cs +System.ComponentModel/ISupportInitialize.cs +System.ComponentModel/ISupportInitializeNotification.cs +System.ComponentModel/ISynchronizeInvoke.cs +System.ComponentModel/ITypeDescriptorContext.cs +System.ComponentModel/ITypedList.cs +System.ComponentModel/LicenseContext.cs +System.ComponentModel/License.cs +System.ComponentModel/LicenseException.cs +System.ComponentModel/LicenseManager.cs +System.ComponentModel/LicenseProviderAttribute.cs +System.ComponentModel/LicenseProvider.cs +System.ComponentModel/LicenseUsageMode.cs +System.ComponentModel/LicFileLicenseProvider.cs +System.ComponentModel/ListBindableAttribute.cs +System.ComponentModel/ListChangedEventArgs.cs +System.ComponentModel/ListChangedEventHandler.cs +System.ComponentModel/ListChangedType.cs +System.ComponentModel/ListSortDescriptionCollection.cs +System.ComponentModel/ListSortDescription.cs +System.ComponentModel/ListSortDirection.cs +System.ComponentModel/LocalizableAttribute.cs +System.ComponentModel/LookupBindingPropertiesAttribute.cs +System.ComponentModel/MarshalByValueComponent.cs +System.ComponentModel/MaskedTextProvider.cs +System.ComponentModel/MaskedTextResultHint.cs +System.ComponentModel/MemberDescriptor.cs +System.ComponentModel/MergablePropertyAttribute.cs +System.ComponentModel/MultilineStringConverter.cs +System.ComponentModel/NestedContainer.cs +System.ComponentModel/NotifyParentPropertyAttribute.cs +System.ComponentModel/NullableConverter.cs +System.ComponentModel/ParenthesizePropertyNameAttribute.cs +System.ComponentModel/PasswordPropertyTextAttribute.cs +System.ComponentModel/PropertyChangedEventArgs.cs +System.ComponentModel/PropertyChangedEventHandler.cs +System.ComponentModel/PropertyChangingEventArgs.cs +System.ComponentModel/PropertyChangingEventHandler.cs +System.ComponentModel/PropertyDescriptorCollection.cs +System.ComponentModel/PropertyDescriptor.cs +System.ComponentModel/PropertyTabAttribute.cs +System.ComponentModel/PropertyTabScope.cs +System.ComponentModel/ProvidePropertyAttribute.cs +System.ComponentModel/ReadOnlyAttribute.cs +System.ComponentModel/RecommendedAsConfigurableAttribute.cs +System.ComponentModel/ReferenceConverter.cs +System.ComponentModel/ReflectionEventDescriptor.cs +System.ComponentModel/ReflectionPropertyDescriptor.cs +System.ComponentModel/RefreshEventArgs.cs +System.ComponentModel/RefreshEventHandler.cs +System.ComponentModel/RefreshPropertiesAttribute.cs +System.ComponentModel/RefreshProperties.cs +System.ComponentModel/RunInstallerAttribute.cs +System.ComponentModel/RunWorkerCompletedEventArgs.cs +System.ComponentModel/RunWorkerCompletedEventHandler.cs +System.ComponentModel/SByteConverter.cs +System.ComponentModel/SettingsBindableAttribute.cs +System.ComponentModel/SingleConverter.cs +System.ComponentModel/StringConverter.cs +System.ComponentModel/SyntaxCheck.cs +System.ComponentModel/TimeSpanConverter.cs +System.ComponentModel/ToolboxItemAttribute.cs +System.ComponentModel/ToolboxItemFilterAttribute.cs +System.ComponentModel/ToolboxItemFilterType.cs +System.ComponentModel/TypeConverterAttribute.cs +System.ComponentModel/TypeConverter.cs +System.ComponentModel/TypeDescriptionProvider.cs +System.ComponentModel/TypeDescriptionProviderAttribute.cs +System.ComponentModel/TypeDescriptor.cs +System.ComponentModel/TypeListConverter.cs +System.ComponentModel/UInt16Converter.cs +System.ComponentModel/UInt32Converter.cs +System.ComponentModel/UInt64Converter.cs +System.ComponentModel/WarningException.cs +System.ComponentModel/WeakObjectWrapper.cs +System.ComponentModel/WeakObjectWrapperComparer.cs +System.ComponentModel/Win32Exception.cs +System.Configuration/ApplicationScopedSettingAttribute.cs +System.Configuration/ApplicationSettingsBase.cs +System.Configuration/ApplicationSettingsGroup.cs +System.Configuration/AppSettingsReader.cs +System.Configuration/ClientSettingsSection.cs +System.Configuration/ConfigHelper.cs +System.Configuration/ConfigurationException.cs +System.Configuration/ConfigurationSettings.cs +System.Configuration/ConfigXmlDocument.cs +System.Configuration/CustomizableFileSettingsProvider.cs +System.Configuration/DefaultSettingValueAttribute.cs +System.Configuration/DictionarySectionHandler.cs +System.Configuration/IApplicationSettingsProvider.cs +System.Configuration/IConfigurationSectionHandler.cs +System.Configuration/IConfigurationSystem.cs +System.Configuration/IConfigXmlNode.cs +System.Configuration/IdnElement.cs +System.Configuration/IgnoreSectionHandler.cs +System.Configuration/IriParsingElement.cs +System.Configuration/IPersistComponentSettings.cs +System.Configuration/ISettingsProviderService.cs +System.Configuration/LocalFileSettingsProvider.cs +System.Configuration/NameValueFileSectionHandler.cs +System.Configuration/NameValueSectionHandler.cs +System.Configuration/NoSettingsVersionUpgradeAttribute.cs +System.Configuration/SettingAttribute.cs +System.Configuration/SettingChangingEventArgs.cs +System.Configuration/SettingChangingEventHandler.cs +System.Configuration/SettingElementCollection.cs +System.Configuration/SettingElement.cs +System.Configuration/SettingsAttributeDictionary.cs +System.Configuration/SettingsBase.cs +System.Configuration/SettingsContext.cs +System.Configuration/SettingsLoadedEventArgs.cs +System.Configuration/SettingsLoadedEventHandler.cs +System.Configuration/SettingsPropertyCollection.cs +System.Configuration/SettingsProperty.cs +System.Configuration/SettingsPropertyIsReadOnlyException.cs +System.Configuration/SettingsPropertyNotFoundException.cs +System.Configuration/SettingsPropertyValueCollection.cs +System.Configuration/SettingsPropertyValue.cs +System.Configuration/SettingsPropertyWrongTypeException.cs +System.Configuration/SettingsProviderAttribute.cs +System.Configuration/SettingsProviderCollection.cs +System.Configuration/SettingsProvider.cs +System.Configuration/SettingsSavingEventHandler.cs +System.Configuration/SettingsSerializeAsAttribute.cs +System.Configuration/SettingsSerializeAs.cs +System.Configuration/SettingValueElement.cs +System.Configuration/SettingsManageability.cs +System.Configuration/SettingsManageabilityAttribute.cs +System.Configuration/SettingsGroupDescriptionAttribute.cs +System.Configuration/SettingsDescriptionAttribute.cs +System.Configuration/SettingsGroupNameAttribute.cs +System.Configuration/SingleTagSectionHandler.cs +System.Configuration/SpecialSetting.cs +System.Configuration/SpecialSettingAttribute.cs +System.Configuration/UriSection.cs +System.Configuration/UserSettingsGroup.cs +System.Configuration/UserScopedSettingAttribute.cs +System/DefaultUriParser.cs +System.Diagnostics/AlphabeticalEnumConverter.cs +System.Diagnostics/BooleanSwitch.cs +System.Diagnostics/ConsoleTraceListener.cs +System.Diagnostics/CorrelationManager.cs +System.Diagnostics/CounterCreationDataCollection.cs +System.Diagnostics/CounterCreationData.cs +System.Diagnostics/CounterSampleCalculator.cs +System.Diagnostics/CounterSample.cs +System.Diagnostics/DataReceivedEventArgs.cs +System.Diagnostics/DataReceivedEventHandler.cs +System.Diagnostics/Debug.cs +System.Diagnostics/DefaultTraceListener.cs +System.Diagnostics/DelimitedListTraceListener.cs +System.Diagnostics/DiagnosticsConfigurationHandler.cs +System.Diagnostics/EntryWrittenEventArgs.cs +System.Diagnostics/EntryWrittenEventHandler.cs +System.Diagnostics/EventInstance.cs +System.Diagnostics/EventLog.cs +System.Diagnostics/EventLogEntryCollection.cs +System.Diagnostics/EventLogEntry.cs +System.Diagnostics/EventLogEntryType.cs +System.Diagnostics/EventLogImpl.cs +System.Diagnostics/EventLogInstaller.cs +System.Diagnostics/EventLogPermissionAccess.cs +System.Diagnostics/EventLogPermissionAttribute.cs +System.Diagnostics/EventLogPermission.cs +System.Diagnostics/EventLogPermissionEntryCollection.cs +System.Diagnostics/EventLogPermissionEntry.cs +System.Diagnostics/EventLogTraceListener.cs +System.Diagnostics/EventSourceCreationData.cs +System.Diagnostics/EventTypeFilter.cs +System.Diagnostics/FileVersionInfo.cs +System.Diagnostics/ICollectData.cs +System.Diagnostics/InstanceDataCollectionCollection.cs +System.Diagnostics/InstanceDataCollection.cs +System.Diagnostics/InstanceData.cs +System.Diagnostics/LocalFileEventLog.cs +System.Diagnostics/MonitoringDescriptionAttribute.cs +System.Diagnostics/NullEventLog.cs +System.Diagnostics/OverflowAction.cs +System.Diagnostics/PerformanceCounterCategory.cs +System.Diagnostics/PerformanceCounterCategoryType.cs +System.Diagnostics/PerformanceCounter.cs +System.Diagnostics/PerformanceCounterInstaller.cs +System.Diagnostics/PerformanceCounterInstanceLifetime.cs +System.Diagnostics/PerformanceCounterManager.cs +System.Diagnostics/PerformanceCounterPermissionAccess.cs +System.Diagnostics/PerformanceCounterPermissionAttribute.cs +System.Diagnostics/PerformanceCounterPermission.cs +System.Diagnostics/PerformanceCounterPermissionEntryCollection.cs +System.Diagnostics/PerformanceCounterPermissionEntry.cs +System.Diagnostics/PerformanceCounterType.cs +System.Diagnostics/Process.cs +System.Diagnostics/ProcessModuleCollection.cs +System.Diagnostics/ProcessModule.cs +System.Diagnostics/ProcessPriorityClass.cs +System.Diagnostics/ProcessStartInfo.cs +System.Diagnostics/ProcessThreadCollection.cs +System.Diagnostics/ProcessThread.cs +System.Diagnostics/ProcessWindowStyle.cs +System.Diagnostics/SourceFilter.cs +System.Diagnostics/SourceLevels.cs +System.Diagnostics/SourceSwitch.cs +System.Diagnostics/Switch.cs +System.Diagnostics/SwitchAttribute.cs +System.Diagnostics/SwitchLevelAttribute.cs +System.Diagnostics/Stopwatch.cs +System.Diagnostics/TextWriterTraceListener.cs +System.Diagnostics/ThreadPriorityLevel.cs +System.Diagnostics/ThreadState.cs +System.Diagnostics/ThreadWaitReason.cs +System.Diagnostics/Trace.cs +System.Diagnostics/TraceEventCache.cs +System.Diagnostics/TraceEventType.cs +System.Diagnostics/TraceFilter.cs +System.Diagnostics/TraceImpl.cs +System.Diagnostics/TraceLevel.cs +System.Diagnostics/TraceListenerCollection.cs +System.Diagnostics/TraceListener.cs +System.Diagnostics/TraceOptions.cs +System.Diagnostics/TraceSource.cs +System.Diagnostics/TraceSourceInfo.cs +System.Diagnostics/TraceSwitch.cs +System.Diagnostics/Win32EventLog.cs +System.Diagnostics/XmlWriterTraceListener.cs +System.Diagnostics.CodeAnalysis/ExcludeFromCodeCoverageAttribute.cs +System/FileStyleUriParser.cs +System/FtpStyleUriParser.cs +System/GenericUriParser.cs +System/GenericUriParserOptions.cs +System/GopherStyleUriParser.cs +System/HttpStyleUriParser.cs +System/Platform.cs +System.IO.Compression/CompressionLevel.cs +System.IO.Compression/CompressionMode.cs +System.IO.Compression/DeflateStream.cs +System.IO.Compression/GZipStream.cs +System.IO/DefaultWatcher.cs +System.IO/ErrorEventArgs.cs +System.IO/ErrorEventHandler.cs +System.IO/FAMWatcher.cs +System.IO/NullFileWatcher.cs +System.IO/FileAction.cs +System.IO/FileSystemEventArgs.cs +System.IO/FileSystemEventHandler.cs +System.IO/FileSystemWatcher.cs +System.IO/IFileWatcher.cs +System.IO/InotifyWatcher.cs +System.IO/InternalBufferOverflowException.cs +System.IO/InvalidDataException.cs +System.IO/IODescriptionAttribute.cs +System.IO/KeventWatcher.cs +System.IO/MonoSyncFileStream.cs +System.IO/NotifyFilters.cs +System.IO.Ports/Handshake.cs +System.IO.Ports/ISerialStream.cs +System.IO.Ports/Parity.cs +System.IO.Ports/SerialData.cs +System.IO.Ports/SerialError.cs +System.IO.Ports/SerialErrorEventArgs.cs +System.IO.Ports/SerialPinChange.cs +System.IO.Ports/SerialPinChangedEventArgs.cs +System.IO.Ports/SerialPort.cs +System.IO.Ports/SerialPortStream.cs +System.IO.Ports/SerialReceivedEventArgs.cs +System.IO.Ports/SerialSignal.cs +System.IO.Ports/StopBits.cs +System.IO.Ports/WinSerialStream.cs +System.IO/RenamedEventArgs.cs +System.IO/RenamedEventHandler.cs +System.IO/SearchPattern.cs +System.IO/WaitForChangedResult.cs +System.IO/WatcherChangeTypes.cs +System.IO/WindowsWatcher.cs +System/LdapStyleUriParser.cs +System.Media/AudioData.cs +System.Media/AudioDevice.cs +System.Media/SoundPlayer.cs +System.Media/SystemSound.cs +System.Media/SystemSounds.cs +System.Media/Win32SoundPlayer.cs +System.Net/AuthenticationManager.cs +System.Net/AuthenticationSchemes.cs +System.Net/AuthenticationSchemeSelector.cs +System.Net/Authorization.cs +System.Net/BasicClient.cs +System.Net/BindIPEndPoint.cs +System.Net.Cache/HttpCacheAgeControl.cs +System.Net.Cache/HttpRequestCacheLevel.cs +System.Net.Cache/HttpRequestCachePolicy.cs +System.Net.Cache/RequestCacheLevel.cs +System.Net.Cache/RequestCachePolicy.cs +System.Net/ChunkedInputStream.cs +System.Net/ChunkStream.cs +System.Net.Configuration/AuthenticationModuleElementCollection.cs +System.Net.Configuration/AuthenticationModuleElement.cs +System.Net.Configuration/AuthenticationModulesSection.cs +System.Net.Configuration/BypassElementCollection.cs +System.Net.Configuration/BypassElement.cs +System.Net.Configuration/ConnectionManagementElementCollection.cs +System.Net.Configuration/ConnectionManagementElement.cs +System.Net.Configuration/ConnectionManagementHandler.cs +System.Net.Configuration/ConnectionManagementSection.cs +System.Net.Configuration/DefaultProxyHandler.cs +System.Net.Configuration/DefaultProxySection.cs +System.Net.Configuration/FtpCachePolicyElement.cs +System.Net.Configuration/HttpCachePolicyElement.cs +System.Net.Configuration/HttpWebRequestElement.cs +System.Net.Configuration/Ipv6Element.cs +System.Net.Configuration/MailSettingsSectionGroup.cs +System.Net.Configuration/ModuleElement.cs +System.Net.Configuration/NetAuthenticationModuleHandler.cs +System.Net.Configuration/NetConfigurationHandler.cs +System.Net.Configuration/NetSectionGroup.cs +System.Net.Configuration/PerformanceCountersElement.cs +System.Net.Configuration/ProxyElement.cs +System.Net.Configuration/RequestCachingSection.cs +System.Net.Configuration/ServicePointManagerElement.cs +System.Net.Configuration/SettingsSection.cs +System.Net.Configuration/SmtpNetworkElement.cs +System.Net.Configuration/SmtpSection.cs +System.Net.Configuration/SmtpSpecifiedPickupDirectoryElement.cs +System.Net.Configuration/SocketElement.cs +System.Net.Configuration/WebProxyScriptElement.cs +System.Net.Configuration/WebRequestModuleElementCollection.cs +System.Net.Configuration/WebRequestModuleElement.cs +System.Net.Configuration/WebRequestModuleHandler.cs +System.Net.Configuration/WebRequestModulesSection.cs +System.Net/ConnectionModes.cs +System.Net/CookieCollection.cs +System.Net/CookieContainer.cs +System.Net/Cookie.cs +System.Net/CookieException.cs +System.Net/CookieParser.cs +System.Net/CredentialCache.cs +System.Net/DecompressionMethods.cs +System.Net/DefaultCertificatePolicy.cs +System.Net/DigestClient.cs +System.Net/Dns.cs +System.Net/DnsEndPoint.cs +System.Net/DnsPermissionAttribute.cs +System.Net/DnsPermission.cs +System.Net/EndPoint.cs +System.Net/EndPointListener.cs +System.Net/EndPointManager.cs +System.Net/EndpointPermission.cs +System.Net/FileWebRequestCreator.cs +System.Net/FileWebRequest.cs +System.Net/FileWebResponse.cs +System.Net/FtpAsyncResult.cs +System.Net/FtpDataStream.cs +System.Net/FtpRequestCreator.cs +System.Net/FtpStatusCode.cs +System.Net/FtpWebRequest.cs +System.Net/FtpStatus.cs +System.Net/FtpWebResponse.cs +System.Net/GlobalProxySelection.cs +System.Net/HttpConnection.cs +System.Net/HttpContinueDelegate.cs +System.Net/HttpListenerBasicIdentity.cs +System.Net/HttpListenerContext.cs +System.Net/HttpListener.cs +System.Net/HttpListenerException.cs +System.Net/HttpListenerPrefixCollection.cs +System.Net/HttpListenerRequest.cs +System.Net/HttpListenerResponse.cs +System.Net/HttpRequestCreator.cs +System.Net/HttpRequestHeader.cs +System.Net/HttpResponseHeader.cs +System.Net/HttpStatusCode.cs +System.Net/HttpStreamAsyncResult.cs +System.Net/HttpUtility.cs +System.Net/HttpVersion.cs +System.Net/HttpWebRequest.cs +System.Net/HttpWebResponse.cs +System.Net/IAuthenticationModule.cs +System.Net/ICertificatePolicy.cs +System.Net/ICredentialLookup.cs +System.Net/ICredentialPolicy.cs +System.Net/ICredentialsByHost.cs +System.Net/IPAddress.cs +System.Net/IPEndPoint.cs +System.Net/IPHostEntry.cs +System.Net/IPv6Address.cs +System.Net/IWebProxy.cs +System.Net/IWebProxyScript.cs +System.Net/IWebConnectionState.cs +System.Net/IWebRequestCreate.cs +System.Net/ListenerAsyncResult.cs +System.Net/ListenerPrefix.cs +System.Net.Mail/AlternateViewCollection.cs +System.Net.Mail/AlternateView.cs +System.Net.Mail/AttachmentBase.cs +System.Net.Mail/AttachmentCollection.cs +System.Net.Mail/Attachment.cs +System.Net.Mail/DeliveryNotificationOptions.cs +System.Net.Mail/LinkedResourceCollection.cs +System.Net.Mail/LinkedResource.cs +System.Net.Mail/MailAddressCollection.cs +System.Net.Mail/MailAddress.cs +System.Net.Mail/MailMessage.cs +System.Net.Mail/MailPriority.cs +System.Net.Mail/SendCompletedEventHandler.cs +System.Net.Mail/SmtpAccess.cs +System.Net.Mail/SmtpClient.cs +System.Net.Mail/SmtpDeliveryMethod.cs +System.Net.Mail/SmtpException.cs +System.Net.Mail/SmtpFailedRecipientException.cs +System.Net.Mail/SmtpFailedRecipientsException.cs +System.Net.Mail/SmtpPermission.cs +System.Net.Mail/SmtpPermissionAttribute.cs +System.Net.Mail/SmtpStatusCode.cs +System.Net.Mime/ContentDisposition.cs +System.Net.Mime/ContentType.cs +System.Net.Mime/DispositionTypeNames.cs +System.Net.Mime/MediaTypeNames.cs +System.Net.Mime/TransferEncoding.cs +System.Net/MacProxy.cs +System.Net/MonoHttpDate.cs +System.Net/NetConfig.cs +System.Net/NetworkAccess.cs +System.Net/NetworkCredential.cs +System.Net.NetworkInformation/DuplicateAddressDetectionState.cs +System.Net.NetworkInformation/GatewayIPAddressInformationCollection.cs +System.Net.NetworkInformation/GatewayIPAddressInformation.cs +System.Net.NetworkInformation/IcmpV4Statistics.cs +System.Net.NetworkInformation/IcmpV6Statistics.cs +System.Net.NetworkInformation/IPAddressCollection.cs +System.Net.NetworkInformation/IPAddressInformationCollection.cs +System.Net.NetworkInformation/IPAddressInformation.cs +System.Net.NetworkInformation/IPGlobalProperties.cs +System.Net.NetworkInformation/IPGlobalStatistics.cs +System.Net.NetworkInformation/IPInterfaceProperties.cs +System.Net.NetworkInformation/IPStatus.cs +System.Net.NetworkInformation/IPv4InterfaceProperties.cs +System.Net.NetworkInformation/IPv4InterfaceStatistics.cs +System.Net.NetworkInformation/IPv6InterfaceProperties.cs +System.Net.NetworkInformation/LinuxNetworkInterfaceMarshal.cs +System.Net.NetworkInformation/MacOsNetworkInterfaceMarshal.cs +System.Net.NetworkInformation/MulticastIPAddressInformationCollection.cs +System.Net.NetworkInformation/MulticastIPAddressInformation.cs +System.Net.NetworkInformation/NetBiosNodeType.cs +System.Net.NetworkInformation/NetworkAddressChangedEventHandler.cs +System.Net.NetworkInformation/NetworkAvailabilityChangedEventHandler.cs +System.Net.NetworkInformation/NetworkAvailabilityEventArgs.cs +System.Net.NetworkInformation/NetworkChange.cs +System.Net.NetworkInformation/NetworkInformationAccess.cs +System.Net.NetworkInformation/NetworkInformationException.cs +System.Net.NetworkInformation/NetworkInformationPermissionAttribute.cs +System.Net.NetworkInformation/NetworkInformationPermission.cs +System.Net.NetworkInformation/NetworkInterfaceComponent.cs +System.Net.NetworkInformation/NetworkInterface.cs +System.Net.NetworkInformation/NetworkInterfaceType.cs +System.Net.NetworkInformation/OperationalStatus.cs +System.Net.NetworkInformation/PhysicalAddress.cs +System.Net.NetworkInformation/PingCompletedEventArgs.cs +System.Net.NetworkInformation/PingCompletedEventHandler.cs +System.Net.NetworkInformation/Ping.cs +System.Net.NetworkInformation/PingException.cs +System.Net.NetworkInformation/PingOptions.cs +System.Net.NetworkInformation/PingReply.cs +System.Net.NetworkInformation/PrefixOrigin.cs +System.Net.NetworkInformation/SuffixOrigin.cs +System.Net.NetworkInformation/TcpConnectionInformation.cs +System.Net.NetworkInformation/TcpState.cs +System.Net.NetworkInformation/TcpStatistics.cs +System.Net.NetworkInformation/UdpStatistics.cs +System.Net.NetworkInformation/UnicastIPAddressInformationCollection.cs +System.Net.NetworkInformation/UnicastIPAddressInformation.cs +System.Net.NetworkInformation/Win32NetworkInterfaceMarshal.cs +System.Net/NtlmClient.cs +System/NetPipeStyleUriParser.cs +System.Net/ProtocolViolationException.cs +System.Net/RequestStream.cs +System.Net/ResponseStream.cs +System.Net.Security/AuthenticatedStream.cs +System.Net.Security/AuthenticationLevel.cs +System.Net.Security/LocalCertificateSelectionCallback.cs +System.Net.Security/NegotiateStream.cs +System.Net.Security/ProtectionLevel.cs +System.Net/SecurityProtocolType.cs +System.Net.Security/RemoteCertificateValidationCallback.cs +System.Net.Security/SslStream.cs +System.Net.Security/SslPolicyErrors.cs +System.Net/ServicePoint.cs +System.Net/ServicePointManager.cs +System.Net/ServicePointManager.extra.cs +System.Net/SimpleAsyncResult.cs +System.Net/SocketAddress.cs +System.Net/SocketPermissionAttribute.cs +System.Net/SocketPermission.cs +System.Net.Sockets/AddressFamily.cs +System.Net.Sockets/IOControlCode.cs +System.Net.Sockets/IPv6MulticastOption.cs +System.Net.Sockets/IPPacketInformation.cs +System.Net.Sockets/LingerOption.cs +System.Net.Sockets/MulticastOption.cs +System.Net.Sockets/NetworkStream.cs +System.Net.Sockets/ProtocolFamily.cs +System.Net.Sockets/ProtocolType.cs +System.Net.Sockets/SelectMode.cs +System.Net.Sockets/SendPacketsElement.cs +System.Net.Sockets/Socket.cs +System.Net.Sockets/Socket_2_1.cs +System.Net.Sockets/SocketAsyncEventArgs.cs +System.Net.Sockets/SocketAsyncOperation.cs +System.Net.Sockets/SocketError.cs +System.Net.Sockets/SocketException.cs +System.Net.Sockets/SocketFlags.cs +System.Net.Sockets/SocketInformation.cs +System.Net.Sockets/SocketInformationOptions.cs +System.Net.Sockets/SocketOptionLevel.cs +System.Net.Sockets/SocketOptionName.cs +System.Net.Sockets/SocketShutdown.cs +System.Net.Sockets/SocketType.cs +System.Net.Sockets/TcpClient.cs +System.Net.Sockets/TcpListener.cs +System.Net.Sockets/TransmitFileOptions.cs +System.Net.Sockets/UdpClient.cs +System.Net.Sockets/UdpReceiveResult.cs +System/NetTcpStyleUriParser.cs +System.Net/TransportContext.cs +System.Net/TransportType.cs +System.Net/WebAsyncResult.cs +System.Net/WebClient.cs +System.Net/WebConnection.cs +System.Net/WebConnectionData.cs +System.Net/WebConnectionGroup.cs +System.Net/WebConnectionStream.cs +System.Net/WebException.cs +System.Net/WebExceptionStatus.cs +System.Net/WebHeaderCollection.cs +System.Net/WebPermissionAttribute.cs +System.Net/WebPermission.cs +System.Net/WebProxy.cs +System.Net/WebRequest.cs +System.Net/WebRequestMethods.cs +System.Net/WebResponse.cs +System.Net/WebUtility.cs +System.Net.WebSockets/ClientWebSocket.cs +System.Net.WebSockets/ClientWebSocketOptions.cs +System.Net.WebSockets/HttpListenerWebSocketContext.cs +System.Net.WebSockets/WebSocket.cs +System.Net.WebSockets/WebSocketCloseStatus.cs +System.Net.WebSockets/WebSocketContext.cs +System.Net.WebSockets/WebSocketError.cs +System.Net.WebSockets/WebSocketException.cs +System.Net.WebSockets/WebSocketMessageType.cs +System.Net.WebSockets/WebSocketReceiveResult.cs +System.Net.WebSockets/WebSocketState.cs +System/NewsStyleUriParser.cs +System.Runtime.Versioning/FrameworkName.cs +System.Security.AccessControl/SemaphoreAccessRule.cs +System.Security.AccessControl/SemaphoreAuditRule.cs +System.Security.AccessControl/SemaphoreRights.cs +System.Security.AccessControl/SemaphoreSecurity.cs +System.Security.Authentication/AuthenticationException.cs +System.Security.Authentication/CipherAlgorithmType.cs +System.Security.Authentication/ExchangeAlgorithmType.cs +System.Security.Authentication/HashAlgorithmType.cs +System.Security.Authentication/SslProtocols.cs +System.Security.Authentication/InvalidCredentialException.cs +System.Security.Authentication.ExtendedProtection/ChannelBinding.cs +System.Security.Authentication.ExtendedProtection/ChannelBindingKind.cs +System.Security.Authentication.ExtendedProtection/ExtendedProtectionPolicy.cs +System.Security.Authentication.ExtendedProtection/ExtendedProtectionPolicyTypeConverter.cs +System.Security.Authentication.ExtendedProtection/PolicyEnforcement.cs +System.Security.Authentication.ExtendedProtection/ProtectionScenario.cs +System.Security.Authentication.ExtendedProtection/ServiceNameCollection.cs +System.Security.Authentication.ExtendedProtection.Configuration/ConfigUtil.cs +System.Security.Authentication.ExtendedProtection.Configuration/ExtendedProtectionPolicyElement.cs +System.Security.Authentication.ExtendedProtection.Configuration/ServiceNameElement.cs +System.Security.Authentication.ExtendedProtection.Configuration/ServiceNameElementCollection.cs +System.Security.Cryptography/AsnEncodedDataCollection.cs +System.Security.Cryptography/AsnEncodedData.cs +System.Security.Cryptography/AsnEncodedDataEnumerator.cs +System.Security.Cryptography/OidCollection.cs +System.Security.Cryptography/Oid.cs +System.Security.Cryptography/OidEnumerator.cs +System.Security.Cryptography.X509Certificates/OpenFlags.cs +System.Security.Cryptography.X509Certificates/OSX509Certificates.cs +System.Security.Cryptography.X509Certificates/PublicKey.cs +System.Security.Cryptography.X509Certificates/StoreLocation.cs +System.Security.Cryptography.X509Certificates/StoreName.cs +System.Security.Cryptography.X509Certificates/X500DistinguishedName.cs +System.Security.Cryptography.X509Certificates/X500DistinguishedNameFlags.cs +System.Security.Cryptography.X509Certificates/X509BasicConstraintsExtension.cs +System.Security.Cryptography.X509Certificates/X509Certificate2Collection.cs +System.Security.Cryptography.X509Certificates/X509Certificate2.cs +System.Security.Cryptography.X509Certificates/X509Certificate2Enumerator.cs +System.Security.Cryptography.X509Certificates/X509CertificateCollection.cs +System.Security.Cryptography.X509Certificates/X509Chain.cs +System.Security.Cryptography.X509Certificates/X509ChainElementCollection.cs +System.Security.Cryptography.X509Certificates/X509ChainElement.cs +System.Security.Cryptography.X509Certificates/X509ChainElementEnumerator.cs +System.Security.Cryptography.X509Certificates/X509ChainPolicy.cs +System.Security.Cryptography.X509Certificates/X509ChainStatus.cs +System.Security.Cryptography.X509Certificates/X509ChainStatusFlags.cs +System.Security.Cryptography.X509Certificates/X509EnhancedKeyUsageExtension.cs +System.Security.Cryptography.X509Certificates/X509ExtensionCollection.cs +System.Security.Cryptography.X509Certificates/X509Extension.cs +System.Security.Cryptography.X509Certificates/X509ExtensionEnumerator.cs +System.Security.Cryptography.X509Certificates/X509FindType.cs +System.Security.Cryptography.X509Certificates/X509IncludeOption.cs +System.Security.Cryptography.X509Certificates/X509KeyUsageExtension.cs +System.Security.Cryptography.X509Certificates/X509KeyUsageFlags.cs +System.Security.Cryptography.X509Certificates/X509NameType.cs +System.Security.Cryptography.X509Certificates/X509RevocationFlag.cs +System.Security.Cryptography.X509Certificates/X509RevocationMode.cs +System.Security.Cryptography.X509Certificates/X509Store.cs +System.Security.Cryptography.X509Certificates/X509SubjectKeyIdentifierExtension.cs +System.Security.Cryptography.X509Certificates/X509SubjectKeyIdentifierHashAlgorithm.cs +System.Security.Cryptography.X509Certificates/X509VerificationFlags.cs +System.Security.Permissions/PermissionHelper.cs +System.Security.Permissions/ResourcePermissionBase.cs +System.Security.Permissions/ResourcePermissionBaseEntry.cs +System.Security.Permissions/StorePermissionAttribute.cs +System.Security.Permissions/StorePermission.cs +System.Security.Permissions/StorePermissionFlags.cs +System/SRDescriptionAttribute.cs +System.Threading/Semaphore.cs +System.Threading/SemaphoreFullException.cs +System.Threading/ThreadExceptionEventArgs.cs +System.Threading/ThreadExceptionEventHandler.cs +System.Threading/Barrier.cs +System.Threading/BarrierPostPhaseException.cs +System.Timers/ElapsedEventArgs.cs +System.Timers/ElapsedEventHandler.cs +System.Timers/Timer.cs +System.Timers/TimersDescriptionAttribute.cs +System/UriBuilder.cs +System/UriComponents.cs +System/Uri.cs +System/UriFormat.cs +System/UriFormatException.cs +System/UriHostNameType.cs +System/UriHelper.cs +System/UriIdnScope.cs +System/UriKind.cs +System/UriParser.cs +System/UriPartial.cs +System/UriTypeConverter.cs +System/UriElements.cs +System/UriParseComponents.cs +System.Web/AspNetHostingPermissionAttribute.cs +System.Web/AspNetHostingPermission.cs +System.Web/AspNetHostingPermissionLevel.cs +System.ComponentModel/ProgressChangedEventHandler.cs +System.ComponentModel/ProgressChangedEventArgs.cs +System.Net/UploadDataCompletedEventArgs.cs +System.Net/UploadFileCompletedEventArgs.cs +System.Net/UploadFileCompletedEventHandler.cs +System.Net/UploadProgressChangedEventHandler.cs +System.Net/OpenReadCompletedEventHandler.cs +System.Net/DownloadDataCompletedEventHandler.cs +System.Net/DownloadProgressChangedEventHandler.cs +System.Net/OpenReadCompletedEventArgs.cs +System.Net/DownloadStringCompletedEventArgs.cs +System.Net/DownloadDataCompletedEventArgs.cs +System.Net/DownloadProgressChangedEventArgs.cs +System.Net/UploadStringCompletedEventArgs.cs +System.Net/OpenWriteCompletedEventArgs.cs +System.Net/UploadProgressChangedEventArgs.cs +System.Net/OpenWriteCompletedEventHandler.cs +System.Net/UploadDataCompletedEventHandler.cs +System.Net/UploadValuesCompletedEventArgs.cs +System.Net/UploadValuesCompletedEventHandler.cs +System.Net/UploadStringCompletedEventHandler.cs +System.Net/DownloadStringCompletedEventHandler.cs +System.Runtime.InteropServices/DefaultParameterValueAttribute.cs +System.Runtime.InteropServices/HandleCollector.cs +System.Runtime.InteropServices/StandardOleMarshalObject.cs +System.Runtime.InteropServices.ComTypes/ADVF.cs +System.Runtime.InteropServices.ComTypes/DATADIR.cs +System.Runtime.InteropServices.ComTypes/DVASPECT.cs +System.Runtime.InteropServices.ComTypes/FORMATETC.cs +System.Runtime.InteropServices.ComTypes/IAdviseSink.cs +System.Runtime.InteropServices.ComTypes/IDataObject.cs +System.Runtime.InteropServices.ComTypes/IEnumFORMATETC.cs +System.Runtime.InteropServices.ComTypes/IEnumSTATDATA.cs +System.Runtime.InteropServices.ComTypes/STATDATA.cs +System.Runtime.InteropServices.ComTypes/STGMEDIUM.cs +System.Runtime.InteropServices.ComTypes/TYMED.cs +System/IUriData.cs +System/UriData.cs +Mono.Net.Dns/DnsClass.cs +Mono.Net.Dns/DnsHeader.cs +Mono.Net.Dns/DnsOpCode.cs +Mono.Net.Dns/DnsPacket.cs +Mono.Net.Dns/DnsQClass.cs +Mono.Net.Dns/DnsQType.cs +Mono.Net.Dns/DnsQuery.cs +Mono.Net.Dns/DnsQuestion.cs +Mono.Net.Dns/DnsRCode.cs +Mono.Net.Dns/DnsResourceRecordA.cs +Mono.Net.Dns/DnsResourceRecordAAAA.cs +Mono.Net.Dns/DnsResourceRecordCName.cs +Mono.Net.Dns/DnsResourceRecord.cs +Mono.Net.Dns/DnsResourceRecordIPAddress.cs +Mono.Net.Dns/DnsResourceRecordPTR.cs +Mono.Net.Dns/DnsResponse.cs +Mono.Net.Dns/DnsType.cs +Mono.Net.Dns/DnsUtil.cs +Mono.Net.Dns/ResolverAsyncOperation.cs +Mono.Net.Dns/SimpleResolver.cs +Mono.Net.Dns/ResolverError.cs +Mono.Net.Dns/SimpleResolverEventArgs.cs +System.Net/DnsAsyncResult.cs +System.Windows.Input/ICommand.cs + +../../../external/referencesource/System/regex/system/text/regularexpressions/Regex.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexBoyerMoore.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexCapture.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexCaptureCollection.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexCharClass.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexCode.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexCompilationInfo.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexCompiler.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexFCD.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexGroup.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexGroupCollection.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexInterpreter.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexMatch.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexMatchCollection.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexMatchTimeoutException.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexNode.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexOptions.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexParser.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexReplacement.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexRunner.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexRunnerFactory.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexTree.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexWriter.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/compiledregexrunner.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/compiledregexrunnerfactory.cs \ No newline at end of file diff --git a/mcs/class/System/mobile_System.dll.sources b/mcs/class/System/mobile_System.dll.sources index 6a014b9133a..8420dab5155 100644 --- a/mcs/class/System/mobile_System.dll.sources +++ b/mcs/class/System/mobile_System.dll.sources @@ -1,4 +1,6 @@ Assembly/AssemblyInfo.cs +SR.cs +../../build/common/SR.cs Mono.Http/NtlmClient.cs System.CodeDom.Compiler/GeneratedCodeAttribute.cs System.CodeDom.Compiler/IndentedTextWriter.cs @@ -11,8 +13,6 @@ System.Collections.Generic/SortedDictionary.cs System.Collections.Generic/SortedList.cs System.Collections.Generic/SortedSet.cs System.Collections.Generic/Stack.cs -System.Collections.Concurrent/BlockingCollection.cs -System.Collections.Concurrent/ConcurrentBag.cs System.Collections.ObjectModel/ObservableCollection.cs System.Collections.ObjectModel/ReadOnlyObservableCollection.cs System.Collections.Specialized/BitVector32.cs @@ -630,31 +630,6 @@ System.Security.Cryptography/AsnEncodedDataEnumerator.cs System.Security.Cryptography/Oid.cs System.Security.Cryptography/OidCollection.cs System.Security.Cryptography/OidEnumerator.cs -System.Text.RegularExpressions/BaseMachine.cs -System.Text.RegularExpressions/Capture.cs -System.Text.RegularExpressions/CaptureCollection.cs -System.Text.RegularExpressions/Group.cs -System.Text.RegularExpressions/GroupCollection.cs -System.Text.RegularExpressions/Match.cs -System.Text.RegularExpressions/MatchCollection.cs -System.Text.RegularExpressions/MatchEvaluator.cs -System.Text.RegularExpressions/Regex.cs -System.Text.RegularExpressions/RegexCompilationInfo.cs -System.Text.RegularExpressions/RegexMatchTimeoutException.cs -System.Text.RegularExpressions/RegexOptions.cs -System.Text.RegularExpressions/RxInterpreter.cs -System.Text.RegularExpressions/RxOp.cs -System.Text.RegularExpressions/arch.cs -System.Text.RegularExpressions/cache.cs -System.Text.RegularExpressions/category.cs -System.Text.RegularExpressions/compiler.cs -System.Text.RegularExpressions/debug.cs -System.Text.RegularExpressions/interpreter.cs -System.Text.RegularExpressions/interval.cs -System.Text.RegularExpressions/parser.cs -System.Text.RegularExpressions/quicksearch.cs -System.Text.RegularExpressions/replace.cs -System.Text.RegularExpressions/syntax.cs System.Threading/Barrier.cs System.Threading/BarrierPostPhaseException.cs System.Threading/Semaphore.cs @@ -693,3 +668,32 @@ System/UriParseComponents.cs System.Runtime.InteropServices/DefaultParameterValueAttribute.cs System.Runtime.InteropServices/HandleCollector.cs System.Windows.Input/ICommand.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/Regex.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexBoyerMoore.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexCapture.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexCaptureCollection.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexCharClass.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexCode.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexCompilationInfo.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexCompiler.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexFCD.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexGroup.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexGroupCollection.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexInterpreter.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexMatch.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexMatchCollection.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexMatchTimeoutException.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexNode.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexOptions.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexParser.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexReplacement.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexRunner.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexRunnerFactory.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexTree.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/RegexWriter.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/compiledregexrunner.cs +../../../external/referencesource/System/regex/system/text/regularexpressions/compiledregexrunnerfactory.cs + +../../../external/referencesource/System/sys/system/collections/concurrent/BlockingCollection.cs +../../../external/referencesource/System/sys/system/collections/concurrent/ConcurrentBag.cs + diff --git a/mcs/class/SystemWebTestShim/SystemWebTestShim-net_2_0.csproj b/mcs/class/SystemWebTestShim/SystemWebTestShim-net_2_0.csproj deleted file mode 100644 index caf855dac7d..00000000000 --- a/mcs/class/SystemWebTestShim/SystemWebTestShim-net_2_0.csproj +++ /dev/null @@ -1,90 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {328B62A2-55C4-420A-81C1-AEAB15A8F3A6} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - - Properties - - - SystemWebTestShim - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {B8F7FDF0-07C7-4AFC-9854-F591BF307939} - System.Web\System.Web-net_2_0-1 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - - - - - diff --git a/mcs/class/WindowsBase/WindowsBase-net_2_0.csproj b/mcs/class/WindowsBase/WindowsBase-net_2_0.csproj deleted file mode 100644 index f945753e57f..00000000000 --- a/mcs/class/WindowsBase/WindowsBase-net_2_0.csproj +++ /dev/null @@ -1,282 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {65F08514-3634-45C8-8EEB-6BAEA2EDC0C8} - Library - 1699 - ./../../class/lib/net_2_0 - True - True - true - Properties - - - WindowsBase - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0;NET_3_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0;NET_3_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - - - - - diff --git a/mcs/class/WindowsBase/WindowsBase-tests-net_2_0.csproj b/mcs/class/WindowsBase/WindowsBase-tests-net_2_0.csproj deleted file mode 100644 index cb8751ff138..00000000000 --- a/mcs/class/WindowsBase/WindowsBase-tests-net_2_0.csproj +++ /dev/null @@ -1,141 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {0003181A-51C0-4874-A5CC-1C556517DF57} - Library - 1699 - bin\Debug\WindowsBase-tests-net_2_0 - True - False - true - Properties - - - WindowsBase_test_net_2_0 - v2.0 - 512 - - - true - full - 1699 - false - DEBUG;TRACE;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 1699 - true - NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {65F08514-3634-45C8-8EEB-6BAEA2EDC0C8} - WindowsBase\WindowsBase-net_2_0 - - - {65F08514-3634-45C8-8EEB-6BAEA2EDC0C8} - WindowsBase\WindowsBase-net_2_0 - - - {1F3B168C-A4D0-44AA-B116-792D8804971F} - System\System-net_2_0-2 - - - {080698DE-8AF0-496E-9AD7-58B6C605328A} - System.XML\System.Xml-net_2_0-1 - - - {FBEC45AD-4493-41EA-9BCC-F3F29A08EB9E} - System.Core\System.Core-net_2_0 - - - - - - - diff --git a/mcs/class/corlib/Makefile b/mcs/class/corlib/Makefile index b9a11912d07..a3853a5a37b 100644 --- a/mcs/class/corlib/Makefile +++ b/mcs/class/corlib/Makefile @@ -36,7 +36,8 @@ RESOURCE_FILES = \ resources/collation.cjkKO.bin \ resources/collation.cjkKOlv2.bin -LOCAL_MCS_FLAGS = -unsafe -nostdlib -nowarn:612,618 -d:INSIDE_CORLIB -d:LIBC +REFERENCE_SOURCES_FLAGS = -d:FEATURE_PAL +LOCAL_MCS_FLAGS = -unsafe -nostdlib -nowarn:612,618 -d:INSIDE_CORLIB -d:LIBC $(REFERENCE_SOURCES_FLAGS) DEFAULT_REFERENCES = # System.IO/DirectoryInfoTest.cs needs Mono.Posix diff --git a/mcs/class/corlib/ReferenceSources/Array.cs b/mcs/class/corlib/ReferenceSources/Array.cs new file mode 100644 index 00000000000..2d101642b7b --- /dev/null +++ b/mcs/class/corlib/ReferenceSources/Array.cs @@ -0,0 +1,7 @@ +namespace System +{ + static class Array_ReferenceSources + { + internal const int MaxArrayLength = 0X7FEFFFFF; + } +} \ No newline at end of file diff --git a/mcs/class/corlib/ReferenceSources/Environment.cs b/mcs/class/corlib/ReferenceSources/Environment.cs new file mode 100644 index 00000000000..5377cfe5bac --- /dev/null +++ b/mcs/class/corlib/ReferenceSources/Environment.cs @@ -0,0 +1,22 @@ +using System.Globalization; + +namespace System +{ + partial class Environment + { + internal static string GetResourceString (string key) + { + return key; + } + + internal static string GetResourceString (string key, CultureInfo culture) + { + return key; + } + + internal static string GetResourceString (string key, params object[] values) + { + return string.Format (CultureInfo.InvariantCulture, key, values); + } + } +} \ No newline at end of file diff --git a/mcs/class/corlib/ReferenceSources/ExecutionContext.cs b/mcs/class/corlib/ReferenceSources/ExecutionContext.cs new file mode 100644 index 00000000000..8094feca738 --- /dev/null +++ b/mcs/class/corlib/ReferenceSources/ExecutionContext.cs @@ -0,0 +1,32 @@ +namespace System.Threading +{ + partial class ExecutionContext + { + internal static ExecutionContext Capture (ref StackCrawlMark stackMark, CaptureOptions options) + { + // For References sources compatibility only + return null; + } + + [Flags] + internal enum CaptureOptions + { + None = 0x00, + + IgnoreSyncCtx = 0x01, //Don't flow SynchronizationContext + + OptimizeDefaultCase = 0x02, //Faster in the typical case, but can't show the result to users + // because they could modify the shared default EC. + // Use this only if you won't be exposing the captured EC to users. + } + } + + [Serializable] + internal enum StackCrawlMark + { + LookForMe = 0, + LookForMyCaller = 1, + LookForMyCallersCaller = 2, + LookForThread = 3 + } +} \ No newline at end of file diff --git a/mcs/class/corlib/ReferenceSources/Helpers.cs b/mcs/class/corlib/ReferenceSources/Helpers.cs new file mode 100644 index 00000000000..e2fe31efeb9 --- /dev/null +++ b/mcs/class/corlib/ReferenceSources/Helpers.cs @@ -0,0 +1,10 @@ +namespace System.Collections +{ + static class HashHelpers + { + public static object GetEqualityComparerForSerialization (object comparer) + { + return comparer; + } + } +} \ No newline at end of file diff --git a/mcs/class/corlib/System.Collections.Generic/List.cs b/mcs/class/corlib/System.Collections.Generic/List.cs index 7f647f38216..8f326784730 100644 --- a/mcs/class/corlib/System.Collections.Generic/List.cs +++ b/mcs/class/corlib/System.Collections.Generic/List.cs @@ -371,12 +371,18 @@ namespace System.Collections.Generic { return Array.GetLastIndex (_items, startIndex - count + 1, count, match); } - public void ForEach (Action action) + public void ForEach (Action action) { if (action == null) throw new ArgumentNullException ("action"); - for(int i=0; i < _size; i++) - action(_items[i]); + + var version =_version; + for (int i = 0; i < _size; i++) { + if (_version != version) + throw Enumerator.GetModifiedCollectionException (); + + action (_items [i]); + } } public Enumerator GetEnumerator () @@ -812,7 +818,7 @@ namespace System.Collections.Generic { } if (ver != l._version) - throw new InvalidOperationException ("Collection was modified; enumeration operation may not execute."); + throw GetModifiedCollectionException (); next = -1; return false; @@ -825,7 +831,7 @@ namespace System.Collections.Generic { void IEnumerator.Reset () { if (ver != l._version) - throw new InvalidOperationException ("Collection was modified; enumeration operation may not execute."); + throw GetModifiedCollectionException (); next = 0; current = default (T); @@ -834,13 +840,18 @@ namespace System.Collections.Generic { object IEnumerator.Current { get { if (ver != l._version) - throw new InvalidOperationException ("Collection was modified; enumeration operation may not execute."); + throw GetModifiedCollectionException (); if (next <= 0) throw new InvalidOperationException (); return current; } } + + internal static InvalidOperationException GetModifiedCollectionException () + { + return new InvalidOperationException ("Collection was modified; enumeration operation may not execute."); + } } } } diff --git a/mcs/class/corlib/System.Runtime.CompilerServices/AsyncTaskMethodBuilder.cs b/mcs/class/corlib/System.Runtime.CompilerServices/AsyncTaskMethodBuilder.cs index cdb7a33db19..edb30d3a480 100644 --- a/mcs/class/corlib/System.Runtime.CompilerServices/AsyncTaskMethodBuilder.cs +++ b/mcs/class/corlib/System.Runtime.CompilerServices/AsyncTaskMethodBuilder.cs @@ -104,7 +104,17 @@ namespace System.Runtime.CompilerServices if (stateMachine == null) throw new ArgumentNullException ("stateMachine"); - stateMachine.MoveNext (); + var thread = Thread.CurrentThread; + var prev = default (ExecutionContext.Switcher); + try { + thread.BranchExecutionContext (out prev); + stateMachine.MoveNext (); + } finally { + // + // Any changes to ExecutionContext within MoveNext scope cannot leak out + // + thread.RestoreExecutionContext (ref prev); + } } } } diff --git a/mcs/class/corlib/System.Runtime.CompilerServices/AsyncTaskMethodBuilder_T.cs b/mcs/class/corlib/System.Runtime.CompilerServices/AsyncTaskMethodBuilder_T.cs index 9d539dfc42d..73b0d128107 100644 --- a/mcs/class/corlib/System.Runtime.CompilerServices/AsyncTaskMethodBuilder_T.cs +++ b/mcs/class/corlib/System.Runtime.CompilerServices/AsyncTaskMethodBuilder_T.cs @@ -104,7 +104,17 @@ namespace System.Runtime.CompilerServices if (stateMachine == null) throw new ArgumentNullException ("stateMachine"); - stateMachine.MoveNext (); + var thread = Thread.CurrentThread; + var prev = default (ExecutionContext.Switcher); + try { + thread.BranchExecutionContext (out prev); + stateMachine.MoveNext (); + } finally { + // + // Any changes to ExecutionContext within MoveNext scope cannot leak out + // + thread.RestoreExecutionContext (ref prev); + } } } } diff --git a/mcs/class/corlib/System.Runtime.Remoting.Messaging/CallContext.cs b/mcs/class/corlib/System.Runtime.Remoting.Messaging/CallContext.cs index 8fe846c632e..a4f55e5d82d 100644 --- a/mcs/class/corlib/System.Runtime.Remoting.Messaging/CallContext.cs +++ b/mcs/class/corlib/System.Runtime.Remoting.Messaging/CallContext.cs @@ -71,8 +71,9 @@ namespace System.Runtime.Remoting.Messaging if (data is ILogicalThreadAffinative) { LogicalSetData (name, data); } else { - LogicalContext.FreeNamedDataSlot (name); - Datastore [name] = data; + var ec = ExecutionContext.GetCurrentWritable (); + ec.LogicalCallContext.FreeNamedDataSlot (name); + ec.DataStore [name] = data; } } @@ -83,8 +84,9 @@ namespace System.Runtime.Remoting.Messaging public static void LogicalSetData (string name, object data) { - Datastore.Remove (name); - LogicalContext.SetData (name, data); + var ec = ExecutionContext.GetCurrentWritable (); + ec.DataStore.Remove (name); + ec.LogicalCallContext.SetData (name, data); } public static Header[] GetHeaders () diff --git a/mcs/class/corlib/System.Threading.Tasks/CyclicDeque.cs b/mcs/class/corlib/System.Threading.Tasks/CyclicDeque.cs index d0b723d285e..7c471baf7c0 100644 --- a/mcs/class/corlib/System.Threading.Tasks/CyclicDeque.cs +++ b/mcs/class/corlib/System.Threading.Tasks/CyclicDeque.cs @@ -55,7 +55,7 @@ namespace System.Threading.Tasks // Take care of growing var size = b - top - upperBound; - if (size > a.Size) { + if (size >= a.Size) { upperBound = top; a = a.Grow (b, upperBound); array = a; diff --git a/mcs/class/corlib/System.Threading.Tasks/Parallel.cs b/mcs/class/corlib/System.Threading.Tasks/Parallel.cs index d62df9a7e68..392458680e1 100644 --- a/mcs/class/corlib/System.Threading.Tasks/Parallel.cs +++ b/mcs/class/corlib/System.Threading.Tasks/Parallel.cs @@ -448,7 +448,7 @@ namespace System.Threading.Tasks return ForEach (Partitioner.Create (source), ParallelOptions.Default, () => null, - (e, s, l) => { body (e, s, -1); return null; }, + (e, s, i, l) => { body (e, s, i); return null; }, _ => {}); } diff --git a/mcs/class/corlib/System.Threading.Tasks/Task.cs b/mcs/class/corlib/System.Threading.Tasks/Task.cs index 4f4abd33e9c..7ca9a591a0c 100644 --- a/mcs/class/corlib/System.Threading.Tasks/Task.cs +++ b/mcs/class/corlib/System.Threading.Tasks/Task.cs @@ -486,9 +486,7 @@ namespace System.Threading.Tasks } if (cancellation) { - ExceptionSlot.Exception = aggregate; - Thread.MemoryBarrier (); - + ExceptionSlot.SetException (aggregate); CancelReal (); } else { HandleGenericException (aggregate); @@ -619,12 +617,15 @@ namespace System.Threading.Tasks if (exSlot == null || exSlot.ChildExceptions == null) return; - if (ExceptionSlot.Exception == null) - exSlot.Exception = new AggregateException (); + var exceptions = new List (); + if (exSlot.Exception != null) + exceptions.AddRange (exSlot.Exception.InnerExceptions); AggregateException childEx; while (exSlot.ChildExceptions.TryDequeue (out childEx)) - exSlot.Exception.AddChildException (childEx); + exceptions.Add (childEx); + + exSlot.SetException (new AggregateException (exceptions)); if (isParent) { Status = TaskStatus.Faulted; @@ -655,7 +656,7 @@ namespace System.Threading.Tasks void HandleGenericException (AggregateException e) { - ExceptionSlot.Exception = e; + ExceptionSlot.SetException (e); Thread.MemoryBarrier (); Status = TaskStatus.Faulted; diff --git a/mcs/class/corlib/System.Threading.Tasks/TaskContinuation.cs b/mcs/class/corlib/System.Threading.Tasks/TaskContinuation.cs index 8ede25eebe4..16869c5f834 100644 --- a/mcs/class/corlib/System.Threading.Tasks/TaskContinuation.cs +++ b/mcs/class/corlib/System.Threading.Tasks/TaskContinuation.cs @@ -113,10 +113,16 @@ namespace System.Threading.Tasks class AwaiterActionContinuation : IContinuation { readonly Action action; + readonly ExecutionContext ec; public AwaiterActionContinuation (Action action) { this.action = action; + + // Capture execution context because the continuation can be inlined + // and we still need to run in original exection context regardless + // of UnsafeOnCompleted/OnCompleted entry + ec = ExecutionContext.Capture (false, true); } public void Execute () @@ -126,7 +132,10 @@ namespace System.Threading.Tasks // because the context where the awaiter task is set to completed can be anywhere (due to TaskCompletionSource) // if ((SynchronizationContext.Current == null || SynchronizationContext.Current.GetType () == typeof (SynchronizationContext)) && TaskScheduler.IsDefault) { - action (); + if (ec != null) + ExecutionContext.Run (ec, l => ((Action)l) (), action); + else + action (); } else { ThreadPool.UnsafeQueueUserWorkItem (l => ((Action) l) (), action); } @@ -389,4 +398,4 @@ namespace System.Threading.Tasks } } -#endif +#endif \ No newline at end of file diff --git a/mcs/class/corlib/System.Threading.Tasks/TaskExceptionSlot.cs b/mcs/class/corlib/System.Threading.Tasks/TaskExceptionSlot.cs index a2ef5655361..c20fbdafd38 100644 --- a/mcs/class/corlib/System.Threading.Tasks/TaskExceptionSlot.cs +++ b/mcs/class/corlib/System.Threading.Tasks/TaskExceptionSlot.cs @@ -32,22 +32,46 @@ using System; using System.Collections.Concurrent; +using System.Runtime.ExceptionServices; namespace System.Threading.Tasks { internal class TaskExceptionSlot { - public volatile AggregateException Exception; public volatile bool Observed; public ConcurrentQueue ChildExceptions; - Task parent; + volatile AggregateException exception; +#if NET_4_5 + volatile ExceptionDispatchInfo dispatchInfo; +#endif + readonly Task parent; public TaskExceptionSlot (Task parent) { this.parent = parent; } + public AggregateException Exception { + get { + return exception; + } + } + + public void SetException (AggregateException exception) + { +#if NET_4_5 + if (dispatchInfo == null) { + // + // Used by task awaiter to rethrow an exception with original call stack, it's + // needed for first exception only + // + dispatchInfo = ExceptionDispatchInfo.Capture (exception.InnerException); + } +#endif + this.exception = exception; + } + ~TaskExceptionSlot () { if (Exception != null && !Observed && !TaskScheduler.FireUnobservedEvent (parent, Exception).Observed) { diff --git a/mcs/class/corlib/System.Threading/ExecutionContext.cs b/mcs/class/corlib/System.Threading/ExecutionContext.cs index 787d8394eee..f312223e02e 100644 --- a/mcs/class/corlib/System.Threading/ExecutionContext.cs +++ b/mcs/class/corlib/System.Threading/ExecutionContext.cs @@ -38,11 +38,46 @@ using System.Collections.Generic; namespace System.Threading { [Serializable] - public sealed class ExecutionContext : ISerializable + public sealed partial class ExecutionContext : ISerializable #if NET_4_0 - , IDisposable + , IDisposable #endif { + internal struct Switcher + { + readonly ExecutionContext ec; + readonly LogicalCallContext _lcc; + readonly bool _suppressFlow; + readonly bool _capture; + readonly Dictionary local_data; + readonly bool copy_on_write; + + public Switcher (ExecutionContext ec) + { + this.ec = ec; + this._lcc = ec._lcc; + this._suppressFlow = ec._suppressFlow; + this._capture = ec._capture; + this.local_data = ec.local_data; + this.copy_on_write = ec.CopyOnWrite; + } + + public bool IsEmpty { + get { + return ec == null; + } + } + + public void Restore (ExecutionContext ec) + { + ec._lcc = this._lcc; + ec._suppressFlow = this._suppressFlow; + ec._capture = this._capture; + ec.local_data = this.local_data; + ec.CopyOnWrite = this.copy_on_write; + } + } + #if !MOBILE private SecurityContext _sc; #endif @@ -57,15 +92,20 @@ namespace System.Threading { private ExecutionContext (ExecutionContext ec) { + CloneData (ec); + + _suppressFlow = ec._suppressFlow; + _capture = true; + } + + void CloneData (ExecutionContext ec) + { #if !MOBILE if (ec._sc != null) _sc = new SecurityContext (ec._sc); #endif if (ec._lcc != null) _lcc = (LogicalCallContext) ec._lcc.Clone (); - - _suppressFlow = ec._suppressFlow; - _capture = true; } [MonoTODO] @@ -81,7 +121,11 @@ namespace System.Threading { internal static ExecutionContext Capture (bool captureSyncContext, bool nullOnEmpty) { - ExecutionContext ec = Current; + var thread = Thread.CurrentThread; + if (nullOnEmpty && !thread.HasExecutionContext) + return null; + + var ec = thread.ExecutionContext; if (ec.FlowSuppressed) return null; @@ -167,6 +211,8 @@ namespace System.Threading { set { _suppressFlow = value; } } + internal bool CopyOnWrite { get; set; } + public static bool IsFlowSuppressed () { return Current.FlowSuppressed; @@ -232,5 +278,16 @@ namespace System.Threading { return Thread.CurrentThread.ExecutionContext; } } + + internal static ExecutionContext GetCurrentWritable () + { + var current = Thread.CurrentThread.ExecutionContext; + if (current.CopyOnWrite) { + current.CopyOnWrite = false; + current.CloneData (current); + } + + return current; + } } -} \ No newline at end of file +} diff --git a/mcs/class/corlib/System.Threading/ExecutionContextSwitcher.cs b/mcs/class/corlib/System.Threading/ExecutionContextSwitcher.cs deleted file mode 100644 index 176a01315af..00000000000 --- a/mcs/class/corlib/System.Threading/ExecutionContextSwitcher.cs +++ /dev/null @@ -1,78 +0,0 @@ -// -// System.Threading.ExecutionContextSwitcher.cs -// -// Author: -// Lluis Sanchez (lluis@novell.com) -// -// Copyright (C) Novell, Inc., 2004 -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -using System.Runtime.ConstrainedExecution; -using System.Runtime.InteropServices; - -namespace System.Threading -{ - [ComVisible (false)] - public struct ExecutionContextSwitcher : IDisposable - { - [MonoTODO] - public override bool Equals (object ob) - { - throw new NotImplementedException (); - } - - [MonoTODO] - public override int GetHashCode () - { - throw new NotImplementedException (); - } - - [MonoTODO] - public static bool operator == (ExecutionContextSwitcher c1, ExecutionContextSwitcher c2) - { - throw new NotImplementedException (); - } - - [MonoTODO] - public static bool operator != (ExecutionContextSwitcher c1, ExecutionContextSwitcher c2) - { - throw new NotImplementedException (); - } - - [MonoTODO] - [ReliabilityContract (Consistency.WillNotCorruptState, Cer.MayFail)] - public void Undo () - { - throw new NotImplementedException (); - } - - [MonoTODO] - void IDisposable.Dispose() - { - throw new NotImplementedException (); - } - } -} - diff --git a/mcs/class/corlib/System.Threading/Monitor.cs b/mcs/class/corlib/System.Threading/Monitor.cs index d6a289e76b5..8b2d4dca9cd 100644 --- a/mcs/class/corlib/System.Threading/Monitor.cs +++ b/mcs/class/corlib/System.Threading/Monitor.cs @@ -226,14 +226,17 @@ namespace System.Threading #endif -#if NET_4_5 [MethodImplAttribute(MethodImplOptions.InternalCall)] extern static bool Monitor_test_owner (object obj); - - public static bool IsEntered (object obj) + +#if NET_4_5 + public +#else + internal +#endif + static bool IsEntered (object obj) { return Monitor_test_owner(obj); } -#endif } } diff --git a/mcs/class/corlib/System.Threading/Thread.cs b/mcs/class/corlib/System.Threading/Thread.cs index a52d8d12585..985c8613d8a 100644 --- a/mcs/class/corlib/System.Threading/Thread.cs +++ b/mcs/class/corlib/System.Threading/Thread.cs @@ -869,6 +869,32 @@ namespace System.Threading { } } + internal bool HasExecutionContext { + get { + return _ec != null; + } + } + + internal void BranchExecutionContext (out ExecutionContext.Switcher switcher) + { + if (_ec == null) { + switcher = new ExecutionContext.Switcher (); + } else { + switcher = new ExecutionContext.Switcher (_ec); + _ec.CopyOnWrite = true; + } + } + + internal void RestoreExecutionContext (ref ExecutionContext.Switcher switcher) + { + if (switcher.IsEmpty) { + _ec = null; + return; + } + + switcher.Restore (_ec); + } + public int ManagedThreadId { [ReliabilityContractAttribute (Consistency.WillNotCorruptState, Cer.Success)] get { diff --git a/mcs/class/corlib/System.Threading/Timeout.cs b/mcs/class/corlib/System.Threading/Timeout.cs index 66f661b2ee3..8cca9840e53 100644 --- a/mcs/class/corlib/System.Threading/Timeout.cs +++ b/mcs/class/corlib/System.Threading/Timeout.cs @@ -38,8 +38,6 @@ namespace System.Threading { { public const int Infinite = -1; -#if NET_4_5 public static readonly TimeSpan InfiniteTimeSpan = new TimeSpan (0, 0, 0, 0, -1); -#endif } } diff --git a/mcs/class/corlib/System.Threading/Volatile.cs b/mcs/class/corlib/System.Threading/Volatile.cs index 92646ceee50..6460f728492 100644 --- a/mcs/class/corlib/System.Threading/Volatile.cs +++ b/mcs/class/corlib/System.Threading/Volatile.cs @@ -24,14 +24,15 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -#if NET_4_5 - using System.Runtime.ConstrainedExecution; using System.Runtime.CompilerServices; namespace System.Threading { - public static class Volatile +#if NET_4_5 + public +#endif + static class Volatile { [MethodImplAttribute (MethodImplOptions.InternalCall)] [ReliabilityContract (Consistency.WillNotCorruptState, Cer.Success)] @@ -156,5 +157,3 @@ namespace System.Threading public extern static void Write(ref T location, T value) where T : class; } } - -#endif diff --git a/mcs/class/corlib/System/AggregateException.cs b/mcs/class/corlib/System/AggregateException.cs index 769ba549db1..ec99bc190cf 100644 --- a/mcs/class/corlib/System/AggregateException.cs +++ b/mcs/class/corlib/System/AggregateException.cs @@ -126,16 +126,6 @@ namespace System } } - internal void AddChildException (AggregateException childEx) - { - if (innerExceptions == null) - innerExceptions = new List (); - if (childEx == null) - return; - - innerExceptions.Add (childEx); - } - public override string ToString () { System.Text.StringBuilder finalMessage = new System.Text.StringBuilder (base.ToString ()); diff --git a/mcs/class/corlib/Test/System.Collections.Generic/ListTest.cs b/mcs/class/corlib/Test/System.Collections.Generic/ListTest.cs index 0dc4231858d..3ff8c32cc45 100644 --- a/mcs/class/corlib/Test/System.Collections.Generic/ListTest.cs +++ b/mcs/class/corlib/Test/System.Collections.Generic/ListTest.cs @@ -623,6 +623,16 @@ namespace MonoTests.System.Collections.Generic { Assert.AreEqual (418, i); } + [Test] + public void ForEach_Modified () + { + try { + _list1.ForEach (l => _list1.Add (0)); + Assert.Fail (); + } catch (InvalidOperationException) { + } + } + [Test] public void FindLastIndexTest () { diff --git a/mcs/class/corlib/Test/System.Reflection.Emit/DynamicMethodTest.cs b/mcs/class/corlib/Test/System.Reflection.Emit/DynamicMethodTest.cs index f65ac28ef5e..4aecf73b87e 100644 --- a/mcs/class/corlib/Test/System.Reflection.Emit/DynamicMethodTest.cs +++ b/mcs/class/corlib/Test/System.Reflection.Emit/DynamicMethodTest.cs @@ -11,6 +11,7 @@ using System; using System.Reflection; using System.Reflection.Emit; +using System.Runtime.InteropServices; using System.Text; using NUnit.Framework; @@ -452,6 +453,62 @@ namespace MonoTests.System.Reflection.Emit Assert.AreEqual (dm.Name, res.Name, "#1"); } + + [StructLayout (LayoutKind.Explicit)] + struct SizeOfTarget { + [FieldOffset (0)] public int X; + [FieldOffset (4)] public int Y; + } + + [Test] + public void SizeOf () + { + var method = new DynamicMethod ("", typeof (int), Type.EmptyTypes); + var il = method.GetILGenerator (); + il.Emit (OpCodes.Sizeof, typeof (SizeOfTarget)); + il.Emit (OpCodes.Ret); + + var func = (Func) method.CreateDelegate (typeof (Func)); + var point_size = func (); + + Assert.AreEqual (8, point_size); + } + + class TypedRefTarget { + public string Name; + } + + [Test] + public void TypedRef () + { + var method = new DynamicMethod ("", typeof (TypedRefTarget), new [] {typeof (TypedRefTarget)}, true); + var il = method.GetILGenerator (); + var tr = il.DeclareLocal (typeof (TypedReference)); + + il.Emit (OpCodes.Ldarga, 0); + il.Emit (OpCodes.Mkrefany, typeof (TypedRefTarget)); + il.Emit (OpCodes.Stloc, tr); + + il.Emit (OpCodes.Ldloc, tr); + il.Emit (OpCodes.Call, GetType ().GetMethod ("AssertTypedRef", BindingFlags.NonPublic | BindingFlags.Static)); + + il.Emit (OpCodes.Ldloc, tr); + il.Emit (OpCodes.Refanyval, typeof (TypedRefTarget)); + il.Emit (OpCodes.Ldobj, typeof (TypedRefTarget)); + il.Emit (OpCodes.Ret); + + var f = (Func) method.CreateDelegate (typeof (Func)); + + var target = new TypedRefTarget { Name = "Foo" }; + var rt = f (target); + + Assert.AreEqual (target, rt); + } + + private static void AssertTypedRef (TypedReference tr) + { + Assert.AreEqual (typeof (TypedRefTarget), TypedReference.GetTargetType (tr)); + } } } diff --git a/mcs/class/corlib/Test/System.Runtime.CompilerServices/AsyncTaskMethodBuilderTest.cs b/mcs/class/corlib/Test/System.Runtime.CompilerServices/AsyncTaskMethodBuilderTest.cs new file mode 100644 index 00000000000..2a6165aff57 --- /dev/null +++ b/mcs/class/corlib/Test/System.Runtime.CompilerServices/AsyncTaskMethodBuilderTest.cs @@ -0,0 +1,66 @@ +// +// AsyncTaskMethodBuilderTest.cs +// +// Authors: +// Marek Safar +// +// Copyright (C) 2014 Xamarin, Inc (http://www.xamarin.com) +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +#if NET_4_5 + +using System; +using System.Threading; +using System.Threading.Tasks; +using NUnit.Framework; +using System.Runtime.CompilerServices; +using System.Runtime.Remoting.Messaging; + +namespace MonoTests.System.Runtime.CompilerServices +{ + [TestFixture] + public class AsyncTaskMethodBuilderTest + { + [Test] + public void CallContextFlow () + { + CallContext.LogicalSetData ("name0", "0"); + + Task.WhenAll (Work ("A"), Work ("B")).Wait (); + Assert.IsNull (CallContext.LogicalGetData ("A"), "#A"); + Assert.IsNull (CallContext.LogicalGetData ("B"), "#B"); + } + + static async Task Work (string name) + { + Assert.AreEqual ("0", CallContext.LogicalGetData ("name0"), "#1" + name); + CallContext.LogicalSetData ("name", name); + + await Task.Delay (10); + + var found = CallContext.LogicalGetData ("name"); + Assert.AreEqual (name, found, "#2" + name); + } + } +} + +#endif \ No newline at end of file diff --git a/mcs/class/corlib/Test/System.Runtime.CompilerServices/TaskAwaiterTest_T.cs b/mcs/class/corlib/Test/System.Runtime.CompilerServices/TaskAwaiterTest_T.cs index 0980b4ac3ae..31242816cd8 100644 --- a/mcs/class/corlib/Test/System.Runtime.CompilerServices/TaskAwaiterTest_T.cs +++ b/mcs/class/corlib/Test/System.Runtime.CompilerServices/TaskAwaiterTest_T.cs @@ -88,6 +88,37 @@ namespace MonoTests.System.Runtime.CompilerServices } } + [Category ("NotWorking")] // Bug #18629 + [Test] + public void GetResultAfterMultipleExceptions () + { + TaskAwaiter awaiter; + CreateFaultedAwaiter (out awaiter); + try { + awaiter.GetResult (); + Assert.Fail (); + } catch (AggregateException ae) { + Assert.IsFalse (ae.StackTrace.Contains ("--- End"), "#1"); + Assert.IsTrue (ae.StackTrace.Contains ("CreateFaultedAwaiter"), "#2"); + } + } + + static void CreateFaultedAwaiter (out TaskAwaiter awaiter) + { + var faultedSource = new TaskCompletionSource(); + faultedSource.SetException(new Exception()); + awaiter = faultedSource.Task.GetAwaiter (); + try { + awaiter.GetResult (); + } catch { + } + + try { + awaiter.GetResult (); + } catch { + } + } + [Test] public void GetResultCanceled () { diff --git a/mcs/class/corlib/Test/System.Threading.Tasks/ParallelTests.cs b/mcs/class/corlib/Test/System.Threading.Tasks/ParallelTests.cs index 472b71a2583..4f381c1c9e8 100644 --- a/mcs/class/corlib/Test/System.Threading.Tasks/ParallelTests.cs +++ b/mcs/class/corlib/Test/System.Threading.Tasks/ParallelTests.cs @@ -115,6 +115,16 @@ namespace MonoTests.System.Threading.Tasks }); } + [Test] + public void ParallelForEachTestCaseWithIndex () + { + var list = new List { 0, 1, 2, 3, 4 }; + + Parallel.ForEach (list, (l, s, i) => { + Assert.AreEqual (l, i, "#1"); + }); + } + class ValueAndSquare { public float Value { get; set; } diff --git a/mcs/class/corlib/Test/System.Threading.Tasks/TaskTest.cs b/mcs/class/corlib/Test/System.Threading.Tasks/TaskTest.cs index 524988828b9..1ad12d00880 100644 --- a/mcs/class/corlib/Test/System.Threading.Tasks/TaskTest.cs +++ b/mcs/class/corlib/Test/System.Threading.Tasks/TaskTest.cs @@ -807,15 +807,20 @@ namespace MonoTests.System.Threading.Tasks finished ++; Monitor.Pulse (monitor); } - return r; + return r ? 1 : 10; //1 -> ok, 10 -> evt wait failed }); var cntd = new CountdownEvent (2); var cntd2 = new CountdownEvent (2); - bool r1 = false, r2 = false; + int r1 = 0, r2 = 0; ThreadPool.QueueUserWorkItem (delegate { cntd.Signal (); - r1 = t.Wait (1000) && t.Result; + if (!t.Wait (1000)) + r1 = 20; // 20 -> task wait failed + else if (t.Result != 1) + r1 = 30 + t.Result; // 30 -> task result is bad + else + r1 = 2; //2 -> ok cntd2.Signal (); lock (monitor) { finished ++; @@ -824,7 +829,13 @@ namespace MonoTests.System.Threading.Tasks }); ThreadPool.QueueUserWorkItem (delegate { cntd.Signal (); - r2 = t.Wait (1000) && t.Result; + if (!t.Wait (1000)) + r2 = 40; // 40 -> task wait failed + else if (t.Result != 1) + r2 = 50 + t.Result; // 50 -> task result is bad + else + r2 = 3; //3 -> ok + cntd2.Signal (); lock (monitor) { finished ++; @@ -834,8 +845,8 @@ namespace MonoTests.System.Threading.Tasks Assert.IsTrue (cntd.Wait (2000), "#1"); evt.Set (); Assert.IsTrue (cntd2.Wait (2000), "#2"); - Assert.IsTrue (r1, "r1"); - Assert.IsTrue (r2, "r2"); + Assert.AreEqual (2, r1, "r1"); + Assert.AreEqual (3, r2, "r2"); // Wait for everything to finish to avoid overloading the tpool lock (monitor) { diff --git a/mcs/class/corlib/Test/System.Threading/ManualResetEventSlimTests.cs b/mcs/class/corlib/Test/System.Threading/ManualResetEventSlimTests.cs index 0694ef80b63..ebb0433c2a2 100644 --- a/mcs/class/corlib/Test/System.Threading/ManualResetEventSlimTests.cs +++ b/mcs/class/corlib/Test/System.Threading/ManualResetEventSlimTests.cs @@ -230,7 +230,7 @@ namespace MonoTests.System.Threading int count = 2; SpinWait wait = new SpinWait (); - ThreadPool.QueueUserWorkItem (_ => { mre.Set (); Interlocked.Decrement (ref count); }); + ThreadPool.QueueUserWorkItem (_ => { while (count > 1) wait.SpinOnce (); mre.Set (); Interlocked.Decrement (ref count); }); ThreadPool.QueueUserWorkItem (_ => { mre.Reset (); Interlocked.Decrement (ref count); }); while (count > 0) diff --git a/mcs/class/corlib/basic_corlib.dll.sources b/mcs/class/corlib/basic_corlib.dll.sources new file mode 100644 index 00000000000..5268a3a9766 --- /dev/null +++ b/mcs/class/corlib/basic_corlib.dll.sources @@ -0,0 +1,1677 @@ +Assembly/AssemblyInfo.cs +../../build/common/Consts.cs +../../build/common/Locale.cs +Microsoft.Win32/IRegistryApi.cs +Microsoft.Win32/RegistryKey.cs +Microsoft.Win32/RegistryKeyPermissionCheck.cs +Microsoft.Win32/Registry.cs +Microsoft.Win32/RegistryHive.cs +Microsoft.Win32/RegistryOptions.cs +Microsoft.Win32/RegistryValueKind.cs +Microsoft.Win32/RegistryValueOptions.cs +Microsoft.Win32/RegistryView.cs +Microsoft.Win32/UnixRegistryApi.cs +Microsoft.Win32/Win32RegistryApi.cs +Microsoft.Win32/Win32ResultCode.cs +Microsoft.Win32.SafeHandles/CriticalHandleZeroOrMinusOneIsInvalid.cs +Microsoft.Win32.SafeHandles/CriticalHandleMinusOneIsInvalid.cs +Microsoft.Win32.SafeHandles/SafeHandleZeroOrMinusOneIsInvalid.cs +Microsoft.Win32.SafeHandles/SafeHandleMinusOneIsInvalid.cs +Microsoft.Win32.SafeHandles/SafeFileHandle.cs +Microsoft.Win32.SafeHandles/SafeRegistryHandle.cs +Microsoft.Win32.SafeHandles/SafeWaitHandle.cs +Mono.Globalization.Unicode/CodePointIndexer.cs +Mono.Globalization.Unicode/MSCompatUnicodeTable.cs +Mono.Globalization.Unicode/MSCompatUnicodeTableUtil.cs +Mono.Globalization.Unicode/SimpleCollator.cs +Mono.Globalization.Unicode/SortKey.cs +Mono.Globalization.Unicode/SortKeyBuffer.cs +Mono.Globalization.Unicode/Normalization.cs +Mono.Globalization.Unicode/NormalizationTableUtil.cs +Mono/Runtime.cs +Mono/DataConverter.cs +Mono.Interop/ComInteropProxy.cs +Mono.Interop/IDispatch.cs +Mono.Interop/IUnknown.cs +../Mono.Security/Mono.Math/BigInteger.cs +../Mono.Security/Mono.Math.Prime/ConfidenceFactor.cs +../Mono.Security/Mono.Math.Prime/PrimalityTests.cs +../Mono.Security/Mono.Math.Prime.Generator/NextPrimeFinder.cs +../Mono.Security/Mono.Math.Prime.Generator/PrimeGeneratorBase.cs +../Mono.Security/Mono.Math.Prime.Generator/SequentialSearchPrimeGeneratorBase.cs +../Mono.Security/Mono.Security/ASN1.cs +../Mono.Security/Mono.Security/ASN1Convert.cs +../Mono.Security/Mono.Security/BitConverterLE.cs +../Mono.Security/Mono.Security/PKCS7.cs +../Mono.Security/Mono.Security/StrongName.cs +Mono.Security/StrongNameManager.cs +Mono.Security/Uri.cs +../Mono.Security/Mono.Security.Authenticode/AuthenticodeBase.cs +../Mono.Security/Mono.Security.Authenticode/AuthenticodeDeformatter.cs +../Mono.Security/Mono.Security.Cryptography/ARC4Managed.cs +../Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs +../Mono.Security/Mono.Security.Cryptography/CryptoTools.cs +Mono.Security.Cryptography/DSAManaged.cs +Mono.Security.Cryptography/HMACAlgorithm.cs +../Mono.Security/Mono.Security.Cryptography/KeyPairPersistence.cs +Mono.Security.Cryptography/MACAlgorithm.cs +../Mono.Security/Mono.Security.Cryptography/MD2.cs +../Mono.Security/Mono.Security.Cryptography/MD2Managed.cs +../Mono.Security/Mono.Security.Cryptography/MD4.cs +../Mono.Security/Mono.Security.Cryptography/MD4Managed.cs +../Mono.Security/Mono.Security.Cryptography/PKCS1.cs +../Mono.Security/Mono.Security.Cryptography/PKCS8.cs +../Mono.Security/Mono.Security.Cryptography/RC4.cs +../Mono.Security/Mono.Security.Cryptography/RSAManaged.cs +../Mono.Security/Mono.Security.Cryptography/SymmetricTransform.cs +../Mono.Security/Mono.Security.X509/PKCS12.cs +../Mono.Security/Mono.Security.X509/X501Name.cs +../Mono.Security/Mono.Security.X509/X509Certificate.cs +../Mono.Security/Mono.Security.X509/X509CertificateCollection.cs +../Mono.Security/Mono.Security.X509/X509Chain.cs +../Mono.Security/Mono.Security.X509/X509ChainStatusFlags.cs +../Mono.Security/Mono.Security.X509/X509CRL.cs +../Mono.Security/Mono.Security.X509/X509Extension.cs +../Mono.Security/Mono.Security.X509/X509Extensions.cs +../Mono.Security/Mono.Security.X509/X509Store.cs +../Mono.Security/Mono.Security.X509/X509Stores.cs +../Mono.Security/Mono.Security.X509/X509StoreManager.cs +../Mono.Security/Mono.Security.X509/X520Attributes.cs +../Mono.Security/Mono.Security.X509.Extensions/BasicConstraintsExtension.cs +../Mono.Security/Mono.Security.X509.Extensions/KeyUsageExtension.cs +../Mono.Security/Mono.Security.X509.Extensions/SubjectKeyIdentifierExtension.cs +Mono.Xml/SmallXmlParser.cs +Mono.Xml/SecurityParser.cs +System/AccessViolationException.cs +System/ActivationContext.cs +System/Activator.cs +System/AndroidPlatform.cs +System/AppDomain.cs +System/AppDomainInitializer.cs +System/AppDomainManager.cs +System/AppDomainSetup.cs +System/AppDomainUnloadedException.cs +System/ApplicationException.cs +System/ApplicationId.cs +System/ApplicationIdentity.cs +System/ArgIterator.cs +System/ArgumentException.cs +System/ArgumentNullException.cs +System/ArgumentOutOfRangeException.cs +System/ArithmeticException.cs +System/Array.cs +System/ArrayTypeMismatchException.cs +System/AssemblyLoadEventArgs.cs +System/AssemblyLoadEventHandler.cs +System/AsyncCallback.cs +System/Attribute.cs +System/AttributeTargets.cs +System/AttributeUsageAttribute.cs +System/BadImageFormatException.cs +System/Base64FormattingOptions.cs +System/BitConverter.cs +System/Boolean.cs +System/Buffer.cs +System/Byte.cs +System/CannotUnloadAppDomainException.cs +System/Char.cs +System/CharEnumerator.cs +System/CLSCompliantAttribute.cs +System/CStreamReader.cs +System/CStreamWriter.cs +System/Console.cs +System/Console.iOS.cs +System/ConsoleCancelEventArgs.cs +System/ConsoleCancelEventHandler.cs +System/ConsoleColor.cs +System/ConsoleDriver.cs +System/ConsoleKey.cs +System/ConsoleKeyInfo.cs +System/ConsoleModifiers.cs +System/ConsoleSpecialKey.cs +System/ContextBoundObject.cs +System/ContextMarshalException.cs +System/ContextStaticAttribute.cs +System/ControlCharacters.cs +System/Convert.cs +System/CrossAppDomainDelegate.cs +System/DataMisalignedException.cs +System/DateTime.cs +System/DateTimeKind.cs +System/DateTimeOffset.cs +System/DateTimeUtils.cs +System/DayOfWeek.cs +System/DBNull.cs +System/Decimal.cs +System/Delegate.cs +System/DelegateSerializationHolder.cs +System/DivideByZeroException.cs +System/DllNotFoundException.cs +System/DomainManagerInitializationFlags.cs +System/Double.cs +System/DuplicateWaitObjectException.cs +System/EmptyArray.cs +System/EntryPointNotFoundException.cs +System/Enum.cs +System/Environment.cs +System/EnvironmentVariableTarget.cs +System/EventArgs.cs +System/EventHandler.cs +System/Exception.cs +System/ExecutionEngineException.cs +System/FieldAccessException.cs +System/FirstChanceExceptionEventArgs.cs +System/FlagsAttribute.cs +System/FormatException.cs +System/Funcs.cs +System/GC.cs +System/GCCollectionMode.cs +System/GCNotificationStatus.cs +System/Guid.cs +System/IAppDomainSetup.cs +System/IAsyncResult.cs +System/IObservable.cs +System/IObserver.cs +System/ICloneable.cs +System/IComparable.cs +System/IEquatable.cs +System/IConsoleDriver.cs +System/IConvertible.cs +System/ICustomFormatter.cs +System/IDisposable.cs +System/IFormatProvider.cs +System/IFormattable.cs +System/IndexOutOfRangeException.cs +System/InsufficientExecutionStackException.cs +System/InsufficientMemoryException.cs +System/Int16.cs +System/Int32.cs +System/Int64.cs +System/IntPtr.cs +System/InvalidCastException.cs +System/InvalidOperationException.cs +System/InvalidProgramException.cs +System/InvalidTimeZoneException.cs +System/IProgress.cs +System/IServiceProvider.cs +System/KnownTerminals.cs +System/Lazy.cs +System/LoaderOptimization.cs +System/LoaderOptimizationAttribute.cs +System/LocalDataStoreSlot.cs +System/MarshalByRefObject.cs +System/Math.cs +System/MemberAccessException.cs +System/MethodAccessException.cs +System/MidpointRounding.cs +System/MissingFieldException.cs +System/MissingMemberException.cs +System/MissingMethodException.cs +System/MonoAsyncCall.cs +System/MonoCQItem.cs +System/MonoCustomAttrs.cs +System/MonoListItem.cs +System/MonoType.cs +System/MonoTouchAOTHelper.cs +System/MTAThreadAttribute.cs +System/MulticastDelegate.cs +System/MulticastNotSupportedException.cs +System/NonSerializedAttribute.cs +System/NotFiniteNumberException.cs +System/NotImplementedException.cs +System/NotSupportedException.cs +System/NullConsoleDriver.cs +System/Nullable.cs +System/NullReferenceException.cs +System/NumberFormatter.cs +System/Object.cs +System/ObjectDisposedException.cs +System/ObsoleteAttribute.cs +System/OperatingSystem.cs +System/OperationCanceledException.cs +System/OutOfMemoryException.cs +System/OverflowException.cs +System/ParamArrayAttribute.cs +System/PlatformID.cs +System/PlatformNotSupportedException.cs +System/Random.cs +System/RankException.cs +System/ResolveEventArgs.cs +System/ResolveEventHandler.cs +System/RuntimeArgumentHandle.cs +System/RuntimeFieldHandle.cs +System/RuntimeMethodHandle.cs +System/RuntimeTypeHandle.cs +System/ModuleHandle.cs +System/SByte.cs +System/SerializableAttribute.cs +System/Single.cs +System/StackOverflowException.cs +System/STAThreadAttribute.cs +System/String.cs +System/StringSplitOptions.cs +System/StringComparer.cs +System/StringComparison.cs +System/SystemException.cs +System/TermInfoBooleans.cs +System/TermInfoDriver.cs +System/TermInfoNumbers.cs +System/TermInfoReader.cs +System/TermInfoStrings.cs +System/ThreadStaticAttribute.cs +System/TimeSpan.cs +System/TimeZone.cs +../System.Core/System/TimeZoneInfo.cs +../System.Core/System/TimeZoneInfo.AdjustmentRule.cs +../System.Core/System/TimeZoneInfo.Android.cs +../System.Core/System/TimeZoneInfo.MonoTouch.cs +../System.Core/System/TimeZoneInfo.Serialization.cs +../System.Core/System/TimeZoneInfo.TransitionTime.cs +System/TimeZoneNotFoundException.cs +System/TimeoutException.cs +../../build/common/MonoTODOAttribute.cs +System/Type.cs +System/TypeSpec.cs +System/TypeAccessException.cs +System/TypeCode.cs +System/TypedReference.cs +System/TypeInitializationException.cs +System/TypeLoadException.cs +System/TypeUnloadedException.cs +System/Tuple.cs +System/Tuples.cs +System/UInt16.cs +System/UInt32.cs +System/UInt64.cs +System/UIntPtr.cs +System/UnauthorizedAccessException.cs +System/UnhandledExceptionEventArgs.cs +System/UnhandledExceptionEventHandler.cs +System/UnitySerializationHolder.cs +System/ValueType.cs +System/Variant.cs +System/Version.cs +System/Void.cs +System/WeakReference.cs +System/WeakReference_T.cs +System/WindowsConsoleDriver.cs +System/_AppDomain.cs +System/__ComObject.cs +System.Collections/ArrayList.cs +System.Collections/BitArray.cs +System.Collections/CaseInsensitiveComparer.cs +System.Collections/CaseInsensitiveHashCodeProvider.cs +System.Collections/CollectionBase.cs +System.Collections/Comparer.cs +System.Collections/CollectionDebuggerView.cs +System.Collections/DictionaryBase.cs +System.Collections/DictionaryEntry.cs +System.Collections/Hashtable.cs +System.Collections/HashPrimeNumbers.cs +System.Collections/ICollection.cs +System.Collections/IComparer.cs +System.Collections/IDictionary.cs +System.Collections/IDictionaryEnumerator.cs +System.Collections/IEnumerable.cs +System.Collections/IEnumerator.cs +System.Collections/IEqualityComparer.cs +System.Collections/IHashCodeProvider.cs +System.Collections/IList.cs +System.Collections/IStructuralComparable.cs +System.Collections/IStructuralEquatable.cs +System.Collections/Queue.cs +System.Collections/ReadOnlyCollectionBase.cs +System.Collections/SortedList.cs +System.Collections/Stack.cs +System.Collections/StructuralComparisons.cs +System.Configuration.Assemblies/AssemblyHash.cs +System.Configuration.Assemblies/AssemblyHashAlgorithm.cs +System.Configuration.Assemblies/AssemblyVersionCompatibility.cs +System.Configuration.Assemblies/ProcessorID.cs +System.Deployment.Internal/InternalActivationContextHelper.cs +System.Deployment.Internal/InternalApplicationIdentityHelper.cs +System.Diagnostics/ConditionalAttribute.cs +System.Diagnostics/DebuggableAttribute.cs +System.Diagnostics/Debugger.cs +System.Diagnostics/DebuggerBrowsableState.cs +System.Diagnostics/DebuggerBrowsableAttribute.cs +System.Diagnostics/DebuggerDisplayAttribute.cs +System.Diagnostics/DebuggerHiddenAttribute.cs +System.Diagnostics/DebuggerNonUserCodeAttribute.cs +System.Diagnostics/DebuggerStepThroughAttribute.cs +System.Diagnostics/DebuggerStepperBoundaryAttribute.cs +System.Diagnostics/DebuggerTypeProxyAttribute.cs +System.Diagnostics/DebuggerVisualizerAttribute.cs +System.Diagnostics/StackFrame.cs +System.Diagnostics/StackTrace.cs +System.Diagnostics.CodeAnalysis/SuppressMessageAttribute.cs +System.Diagnostics.Contracts/Contract.cs +System.Diagnostics.Contracts/ContractAbbreviatorAttribute.cs +System.Diagnostics.Contracts/ContractArgumentValidatorAttribute.cs +System.Diagnostics.Contracts/ContractClassAttribute.cs +System.Diagnostics.Contracts/ContractClassForAttribute.cs +System.Diagnostics.Contracts/ContractException.cs +System.Diagnostics.Contracts/ContractFailedEventArgs.cs +System.Diagnostics.Contracts/ContractFailureKind.cs +System.Diagnostics.Contracts/ContractInvariantMethodAttribute.cs +System.Diagnostics.Contracts/ContractOptionAttribute.cs +System.Diagnostics.Contracts/ContractPublicPropertyNameAttribute.cs +System.Diagnostics.Contracts/ContractReferenceAssemblyAttribute.cs +System.Diagnostics.Contracts/ContractRuntimeIgnoredAttribute.cs +System.Diagnostics.Contracts/ContractShouldAssertException.cs +System.Diagnostics.Contracts/ContractVerificationAttribute.cs +System.Diagnostics.Contracts/PureAttribute.cs +System.Diagnostics.Contracts.Internal/ContractHelper.cs +System.Diagnostics.Tracing/EventAttribute.cs +System.Diagnostics.Tracing/EventCommand.cs +System.Diagnostics.Tracing/EventKeywords.cs +System.Diagnostics.Tracing/EventLevel.cs +System.Diagnostics.Tracing/EventSource.cs +System.Diagnostics.Tracing/EventSourceAttribute.cs +System.Diagnostics.Tracing/EventCommandEventArgs.cs +System.Diagnostics.Tracing/NonEventAttribute.cs +System.Diagnostics.SymbolStore/ISymbolBinder.cs +System.Diagnostics.SymbolStore/ISymbolBinder1.cs +System.Diagnostics.SymbolStore/ISymbolDocument.cs +System.Diagnostics.SymbolStore/ISymbolDocumentWriter.cs +System.Diagnostics.SymbolStore/ISymbolMethod.cs +System.Diagnostics.SymbolStore/ISymbolNamespace.cs +System.Diagnostics.SymbolStore/ISymbolReader.cs +System.Diagnostics.SymbolStore/ISymbolScope.cs +System.Diagnostics.SymbolStore/ISymbolVariable.cs +System.Diagnostics.SymbolStore/ISymbolWriter.cs +System.Diagnostics.SymbolStore/SymAddressKind.cs +System.Diagnostics.SymbolStore/SymbolToken.cs +System.Diagnostics.SymbolStore/SymDocumentType.cs +System.Diagnostics.SymbolStore/SymLanguageType.cs +System.Diagnostics.SymbolStore/SymLanguageVendor.cs +System.Globalization/Calendar.cs +System.Globalization/CalendarAlgorithmType.cs +System.Globalization/CalendarWeekRule.cs +System.Globalization/CalendricalCalculations.cs +System.Globalization/CharUnicodeInfo.cs +System.Globalization/ChineseLunisolarCalendar.cs +System.Globalization/CodePageDataItem.cs +System.Globalization/CompareInfo.cs +System.Globalization/CompareOptions.cs +System.Globalization/CultureInfo.cs +System.Globalization/CultureNotFoundException.cs +System.Globalization/CultureTypes.cs +System.Globalization/DateTimeFormatInfo.cs +System.Globalization/DateTimeStyles.cs +System.Globalization/DaylightTime.cs +System.Globalization/DigitShapes.cs +System.Globalization/EastAsianLunisolarCalendar.cs +System.Globalization/GregorianCalendar.cs +System.Globalization/GregorianCalendarTypes.cs +System.Globalization/HebrewCalendar.cs +System.Globalization/HijriCalendar.cs +System.Globalization/IdnMapping.cs +System.Globalization/JapaneseCalendar.cs +System.Globalization/JapaneseLunisolarCalendar.cs +System.Globalization/JulianCalendar.cs +System.Globalization/KoreanCalendar.cs +System.Globalization/KoreanLunisolarCalendar.cs +System.Globalization/NumberFormatInfo.cs +System.Globalization/NumberStyles.cs +System.Globalization/PersianCalendar.cs +System.Globalization/RegionInfo.cs +System.Globalization/RegionInfo.MonoTouch.cs +System.Globalization/SortVersion.cs +System.Globalization/StringInfo.cs +System.Globalization/TaiwanCalendar.cs +System.Globalization/TaiwanLunisolarCalendar.cs +System.Globalization/TextElementEnumerator.cs +System.Globalization/TextInfo.cs +System.Globalization/ThaiBuddhistCalendar.cs +System.Globalization/TimeSpanStyles.cs +System.Globalization/UmAlQuraCalendar.cs +System.Globalization/UnicodeCategory.cs +System.IO/BinaryReader.cs +System.IO/BinaryWriter.cs +System.IO/BufferedStream.cs +System.IO/Directory.cs +System.IO/DirectoryInfo.cs +System.IO/DirectoryNotFoundException.cs +System.IO/DriveInfo.cs +System.IO/DriveNotFoundException.cs +System.IO/DriveType.cs +System.IO/EndOfStreamException.cs +System.IO/File.cs +System.IO/FileAccess.cs +System.IO/FileAttributes.cs +System.IO/FileInfo.cs +System.IO/FileLoadException.cs +System.IO/FileMode.cs +System.IO/FileNotFoundException.cs +System.IO/FileOptions.cs +System.IO/FileShare.cs +System.IO/FileStream.cs +System.IO/FileStreamAsyncResult.cs +System.IO/FileSystemInfo.cs +System.IO/IOException.cs +System.IO/LogcatTextWriter.cs +System.IO/MemoryStream.cs +System.IO/MonoIO.cs +System.IO/MonoIOError.cs +System.IO/MonoFileType.cs +System.IO/MonoIOStat.cs +System.IO/Path.cs +System.IO/PathTooLongException.cs +System.IO/SearchOption.cs +System.IO/SearchPattern.cs +System.IO/SeekOrigin.cs +System.IO/Stream.cs +System.IO/StreamReader.cs +System.IO/StreamWriter.cs +System.IO/StringReader.cs +System.IO/StringWriter.cs +System.IO/TextReader.cs +System.IO/TextWriter.cs +System.IO/UnexceptionalStreamReader.cs +System.IO/UnexceptionalStreamWriter.cs +System.IO/UnmanagedMemoryAccessor.cs +System.IO/UnmanagedMemoryStream.cs +System.IO.IsolatedStorage/INormalizeForIsolatedStorage.cs +System.IO.IsolatedStorage/IsolatedStorage.cs +System.IO.IsolatedStorage/IsolatedStorageException.cs +System.IO.IsolatedStorage/IsolatedStorageFile.cs +System.IO.IsolatedStorage/IsolatedStorageFileEnumerator.cs +System.IO.IsolatedStorage/IsolatedStorageFileStream.cs +System.IO.IsolatedStorage/IsolatedStorageScope.cs +System.IO.IsolatedStorage/IsolatedStorageSecurityOptions.cs +System.IO.IsolatedStorage/IsolatedStorageSecurityState.cs +System.Reflection/AmbiguousMatchException.cs +System.Reflection/Assembly.cs +System.Reflection/AssemblyAlgorithmIdAttribute.cs +System.Reflection/AssemblyCompanyAttribute.cs +System.Reflection/AssemblyConfigurationAttribute.cs +System.Reflection/AssemblyContentType.cs +System.Reflection/AssemblyCopyrightAttribute.cs +System.Reflection/AssemblyCultureAttribute.cs +System.Reflection/AssemblyDefaultAliasAttribute.cs +System.Reflection/AssemblyDelaySignAttribute.cs +System.Reflection/AssemblyDescriptionAttribute.cs +System.Reflection/AssemblyFileVersionAttribute.cs +System.Reflection/AssemblyFlagsAttribute.cs +System.Reflection/AssemblyInformationalVersionAttribute.cs +System.Reflection/AssemblyKeyFileAttribute.cs +System.Reflection/AssemblyKeyNameAttribute.cs +System.Reflection/AssemblyMetadataAttribute.cs +System.Reflection/AssemblyName.cs +System.Reflection/AssemblyNameFlags.cs +System.Reflection/AssemblyNameProxy.cs +System.Reflection/AssemblyProductAttribute.cs +System.Reflection/AssemblySignatureKeyAttribute.cs +System.Reflection/AssemblyTitleAttribute.cs +System.Reflection/AssemblyTradeMarkAttribute.cs +System.Reflection/AssemblyVersionAttribute.cs +System.Reflection/Binder.cs +System.Reflection/BindingFlags.cs +System.Reflection/CallingConventions.cs +System.Reflection/ConstructorInfo.cs +System.Reflection/CustomAttributeData.cs +System.Reflection/CustomAttributeExtensions.cs +System.Reflection/CustomAttributeFormatException.cs +System.Reflection/CustomAttributeNamedArgument.cs +System.Reflection/CustomAttributeTypedArgument.cs +System.Reflection/DefaultMemberAttribute.cs +System.Reflection/EventAttributes.cs +System.Reflection/EventInfo.cs +System.Reflection/ExceptionHandlingClause.cs +System.Reflection/ExceptionHandlingClauseOptions.cs +System.Reflection/FieldAttributes.cs +System.Reflection/FieldInfo.cs +System.Reflection/GenericParameterAttributes.cs +System.Reflection/ICustomAttributeProvider.cs +System.Reflection/ImageFileMachine.cs +System.Reflection/InterfaceMapping.cs +System.Reflection/IntrospectionExtensions.cs +System.Reflection/InvalidFilterCriteriaException.cs +System.Reflection/IReflect.cs +System.Reflection/IReflectableType.cs +System.Reflection/LocalVariableInfo.cs +System.Reflection/ManifestResourceInfo.cs +System.Reflection/MemberFilter.cs +System.Reflection/MemberInfo.cs +System.Reflection/MemberInfoSerializationHolder.cs +System.Reflection/MemberTypes.cs +System.Reflection/MethodAttributes.cs +System.Reflection/MethodBase.cs +System.Reflection/MethodBody.cs +System.Reflection/MethodImplAttributes.cs +System.Reflection/MethodInfo.cs +System.Reflection/Missing.cs +System.Reflection/Module.cs +System.Reflection/ModuleResolveEventHandler.cs +System.Reflection/MonoAssembly.cs +System.Reflection/MonoGenericClass.cs +System.Reflection/MonoGenericMethod.cs +System.Reflection/MonoEvent.cs +System.Reflection/MonoField.cs +System.Reflection/MonoMethod.cs +System.Reflection/MonoModule.cs +System.Reflection/MonoParameterInfo.cs +System.Reflection/MonoProperty.cs +System.Reflection/ObfuscateAssemblyAttribute.cs +System.Reflection/ObfuscationAttribute.cs +System.Reflection/ParameterAttributes.cs +System.Reflection/ParameterInfo.cs +System.Reflection/ParameterModifier.cs +System.Reflection/Pointer.cs +System.Reflection/PortableExecutableKinds.cs +System.Reflection/ProcessorArchitecture.cs +System.Reflection/PropertyAttributes.cs +System.Reflection/PropertyInfo.cs +System.Reflection/ReflectionContext.cs +System.Reflection/ReflectionTypeLoadException.cs +System.Reflection/ResourceAttributes.cs +System.Reflection/ResourceLocation.cs +System.Reflection/RuntimeReflectionExtensions.cs +System.Reflection/StrongNameKeyPair.cs +System.Reflection/TargetException.cs +System.Reflection/TargetInvocationException.cs +System.Reflection/TargetParameterCountException.cs +System.Reflection/TypeAttributes.cs +System.Reflection/TypeDelegator.cs +System.Reflection/TypeFilter.cs +System.Reflection/TypeInfo.cs +System.Reflection.Emit/AssemblyBuilder.cs +System.Reflection.Emit/AssemblyBuilderAccess.cs +System.Reflection.Emit/ConstructorBuilder.cs +System.Reflection.Emit/ConstructorOnTypeBuilderInst.cs +System.Reflection.Emit/CustomAttributeBuilder.cs +System.Reflection.Emit/DerivedTypes.cs +System.Reflection.Emit/DynamicILInfo.cs +System.Reflection.Emit/DynamicMethod.cs +System.Reflection.Emit/EnumBuilder.cs +System.Reflection.Emit/EventBuilder.cs +System.Reflection.Emit/EventOnTypeBuilderInst.cs +System.Reflection.Emit/EventToken.cs +System.Reflection.Emit/FieldBuilder.cs +System.Reflection.Emit/FieldOnTypeBuilderInst.cs +System.Reflection.Emit/FieldToken.cs +System.Reflection.Emit/FlowControl.cs +System.Reflection.Emit/GenericTypeParameterBuilder.cs +System.Reflection.Emit/ILGenerator.cs +System.Reflection.Emit/Label.cs +System.Reflection.Emit/LocalBuilder.cs +System.Reflection.Emit/MethodBuilder.cs +System.Reflection.Emit/MethodOnTypeBuilderInst.cs +System.Reflection.Emit/MethodToken.cs +System.Reflection.Emit/MethodRental.cs +System.Reflection.Emit/ModuleBuilder.cs +System.Reflection.Emit/MonoArrayMethod.cs +System.Reflection.Emit/OpCodeNames.cs +System.Reflection.Emit/OpCode.cs +System.Reflection.Emit/OpCodes.cs +System.Reflection.Emit/OpCodeType.cs +System.Reflection.Emit/OperandType.cs +System.Reflection.Emit/PackingSize.cs +System.Reflection.Emit/ParameterBuilder.cs +System.Reflection.Emit/ParameterToken.cs +System.Reflection.Emit/PEFileKinds.cs +System.Reflection.Emit/PropertyBuilder.cs +System.Reflection.Emit/PropertyOnTypeBuilderInst.cs +System.Reflection.Emit/PropertyToken.cs +System.Reflection.Emit/SignatureHelper.cs +System.Reflection.Emit/SignatureToken.cs +System.Reflection.Emit/StackBehaviour.cs +System.Reflection.Emit/StringToken.cs +System.Reflection.Emit/TypeBuilder.cs +System.Reflection.Emit/TypeToken.cs +System.Reflection.Emit/UnmanagedMarshal.cs +System.Resources/IResourceReader.cs +System.Resources/IResourceWriter.cs +System.Resources/MissingManifestResourceException.cs +System.Resources/MissingSatelliteAssemblyException.cs +System.Resources/NeutralResourcesLanguageAttribute.cs +System.Resources/ResourceManager.cs +System.Resources/ResourceReader.cs +System.Resources/ResourceSet.cs +System.Resources/ResourceWriter.cs +System.Resources/RuntimeResourceSet.cs +System.Resources/SatelliteContractVersionAttribute.cs +System.Resources/UltimateResourceFallbackLocation.cs +System.Resources/Win32Resources.cs +System.Runtime/AssemblyTargetedPatchBandAttribute.cs +System.Runtime/GCLargeObjectHeapCompactionMode.cs +System.Runtime/GCLatencyMode.cs +System.Runtime/GCSettings.cs +System.Runtime/MemoryFailPoint.cs +System.Runtime/TargetedPatchingOptOutAttribute.cs +System.Runtime.CompilerServices/AccessedThroughPropertyAttribute.cs +System.Runtime.CompilerServices/AsyncStateMachineAttribute.cs +System.Runtime.CompilerServices/AsyncVoidMethodBuilder.cs +System.Runtime.CompilerServices/AsyncTaskMethodBuilder.cs +System.Runtime.CompilerServices/AsyncTaskMethodBuilder_T.cs +System.Runtime.CompilerServices/ReferenceAssemblyAttribute.cs +System.Runtime.CompilerServices/CallConvCdecl.cs +System.Runtime.CompilerServices/CallConvFastcall.cs +System.Runtime.CompilerServices/CallConvThiscall.cs +System.Runtime.CompilerServices/CallConvStdcall.cs +System.Runtime.CompilerServices/CallerFilePathAttribute.cs +System.Runtime.CompilerServices/CallerLineNumberAttribute.cs +System.Runtime.CompilerServices/CallerMemberNameAttribute.cs +System.Runtime.CompilerServices/CompilationRelaxations.cs +System.Runtime.CompilerServices/CompilationRelaxationsAttribute.cs +System.Runtime.CompilerServices/CompilerGeneratedAttribute.cs +System.Runtime.CompilerServices/CompilerGlobalScopeAttribute.cs +System.Runtime.CompilerServices/CompilerMarshalOverride.cs +System.Runtime.CompilerServices/ConditionalWeakTable.cs +System.Runtime.CompilerServices/ConfiguredTaskAwaitable.cs +System.Runtime.CompilerServices/ConfiguredTaskAwaitable_T.cs +System.Runtime.CompilerServices/ContractHelper.cs +System.Runtime.CompilerServices/CustomConstantAttribute.cs +System.Runtime.CompilerServices/DateTimeConstantAttribute.cs +System.Runtime.CompilerServices/DecimalConstantAttribute.cs +System.Runtime.CompilerServices/DefaultDependencyAttribute.cs +System.Runtime.CompilerServices/DependencyAttribute.cs +System.Runtime.CompilerServices/DiscardableAttribute.cs +System.Runtime.CompilerServices/ExtensionAttribute.cs +System.Runtime.CompilerServices/FixedAddressValueTypeAttribute.cs +System.Runtime.CompilerServices/FixedBufferAttribute.cs +System.Runtime.CompilerServices/HasCopySemanticsAttribute.cs +System.Runtime.CompilerServices/IAsyncStateMachine.cs +System.Runtime.CompilerServices/ICriticalNotifyCompletion.cs +System.Runtime.CompilerServices/IDispatchConstantAttribute.cs +System.Runtime.CompilerServices/IUnknownConstantAttribute.cs +System.Runtime.CompilerServices/IndexerNameAttribute.cs +System.Runtime.CompilerServices/INotifyCompletion.cs +System.Runtime.CompilerServices/InternalsVisibleToAttribute.cs +System.Runtime.CompilerServices/IsBoxed.cs +System.Runtime.CompilerServices/IsByValue.cs +System.Runtime.CompilerServices/IsConst.cs +System.Runtime.CompilerServices/IsCopyConstructed.cs +System.Runtime.CompilerServices/IsExplicitlyDereferenced.cs +System.Runtime.CompilerServices/IsImplicitlyDereferenced.cs +System.Runtime.CompilerServices/IsJitIntrinsic.cs +System.Runtime.CompilerServices/IsLong.cs +System.Runtime.CompilerServices/IsPinned.cs +System.Runtime.CompilerServices/IsSignUnspecifiedByte.cs +System.Runtime.CompilerServices/IsUdtReturn.cs +System.Runtime.CompilerServices/IsVolatile.cs +System.Runtime.CompilerServices/IteratorStateMachineAttribute.cs +System.Runtime.CompilerServices/LoadHint.cs +System.Runtime.CompilerServices/MethodCodeType.cs +System.Runtime.CompilerServices/MethodImplAttribute.cs +System.Runtime.CompilerServices/MethodImplOptions.cs +System.Runtime.CompilerServices/NativeCppClassAttribute.cs +System.Runtime.CompilerServices/RequiredAttributeAttribute.cs +System.Runtime.CompilerServices/RuntimeCompatibilityAttribute.cs +System.Runtime.CompilerServices/RuntimeHelpers.cs +System.Runtime.CompilerServices/RuntimeWrappedException.cs +System.Runtime.CompilerServices/SpecialNameAttribute.cs +System.Runtime.CompilerServices/ScopelessEnumAttribute.cs +System.Runtime.CompilerServices/SuppressIldasmAttribute.cs +System.Runtime.CompilerServices/StateMachineAttribute.cs +System.Runtime.CompilerServices/StringFreezingAttribute.cs +System.Runtime.CompilerServices/UnsafeValueTypeAttribute.cs +System.Runtime.CompilerServices/TaskAwaiter.cs +System.Runtime.CompilerServices/TaskAwaiter_T.cs +System.Runtime.CompilerServices/TypeForwardedFromAttribute.cs +System.Runtime.CompilerServices/TypeForwardedToAttribute.cs +System.Runtime.CompilerServices/YieldAwaitable.cs +System.Runtime.ConstrainedExecution/CriticialFinalizerObject.cs +System.Runtime.ConstrainedExecution/CER.cs +System.Runtime.ConstrainedExecution/Consistency.cs +System.Runtime.ConstrainedExecution/PrePrepareMethodAttribute.cs +System.Runtime.ConstrainedExecution/ReliabilityContractAttribute.cs +System.Runtime.ExceptionServices/ExceptionDispatchInfo.cs +System.Runtime.ExceptionServices/FirstChanceExceptionEventArgs.cs +System.Runtime.ExceptionServices/HandleProcessCorruptedStateExceptionsAttribute.cs +System.Runtime.Hosting/ActivationArguments.cs +System.Runtime.Hosting/ApplicationActivator.cs +System.Runtime.InteropServices/_Activator.cs +System.Runtime.InteropServices/_Assembly.cs +System.Runtime.InteropServices/_AssemblyBuilder.cs +System.Runtime.InteropServices/_AssemblyName.cs +System.Runtime.InteropServices/_Attribute.cs +System.Runtime.InteropServices/_ConstructorBuilder.cs +System.Runtime.InteropServices/_ConstructorInfo.cs +System.Runtime.InteropServices/_CustomAttributeBuilder.cs +System.Runtime.InteropServices/_EnumBuilder.cs +System.Runtime.InteropServices/_EventBuilder.cs +System.Runtime.InteropServices/_EventInfo.cs +System.Runtime.InteropServices/_Exception.cs +System.Runtime.InteropServices/_FieldBuilder.cs +System.Runtime.InteropServices/_FieldInfo.cs +System.Runtime.InteropServices/_ILGenerator.cs +System.Runtime.InteropServices/_LocalBuilder.cs +System.Runtime.InteropServices/_MemberInfo.cs +System.Runtime.InteropServices/_MethodBase.cs +System.Runtime.InteropServices/_MethodBuilder.cs +System.Runtime.InteropServices/_MethodInfo.cs +System.Runtime.InteropServices/_MethodRental.cs +System.Runtime.InteropServices/_Module.cs +System.Runtime.InteropServices/_ModuleBuilder.cs +System.Runtime.InteropServices/_ParameterBuilder.cs +System.Runtime.InteropServices/_ParameterInfo.cs +System.Runtime.InteropServices/_PropertyBuilder.cs +System.Runtime.InteropServices/_PropertyInfo.cs +System.Runtime.InteropServices/_SignatureHelper.cs +System.Runtime.InteropServices/_Thread.cs +System.Runtime.InteropServices/_Type.cs +System.Runtime.InteropServices/_TypeBuilder.cs +System.Runtime.InteropServices/AllowReversePInvokeCallsAttribute.cs +System.Runtime.InteropServices/ArrayWithOffset.cs +System.Runtime.InteropServices/AssemblyRegistrationFlags.cs +System.Runtime.InteropServices/AutomationProxyAttribute.cs +System.Runtime.InteropServices/BestFitMappingAttribute.cs +System.Runtime.InteropServices/BIND_OPTS.cs +System.Runtime.InteropServices/BINDPTR.cs +System.Runtime.InteropServices/BStrWrapper.cs +System.Runtime.InteropServices/CALLCONV.cs +System.Runtime.InteropServices/CallingConvention.cs +System.Runtime.InteropServices/CharSet.cs +System.Runtime.InteropServices/ClassInterfaceAttribute.cs +System.Runtime.InteropServices/ClassInterfaceType.cs +System.Runtime.InteropServices/CoClassAttribute.cs +System.Runtime.InteropServices/ComAliasNameAttribute.cs +System.Runtime.InteropServices/ComCompatibleVersionAttribute.cs +System.Runtime.InteropServices/ComConversionLossAttribute.cs +System.Runtime.InteropServices/ComDefaultInterfaceAttribute.cs +System.Runtime.InteropServices/COMException.cs +System.Runtime.InteropServices/ComEventInterfaceAttribute.cs +System.Runtime.InteropServices/ComImportAttribute.cs +System.Runtime.InteropServices/ComInterfaceType.cs +System.Runtime.InteropServices/ComMemberType.cs +System.Runtime.InteropServices/ComRegisterFunctionAttribute.cs +System.Runtime.InteropServices/ComSourceInterfacesAttribute.cs +System.Runtime.InteropServices/ComUnregisterFunctionAttribute.cs +System.Runtime.InteropServices/ComVisible.cs +System.Runtime.InteropServices/CONNECTDATA.cs +System.Runtime.InteropServices/CriticalHandle.cs +System.Runtime.InteropServices/CurrencyWrapper.cs +System.Runtime.InteropServices/DefaultCharSetAttribute.cs +System.Runtime.InteropServices/DESCKIND.cs +System.Runtime.InteropServices/DispatchWrapper.cs +System.Runtime.InteropServices/DISPPARAMS.cs +System.Runtime.InteropServices/DispIdAttribute.cs +System.Runtime.InteropServices/DllImportAttribute.cs +System.Runtime.InteropServices/ELEMDESC.cs +System.Runtime.InteropServices/ErrorWrapper.cs +System.Runtime.InteropServices/EXCEPINFO.cs +System.Runtime.InteropServices/ExporterEventKind.cs +System.Runtime.InteropServices/ExtensibleClassFactory.cs +System.Runtime.InteropServices/ExternalException.cs +System.Runtime.InteropServices/FieldOffsetAttribute.cs +System.Runtime.InteropServices/FILETIME.cs +System.Runtime.InteropServices/FUNCDESC.cs +System.Runtime.InteropServices/FUNCFLAGS.cs +System.Runtime.InteropServices/FUNCKIND.cs +System.Runtime.InteropServices/GCHandle.cs +System.Runtime.InteropServices/GCHandleType.cs +System.Runtime.InteropServices/GuidAttribute.cs +System.Runtime.InteropServices/HandleRef.cs +System.Runtime.InteropServices/ICustomAdapter.cs +System.Runtime.InteropServices/ICustomFactory.cs +System.Runtime.InteropServices/ICustomMarshaler.cs +System.Runtime.InteropServices/IDispatchImplAttribute.cs +System.Runtime.InteropServices/IDispatchImplType.cs +System.Runtime.InteropServices/IDLDESC.cs +System.Runtime.InteropServices/IDLFLAG.cs +System.Runtime.InteropServices/IErrorInfo.cs +System.Runtime.InteropServices/IMPLTYPEFLAGS.cs +System.Runtime.InteropServices/INVOKEKIND.cs +System.Runtime.InteropServices/IRegistrationServices.cs +System.Runtime.InteropServices/ITypeLibConverter.cs +System.Runtime.InteropServices/ITypeLibExporterNameProvider.cs +System.Runtime.InteropServices/ITypeLibExporterNotifySink.cs +System.Runtime.InteropServices/ITypeLibImporterNotifySink.cs +System.Runtime.InteropServices/ImportedFromTypeLibAttribute.cs +System.Runtime.InteropServices/ImporterEventKind.cs +System.Runtime.InteropServices/InAttribute.cs +System.Runtime.InteropServices/InterfaceTypeAttribute.cs +System.Runtime.InteropServices/InvalidComObjectException.cs +System.Runtime.InteropServices/InvalidOleVariantTypeException.cs +System.Runtime.InteropServices/LCIDConversionAttribute.cs +System.Runtime.InteropServices/LIBFLAGS.cs +System.Runtime.InteropServices/LayoutKind.cs +System.Runtime.InteropServices/ManagedErrorInfo.cs +System.Runtime.InteropServices/Marshal.cs +System.Runtime.InteropServices/MarshalAsAttribute.cs +System.Runtime.InteropServices/MarshalDirectiveException.cs +System.Runtime.InteropServices/ObjectCreationDelegate.cs +System.Runtime.InteropServices/OptionalAttribute.cs +System.Runtime.InteropServices/OutAttribute.cs +System.Runtime.InteropServices/PARAMDESC.cs +System.Runtime.InteropServices/PARAMFLAG.cs +System.Runtime.InteropServices/PreserveSigAttribute.cs +System.Runtime.InteropServices/PrimaryInteropAssemblyAttribute.cs +System.Runtime.InteropServices/RegistrationClassContext.cs +System.Runtime.InteropServices/RegistrationConnectionType.cs +System.Runtime.InteropServices/SEHException.cs +System.Runtime.InteropServices/STATSTG.cs +System.Runtime.InteropServices/ProgIdAttribute.cs +System.Runtime.InteropServices/RegistrationServices.cs +System.Runtime.InteropServices/RuntimeEnvironment.cs +System.Runtime.InteropServices/SafeArrayRankMismatchException.cs +System.Runtime.InteropServices/SafeArrayTypeMismatchException.cs +System.Runtime.InteropServices/SafeBuffer.cs +System.Runtime.InteropServices/SafeHandle.cs +System.Runtime.InteropServices/SetWin32ContextInIDispatchAttribute.cs +System.Runtime.InteropServices/StructLayoutAttribute.cs +System.Runtime.InteropServices/SYSKIND.cs +System.Runtime.InteropServices/TYPEATTR.cs +System.Runtime.InteropServices/TYPEDESC.cs +System.Runtime.InteropServices/TYPEFLAGS.cs +System.Runtime.InteropServices/TYPEKIND.cs +System.Runtime.InteropServices/TYPELIBATTR.cs +System.Runtime.InteropServices/TypeIdentifierAttribute.cs +System.Runtime.InteropServices/TypeLibConverter.cs +System.Runtime.InteropServices/TypeLibExporterFlags.cs +System.Runtime.InteropServices/TypeLibFuncAttribute.cs +System.Runtime.InteropServices/TypeLibFuncFlags.cs +System.Runtime.InteropServices/TypeLibImportClassAttribute.cs +System.Runtime.InteropServices/TypeLibImporterFlags.cs +System.Runtime.InteropServices/TypeLibTypeAttribute.cs +System.Runtime.InteropServices/TypeLibTypeFlags.cs +System.Runtime.InteropServices/TypeLibVarAttribute.cs +System.Runtime.InteropServices/TypeLibVarFlags.cs +System.Runtime.InteropServices/TypeLibVersionAttribute.cs +System.Runtime.InteropServices/UCOMIBindCtx.cs +System.Runtime.InteropServices/UCOMIConnectionPoint.cs +System.Runtime.InteropServices/UCOMIConnectionPointContainer.cs +System.Runtime.InteropServices/UCOMIEnumConnectionPoints.cs +System.Runtime.InteropServices/UCOMIEnumConnections.cs +System.Runtime.InteropServices/UCOMIEnumMoniker.cs +System.Runtime.InteropServices/UCOMIEnumString.cs +System.Runtime.InteropServices/UCOMIEnumVARIANT.cs +System.Runtime.InteropServices/UCOMIMoniker.cs +System.Runtime.InteropServices/UCOMIPersistFile.cs +System.Runtime.InteropServices/UCOMIRunningObjectTable.cs +System.Runtime.InteropServices/UCOMIStream.cs +System.Runtime.InteropServices/UCOMITypeComp.cs +System.Runtime.InteropServices/UCOMITypeInfo.cs +System.Runtime.InteropServices/UCOMITypeLib.cs +System.Runtime.InteropServices/UnknownWrapper.cs +System.Runtime.InteropServices/UnmanagedFunctionPointerAttribute.cs +System.Runtime.InteropServices/UnmanagedType.cs +System.Runtime.InteropServices/VARDESC.cs +System.Runtime.InteropServices/VarEnum.cs +System.Runtime.InteropServices/VARFLAGS.cs +System.Runtime.InteropServices/VariantWrapper.cs +System.Runtime.InteropServices.ComTypes/BINDPTR.cs +System.Runtime.InteropServices.ComTypes/BIND_OPTS.cs +System.Runtime.InteropServices.ComTypes/CALLCONV.cs +System.Runtime.InteropServices.ComTypes/CONNECTDATA.cs +System.Runtime.InteropServices.ComTypes/DESCKIND.cs +System.Runtime.InteropServices.ComTypes/DISPPARAMS.cs +System.Runtime.InteropServices.ComTypes/ELEMDESC.cs +System.Runtime.InteropServices.ComTypes/EXCEPINFO.cs +System.Runtime.InteropServices.ComTypes/FILETIME.cs +System.Runtime.InteropServices.ComTypes/FUNCDESC.cs +System.Runtime.InteropServices.ComTypes/FUNCFLAGS.cs +System.Runtime.InteropServices.ComTypes/FUNCKIND.cs +System.Runtime.InteropServices.ComTypes/IBindCtx.cs +System.Runtime.InteropServices.ComTypes/IConnectionPoint.cs +System.Runtime.InteropServices.ComTypes/IConnectionPointContainer.cs +System.Runtime.InteropServices.ComTypes/IDLDESC.cs +System.Runtime.InteropServices.ComTypes/IDLFLAG.cs +System.Runtime.InteropServices.ComTypes/IEnumConnectionPoints.cs +System.Runtime.InteropServices.ComTypes/IEnumConnections.cs +System.Runtime.InteropServices.ComTypes/IEnumMoniker.cs +System.Runtime.InteropServices.ComTypes/IEnumString.cs +System.Runtime.InteropServices.ComTypes/IEnumVARIANT.cs +System.Runtime.InteropServices.ComTypes/IMoniker.cs +System.Runtime.InteropServices.ComTypes/IMPLTYPEFLAGS.cs +System.Runtime.InteropServices.ComTypes/INVOKEKIND.cs +System.Runtime.InteropServices.ComTypes/IPersistFile.cs +System.Runtime.InteropServices.ComTypes/IRunningObjectTable.cs +System.Runtime.InteropServices.ComTypes/IStream.cs +System.Runtime.InteropServices.ComTypes/ITypeComp.cs +System.Runtime.InteropServices.ComTypes/ITypeInfo.cs +System.Runtime.InteropServices.ComTypes/ITypeInfo2.cs +System.Runtime.InteropServices.ComTypes/ITypeLib.cs +System.Runtime.InteropServices.ComTypes/ITypeLib2.cs +System.Runtime.InteropServices.ComTypes/LIBFLAGS.cs +System.Runtime.InteropServices.ComTypes/PARAMDESC.cs +System.Runtime.InteropServices.ComTypes/PARAMFLAG.cs +System.Runtime.InteropServices.ComTypes/STATSTG.cs +System.Runtime.InteropServices.ComTypes/SYSKIND.cs +System.Runtime.InteropServices.ComTypes/TYPEATTR.cs +System.Runtime.InteropServices.ComTypes/TYPEDESC.cs +System.Runtime.InteropServices.ComTypes/TYPEFLAGS.cs +System.Runtime.InteropServices.ComTypes/TYPEKIND.cs +System.Runtime.InteropServices.ComTypes/TYPELIBATTR.cs +System.Runtime.InteropServices.ComTypes/VARDESC.cs +System.Runtime.InteropServices.ComTypes/VARFLAGS.cs +System.Runtime.InteropServices.ComTypes/VARKIND.cs +System.Runtime.InteropServices.Expando/IExpando.cs +System.Runtime.InteropServices.WindowsRuntime/DefaultInterfaceAttribute.cs +System.Runtime.InteropServices.WindowsRuntime/DesignerNamespaceResolveEventArgs.cs +System.Runtime.InteropServices.WindowsRuntime/EventRegistrationToken.cs +System.Runtime.InteropServices.WindowsRuntime/EventRegistrationTokenTable.cs +System.Runtime.InteropServices.WindowsRuntime/IActivationFactory.cs +System.Runtime.InteropServices.WindowsRuntime/InterfaceImplementedInVersionAttribute.cs +System.Runtime.InteropServices.WindowsRuntime/NamespaceResolveEventArgs.cs +System.Runtime.InteropServices.WindowsRuntime/ReadOnlyArrayAttribute.cs +System.Runtime.InteropServices.WindowsRuntime/ReturnValueNameAttribute.cs +System.Runtime.InteropServices.WindowsRuntime/WindowsRuntimeMarshal.cs +System.Runtime.InteropServices.WindowsRuntime/WindowsRuntimeMetadata.cs +System.Runtime.InteropServices.WindowsRuntime/WriteOnlyArrayAttribute.cs +System.Runtime.Remoting/ActivatedClientTypeEntry.cs +System.Runtime.Remoting/ActivatedServiceTypeEntry.cs +System.Runtime.Remoting/CustomErrorsModes.cs +System.Runtime.Remoting/EnvoyInfo.cs +System.Runtime.Remoting/IObjectHandle.cs +System.Runtime.Remoting/IChannelInfo.cs +System.Runtime.Remoting/Identity.cs +System.Runtime.Remoting/InternalRemotingServices.cs +System.Runtime.Remoting/IEnvoyInfo.cs +System.Runtime.Remoting/IRemotingTypeInfo.cs +System.Runtime.Remoting/ObjectHandle.cs +System.Runtime.Remoting/ObjRef.cs +System.Runtime.Remoting/RemotingConfiguration.cs +System.Runtime.Remoting/RemotingException.cs +System.Runtime.Remoting/RemotingTimeoutException.cs +System.Runtime.Remoting/RemotingServices.cs +System.Runtime.Remoting/ServerException.cs +System.Runtime.Remoting/ServerIdentity.cs +System.Runtime.Remoting/SoapServices.cs +System.Runtime.Remoting/TypeEntry.cs +System.Runtime.Remoting/TypeInfo.cs +System.Runtime.Remoting/WellKnownObjectMode.cs +System.Runtime.Remoting/WellKnownClientTypeEntry.cs +System.Runtime.Remoting/WellKnownServiceTypeEntry.cs +System.Runtime.Remoting.Activation/ActivationServices.cs +System.Runtime.Remoting.Activation/ActivatorLevel.cs +System.Runtime.Remoting.Activation/AppDomainLevelActivator.cs +System.Runtime.Remoting.Activation/ConstructionLevelActivator.cs +System.Runtime.Remoting.Activation/ContextLevelActivator.cs +System.Runtime.Remoting.Activation/IActivator.cs +System.Runtime.Remoting.Activation/IConstructionCallMessage.cs +System.Runtime.Remoting.Activation/IConstructionReturnMessage.cs +System.Runtime.Remoting.Activation/RemoteActivator.cs +System.Runtime.Remoting.Activation/RemoteActivationAttribute.cs +System.Runtime.Remoting.Activation/UrlAttribute.cs +System.Runtime.Remoting.Channels/AggregateDictionary.cs +System.Runtime.Remoting.Channels/BaseChannelObjectWithProperties.cs +System.Runtime.Remoting.Channels/BaseChannelSinkWithProperties.cs +System.Runtime.Remoting.Channels/BaseChannelWithProperties.cs +System.Runtime.Remoting.Channels/ChannelDataStore.cs +System.Runtime.Remoting.Channels/ChannelServices.cs +System.Runtime.Remoting.Channels/ChannelSinkStackEntry.cs +System.Runtime.Remoting.Channels/ClientChannelSinkStack.cs +System.Runtime.Remoting.Channels/IChannel.cs +System.Runtime.Remoting.Channels/IChannelDataStore.cs +System.Runtime.Remoting.Channels/IChannelReceiver.cs +System.Runtime.Remoting.Channels/IChannelReceiverHook.cs +System.Runtime.Remoting.Channels/IChannelSender.cs +System.Runtime.Remoting.Channels/IChannelSinkBase.cs +System.Runtime.Remoting.Channels/IClientChannelSink.cs +System.Runtime.Remoting.Channels/IClientChannelSinkProvider.cs +System.Runtime.Remoting.Channels/IClientChannelSinkStack.cs +System.Runtime.Remoting.Channels/IClientFormatterSink.cs +System.Runtime.Remoting.Channels/IClientFormatterSinkProvider.cs +System.Runtime.Remoting.Channels/IClientResponseChannelSinkStack.cs +System.Runtime.Remoting.Channels/ISecurableChannel.cs +System.Runtime.Remoting.Channels/IServerResponseChannelSinkStack.cs +System.Runtime.Remoting.Channels/ServerDispatchSink.cs +System.Runtime.Remoting.Channels/ServerDispatchSinkProvider.cs +System.Runtime.Remoting.Channels/IServerChannelSink.cs +System.Runtime.Remoting.Channels/IServerChannelSinkProvider.cs +System.Runtime.Remoting.Channels/IServerChannelSinkStack.cs +System.Runtime.Remoting.Channels/IServerFormatterSinkProvider.cs +System.Runtime.Remoting.Channels/ITransportHeaders.cs +System.Runtime.Remoting.Channels/ServerChannelSinkStack.cs +System.Runtime.Remoting.Channels/ServerProcessing.cs +System.Runtime.Remoting.Channels/SinkProviderData.cs +System.Runtime.Remoting.Channels/TransportHeaders.cs +System.Runtime.Remoting.Channels/CrossAppDomainChannel.cs +System.Runtime.Remoting.Contexts/Context.cs +System.Runtime.Remoting.Contexts/ContextAttribute.cs +System.Runtime.Remoting.Contexts/ContextProperty.cs +System.Runtime.Remoting.Contexts/CrossContextChannel.cs +System.Runtime.Remoting.Contexts/CrossContextDelegate.cs +System.Runtime.Remoting.Contexts/IContextAttribute.cs +System.Runtime.Remoting.Contexts/IContextProperty.cs +System.Runtime.Remoting.Contexts/IContextPropertyActivator.cs +System.Runtime.Remoting.Contexts/IContributeClientContextSink.cs +System.Runtime.Remoting.Contexts/IContributeDynamicSink.cs +System.Runtime.Remoting.Contexts/IContributeEnvoySink.cs +System.Runtime.Remoting.Contexts/IContributeObjectSink.cs +System.Runtime.Remoting.Contexts/IContributeServerContextSink.cs +System.Runtime.Remoting.Contexts/IDynamicMessageSink.cs +System.Runtime.Remoting.Contexts/IDynamicProperty.cs +System.Runtime.Remoting.Contexts/SynchronizationAttribute.cs +System.Runtime.Remoting.Lifetime/ClientSponsor.cs +System.Runtime.Remoting.Lifetime/ILease.cs +System.Runtime.Remoting.Lifetime/ISponsor.cs +System.Runtime.Remoting.Lifetime/Lease.cs +System.Runtime.Remoting.Lifetime/LeaseManager.cs +System.Runtime.Remoting.Lifetime/LeaseSink.cs +System.Runtime.Remoting.Lifetime/LeaseState.cs +System.Runtime.Remoting.Lifetime/LifetimeServices.cs +System.Runtime.Remoting.Messaging/ArgInfo.cs +System.Runtime.Remoting.Messaging/AsyncResult.cs +System.Runtime.Remoting.Messaging/CallContext.cs +System.Runtime.Remoting.Messaging/ClientContextTerminatorSink.cs +System.Runtime.Remoting.Messaging/ConstructionCall.cs +System.Runtime.Remoting.Messaging/ConstructionCallDictionary.cs +System.Runtime.Remoting.Messaging/ConstructionResponse.cs +System.Runtime.Remoting.Messaging/EnvoyTerminatorSink.cs +System.Runtime.Remoting.Messaging/Header.cs +System.Runtime.Remoting.Messaging/HeaderHandler.cs +System.Runtime.Remoting.Messaging/ErrorMessage.cs +System.Runtime.Remoting.Messaging/IInternalMessage.cs +System.Runtime.Remoting.Messaging/IMessage.cs +System.Runtime.Remoting.Messaging/IMessageCtrl.cs +System.Runtime.Remoting.Messaging/IMessageSink.cs +System.Runtime.Remoting.Messaging/IMethodCallMessage.cs +System.Runtime.Remoting.Messaging/IMethodMessage.cs +System.Runtime.Remoting.Messaging/IMethodReturnMessage.cs +System.Runtime.Remoting.Messaging/IRemotingFormatter.cs +System.Runtime.Remoting.Messaging/InternalMessageWrapper.cs +System.Runtime.Remoting.Messaging/ISerializationRootObject.cs +System.Runtime.Remoting.Messaging/LogicalCallContext.cs +System.Runtime.Remoting.Messaging/MessageSurrogateFilter.cs +System.Runtime.Remoting.Messaging/MethodCall.cs +System.Runtime.Remoting.Messaging/MethodCallMessageWrapper.cs +System.Runtime.Remoting.Messaging/MethodResponse.cs +System.Runtime.Remoting.Messaging/MethodCallDictionary.cs +System.Runtime.Remoting.Messaging/MethodDictionary.cs +System.Runtime.Remoting.Messaging/MethodReturnDictionary.cs +System.Runtime.Remoting.Messaging/MethodReturnMessageWrapper.cs +System.Runtime.Remoting.Messaging/MonoMethodMessage.cs +System.Runtime.Remoting.Messaging/OneWayAttribute.cs +System.Runtime.Remoting.Messaging/RemotingSurrogateSelector.cs +System.Runtime.Remoting.Messaging/RemotingSurrogate.cs +System.Runtime.Remoting.Messaging/ReturnMessage.cs +System.Runtime.Remoting.Messaging/ServerContextTerminatorSink.cs +System.Runtime.Remoting.Messaging/ServerObjectTerminatorSink.cs +System.Runtime.Remoting.Messaging/StackBuilderSink.cs +System.Runtime.Remoting.Messaging/CADMessages.cs +System.Runtime.Remoting.Metadata/SoapAttribute.cs +System.Runtime.Remoting.Metadata/SoapFieldAttribute.cs +System.Runtime.Remoting.Metadata/SoapMethodAttribute.cs +System.Runtime.Remoting.Metadata/SoapOption.cs +System.Runtime.Remoting.Metadata/SoapParameterAttribute.cs +System.Runtime.Remoting.Metadata/SoapTypeAttribute.cs +System.Runtime.Remoting.Metadata/XmlFieldOrderOption.cs +System.Runtime.Remoting.Metadata.W3cXsd2001/ISoapXsd.cs +System.Runtime.Remoting.Metadata.W3cXsd2001/SoapAnyUri.cs +System.Runtime.Remoting.Metadata.W3cXsd2001/SoapEntity.cs +System.Runtime.Remoting.Metadata.W3cXsd2001/SoapMonth.cs +System.Runtime.Remoting.Metadata.W3cXsd2001/SoapNonNegativeInteger.cs +System.Runtime.Remoting.Metadata.W3cXsd2001/SoapToken.cs +System.Runtime.Remoting.Metadata.W3cXsd2001/SoapBase64Binary.cs +System.Runtime.Remoting.Metadata.W3cXsd2001/SoapHexBinary.cs +System.Runtime.Remoting.Metadata.W3cXsd2001/SoapMonthDay.cs +System.Runtime.Remoting.Metadata.W3cXsd2001/SoapNonPositiveInteger.cs +System.Runtime.Remoting.Metadata.W3cXsd2001/SoapYear.cs +System.Runtime.Remoting.Metadata.W3cXsd2001/SoapDate.cs +System.Runtime.Remoting.Metadata.W3cXsd2001/SoapHelper.cs +System.Runtime.Remoting.Metadata.W3cXsd2001/SoapId.cs +System.Runtime.Remoting.Metadata.W3cXsd2001/SoapName.cs +System.Runtime.Remoting.Metadata.W3cXsd2001/SoapNormalizedString.cs +System.Runtime.Remoting.Metadata.W3cXsd2001/SoapYearMonth.cs +System.Runtime.Remoting.Metadata.W3cXsd2001/SoapDateTime.cs +System.Runtime.Remoting.Metadata.W3cXsd2001/SoapIdref.cs +System.Runtime.Remoting.Metadata.W3cXsd2001/SoapNcName.cs +System.Runtime.Remoting.Metadata.W3cXsd2001/SoapNotation.cs +System.Runtime.Remoting.Metadata.W3cXsd2001/SoapDay.cs +System.Runtime.Remoting.Metadata.W3cXsd2001/SoapIdrefs.cs +System.Runtime.Remoting.Metadata.W3cXsd2001/SoapNegativeInteger.cs +System.Runtime.Remoting.Metadata.W3cXsd2001/SoapPositiveInteger.cs +System.Runtime.Remoting.Metadata.W3cXsd2001/SoapDuration.cs +System.Runtime.Remoting.Metadata.W3cXsd2001/SoapInteger.cs +System.Runtime.Remoting.Metadata.W3cXsd2001/SoapNmtoken.cs +System.Runtime.Remoting.Metadata.W3cXsd2001/SoapQName.cs +System.Runtime.Remoting.Metadata.W3cXsd2001/SoapEntities.cs +System.Runtime.Remoting.Metadata.W3cXsd2001/SoapLanguage.cs +System.Runtime.Remoting.Metadata.W3cXsd2001/SoapNmtokens.cs +System.Runtime.Remoting.Metadata.W3cXsd2001/SoapTime.cs +System.Runtime.Remoting.Proxies/RealProxy.cs +System.Runtime.Remoting.Proxies/RemotingProxy.cs +System.Runtime.Remoting.Proxies/ProxyAttribute.cs +System.Runtime.Remoting.Services/EnterpriseServicesHelper.cs +System.Runtime.Remoting.Services/ITrackingHandler.cs +System.Runtime.Remoting.Services/TrackingServices.cs +System.Runtime.Serialization/Formatter.cs +System.Runtime.Serialization/FormatterConverter.cs +System.Runtime.Serialization/FormatterServices.cs +System.Runtime.Serialization/IDeserializationCallback.cs +System.Runtime.Serialization/IFormatter.cs +System.Runtime.Serialization/IFormatterConverter.cs +System.Runtime.Serialization/IObjectReference.cs +System.Runtime.Serialization/ISafeSerializationData.cs +System.Runtime.Serialization/ISerializable.cs +System.Runtime.Serialization/ISerializationSurrogate.cs +System.Runtime.Serialization/ISurrogateSelector.cs +System.Runtime.Serialization/ObjectIDGenerator.cs +System.Runtime.Serialization/ObjectManager.cs +System.Runtime.Serialization/OnDeserializedAttribute.cs +System.Runtime.Serialization/OnDeserializingAttribute.cs +System.Runtime.Serialization/OnSerializedAttribute.cs +System.Runtime.Serialization/OnSerializingAttribute.cs +System.Runtime.Serialization/OptionalFieldAttribute.cs +System.Runtime.Serialization/SafeSerializationEventArgs.cs +System.Runtime.Serialization/SerializationBinder.cs +System.Runtime.Serialization/SerializationCallbacks.cs +System.Runtime.Serialization/SerializationEntry.cs +System.Runtime.Serialization/SerializationException.cs +System.Runtime.Serialization/SerializationInfo.cs +System.Runtime.Serialization/SerializationInfoEnumerator.cs +System.Runtime.Serialization/SerializationObjectManager.cs +System.Runtime.Serialization/StreamingContext.cs +System.Runtime.Serialization/StreamingContextStates.cs +System.Runtime.Serialization/SurrogateSelector.cs +System.Runtime.Serialization.Formatters/FormatterAssemblyStyle.cs +System.Runtime.Serialization.Formatters/FormatterTopObjectStyle.cs +System.Runtime.Serialization.Formatters/FormatterTypeStyle.cs +System.Runtime.Serialization.Formatters/IFieldInfo.cs +System.Runtime.Serialization.Formatters/InternalArrayTypeE.cs +System.Runtime.Serialization.Formatters/InternalElementTypeE.cs +System.Runtime.Serialization.Formatters/InternalMemberTypeE.cs +System.Runtime.Serialization.Formatters/InternalMemberValueE.cs +System.Runtime.Serialization.Formatters/InternalNameSpaceE.cs +System.Runtime.Serialization.Formatters/InternalObjectPositionE.cs +System.Runtime.Serialization.Formatters/InternalObjectTypeE.cs +System.Runtime.Serialization.Formatters/InternalParseStateE.cs +System.Runtime.Serialization.Formatters/InternalParseTypeE.cs +System.Runtime.Serialization.Formatters/InternalPrimitiveTypeE.cs +System.Runtime.Serialization.Formatters/InternalRM.cs +System.Runtime.Serialization.Formatters/InternalSerializerTypeE.cs +System.Runtime.Serialization.Formatters/InternalST.cs +System.Runtime.Serialization.Formatters/ISoapMessage.cs +System.Runtime.Serialization.Formatters/ServerFault.cs +System.Runtime.Serialization.Formatters/SoapFault.cs +System.Runtime.Serialization.Formatters/SoapMessage.cs +System.Runtime.Serialization.Formatters/TypeFilterLevel.cs +System.Runtime.Serialization.Formatters.Binary/BinaryFormatter.cs +System.Runtime.Serialization.Formatters.Binary/BinaryCommon.cs +System.Runtime.Serialization.Formatters.Binary/CodeGenerator.cs +System.Runtime.Serialization.Formatters.Binary/ObjectReader.cs +System.Runtime.Serialization.Formatters.Binary/ObjectWriter.cs +System.Runtime.Serialization.Formatters.Binary/MessageFormatter.cs +System.Runtime.Versioning/CompatibilitySwitch.cs +System.Runtime.Versioning/ComponentGuaranteesAttribute.cs +System.Runtime.Versioning/ComponentGuaranteesOptions.cs +System.Runtime.Versioning/ResourceConsumptionAttribute.cs +System.Runtime.Versioning/ResourceExposureAttribute.cs +System.Runtime.Versioning/ResourceScope.cs +System.Runtime.Versioning/TargetFrameworkAttribute.cs +System.Runtime.Versioning/VersioningHelper.cs +System.Security/AllowPartiallyTrustedCallersAttribute.cs +System.Security/CodeAccessPermission.cs +System.Security/HostProtectionException.cs +System.Security/HostSecurityManager.cs +System.Security/HostSecurityManagerFlags.cs +System.Security/IEvidenceFactory.cs +System.Security/IPermission.cs +System.Security/ISecurityEncodable.cs +System.Security/ISecurityPolicyEncodable.cs +System.Security/IStackWalk.cs +System.Security/NamedPermissionSet.cs +System.Security/PermissionBuilder.cs +System.Security/PermissionSet.cs +System.Security/PolicyLevelType.cs +System.Security/SecureString.cs +System.Security/SecurityContext.cs +System.Security/SecurityContextSource.cs +System.Security/SecurityCriticalAttribute.cs +System.Security/SecurityCriticalScope.cs +System.Security/SecurityElement.cs +System.Security/SecurityFrame.cs +System.Security/SecurityException.cs +System.Security/SecurityManager.cs +System.Security/SecurityManager_mobile.cs +System.Security/SecurityRuleSet.cs +System.Security/SecurityRulesAttribute.cs +System.Security/SecuritySafeCriticalAttribute.cs +System.Security/SecurityState.cs +System.Security/SecurityTransparentAttribute.cs +System.Security/SecurityTreatAsSafeAttribute.cs +System.Security/SecurityZone.cs +System.Security/SuppressUnmanagedCodeSecurityAttribute.cs +System.Security/UnverifiableCodeAttribute.cs +System.Security/VerificationException.cs +System.Security/XmlSyntaxException.cs +System.Security.AccessControl/AccessControlActions.cs +System.Security.AccessControl/AccessControlModification.cs +System.Security.AccessControl/AccessControlSections.cs +System.Security.AccessControl/AccessControlType.cs +System.Security.AccessControl/AccessRule.cs +System.Security.AccessControl/AccessRule_T.cs +System.Security.AccessControl/AceEnumerator.cs +System.Security.AccessControl/AceFlags.cs +System.Security.AccessControl/AceQualifier.cs +System.Security.AccessControl/AceType.cs +System.Security.AccessControl/AuditFlags.cs +System.Security.AccessControl/AuditRule.cs +System.Security.AccessControl/AuditRule_T.cs +System.Security.AccessControl/AuthorizationRule.cs +System.Security.AccessControl/AuthorizationRuleCollection.cs +System.Security.AccessControl/CommonAce.cs +System.Security.AccessControl/CommonAcl.cs +System.Security.AccessControl/CommonObjectSecurity.cs +System.Security.AccessControl/CommonSecurityDescriptor.cs +System.Security.AccessControl/CompoundAce.cs +System.Security.AccessControl/CompoundAceType.cs +System.Security.AccessControl/ControlFlags.cs +System.Security.AccessControl/CryptoKeyAccessRule.cs +System.Security.AccessControl/CryptoKeyAuditRule.cs +System.Security.AccessControl/CryptoKeyRights.cs +System.Security.AccessControl/CryptoKeySecurity.cs +System.Security.AccessControl/CustomAce.cs +System.Security.AccessControl/DirectoryObjectSecurity.cs +System.Security.AccessControl/DirectorySecurity.cs +System.Security.AccessControl/DiscretionaryAcl.cs +System.Security.AccessControl/EventWaitHandleAccessRule.cs +System.Security.AccessControl/EventWaitHandleAuditRule.cs +System.Security.AccessControl/EventWaitHandleRights.cs +System.Security.AccessControl/EventWaitHandleSecurity.cs +System.Security.AccessControl/FileSecurity.cs +System.Security.AccessControl/FileSystemAccessRule.cs +System.Security.AccessControl/FileSystemAuditRule.cs +System.Security.AccessControl/FileSystemRights.cs +System.Security.AccessControl/FileSystemSecurity.cs +System.Security.AccessControl/GenericAce.cs +System.Security.AccessControl/GenericAcl.cs +System.Security.AccessControl/GenericSecurityDescriptor.cs +System.Security.AccessControl/InheritanceFlags.cs +System.Security.AccessControl/KnownAce.cs +System.Security.AccessControl/MutexAccessRule.cs +System.Security.AccessControl/MutexAuditRule.cs +System.Security.AccessControl/MutexRights.cs +System.Security.AccessControl/MutexSecurity.cs +System.Security.AccessControl/NativeObjectSecurity.cs +System.Security.AccessControl/ObjectAccessRule.cs +System.Security.AccessControl/ObjectAce.cs +System.Security.AccessControl/ObjectAceFlags.cs +System.Security.AccessControl/ObjectAuditRule.cs +System.Security.AccessControl/ObjectSecurity.cs +System.Security.AccessControl/ObjectSecurity_T.cs +System.Security.AccessControl/PrivilegeNotHeldException.cs +System.Security.AccessControl/PropagationFlags.cs +System.Security.AccessControl/QualifiedAce.cs +System.Security.AccessControl/RawAcl.cs +System.Security.AccessControl/RawSecurityDescriptor.cs +System.Security.AccessControl/RegistryAccessRule.cs +System.Security.AccessControl/RegistryAuditRule.cs +System.Security.AccessControl/RegistryRights.cs +System.Security.AccessControl/RegistrySecurity.cs +System.Security.AccessControl/ResourceType.cs +System.Security.AccessControl/SddlAccessRight.cs +System.Security.AccessControl/SecurityInfos.cs +System.Security.AccessControl/SystemAcl.cs +../System.Core/System.Security.Cryptography/Aes.cs +System.Security.Claims/Claim.cs +System.Security.Claims/ClaimsIdentity.cs +System.Security.Claims/ClaimsPrincipal.cs +System.Security.Claims/ClaimTypes.cs +System.Security.Claims/ClaimValueTypes.cs +System.Security.Cryptography/AsymmetricAlgorithm.cs +System.Security.Cryptography/AsymmetricKeyExchangeDeformatter.cs +System.Security.Cryptography/AsymmetricKeyExchangeFormatter.cs +System.Security.Cryptography/AsymmetricSignatureDeformatter.cs +System.Security.Cryptography/AsymmetricSignatureFormatter.cs +System.Security.Cryptography/Base64Constants.cs +System.Security.Cryptography/CipherMode.cs +System.Security.Cryptography/CryptoAPITransform.cs +System.Security.Cryptography/CryptoConfig.cs +System.Security.Cryptography/CryptoConfig_2_1.cs +System.Security.Cryptography/CryptoConfig.fullaot.cs +System.Security.Cryptography/CryptographicException.cs +System.Security.Cryptography/CryptographicUnexpectedOperationExcpetion.cs +System.Security.Cryptography/CryptoStream.cs +System.Security.Cryptography/CryptoStreamMode.cs +System.Security.Cryptography/CspKeyContainerInfo.cs +System.Security.Cryptography/CspParameters.cs +System.Security.Cryptography/CspProviderFlags.cs +System.Security.Cryptography/DeriveBytes.cs +System.Security.Cryptography/DES.cs +System.Security.Cryptography/DESCryptoServiceProvider.cs +System.Security.Cryptography/DSA.cs +System.Security.Cryptography/DSACryptoServiceProvider.cs +System.Security.Cryptography/DSAParameters.cs +System.Security.Cryptography/DSASignatureDeformatter.cs +System.Security.Cryptography/DSASignatureFormatter.cs +System.Security.Cryptography/FromBase64Transform.cs +System.Security.Cryptography/HashAlgorithm.cs +System.Security.Cryptography/HMAC.cs +System.Security.Cryptography/HMACMD5.cs +System.Security.Cryptography/HMACRIPEMD160.cs +System.Security.Cryptography/HMACSHA1.cs +System.Security.Cryptography/HMACSHA256.cs +System.Security.Cryptography/HMACSHA384.cs +System.Security.Cryptography/HMACSHA512.cs +System.Security.Cryptography/ICryptoTransform.cs +System.Security.Cryptography/ICspAsymmetricAlgorithm.cs +System.Security.Cryptography/KeyedHashAlgorithm.cs +System.Security.Cryptography/KeyNumber.cs +System.Security.Cryptography/KeySizes.cs +System.Security.Cryptography/MACTripleDES.cs +System.Security.Cryptography/MaskGenerationMethod.cs +System.Security.Cryptography/MD5.cs +System.Security.Cryptography/MD5CryptoServiceProvider.cs +System.Security.Cryptography/PaddingMode.cs +System.Security.Cryptography/PasswordDeriveBytes.cs +System.Security.Cryptography/PKCS1MaskGenerationMethod.cs +System.Security.Cryptography/RandomNumberGenerator.cs +System.Security.Cryptography/RC2.cs +System.Security.Cryptography/RC2CryptoServiceProvider.cs +System.Security.Cryptography/Rfc2898DeriveBytes.cs +System.Security.Cryptography/Rijndael.cs +System.Security.Cryptography/RijndaelManaged.cs +System.Security.Cryptography/RijndaelManagedTransform.cs +System.Security.Cryptography/RIPEMD160.cs +System.Security.Cryptography/RIPEMD160Managed.cs +System.Security.Cryptography/RNGCryptoServiceProvider.cs +System.Security.Cryptography/RSA.cs +System.Security.Cryptography/RSACryptoServiceProvider.cs +System.Security.Cryptography/RSAOAEPKeyExchangeDeformatter.cs +System.Security.Cryptography/RSAOAEPKeyExchangeFormatter.cs +System.Security.Cryptography/RSAParameters.cs +System.Security.Cryptography/RSAPKCS1KeyExchangeDeformatter.cs +System.Security.Cryptography/RSAPKCS1KeyExchangeFormatter.cs +System.Security.Cryptography/RSAPKCS1SignatureDeformatter.cs +System.Security.Cryptography/RSAPKCS1SignatureFormatter.cs +System.Security.Cryptography/SHA1.cs +System.Security.Cryptography/SHA1CryptoServiceProvider.cs +System.Security.Cryptography/SHA1Managed.cs +System.Security.Cryptography/SHA256.cs +System.Security.Cryptography/SHA256Managed.cs +System.Security.Cryptography/SHA384.cs +System.Security.Cryptography/SHA384Managed.cs +System.Security.Cryptography/SHA512.cs +System.Security.Cryptography/SHA512Managed.cs +System.Security.Cryptography/SHAConstants.cs +System.Security.Cryptography/SignatureDescription.cs +System.Security.Cryptography/SymmetricAlgorithm.cs +System.Security.Cryptography/ToBase64Transform.cs +System.Security.Cryptography/TripleDES.cs +System.Security.Cryptography/TripleDESCryptoServiceProvider.cs +System.Security.Cryptography.X509Certificates/X509Certificate.cs +System.Security.Cryptography.X509Certificates/X509Certificate20.cs +System.Security.Cryptography.X509Certificates/X509ContentType.cs +System.Security.Cryptography.X509Certificates/X509KeyStorageFlags.cs +System.Security.Permissions/CodeAccessSecurityAttribute.cs +System.Security.Permissions/EnvironmentPermission.cs +System.Security.Permissions/EnvironmentPermissionAccess.cs +System.Security.Permissions/EnvironmentPermissionAttribute.cs +System.Security.Permissions/FileDialogPermission.cs +System.Security.Permissions/FileDialogPermissionAccess.cs +System.Security.Permissions/FileDialogPermissionAttribute.cs +System.Security.Permissions/FileIOPermission.cs +System.Security.Permissions/FileIOPermissionAccess.cs +System.Security.Permissions/FileIOPermissionAttribute.cs +System.Security.Permissions/GacIdentityPermission.cs +System.Security.Permissions/GacIdentityPermissionAttribute.cs +System.Security.Permissions/HostProtectionAttribute.cs +System.Security.Permissions/HostProtectionPermission.cs +System.Security.Permissions/HostProtectionResource.cs +System.Security.Permissions/IBuiltInPermission.cs +System.Security.Permissions/IsolatedStorageContainment.cs +System.Security.Permissions/IsolatedStorageFilePermission.cs +System.Security.Permissions/IsolatedStorageFilePermissionAttribute.cs +System.Security.Permissions/IsolatedStoragePermission.cs +System.Security.Permissions/IsolatedStoragePermissionAttribute.cs +System.Security.Permissions/IUnrestrictedPermission.cs +System.Security.Permissions/KeyContainerPermission.cs +System.Security.Permissions/KeyContainerPermissionAccessEntry.cs +System.Security.Permissions/KeyContainerPermissionAccessEntryCollection.cs +System.Security.Permissions/KeyContainerPermissionAccessEntryEnumerator.cs +System.Security.Permissions/KeyContainerPermissionAttribute.cs +System.Security.Permissions/KeyContainerPermissionFlags.cs +System.Security.Permissions/PermissionSetAttribute.cs +System.Security.Permissions/PermissionState.cs +System.Security.Permissions/PrincipalPermission.cs +System.Security.Permissions/PrincipalPermissionAttribute.cs +System.Security.Permissions/PublisherIdentityPermission.cs +System.Security.Permissions/PublisherIdentityPermissionAttribute.cs +System.Security.Permissions/ReflectionPermission.cs +System.Security.Permissions/ReflectionPermissionAttribute.cs +System.Security.Permissions/ReflectionPermissionFlag.cs +System.Security.Permissions/RegistryPermission.cs +System.Security.Permissions/RegistryPermissionAccess.cs +System.Security.Permissions/RegistryPermissionAttribute.cs +System.Security.Permissions/SecurityAction.cs +System.Security.Permissions/SecurityAttribute.cs +System.Security.Permissions/SecurityPermission.cs +System.Security.Permissions/SecurityPermissionAttribute.cs +System.Security.Permissions/SecurityPermissionFlag.cs +System.Security.Permissions/SiteIdentityPermission.cs +System.Security.Permissions/SiteIdentityPermissionAttribute.cs +System.Security.Permissions/StrongNameIdentityPermission.cs +System.Security.Permissions/StrongNamePermissionAttribute.cs +System.Security.Permissions/StrongNamePublicKeyBlob.cs +System.Security.Permissions/UIPermission.cs +System.Security.Permissions/UIPermissionAttribute.cs +System.Security.Permissions/UIPermissionClipboard.cs +System.Security.Permissions/UIPermissionWindow.cs +System.Security.Permissions/UrlIdentityPermission.cs +System.Security.Permissions/UrlIdentityPermissionAttribute.cs +System.Security.Permissions/ZoneIdentityPermission.cs +System.Security.Permissions/ZoneIdentityPermissionAttribute.cs +System.Security.Policy/AllMembershipCondition.cs +System.Security.Policy/ApplicationDirectory.cs +System.Security.Policy/ApplicationDirectoryMembershipCondition.cs +System.Security.Policy/ApplicationSecurityInfo.cs +System.Security.Policy/ApplicationSecurityManager.cs +System.Security.Policy/ApplicationTrust.cs +System.Security.Policy/ApplicationTrustCollection.cs +System.Security.Policy/ApplicationTrustEnumerator.cs +System.Security.Policy/ApplicationVersionMatch.cs +System.Security.Policy/CodeConnectAccess.cs +System.Security.Policy/CodeGroup.cs +System.Security.Policy/DefaultPolicies.cs +System.Security.Policy/Evidence.cs +System.Security.Policy/EvidenceBase.cs +System.Security.Policy/FileCodeGroup.cs +System.Security.Policy/FirstMatchCodeGroup.cs +System.Security.Policy/Gac.cs +System.Security.Policy/GacMembershipCondition.cs +System.Security.Policy/Hash.cs +System.Security.Policy/HashMembershipCondition.cs +System.Security.Policy/IApplicationTrustManager.cs +System.Security.Policy/IBuiltInEvidence.cs +System.Security.Policy/IConstantMembershipCondition.cs +System.Security.Policy/IIdentityPermissionFactory.cs +System.Security.Policy/IMembershipCondition.cs +System.Security.Policy/MembershipConditionHelper.cs +System.Security.Policy/MonoTrustManager.cs +System.Security.Policy/NetCodeGroup.cs +System.Security.Policy/PermissionRequestEvidence.cs +System.Security.Policy/PolicyException.cs +System.Security.Policy/PolicyLevel.cs +System.Security.Policy/PolicyStatement.cs +System.Security.Policy/PolicyStatementAttribute.cs +System.Security.Policy/Publisher.cs +System.Security.Policy/PublisherMembershipCondition.cs +System.Security.Policy/Site.cs +System.Security.Policy/SiteMembershipCondition.cs +System.Security.Policy/StrongName.cs +System.Security.Policy/StrongNameMembershipCondition.cs +System.Security.Policy/TrustManagerContext.cs +System.Security.Policy/TrustManagerUIContext.cs +System.Security.Policy/UnionCodeGroup.cs +System.Security.Policy/Url.cs +System.Security.Policy/UrlMembershipCondition.cs +System.Security.Policy/Zone.cs +System.Security.Policy/ZoneMembershipCondition.cs +System.Security.Principal/GenericIdentity.cs +System.Security.Principal/GenericPrincipal.cs +System.Security.Principal/IdentityNotMappedException.cs +System.Security.Principal/IdentityReferenceCollection.cs +System.Security.Principal/IdentityReference.cs +System.Security.Principal/IIdentity.cs +System.Security.Principal/IPrincipal.cs +System.Security.Principal/NTAccount.cs +System.Security.Principal/PrincipalPolicy.cs +System.Security.Principal/SecurityIdentifier.cs +System.Security.Principal/TokenAccessLevels.cs +System.Security.Principal/TokenImpersonationLevel.cs +System.Security.Principal/WellKnownAccount.cs +System.Security.Principal/WellKnownSidType.cs +System.Security.Principal/WindowsAccountType.cs +System.Security.Principal/WindowsBuiltInRole.cs +System.Security.Principal/WindowsIdentity.cs +System.Security.Principal/WindowsImpersonationContext.cs +System.Security.Principal/WindowsPrincipal.cs +System.Text/ASCIIEncoding.cs +System.Text/CodePageEncoding.cs +System.Text/Decoder.cs +System.Text/DecoderExceptionFallback.cs +System.Text/DecoderExceptionFallbackBuffer.cs +System.Text/DecoderFallback.cs +System.Text/DecoderFallbackBuffer.cs +System.Text/DecoderFallbackException.cs +System.Text/DecoderReplacementFallback.cs +System.Text/DecoderReplacementFallbackBuffer.cs +System.Text/Encoder.cs +System.Text/EncoderExceptionFallback.cs +System.Text/EncoderExceptionFallbackBuffer.cs +System.Text/EncoderFallback.cs +System.Text/EncoderFallbackBuffer.cs +System.Text/EncoderFallbackException.cs +System.Text/EncoderReplacementFallback.cs +System.Text/EncoderReplacementFallbackBuffer.cs +System.Text/Encoding.cs +System.Text/EncodingEncoder.cs +System.Text/EncodingDecoder.cs +System.Text/EncodingInfo.cs +System.Text/Latin1Encoding.cs +System.Text/MLangCodePageEncoding.cs +System.Text/NormalizationForm.cs +System.Text/StringBuilder.cs +System.Text/SurrogateEncoder.cs +System.Text/UnicodeEncoding.cs +System.Text/UTF7Encoding.cs +System.Text/UTF8Encoding.cs +System.Text/UTF32Encoding.cs +System.Threading/AbandonedMutexException.cs +System.Threading/ApartmentState.cs +System.Threading/AsyncFlowControl.cs +System.Threading/AutoResetEvent.cs +System.Threading/CompressedStack.cs +System.Threading/ContextCallback.cs +System.Threading/EventResetMode.cs +System.Threading/EventWaitHandle.cs +System.Threading/ExecutionContext.cs +System.Threading/HostExecutionContext.cs +System.Threading/HostExecutionContextManager.cs +System.Threading/Interlocked.cs +System.Threading/IOCompletionCallback.cs +System.Threading/LazyThreadSafetyMode.cs +System.Threading/LockCookie.cs +System.Threading/LockQueue.cs +System.Threading/LockRecursionException.cs +System.Threading/ManualResetEvent.cs +System.Threading/Monitor.cs +System.Threading/Mutex.cs +System.Threading/NamedDataSlot.cs +System.Threading/NativeEventCalls.cs +System.Threading/NativeOverlapped.cs +System.Threading/Overlapped.cs +System.Threading/ParameterizedThreadStart.cs +System.Threading/ReaderWriterLock.cs +System.Threading/RegisteredWaitHandle.cs +System.Threading/SendOrPostCallback.cs +../System/System.Threading/SemaphoreFullException.cs +System.Threading/SynchronizationContext.cs +System.Threading/SynchronizationLockException.cs +System.Threading/Thread.cs +System.Threading/ThreadAbortException.cs +System.Threading/ThreadInterruptedException.cs +System.Threading/ThreadPool.cs +System.Threading/ThreadPriority.cs +System.Threading/ThreadStart.cs +System.Threading/ThreadStartException.cs +System.Threading/ThreadState.cs +System.Threading/ThreadStateException.cs +System.Threading/Timeout.cs +System.Threading/Timer.cs +System.Threading/TimerCallback.cs +System.Threading/Volatile.cs +System.Threading/WaitCallback.cs +System.Threading/WaitHandle.cs +System.Threading/WaitHandleCannotBeOpenedException.cs +System.Threading/WaitOrTimerCallback.cs +System.Collections.Generic/CollectionDebuggerView.cs +System.Collections.Generic/Dictionary.cs +System.Collections.Generic/ICollection.cs +System.Collections.Generic/IEnumerable.cs +System.Collections.Generic/IEnumerator.cs +System.Collections.Generic/IList.cs +System.Collections.Generic/IComparer.cs +System.Collections.Generic/IEqualityComparer.cs +System.Collections.Generic/IDictionary.cs +System.Collections.Generic/IReadOnlyCollection.cs +System.Collections.Generic/IReadOnlyList.cs +System.Collections.Generic/IReadOnlyDictionary.cs +System.Collections.Generic/KeyValuePair.cs +System.Collections.Generic/EqualityComparer.cs +System.Collections.Generic/KeyNotFoundException.cs +System.Collections.Generic/List.cs +System.Collections.ObjectModel/Collection.cs +System.Collections.ObjectModel/KeyedCollection.cs +System.Collections.ObjectModel/ReadOnlyCollection.cs +System.Collections.ObjectModel/ReadOnlyDictionary.cs +System/Action.cs +System/ArraySegment.cs +System/Comparison.cs +System/Converter.cs +System/Predicate.cs +System/Progress.cs +System.Collections.Generic/Comparer.cs + +System.Threading.Tasks/ConcurrentExclusiveSchedulerPair.cs +System.Threading.Tasks/DecoupledTask.cs +System.Threading.Tasks/TaskFactory.cs +System.Threading.Tasks/TaskFactory_T.cs +System.Threading.Tasks/TaskStatus.cs +System.Threading.Tasks/TaskCreationOptions.cs +System.Threading.Tasks/CyclicDeque.cs +System.Threading.Tasks/IConcurrentDeque.cs +System.Threading.Tasks/PopResult.cs +System.Threading.Tasks/TaskScheduler.cs +System.Threading.Tasks/TaskContinuationOptions.cs +System.Threading.Tasks/TaskCanceledException.cs +System.Threading.Tasks/Task_T.cs +System.Threading.Tasks/Task.cs +System.Threading.Tasks/TaskCompletionQueue.cs +System.Threading.Tasks/TaskExceptionSlot.cs +System.Threading.Tasks/TaskActionInvoker.cs +System.Threading.Tasks/TaskDebuggerView.cs +System.Threading.Tasks/TaskCompletionSource.cs +System.Threading.Tasks/TaskContinuation.cs +System.Threading.Tasks/TaskSchedulerException.cs +System.Threading.Tasks/TaskConstants.cs +System.Threading.Tasks/TaskConstants_T.cs +System.Collections.Concurrent/OrderablePartitioner.cs +System.Collections.Concurrent/ConcurrentDictionary.cs +System.Collections.Concurrent/Partitioner.cs +System.Collections.Concurrent/ConcurrentQueue.cs +System.Collections.Concurrent/EnumerablePartitionerOptions.cs +System.Collections.Concurrent.Partitioners/ListPartitioner.cs +System.Collections.Concurrent.Partitioners/EnumerablePartitioner.cs +System.Collections.Concurrent.Partitioners/UserRangePartitioner.cs +System.Collections.Concurrent/IProducerConsumerCollection.cs +System.Collections.Concurrent/ConcurrentStack.cs +System.Collections.Concurrent/SplitOrderedList.cs +System.Collections.Concurrent/ConcurrentOrderedList.cs +System.Threading/LazyInitializer.cs +System.Threading/CountdownEvent.cs +System.Threading/CancellationTokenSource.cs +System.Threading/CancellationToken.cs +System.Threading/SpinWait.cs +System.Threading/SemaphoreSlim.cs +System.Threading/CancellationTokenRegistration.cs +System.Threading/SpinLock.cs +System.Threading/AtomicBoolean.cs +System.Threading/ManualResetEventSlim.cs +System.Threading/ThreadLocal.cs +System.Threading/Watch.cs +System.Threading.Tasks/ParallelOptions.cs +System.Threading.Tasks/Parallel.cs +System.Threading.Tasks/ParallelLoopResult.cs +System.Threading.Tasks/ParallelLoopState.cs +System/AggregateException.cs +System.Threading.Tasks/SimpleConcurrentBag.cs +System.Threading.Tasks/SynchronizationContextScheduler.cs +System.Threading.Tasks/UnobservedTaskExceptionEventArgs.cs +System.Threading.Tasks/TpScheduler.cs +System.Threading.Tasks/TaskExtensionsImpl.cs diff --git a/mcs/class/corlib/corlib-net_2_0.csproj b/mcs/class/corlib/corlib-net_2_0.csproj deleted file mode 100644 index 5dbd562e425..00000000000 --- a/mcs/class/corlib/corlib-net_2_0.csproj +++ /dev/null @@ -1,1758 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - Library - 612,618,1699 - ./../../class/lib/net_2_0 - True - True - true - Properties - - - mscorlib - v2.0 - 512 - - - true - full - 612,618,1699 - false - DEBUG;TRACE;INSIDE_CORLIB;LIBC;NET_1_1;NET_2_0 - prompt - 4 - - - pdbonly - 612,618,1699 - true - INSIDE_CORLIB;LIBC;NET_1_1;NET_2_0 - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - collation.core.bin - - - collation.tailoring.bin - - - collation.cjkCHS.bin - - - collation.cjkCHT.bin - - - collation.cjkJA.bin - - - collation.cjkKO.bin - - - collation.cjkKOlv2.bin - - - - diff --git a/mcs/class/corlib/corlib-net_4_5.csproj b/mcs/class/corlib/corlib-net_4_5.csproj index bf5bf190955..f3d3c2cfd17 100644 --- a/mcs/class/corlib/corlib-net_4_5.csproj +++ b/mcs/class/corlib/corlib-net_4_5.csproj @@ -737,6 +737,7 @@ + @@ -753,6 +754,7 @@ + diff --git a/mcs/class/corlib/corlib-tests-net_2_0.csproj b/mcs/class/corlib/corlib-tests-net_2_0.csproj deleted file mode 100644 index cf9327ec213..00000000000 --- a/mcs/class/corlib/corlib-tests-net_2_0.csproj +++ /dev/null @@ -1,588 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F1439839-64EC-4B9D-ACC0-097CF94C7EC3} - Library - 612,618,1699,168,219,618,672 - bin\Debug\corlib-tests-net_2_0 - True - False - true - Properties - - - corlib_test_net_2_0 - v2.0 - 512 - - - true - full - 612,618,1699,168,219,618,672 - false - DEBUG;TRACE;INSIDE_CORLIB;LIBC;NET_1_1;NET_2_0;MONO_DATACONVERTER_STATIC_METHODS - prompt - 4 - - - pdbonly - 612,618,1699,168,219,618,672 - true - INSIDE_CORLIB;LIBC;NET_1_1;NET_2_0;MONO_DATACONVERTER_STATIC_METHODS - prompt - 4 - - - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {5A00133C-6D08-48F7-A164-8B796CE6DB83} - corlib\corlib-net_2_0 - - - {AA347918-40BB-4762-8A7F-B94836255127} - Mono.Posix\Mono.Posix-build - - - {C371834B-0195-4342-8652-BF015D18C974} - System.Core\System.Core-build - - - - - - - - Resources.resources - - - - diff --git a/mcs/class/corlib/corlib.dll.sources b/mcs/class/corlib/corlib.dll.sources index 5268a3a9766..80f732e7070 100644 --- a/mcs/class/corlib/corlib.dll.sources +++ b/mcs/class/corlib/corlib.dll.sources @@ -678,7 +678,6 @@ System.Runtime.CompilerServices/IDispatchConstantAttribute.cs System.Runtime.CompilerServices/IUnknownConstantAttribute.cs System.Runtime.CompilerServices/IndexerNameAttribute.cs System.Runtime.CompilerServices/INotifyCompletion.cs -System.Runtime.CompilerServices/InternalsVisibleToAttribute.cs System.Runtime.CompilerServices/IsBoxed.cs System.Runtime.CompilerServices/IsByValue.cs System.Runtime.CompilerServices/IsConst.cs @@ -1641,28 +1640,11 @@ System.Threading.Tasks/TaskContinuation.cs System.Threading.Tasks/TaskSchedulerException.cs System.Threading.Tasks/TaskConstants.cs System.Threading.Tasks/TaskConstants_T.cs -System.Collections.Concurrent/OrderablePartitioner.cs -System.Collections.Concurrent/ConcurrentDictionary.cs -System.Collections.Concurrent/Partitioner.cs -System.Collections.Concurrent/ConcurrentQueue.cs -System.Collections.Concurrent/EnumerablePartitionerOptions.cs -System.Collections.Concurrent.Partitioners/ListPartitioner.cs -System.Collections.Concurrent.Partitioners/EnumerablePartitioner.cs -System.Collections.Concurrent.Partitioners/UserRangePartitioner.cs -System.Collections.Concurrent/IProducerConsumerCollection.cs -System.Collections.Concurrent/ConcurrentStack.cs -System.Collections.Concurrent/SplitOrderedList.cs System.Collections.Concurrent/ConcurrentOrderedList.cs System.Threading/LazyInitializer.cs -System.Threading/CountdownEvent.cs -System.Threading/CancellationTokenSource.cs -System.Threading/CancellationToken.cs -System.Threading/SpinWait.cs System.Threading/SemaphoreSlim.cs -System.Threading/CancellationTokenRegistration.cs System.Threading/SpinLock.cs System.Threading/AtomicBoolean.cs -System.Threading/ManualResetEventSlim.cs System.Threading/ThreadLocal.cs System.Threading/Watch.cs System.Threading.Tasks/ParallelOptions.cs @@ -1675,3 +1657,26 @@ System.Threading.Tasks/SynchronizationContextScheduler.cs System.Threading.Tasks/UnobservedTaskExceptionEventArgs.cs System.Threading.Tasks/TpScheduler.cs System.Threading.Tasks/TaskExtensionsImpl.cs + +ReferenceSources/Array.cs +ReferenceSources/Environment.cs +ReferenceSources/ExecutionContext.cs +ReferenceSources/Helpers.cs +../../../external/referencesource/mscorlib/system/throwhelper.cs +../../../external/referencesource/mscorlib/system/collections/generic/debugview.cs +../../../external/referencesource/mscorlib/system/collections/Concurrent/ConcurrentDictionary.cs +../../../external/referencesource/mscorlib/system/collections/Concurrent/ConcurrentQueue.cs +../../../external/referencesource/mscorlib/system/collections/Concurrent/ConcurrentStack.cs +../../../external/referencesource/mscorlib/system/collections/Concurrent/IProducerConsumerCollection.cs +../../../external/referencesource/mscorlib/system/collections/Concurrent/OrderablePartitioner.cs +../../../external/referencesource/mscorlib/system/collections/Concurrent/Partitioner.cs +../../../external/referencesource/mscorlib/system/collections/Concurrent/PartitionerStatic.cs + +../../../external/referencesource/mscorlib/system/threading/CancellationToken.cs +../../../external/referencesource/mscorlib/system/threading/CancellationTokenRegistration.cs +../../../external/referencesource/mscorlib/system/threading/CancellationTokenSource.cs +../../../external/referencesource/mscorlib/system/threading/CountdownEvent.cs +../../../external/referencesource/mscorlib/system/threading/ManualResetEventSlim.cs +../../../external/referencesource/mscorlib/system/threading/SpinWait.cs + +../../../external/referencesource/mscorlib/system/runtime/compilerservices/internalsvisibletoattribute.cs diff --git a/mcs/class/corlib/corlib_test.dll.sources b/mcs/class/corlib/corlib_test.dll.sources index 8cb367e813e..34e50f9445f 100644 --- a/mcs/class/corlib/corlib_test.dll.sources +++ b/mcs/class/corlib/corlib_test.dll.sources @@ -177,6 +177,7 @@ System.Runtime.CompilerServices/ConditionalWeakTableTest.cs System.Runtime.CompilerServices/InternalsVisibleToAttributeTest.cs System.Runtime.CompilerServices/RuntimeHelpersTest.cs System.Runtime.CompilerServices/RuntimeWrappedExceptionTest.cs +System.Runtime.CompilerServices/AsyncTaskMethodBuilderTest.cs System.Runtime.CompilerServices/AsyncVoidMethodBuilderTest.cs System.Runtime.CompilerServices/TaskAwaiterTest.cs System.Runtime.CompilerServices/TaskAwaiterTest_T.cs diff --git a/mcs/errors/CS0165-51-lib.cs b/mcs/errors/CS0165-51-lib.cs new file mode 100644 index 00000000000..357657698e6 --- /dev/null +++ b/mcs/errors/CS0165-51-lib.cs @@ -0,0 +1,4 @@ +public struct S where T : class +{ + private T t; +} diff --git a/mcs/errors/CS1993-corlib.cs b/mcs/errors/CS1993-corlib.cs new file mode 100644 index 00000000000..2e5128ba361 --- /dev/null +++ b/mcs/errors/CS1993-corlib.cs @@ -0,0 +1,64 @@ +// +// The minimal mscorlib implementation +// + +namespace System +{ + public partial class Object {} + + public partial struct Byte {} + public partial struct Int16 {} + public partial struct Int32 {} + public partial struct Int64 {} + public partial struct Single {} + public partial struct Double{} + public partial struct Char {} + public partial struct Boolean {} + public partial struct SByte {} + public partial struct UInt16 {} + public partial struct UInt32 {} + public partial struct UInt64 {} + public partial struct IntPtr {} + public partial struct UIntPtr {} + public partial struct Decimal { } + public partial class String { } + public partial class Delegate {} + public partial class MulticastDelegate {} + public partial class Array {} + public partial class Exception {} + public partial class Type {} + public partial class ValueType {} + public partial class Enum {} + public partial class Attribute {} + public partial struct Void {} + public partial class ParamArrayAttribute {} + public partial class DefaultMemberAttribute {} + public partial struct RuntimeTypeHandle {} + public partial struct RuntimeFieldHandle {} + + public partial interface IDisposable {} + + public delegate void Action (); +} + +namespace System.Runtime.InteropServices +{ + public partial class OutAttribute {} +} + + +namespace System.Collections +{ + public partial interface IEnumerable {} + public partial interface IEnumerator {} +} + +namespace System.Reflection +{ + public partial class DefaultMemberAttribute {} +} + +namespace System.Runtime.CompilerServices +{ + public class ExtensionAttribute : Attribute {} +} diff --git a/mcs/errors/Makefile b/mcs/errors/Makefile index 95ce7d7c3ca..e809a14da44 100644 --- a/mcs/errors/Makefile +++ b/mcs/errors/Makefile @@ -22,7 +22,7 @@ DISTFILES = \ TEST_SUPPORT_FILES = \ CS0012-lib.dll CS0012-2-lib.dll CS0012-3-lib.dll CS0012-4-lib.dll CS0012-5-lib.dll CS0012-6-lib.dll CS0012-9-lib.dll CS0012-10-lib.dll CS0012-11-lib.dll CS0012-12-lib.dll CS0012-13-lib.dll CS0012-14-lib.dll CS0012-15-lib.dll CS0012-16-lib.dll CS0012-17-lib.dll CS0012-18-lib.dll CS0012-21-lib.dll CS0012-22-lib.dll CS0012-23-lib.dll CS0012-24-lib.dll CS0019-71-lib.dll CS0029-26-lib.dll \ - CS0103-2-lib.dll CS0118-2-lib.dll CS0122-8-lib.dll CS0122-10-lib.dll CS0122-14-lib.dll CS0122-15-lib.dll CS0122-19-lib.dll CS0122-35-lib.dll CS0122-36-lib.dll CS0143-lib.dll CS0144-3-lib.dll CS0165-19-lib.dll \ + CS0103-2-lib.dll CS0118-2-lib.dll CS0122-8-lib.dll CS0122-10-lib.dll CS0122-14-lib.dll CS0122-15-lib.dll CS0122-19-lib.dll CS0122-35-lib.dll CS0122-36-lib.dll CS0143-lib.dll CS0144-3-lib.dll CS0165-19-lib.dll CS0165-51-lib.dll \ CS0205-3-lib.dll CS0246-29-lib.dll CS0229-3-lib.dll CS0229-4-lib.dll CS0266-25-lib.dll \ CS0315-2-lib.dll \ CS0425-7-lib.dll CS0433-lib.dll CS0433-2-lib.dll \ diff --git a/mcs/errors/cs0103-13.cs b/mcs/errors/cs0103-13.cs index 891a1559d34..52b1c5a458d 100644 --- a/mcs/errors/cs0103-13.cs +++ b/mcs/errors/cs0103-13.cs @@ -1,5 +1,6 @@ // CS0103: The name `value' does not exist in the current context // Line: 8 +// Compiler options: -langversion:experimental class X (double value) { diff --git a/mcs/errors/cs0103-14.cs b/mcs/errors/cs0103-14.cs index 80f1e629f61..aacf9a24379 100644 --- a/mcs/errors/cs0103-14.cs +++ b/mcs/errors/cs0103-14.cs @@ -1,5 +1,6 @@ // C0103: The name `s' does not exist in the current context // Line: 7 +// Compiler options: -langversion:experimental class Test(string s) { diff --git a/mcs/errors/cs0111-12.cs b/mcs/errors/cs0111-12.cs index 034963c22a0..dd48150bef8 100644 --- a/mcs/errors/cs0111-12.cs +++ b/mcs/errors/cs0111-12.cs @@ -1,5 +1,6 @@ // CS0111: A member `S3.S3(string)' is already defined. Rename this member or use different parameter types // Line: 6 +// Compiler options: -langversion:experimental struct S3 (string s) { diff --git a/mcs/errors/cs0136-18.cs b/mcs/errors/cs0136-18.cs index 20630a4bcf3..7c2bff9836f 100644 --- a/mcs/errors/cs0136-18.cs +++ b/mcs/errors/cs0136-18.cs @@ -1,5 +1,6 @@ // CS0136: A local variable named `arg' cannot be declared in this scope because it would give a different meaning to `arg', which is already used in a `parent or current' scope to denote something else // Line: 11 +// Compiler options: -langversion:experimental using System; diff --git a/mcs/errors/cs0136-19.cs b/mcs/errors/cs0136-19.cs index ae9e0f606e3..7b81852d4f9 100644 --- a/mcs/errors/cs0136-19.cs +++ b/mcs/errors/cs0136-19.cs @@ -1,5 +1,6 @@ // CS0136: A local variable named `arg' cannot be declared in this scope because it would give a different meaning to `arg', which is already used in a `parent or current' scope to denote something else // Line: 11 +// Compiler options: -langversion:experimental using System; diff --git a/mcs/errors/cs0165-51.cs b/mcs/errors/cs0165-51.cs new file mode 100644 index 00000000000..bce82c61b55 --- /dev/null +++ b/mcs/errors/cs0165-51.cs @@ -0,0 +1,14 @@ +// CS0165: Use of unassigned local variable `s' +// Line: 12 +// Compiler options: -r:CS0165-51-lib.dll + +using System; + +class C where T : class +{ + public static void Foo () + { + S s; + Console.WriteLine (s); + } +} diff --git a/mcs/errors/cs0177-99.cs b/mcs/errors/cs0177-99.cs index b221d4638e6..989168afdf8 100644 --- a/mcs/errors/cs0177-99.cs +++ b/mcs/errors/cs0177-99.cs @@ -1,5 +1,6 @@ // CS0177: The out parameter `o' must be assigned to before control leaves the current method // Line: 4 +// Compiler options: -langversion:experimental class Test(out int o) { diff --git a/mcs/errors/cs0411-24.cs b/mcs/errors/cs0411-24.cs index 1462cbac233..75a5d859176 100644 --- a/mcs/errors/cs0411-24.cs +++ b/mcs/errors/cs0411-24.cs @@ -1,5 +1,6 @@ // CS0411: The type arguments for method `C.Foo(out T)' cannot be inferred from the usage. Try specifying the type arguments explicitly // Line: 8 +// Compiler options: -langversion:experimental public class C { diff --git a/mcs/errors/cs0657-23.cs b/mcs/errors/cs0657-23.cs index 2e6f6a61381..193a6ae51d8 100644 --- a/mcs/errors/cs0657-23.cs +++ b/mcs/errors/cs0657-23.cs @@ -1,6 +1,6 @@ // CS0657: `field' is not a valid attribute location for this declaration. Valid attribute locations for this declaration are `param'. All attributes in this section will be ignored // Line: 9 -// Compiler options: -warnaserror +// Compiler options: -warnaserror -langversion:experimental using System; diff --git a/mcs/errors/cs0815-7.cs b/mcs/errors/cs0815-7.cs index ae41a72d91a..af3d10f8c6c 100644 --- a/mcs/errors/cs0815-7.cs +++ b/mcs/errors/cs0815-7.cs @@ -1,5 +1,6 @@ // CS0815: An implicitly typed local variable declaration cannot be initialized with `void' // Line: 8 +// Compiler options: -langversion:experimental class X { diff --git a/mcs/errors/cs0841-5.cs b/mcs/errors/cs0841-5.cs index 798b33547c8..8872ce40389 100644 --- a/mcs/errors/cs0841-5.cs +++ b/mcs/errors/cs0841-5.cs @@ -1,5 +1,6 @@ // CS0841: A local variable `x' cannot be used before it is declared // Line: 8 +// Compiler options: -langversion:experimental class X { diff --git a/mcs/errors/cs1503-17.cs b/mcs/errors/cs1503-17.cs index 26766c0ade7..07da09dfe29 100644 --- a/mcs/errors/cs1503-17.cs +++ b/mcs/errors/cs1503-17.cs @@ -1,5 +1,6 @@ // CS1501: Argument `#1' cannot convert `ref string' expression to type `ref int' // Line: 8 +// Compiler options: -langversion:experimental class C { diff --git a/mcs/errors/cs1525-56.cs b/mcs/errors/cs1525-56.cs new file mode 100644 index 00000000000..c2b50876014 --- /dev/null +++ b/mcs/errors/cs1525-56.cs @@ -0,0 +1,8 @@ +// CS1525: Unexpected symbol `string', expecting `,' or `]' +// Line: 5 + +public class TestApp { + static void Main ([MarshalAs (UnmanagedType.LPStr) string[] args) + { + } +} \ No newline at end of file diff --git a/mcs/errors/cs1615-3.cs b/mcs/errors/cs1615-3.cs index c64fb7fe842..dc9a604fbb4 100644 --- a/mcs/errors/cs1615-3.cs +++ b/mcs/errors/cs1615-3.cs @@ -1,5 +1,6 @@ // CS1615: Argument `#1' does not require `out' modifier. Consider removing `out' modifier // Line: 8 +// Compiler options: -langversion:experimental public class C { diff --git a/mcs/errors/cs1993.cs b/mcs/errors/cs1993.cs index 42e0254b514..e93ee681886 100644 --- a/mcs/errors/cs1993.cs +++ b/mcs/errors/cs1993.cs @@ -1,6 +1,6 @@ // CS1993: Cannot find compiler required types for asynchronous functions support. Are you targeting the wrong framework version? // Line: 38 -// Compiler options: -sdk:2 +// Compiler options: -nostdlib CS1993-corlib.cs using System.Threading.Tasks; diff --git a/mcs/errors/cs7048.cs b/mcs/errors/cs7048.cs new file mode 100644 index 00000000000..398c32e7dc7 --- /dev/null +++ b/mcs/errors/cs7048.cs @@ -0,0 +1,26 @@ +// CS7048: First argument of a security attribute `CustomSecurityAttribute' must be a valid SecurityAction +// Line: 20 + +using System.Security; +using System.Security.Permissions; + +public class CustomSecurityAttribute : CodeAccessSecurityAttribute +{ + public CustomSecurityAttribute () + : base (SecurityAction.Demand) + { + } + + public override IPermission CreatePermission() + { + return null; + } +} + +[CustomSecurity] +class X +{ + public static void Main () + { + } +} diff --git a/mcs/errors/cs8036.cs b/mcs/errors/cs8036.cs index 59694800fd7..68317ac0665 100644 --- a/mcs/errors/cs8036.cs +++ b/mcs/errors/cs8036.cs @@ -1,5 +1,6 @@ -// CS9001: Only one part of a partial type can declare primary constructor parameters +// CS8036: Only one part of a partial type can declare primary constructor parameters // Line: 8 +// Compiler options: -langversion:experimental partial class Part(int arg) { diff --git a/mcs/errors/cs8037.cs b/mcs/errors/cs8037.cs index ea40954ebd6..39e695003a6 100644 --- a/mcs/errors/cs8037.cs +++ b/mcs/errors/cs8037.cs @@ -1,5 +1,6 @@ -// CS9002: `S.S(long)': Instance constructor of type with primary constructor must specify `this' constructor initializer +// CS8037: `S.S(long)': Instance constructor of type with primary constructor must specify `this' constructor initializer // Line: 6 +// Compiler options: -langversion:experimental class S (int arg) { diff --git a/mcs/errors/cs8038.cs b/mcs/errors/cs8038.cs index 76dc74646d6..a3538267646 100644 --- a/mcs/errors/cs8038.cs +++ b/mcs/errors/cs8038.cs @@ -1,5 +1,6 @@ // CS8038: Primary constructor of type `Test' has parameter of same name as type parameter `T' // Line: 4 +// Compiler options: -langversion:experimental class Test(T T) { diff --git a/mcs/errors/cs8039.cs b/mcs/errors/cs8039.cs index 7793ffdd721..63353bf8589 100644 --- a/mcs/errors/cs8039.cs +++ b/mcs/errors/cs8039.cs @@ -1,5 +1,6 @@ // CS8039: Primary constructor of type `Test' has parameter of same name as containing type // Line: 4 +// Compiler options: -langversion:experimental class Test(object Test) { diff --git a/mcs/errors/cs8043.cs b/mcs/errors/cs8043.cs index b7f9da825f6..6c011e11f4a 100644 --- a/mcs/errors/cs8043.cs +++ b/mcs/errors/cs8043.cs @@ -1,5 +1,6 @@ // CS8043: `S.S(long)': Structs with primary constructor cannot specify default constructor initializer // Line: 6 +// Compiler options: -langversion:experimental struct S (int x) { diff --git a/mcs/errors/cs8046.cs b/mcs/errors/cs8046.cs index f8b9ad556f0..3335e29c4b1 100644 --- a/mcs/errors/cs8046.cs +++ b/mcs/errors/cs8046.cs @@ -1,5 +1,6 @@ // CS8046: An expression tree cannot contain a declaration expression // Line: 11 +// Compiler options: -langversion:experimental using System; using System.Linq.Expressions; diff --git a/mcs/errors/cs8047.cs b/mcs/errors/cs8047.cs index 7171d569ce3..cd91a4fb3a7 100644 --- a/mcs/errors/cs8047.cs +++ b/mcs/errors/cs8047.cs @@ -1,5 +1,6 @@ // CS8047: Declaration expression cannot be used in this context // Line: 8 +// Compiler options: -langversion:experimental public class C { diff --git a/mcs/errors/cs8049.cs b/mcs/errors/cs8049.cs index 0689057684c..e747fdcca9d 100644 --- a/mcs/errors/cs8049.cs +++ b/mcs/errors/cs8049.cs @@ -1,5 +1,6 @@ // CS8049: Implemented interfaces cannot have arguments // Line: 6 +// Compiler options: -langversion:experimental using System; diff --git a/mcs/errors/cs8800.cs b/mcs/errors/cs8800.cs index 2952c7f98ec..8daa76e58aa 100644 --- a/mcs/errors/cs8800.cs +++ b/mcs/errors/cs8800.cs @@ -1,5 +1,6 @@ // CS8800: `S': Static classes cannot have primary constructor // Line: 4 +// Compiler options: -langversion:experimental static class S(int i) { diff --git a/mcs/mcs/anonymous.cs b/mcs/mcs/anonymous.cs index 847cbcfd5d8..b20608ea52d 100644 --- a/mcs/mcs/anonymous.cs +++ b/mcs/mcs/anonymous.cs @@ -352,7 +352,7 @@ namespace Mono.CSharp { hoisted_locals.Add (hoisted); } - if (ec.CurrentBlock.Explicit != localVariable.Block.Explicit && !(hoisted.Storey is StateMachine)) + if (ec.CurrentBlock.Explicit != localVariable.Block.Explicit && !(hoisted.Storey is StateMachine) && hoisted.Storey != null) hoisted.Storey.AddReferenceFromChildrenBlock (ec.CurrentBlock.Explicit); } diff --git a/mcs/mcs/async.cs b/mcs/mcs/async.cs index 6ffa92aa06a..797319f6255 100644 --- a/mcs/mcs/async.cs +++ b/mcs/mcs/async.cs @@ -159,7 +159,7 @@ namespace Mono.CSharp if (invocation != null && invocation.MethodGroup != null && (invocation.MethodGroup.BestCandidate.Modifiers & Modifiers.ASYNC) != 0) { rc.Report.Error (4008, loc, "Cannot await void method `{0}'. Consider changing method return type to `Task'", invocation.GetSignatureForError ()); - } else { + } else if (type != InternalType.ErrorType) { rc.Report.Error (4001, loc, "Cannot await `{0}' expression", type.GetSignatureForError ()); } } diff --git a/mcs/mcs/attribute.cs b/mcs/mcs/attribute.cs index f05e513ef4a..4ab296b200a 100644 --- a/mcs/mcs/attribute.cs +++ b/mcs/mcs/attribute.cs @@ -832,9 +832,9 @@ namespace Mono.CSharp { /// bool IsSecurityActionValid () { - SecurityAction action = GetSecurityActionValue (); + Constant c = null; + var action = GetSecurityActionValue (ref c); bool for_assembly = Target == AttributeTargets.Assembly || Target == AttributeTargets.Module; - var c = (Constant)pos_args [0].Expr; switch (action) { #pragma warning disable 618 @@ -855,6 +855,10 @@ namespace Mono.CSharp { return true; break; #pragma warning restore 618 + case null: + Report.Error (7048, loc, "First argument of a security attribute `{0}' must be a valid SecurityAction", + Type.GetSignatureForError ()); + return false; default: Report.Error (7049, c.Location, "Security attribute `{0}' has an invalid SecurityAction value `{1}'", @@ -876,9 +880,25 @@ namespace Mono.CSharp { return false; } - System.Security.Permissions.SecurityAction GetSecurityActionValue () + SecurityAction? GetSecurityActionValue (ref Constant value) { - return (SecurityAction) ((Constant) pos_args[0].Expr).GetValue (); + if (pos_args == null) { + var predefined = context.Module.PredefinedAttributes; + + // + // BCL defines System.Security.Permissions.HostProtectionAttribute with parameterless + // contructor which should not be valid but it's already part of the framework + // + if (Type == predefined.HostProtection.TypeSpec) { + value = new IntConstant (context.Module.Compiler.BuiltinTypes, (int)SecurityAction.LinkDemand, loc); + return SecurityAction.LinkDemand; + } + + return null; + } + + value = (Constant) pos_args [0].Expr; + return (SecurityAction) value.GetValue (); } /// @@ -888,9 +908,14 @@ namespace Mono.CSharp { public void ExtractSecurityPermissionSet (MethodSpec ctor, ref SecurityType permissions) { #if STATIC - object[] values = new object[pos_args.Count]; - for (int i = 0; i < values.Length; ++i) - values[i] = ((Constant) pos_args[i].Expr).GetValue (); + object[] values; + if (pos_args != null) { + values = new object[pos_args.Count]; + for (int i = 0; i < values.Length; ++i) + values[i] = ((Constant) pos_args[i].Expr).GetValue (); + } else { + values = null; + } PropertyInfo[] prop; object[] prop_values; @@ -1679,6 +1704,7 @@ namespace Mono.CSharp { public readonly PredefinedDebuggerBrowsableAttribute DebuggerBrowsable; public readonly PredefinedAttribute DebuggerStepThrough; public readonly PredefinedDebuggableAttribute Debuggable; + public readonly PredefinedAttribute HostProtection; // New in .NET 3.5 public readonly PredefinedAttribute Extension; @@ -1733,6 +1759,7 @@ namespace Mono.CSharp { DefaultParameterValue = new PredefinedAttribute (module, "System.Runtime.InteropServices", "DefaultParameterValueAttribute"); OptionalParameter = new PredefinedAttribute (module, "System.Runtime.InteropServices", "OptionalAttribute"); UnverifiableCode = new PredefinedAttribute (module, "System.Security", "UnverifiableCodeAttribute"); + HostProtection = new PredefinedAttribute (module, "System.Security.Permissions", "HostProtectionAttribute"); DefaultCharset = new PredefinedAttribute (module, "System.Runtime.InteropServices", "DefaultCharSetAttribute"); TypeForwarder = new PredefinedAttribute (module, "System.Runtime.CompilerServices", "TypeForwardedToAttribute"); diff --git a/mcs/mcs/class.cs b/mcs/mcs/class.cs index 37e1667db6f..5dac7c44002 100644 --- a/mcs/mcs/class.cs +++ b/mcs/mcs/class.cs @@ -1298,7 +1298,7 @@ namespace Mono.CSharp CreateMetadataName (sb); TypeBuilder = Module.CreateBuilder (sb.ToString (), TypeAttr, type_size); } else { - TypeBuilder = parent_def.TypeBuilder.DefineNestedType (MemberName.Basename, TypeAttr, null, type_size); + TypeBuilder = parent_def.TypeBuilder.DefineNestedType (FilterNestedName (MemberName.Basename), TypeAttr, null, type_size); } if (DeclaringAssembly.Importer != null) @@ -1328,6 +1328,18 @@ namespace Mono.CSharp return true; } + public static string FilterNestedName (string name) + { + // + // SRE API does not handle namespaces and types separately but + // determine that from '.' in name. That's problematic because + // dot is valid character for type name. By replacing any '.' + // in name we avoid any ambiguities and never emit metadata + // namespace for nested types + // + return name.Replace ('.', '_'); + } + string[] CreateTypeParameters (TypeParameters parentAllTypeParameters) { string[] names; diff --git a/mcs/mcs/cs-parser.jay b/mcs/mcs/cs-parser.jay index 2db083886ca..ed173cc5e4b 100644 --- a/mcs/mcs/cs-parser.jay +++ b/mcs/mcs/cs-parser.jay @@ -741,7 +741,9 @@ attribute_section_cont } | error { - CheckAttributeTarget (yyToken, GetTokenName (yyToken), GetLocation ($1)); + if (CheckAttributeTarget (yyToken, GetTokenName (yyToken), GetLocation ($1)).Length > 0) + Error_SyntaxError (yyToken); + $$ = null; } ; @@ -887,7 +889,7 @@ named_argument named_argument_expr : expression_or_error - | declaration_expression +// | declaration_expression ; opt_named_modifier @@ -3656,7 +3658,7 @@ declaration_expression */ | variable_type identifier_inside_body { - if (lang_version < LanguageVersion.V_6) + if (lang_version != LanguageVersion.Experimental) FeatureIsNotAvailable (GetLocation ($1), "declaration expression"); var lt = (LocatedToken) $2; @@ -3666,7 +3668,7 @@ declaration_expression } | variable_type identifier_inside_body ASSIGN expression { - if (lang_version < LanguageVersion.V_6) + if (lang_version != LanguageVersion.Experimental) FeatureIsNotAvailable (GetLocation ($1), "declaration expression"); var lt = (LocatedToken) $2; @@ -5021,7 +5023,7 @@ primary_parameters // Cannot use opt_formal_parameter_list because it can be shared instance for empty parameters lbag.AppendToMember (current_container, GetLocation ($1), GetLocation ($3)); - if (lang_version < LanguageVersion.V_6) + if (lang_version != LanguageVersion.Experimental) FeatureIsNotAvailable (GetLocation ($1), "primary constructor"); } ; diff --git a/mcs/mcs/cs-tokenizer.cs b/mcs/mcs/cs-tokenizer.cs index b3f8b32a707..1c8a107636b 100644 --- a/mcs/mcs/cs-tokenizer.cs +++ b/mcs/mcs/cs-tokenizer.cs @@ -1035,6 +1035,7 @@ namespace Mono.CSharp case Token.BYTE: case Token.DECIMAL: case Token.BOOL: + case Token.STRING: return Token.OPEN_PARENS_CAST; } } diff --git a/mcs/mcs/delegate.cs b/mcs/mcs/delegate.cs index b50e65e0077..844c04e5771 100644 --- a/mcs/mcs/delegate.cs +++ b/mcs/mcs/delegate.cs @@ -649,7 +649,8 @@ namespace Mono.CSharp { var invoke = Delegate.GetInvokeMethod (target_type); Arguments arguments = CreateDelegateMethodArguments (ec, invoke.Parameters, invoke.Parameters.Types, mg.Location); - return mg.OverloadResolve (ec, ref arguments, null, OverloadResolver.Restrictions.CovariantDelegate | OverloadResolver.Restrictions.ProbingOnly) != null; + mg = mg.OverloadResolve (ec, ref arguments, null, OverloadResolver.Restrictions.CovariantDelegate | OverloadResolver.Restrictions.ProbingOnly); + return mg != null && Delegate.IsTypeCovariant (ec, mg.BestCandidateReturnType, invoke.ReturnType); } #region IErrorHandler Members diff --git a/mcs/mcs/ecore.cs b/mcs/mcs/ecore.cs index 387bac8617f..4d2007cfa13 100644 --- a/mcs/mcs/ecore.cs +++ b/mcs/mcs/ecore.cs @@ -4618,8 +4618,17 @@ namespace Mono.CSharp { // // Tie-breaking rules are applied only for equivalent parameter types // - if (!are_equivalent) + if (!are_equivalent) { + // + // LAMESPEC: A candidate with less default parameters is still better when there + // is no better expression conversion + // + if (candidate_pd.Count < best_pd.Count && !candidate_params && best_pd.FixedParameters [j].HasDefaultValue) { + return true; + } + return false; + } // // If candidate is applicable in its normal form and best has a params array and is applicable diff --git a/mcs/mcs/expression.cs b/mcs/mcs/expression.cs index 4a5cddb992f..192d786ba7b 100644 --- a/mcs/mcs/expression.cs +++ b/mcs/mcs/expression.cs @@ -6212,9 +6212,11 @@ namespace Mono.CSharp } else if ((conv = Convert.ImplicitConversion (ec, false_expr, true_type, loc)) != null) { false_expr = conv; } else { - ec.Report.Error (173, true_expr.Location, - "Type of conditional expression cannot be determined because there is no implicit conversion between `{0}' and `{1}'", - true_type.GetSignatureForError (), false_type.GetSignatureForError ()); + if (false_type != InternalType.ErrorType) { + ec.Report.Error (173, true_expr.Location, + "Type of conditional expression cannot be determined because there is no implicit conversion between `{0}' and `{1}'", + true_type.GetSignatureForError (), false_type.GetSignatureForError ()); + } return null; } } diff --git a/mcs/mcs/field.cs b/mcs/mcs/field.cs index 3531af044f3..824b5c781cd 100644 --- a/mcs/mcs/field.cs +++ b/mcs/mcs/field.cs @@ -425,7 +425,7 @@ namespace Mono.CSharp } // Create nested fixed buffer container - string name = String.Format ("<{0}>__FixedBuffer{1}", Name, GlobalCounter++); + string name = String.Format ("<{0}>__FixedBuffer{1}", TypeDefinition.FilterNestedName (Name), GlobalCounter++); fixed_buffer_type = Parent.TypeBuilder.DefineNestedType (name, TypeAttributes.NestedPublic | TypeAttributes.Sealed | TypeAttributes.BeforeFieldInit, Compiler.BuiltinTypes.ValueType.GetMetaInfo ()); diff --git a/mcs/mcs/flowanalysis.cs b/mcs/mcs/flowanalysis.cs index 183250cde8b..da30a3e5b90 100644 --- a/mcs/mcs/flowanalysis.cs +++ b/mcs/mcs/flowanalysis.cs @@ -105,7 +105,7 @@ namespace Mono.CSharp return struct_info.GetStructField (name); } - public static TypeInfo GetTypeInfo (TypeSpec type) + public static TypeInfo GetTypeInfo (TypeSpec type, IMemberContext context) { if (!type.IsStruct) return simple_type; @@ -114,7 +114,7 @@ namespace Mono.CSharp if (type_hash.TryGetValue (type, out info)) return info; - var struct_info = StructInfo.GetStructInfo (type); + var struct_info = StructInfo.GetStructInfo (type, context); if (struct_info != null) { info = new TypeInfo (struct_info, 0); } else { @@ -184,11 +184,11 @@ namespace Mono.CSharp // // We only need one instance per type // - StructInfo (TypeSpec type) + StructInfo (TypeSpec type, IMemberContext context) { field_type_hash.Add (type, this); - fields = MemberCache.GetAllFieldsForDefiniteAssignment (type); + fields = MemberCache.GetAllFieldsForDefiniteAssignment (type, context); struct_field_hash = new Dictionary (); field_hash = new Dictionary (fields.Count); @@ -202,7 +202,7 @@ namespace Mono.CSharp var field = fields [i]; if (field.MemberType.IsStruct) - sinfo [i] = GetStructInfo (field.MemberType); + sinfo [i] = GetStructInfo (field.MemberType, context); if (sinfo [i] == null) field_hash.Add (field.Name, ++Length); @@ -260,7 +260,7 @@ namespace Mono.CSharp return null; } - public static StructInfo GetStructInfo (TypeSpec type) + public static StructInfo GetStructInfo (TypeSpec type, IMemberContext context) { if (type.BuiltinType > 0) return null; @@ -269,7 +269,7 @@ namespace Mono.CSharp if (field_type_hash.TryGetValue (type, out info)) return info; - return new StructInfo (type); + return new StructInfo (type, context); } } } @@ -305,11 +305,11 @@ namespace Mono.CSharp VariableInfo[] sub_info; - VariableInfo (string name, TypeSpec type, int offset) + VariableInfo (string name, TypeSpec type, int offset, IMemberContext context) { this.Name = name; this.Offset = offset; - this.TypeInfo = TypeInfo.GetTypeInfo (type); + this.TypeInfo = TypeInfo.GetTypeInfo (type, context); Length = TypeInfo.TotalLength; @@ -343,14 +343,14 @@ namespace Mono.CSharp public static VariableInfo Create (BlockContext bc, LocalVariable variable) { - var info = new VariableInfo (variable.Name, variable.Type, bc.AssignmentInfoOffset); + var info = new VariableInfo (variable.Name, variable.Type, bc.AssignmentInfoOffset, bc); bc.AssignmentInfoOffset += info.Length; return info; } public static VariableInfo Create (BlockContext bc, Parameter parameter) { - var info = new VariableInfo (parameter.Name, parameter.Type, bc.AssignmentInfoOffset) { + var info = new VariableInfo (parameter.Name, parameter.Type, bc.AssignmentInfoOffset, bc) { IsParameter = true }; diff --git a/mcs/mcs/membercache.cs b/mcs/mcs/membercache.cs index 3837af2c2d8..042a15b6533 100644 --- a/mcs/mcs/membercache.cs +++ b/mcs/mcs/membercache.cs @@ -686,9 +686,10 @@ namespace Mono.CSharp { throw new NotImplementedException (member.GetType ().ToString ()); } - public static List GetAllFieldsForDefiniteAssignment (TypeSpec container) + public static List GetAllFieldsForDefiniteAssignment (TypeSpec container, IMemberContext context) { List fields = null; + bool imported = container.MemberDefinition.IsImported; foreach (var entry in container.MemberCache.member_hash) { foreach (var name_entry in entry.Value) { if (name_entry.Kind != MemberKind.Field) @@ -704,13 +705,7 @@ namespace Mono.CSharp { continue; var fs = (FieldSpec) name_entry; - - // - // LAMESPEC: Very bizzare hack, definitive assignment is not done - // for imported non-public reference fields except array. No idea what the - // actual csc rule is - // - if (!fs.IsPublic && container.MemberDefinition.IsImported && (!fs.MemberType.IsArray && TypeSpec.IsReferenceType (fs.MemberType))) + if (imported && ShouldIgnoreFieldForDefiniteAssignment (fs, context)) continue; //if ((fs.Modifiers & (Modifiers.BACKING_FIELD) != 0) @@ -727,6 +722,29 @@ namespace Mono.CSharp { return fields ?? new List (0); } + static bool ShouldIgnoreFieldForDefiniteAssignment (FieldSpec fs, IMemberContext context) + { + // + // LAMESPEC: This mimics csc quirk where definitive assignment is not done + // for all kinds of imported non-public struct fields + // + var mod = fs.Modifiers; + if ((mod & Modifiers.PRIVATE) == 0 && ((mod & Modifiers.INTERNAL) != 0 && fs.DeclaringType.MemberDefinition.IsInternalAsPublic (context.Module.DeclaringAssembly))) + return false; + + // + // Ignore reference type fields except when type is an array or type parameter + // + var type = fs.MemberType; + switch (type.Kind) { + case MemberKind.ArrayType: + case MemberKind.TypeParameter: + return false; + default: + return TypeSpec.IsReferenceType (type); + } + } + public static IList GetCompletitionMembers (IMemberContext ctx, TypeSpec container, string name) { var matches = new List (); diff --git a/mcs/nunit24/ClientUtilities/util/Makefile b/mcs/nunit24/ClientUtilities/util/Makefile index 0113915bcac..fe0910186fe 100644 --- a/mcs/nunit24/ClientUtilities/util/Makefile +++ b/mcs/nunit24/ClientUtilities/util/Makefile @@ -21,23 +21,9 @@ EXTRA_DISTFILES = \ CLEAN_FILES = $(RESX_RES) -ifneq (net_2_0, $(PROFILE)) -NO_INSTALL = yes -install-local: install-symlink -uninstall-local: uninstall-symlink -endif - include ../../../build/library.make $(the_lib): $(RESX_RES) $(RESX_RES): %.resources: %.resx $(RESGEN) `echo $< | $(PLATFORM_CHANGE_SEPARATOR_CMD)` - -symlinkdir = $(mono_libdir)/mono/$(FRAMEWORK_VERSION) -install-symlink: - $(MKINSTALLDIRS) $(DESTDIR)$(symlinkdir) - cd $(DESTDIR)$(symlinkdir) && rm -f $(LIBRARY_NAME) && ln -s ../2.0/$(LIBRARY_NAME) $(LIBRARY_NAME) - -uninstall-symlink: - rm -f $(DESTDIR)$(symlinkdir)/$(LIBRARY_NAME) diff --git a/mcs/nunit24/ConsoleRunner/nunit-console/ConsoleUi.cs b/mcs/nunit24/ConsoleRunner/nunit-console/ConsoleUi.cs index 7cfc1e3bab7..e89d705e83c 100644 --- a/mcs/nunit24/ConsoleRunner/nunit-console/ConsoleUi.cs +++ b/mcs/nunit24/ConsoleRunner/nunit-console/ConsoleUi.cs @@ -123,34 +123,36 @@ namespace NUnit.ConsoleRunner Console.WriteLine(); - string xmlOutput = CreateXmlOutput( result ); - - if (options.xmlConsole) - { - Console.WriteLine(xmlOutput); - } - else - { - try + if (result != null) { + string xmlOutput = CreateXmlOutput( result ); + + if (options.xmlConsole) { - //CreateSummaryDocument(xmlOutput, transformReader ); - XmlResultTransform xform = new XmlResultTransform( transformReader ); - xform.Transform( new StringReader( xmlOutput ), Console.Out ); + Console.WriteLine(xmlOutput); } - catch( Exception ex ) + else { - Console.WriteLine( "Error: {0}", ex.Message ); - return TRANSFORM_ERROR; + try + { + //CreateSummaryDocument(xmlOutput, transformReader ); + XmlResultTransform xform = new XmlResultTransform( transformReader ); + xform.Transform( new StringReader( xmlOutput ), Console.Out ); + } + catch( Exception ex ) + { + Console.WriteLine( "Error: {0}", ex.Message ); + return TRANSFORM_ERROR; + } } - } - // Write xml output here - string xmlResultFile = options.xml == null || options.xml == string.Empty - ? "TestResult.xml" : options.xml; + // Write xml output here + string xmlResultFile = options.xml == null || options.xml == string.Empty + ? "TestResult.xml" : options.xml; - using ( StreamWriter writer = new StreamWriter( xmlResultFile ) ) - { - writer.Write(xmlOutput); + using ( StreamWriter writer = new StreamWriter( xmlResultFile ) ) + { + writer.Write(xmlOutput); + } } //if ( testRunner != null ) diff --git a/mcs/nunit24/ConsoleRunner/nunit-console/Makefile b/mcs/nunit24/ConsoleRunner/nunit-console/Makefile index 3b0d5ce3d87..52fe21bf61b 100644 --- a/mcs/nunit24/ConsoleRunner/nunit-console/Makefile +++ b/mcs/nunit24/ConsoleRunner/nunit-console/Makefile @@ -13,18 +13,4 @@ NO_TEST = yo EXTRA_DISTFILES = nunit-console.csproj nunit-console_VS2005.csproj -ifneq (net_2_0, $(PROFILE)) -NO_INSTALL = yes -install-local: install-symlink -uninstall-local: uninstall-symlink -endif - include ../../../build/library.make - -symlinkdir = $(mono_libdir)/mono/$(FRAMEWORK_VERSION) -install-symlink: - $(MKINSTALLDIRS) $(DESTDIR)$(symlinkdir) - cd $(DESTDIR)$(symlinkdir) && rm -f $(LIBRARY_NAME) && ln -s ../2.0/$(LIBRARY_NAME) $(LIBRARY_NAME) - -uninstall-symlink: - rm -f $(DESTDIR)$(symlinkdir)/$(LIBRARY_NAME) diff --git a/mcs/nunit24/NUnitCore/core/Makefile b/mcs/nunit24/NUnitCore/core/Makefile index c20d787be81..ac3b0146fbf 100644 --- a/mcs/nunit24/NUnitCore/core/Makefile +++ b/mcs/nunit24/NUnitCore/core/Makefile @@ -8,20 +8,6 @@ LIBRARY_SNK = $(topdir)/nunit24/nunit.snk LOCAL_MCS_FLAGS= -r:nunit.framework.dll -r:nunit.core.interfaces.dll -r:System.dll /d:StronglyNamedAssembly -warn:1 NO_TEST = yo -ifneq (net_2_0, $(PROFILE)) -NO_INSTALL = yes -install-local: install-symlink -uninstall-local: uninstall-symlink -endif - EXTRA_DISTFILES = nunit.core.dll.csproj nunit.core.dll_VS2005.csproj include ../../../build/library.make - -symlinkdir = $(mono_libdir)/mono/$(FRAMEWORK_VERSION) -install-symlink: - $(MKINSTALLDIRS) $(DESTDIR)$(symlinkdir) - cd $(DESTDIR)$(symlinkdir) && rm -f $(LIBRARY_NAME) && ln -s ../2.0/$(LIBRARY_NAME) $(LIBRARY_NAME) - -uninstall-symlink: - rm -f $(DESTDIR)$(symlinkdir)/$(LIBRARY_NAME) diff --git a/mcs/nunit24/NUnitCore/interfaces/Makefile b/mcs/nunit24/NUnitCore/interfaces/Makefile index d6f4602ce84..e9ddcc79faf 100644 --- a/mcs/nunit24/NUnitCore/interfaces/Makefile +++ b/mcs/nunit24/NUnitCore/interfaces/Makefile @@ -8,20 +8,6 @@ LIBRARY_SNK = $(topdir)/nunit24/nunit.snk LOCAL_MCS_FLAGS= -debug -r:nunit.framework.dll -r:System.dll /d:StronglyNamedAssembly NO_TEST = yo -ifneq (net_2_0, $(PROFILE)) -NO_INSTALL = yes -install-local: install-symlink -uninstall-local: uninstall-symlink -endif - EXTRA_DISTFILES = nunit.core.interfaces.dll.csproj nunit.core.interfaces.dll_VS2005.csproj include ../../../build/library.make - -symlinkdir = $(mono_libdir)/mono/$(FRAMEWORK_VERSION) -install-symlink: - $(MKINSTALLDIRS) $(DESTDIR)$(symlinkdir) - cd $(DESTDIR)$(symlinkdir) && rm -f $(LIBRARY_NAME) && ln -s ../2.0/$(LIBRARY_NAME) $(LIBRARY_NAME) - -uninstall-symlink: - rm -f $(DESTDIR)$(symlinkdir)/$(LIBRARY_NAME) diff --git a/mcs/nunit24/NUnitExtensions/core/Makefile b/mcs/nunit24/NUnitExtensions/core/Makefile index cd09dc556fc..48f8ccf8f6f 100644 --- a/mcs/nunit24/NUnitExtensions/core/Makefile +++ b/mcs/nunit24/NUnitExtensions/core/Makefile @@ -11,22 +11,8 @@ LIB_MCS_FLAGS = \ /r:System.Xml.dll /r:System.dll /d:StronglyNamedAssembly NO_TEST = yo -ifneq (net_2_0, $(PROFILE)) -NO_INSTALL = yes -install-local: install-symlink -uninstall-local: uninstall-symlink -endif - EXTRA_DISTFILES = \ nunit.core.extensions.dll.csproj \ nunit.core.extensions.dll_VS2005.csproj include ../../../build/library.make - -symlinkdir = $(mono_libdir)/mono/$(FRAMEWORK_VERSION) -install-symlink: - $(MKINSTALLDIRS) $(DESTDIR)$(symlinkdir) - cd $(DESTDIR)$(symlinkdir) && rm -f $(LIBRARY_NAME) && ln -s ../2.0/$(LIBRARY_NAME) $(LIBRARY_NAME) - -uninstall-symlink: - rm -f $(DESTDIR)$(symlinkdir)/$(LIBRARY_NAME) diff --git a/mcs/nunit24/NUnitExtensions/framework/Makefile b/mcs/nunit24/NUnitExtensions/framework/Makefile index c49a5f487d9..81d6b15439d 100644 --- a/mcs/nunit24/NUnitExtensions/framework/Makefile +++ b/mcs/nunit24/NUnitExtensions/framework/Makefile @@ -8,22 +8,8 @@ LIBRARY_SNK = $(topdir)/nunit24/nunit.snk LIB_MCS_FLAGS = -debug /r:System.Xml.dll /r:System.dll /d:StronglyNamedAssembly NO_TEST = yo -ifneq (net_2_0, $(PROFILE)) -NO_INSTALL = yes -install-local: install-symlink -uninstall-local: uninstall-symlink -endif - EXTRA_DISTFILES = \ nunit.framework.extensions.dll.csproj \ nunit.framework.extensions.dll_VS2005.csproj include ../../../build/library.make - -symlinkdir = $(mono_libdir)/mono/$(FRAMEWORK_VERSION) -install-symlink: - $(MKINSTALLDIRS) $(DESTDIR)$(symlinkdir) - cd $(DESTDIR)$(symlinkdir) && rm -f $(LIBRARY_NAME) && ln -s ../2.0/$(LIBRARY_NAME) $(LIBRARY_NAME) - -uninstall-symlink: - rm -f $(DESTDIR)$(symlinkdir)/$(LIBRARY_NAME) diff --git a/mcs/nunit24/NUnitFramework/framework/Makefile b/mcs/nunit24/NUnitFramework/framework/Makefile index f00adfacfb9..157b0b4d578 100644 --- a/mcs/nunit24/NUnitFramework/framework/Makefile +++ b/mcs/nunit24/NUnitFramework/framework/Makefile @@ -9,22 +9,8 @@ LIBRARY_SNK = $(topdir)/nunit24/nunit.snk LIB_MCS_FLAGS = /r:System.Xml.dll /r:System.dll /d:StronglyNamedAssembly -warn:1 NO_TEST = yo -ifneq (net_2_0, $(PROFILE)) -NO_INSTALL = yes -install-local: install-symlink -uninstall-local: uninstall-symlink -endif - EXTRA_DISTFILES = \ nunit.framework.dll.csproj \ nunit.framework.dll_VS2005.csproj include ../../../build/library.make - -symlinkdir = $(mono_libdir)/mono/$(FRAMEWORK_VERSION) -install-symlink: - $(MKINSTALLDIRS) $(DESTDIR)$(symlinkdir) - cd $(DESTDIR)$(symlinkdir) && rm -f $(LIBRARY_NAME) && ln -s ../2.0/$(LIBRARY_NAME) $(LIBRARY_NAME) - -uninstall-symlink: - rm -f $(DESTDIR)$(symlinkdir)/$(LIBRARY_NAME) diff --git a/mcs/nunit24/NUnitMocks/mocks/Makefile b/mcs/nunit24/NUnitMocks/mocks/Makefile index b459c284ad6..b9769c4777d 100644 --- a/mcs/nunit24/NUnitMocks/mocks/Makefile +++ b/mcs/nunit24/NUnitMocks/mocks/Makefile @@ -8,22 +8,8 @@ LIBRARY_SNK = $(topdir)/nunit24/nunit.snk LOCAL_MCS_FLAGS= -debug -r:nunit.framework.dll -r:System.dll /d:StronglyNamedAssembly NO_TEST = yo -ifneq (net_2_0, $(PROFILE)) -NO_INSTALL = yes -install-local: install-symlink -uninstall-local: uninstall-symlink -endif - EXTRA_DISTFILES = \ nunit.mocks.csproj \ nunit.mocks_VS2005.csproj include ../../../build/library.make - -symlinkdir = $(mono_libdir)/mono/$(FRAMEWORK_VERSION) -install-symlink: - $(MKINSTALLDIRS) $(DESTDIR)$(symlinkdir) - cd $(DESTDIR)$(symlinkdir) && rm -f $(LIBRARY_NAME) && ln -s ../2.0/$(LIBRARY_NAME) $(LIBRARY_NAME) - -uninstall-symlink: - rm -f $(DESTDIR)$(symlinkdir)/$(LIBRARY_NAME) diff --git a/mcs/tests/Makefile b/mcs/tests/Makefile index 522c78d44d3..78c861799e4 100644 --- a/mcs/tests/Makefile +++ b/mcs/tests/Makefile @@ -61,7 +61,7 @@ build-compiler-lib: cd ../class/Mono.CSharp && $(MAKE) NO_DIR_CHECK=yes qcheck: build-compiler-lib qcheck2 - + qcheck2: $(TESTER) -mode:pos -files:$(TEST_PATTERN) -compiler:$(COMPILER) -issues:known-issues-$(PROFILE) -log:$(PROFILE).log -il:ver-il-$(PROFILE).xml $(DEFINES) $(TOPTIONS) diff --git a/mcs/tests/gtest-409.cs b/mcs/tests/gtest-409.cs index 2f5ea10ae8f..45d03a328a7 100644 --- a/mcs/tests/gtest-409.cs +++ b/mcs/tests/gtest-409.cs @@ -160,6 +160,11 @@ public class ConditionalParsing var x = 1 > 0 ? table[5, 1] : 0; } + void Test_20 () + { + var t = (Object)string.Empty; + } + static void Helper (T arg) { } diff --git a/mcs/tests/gtest-626.cs b/mcs/tests/gtest-626.cs new file mode 100644 index 00000000000..045028df5ed --- /dev/null +++ b/mcs/tests/gtest-626.cs @@ -0,0 +1,30 @@ +using System; + +class Program +{ + public class Foo + { + public static bool MG (Foo t) + { + return false; + } + } + + public class Bar + { + public static Bar Create (Func a) + { + return null; + } + + public static Bar Create (Func a, Func b = null) + { + throw new ApplicationException (); + } + } + + static void Main () + { + var x = Bar.Create (Foo.MG); + } +} diff --git a/mcs/tests/gtest-627.cs b/mcs/tests/gtest-627.cs new file mode 100644 index 00000000000..7ac0117862a --- /dev/null +++ b/mcs/tests/gtest-627.cs @@ -0,0 +1,19 @@ +using System; + +class X +{ + public static U Foo (double? value, Func f, int dv = 0) + { + throw new ApplicationException (); + } + + public static U Foo (T? source, Func f) where T : struct + { + return default (U); + } + + static void Main (string[] args) + { + Foo (default (double?), v => v / 100); + } +} diff --git a/mcs/tests/gtest-named-06.cs b/mcs/tests/gtest-named-06.cs new file mode 100644 index 00000000000..e9b2de5b5c5 --- /dev/null +++ b/mcs/tests/gtest-named-06.cs @@ -0,0 +1,18 @@ +// parser test + +class X +{ + public static int T1 (int seconds) + { + return T1_Foo (value: seconds * 1000); + } + + public static int T1_Foo (int value = 0) + { + return value; + } + + public static void Main () + { + } +} \ No newline at end of file diff --git a/mcs/tests/test-695.cs b/mcs/tests/test-695.cs index 52d3b1e9d97..58f3f1c37bf 100644 --- a/mcs/tests/test-695.cs +++ b/mcs/tests/test-695.cs @@ -1,4 +1,4 @@ -// Compiler options: -r:../class/lib/net_2_0/Mono.Cecil.dll +// Compiler options: -r:../class/lib/net_4_5/Mono.Cecil.dll using System; using System.IO; diff --git a/mcs/tests/test-814.cs b/mcs/tests/test-814.cs index ded27a93745..495fec55c48 100644 --- a/mcs/tests/test-814.cs +++ b/mcs/tests/test-814.cs @@ -1,4 +1,4 @@ -// Compiler options: -r:../class/lib/net_2_0/Mono.Cecil.dll +// Compiler options: -r:../class/lib/net_4_5/Mono.Cecil.dll using System; using Mono.Cecil; diff --git a/mcs/tests/test-910.cs b/mcs/tests/test-910.cs new file mode 100644 index 00000000000..0cbdf424762 --- /dev/null +++ b/mcs/tests/test-910.cs @@ -0,0 +1,10 @@ +using System.Security; +using System.Security.Permissions; + +[HostProtection] +class X +{ + public static void Main () + { + } +} diff --git a/mcs/tests/test-async-76.cs b/mcs/tests/test-async-76.cs new file mode 100644 index 00000000000..5fa226acccc --- /dev/null +++ b/mcs/tests/test-async-76.cs @@ -0,0 +1,42 @@ +// Compiler options: -r:../class/lib/net_4_5/Mono.Cecil.dll + +using System; +using System.Threading.Tasks; +using Mono.Cecil; + +namespace N +{ + class C + { + } + + interface I + { + void Foo (T t); + } + + class X : I + { + async void I.Foo (C c) + { + await Task.Delay (1); + } + + public static void Main () + { + var assembly = AssemblyDefinition.ReadAssembly (typeof (X).Assembly.Location); + foreach (var t in assembly.MainModule.Types) { + PrintType (t, 0); + } + } + + static void PrintType (TypeDefinition td, int indent) + { + if (td.IsNested && !string.IsNullOrEmpty (td.Namespace)) + throw new ApplicationException ("BROKEN NESTED TYPE:"); + Console.WriteLine ("{2} Namespace: {0} Name: {1}", td.Namespace, td.Name, new string (' ', indent * 4)); + foreach (var tn in td.NestedTypes) + PrintType (tn, indent + 1); + } + } +} \ No newline at end of file diff --git a/mcs/tests/test-decl-expr-01.cs b/mcs/tests/test-decl-expr-01.cs index 15e781dbf22..9078ff7caaa 100644 --- a/mcs/tests/test-decl-expr-01.cs +++ b/mcs/tests/test-decl-expr-01.cs @@ -1,3 +1,4 @@ +// Compiler options: -langversion:experimental using System; class DeclarationExpression @@ -29,9 +30,9 @@ class DeclarationExpression if (r2 != 8) return 6; - Out2 (str: "b", v: out var o5); - if (o5 != 9) - return 7; +// Out2 (str: "b", v: out var o5); +// if (o5 != 9) +// return 7; Out3 (out var o6 = 9m); if (o6.GetType () != typeof (decimal)) diff --git a/mcs/tests/test-decl-expr-02.cs b/mcs/tests/test-decl-expr-02.cs new file mode 100644 index 00000000000..c2fb886cfdf --- /dev/null +++ b/mcs/tests/test-decl-expr-02.cs @@ -0,0 +1,27 @@ +// Compiler options: -langversion:experimental + +using System.Console; + +public class DeclarationExpressions +{ + public static void Main() + { + // TODO: + //Test (int value = 5); + //WriteLine (value); + } + + void M2 () + { +// for (int i = 0; int v = 2; ++i) { + +// } + + } + + static int Test (int x) + { + WriteLine (x); + return x; + } +} \ No newline at end of file diff --git a/mcs/tests/test-primary-ctor-02.cs b/mcs/tests/test-primary-ctor-02.cs index bc02c026c7d..d22b3220691 100644 --- a/mcs/tests/test-primary-ctor-02.cs +++ b/mcs/tests/test-primary-ctor-02.cs @@ -1,3 +1,4 @@ +// Compiler options: -langversion:experimental using System; partial class Part diff --git a/mcs/tests/test-primary-ctor-03.cs b/mcs/tests/test-primary-ctor-03.cs index 269dfe8dd15..36df2c3ad40 100644 --- a/mcs/tests/test-primary-ctor-03.cs +++ b/mcs/tests/test-primary-ctor-03.cs @@ -1,3 +1,4 @@ +// Compiler options: -langversion:experimental class D(string arg) : Base (arg) { } diff --git a/mcs/tests/test-primary-ctor-04.cs b/mcs/tests/test-primary-ctor-04.cs index 55636abedfe..e2015a92479 100644 --- a/mcs/tests/test-primary-ctor-04.cs +++ b/mcs/tests/test-primary-ctor-04.cs @@ -1,3 +1,4 @@ +// Compiler options: -langversion:experimental class Derived (int arg, ref byte b, out int o) : Base (out o) { public long field = arg; diff --git a/mcs/tests/test-primary-ctor-05.cs b/mcs/tests/test-primary-ctor-05.cs index f127ceccc3b..ded85daa0e1 100644 --- a/mcs/tests/test-primary-ctor-05.cs +++ b/mcs/tests/test-primary-ctor-05.cs @@ -1,4 +1,4 @@ -// Compiler options: -warnaserror +// Compiler options: -warnaserror -langversion:experimental using System; using System.Reflection; diff --git a/mcs/tests/test-primary-ctor-06.cs b/mcs/tests/test-primary-ctor-06.cs index 7d9ef1e9c5f..a92739ec96a 100644 --- a/mcs/tests/test-primary-ctor-06.cs +++ b/mcs/tests/test-primary-ctor-06.cs @@ -1,3 +1,4 @@ +// Compiler options: -langversion:experimental using System; class ID () : IDisposable diff --git a/mcs/tests/test-primary-ctor-08.cs b/mcs/tests/test-primary-ctor-08.cs index 9f248858563..2d00b61dd61 100644 --- a/mcs/tests/test-primary-ctor-08.cs +++ b/mcs/tests/test-primary-ctor-08.cs @@ -1,3 +1,4 @@ +// Compiler options: -langversion:experimental struct S (int arg) { { diff --git a/mcs/tests/test-primary-ctor-09.cs b/mcs/tests/test-primary-ctor-09.cs index 64e5ac63327..d9b1bbf4b80 100644 --- a/mcs/tests/test-primary-ctor-09.cs +++ b/mcs/tests/test-primary-ctor-09.cs @@ -1,3 +1,4 @@ +// Compiler options: -langversion:experimental using System; class A (Func barg) diff --git a/mcs/tests/ver-il-net_4_5.xml b/mcs/tests/ver-il-net_4_5.xml index cd8b13f82e0..a02d556a0b3 100644 --- a/mcs/tests/ver-il-net_4_5.xml +++ b/mcs/tests/ver-il-net_4_5.xml @@ -10959,16 +10959,24 @@ 7 - + + + 15 + + + 15 + + + + + 26 + 14 14 - - 26 - 1 @@ -10979,14 +10987,6 @@ 7 - - - 15 - - - 15 - - @@ -11736,16 +11736,24 @@ 7 - + + + 15 + + + 7 + + + + + 26 + 14 19 - - 26 - 1 @@ -11756,14 +11764,6 @@ 7 - - - 15 - - - 7 - - @@ -14472,6 +14472,9 @@ 11 + + 8 + @@ -19478,6 +19481,54 @@ + + + + 37 + + + 7 + + + + + 10 + + + 7 + + + + + 10 + + + 7 + + + 7 + + + + + + + 7 + + + 18 + + + 46 + + + 19 + + + 7 + + + @@ -29332,6 +29383,22 @@ + + + + 21 + + + 10 + + + 2 + + + 7 + + + @@ -50995,6 +51062,16 @@ + + + + 2 + + + 7 + + + @@ -62168,11 +62245,6 @@ 285 - - - 61 - - 33 @@ -62220,11 +62292,6 @@ 13 - - - 13 - - 13 @@ -62257,6 +62324,14 @@ 2 + + + 61 + + + 13 + + @@ -64291,6 +64366,35 @@ + + + + 7 + + + + + 27 + + + 99 + + + 138 + + + 7 + + + + + 157 + + + 13 + + + @@ -65750,7 +65854,7 @@ - 252 + 223 13 @@ -65769,6 +65873,22 @@ + + + + 2 + + + 2 + + + 16 + + + 7 + + + diff --git a/mcs/tools/Makefile b/mcs/tools/Makefile index 3c0f45c251f..540b056bdfe 100644 --- a/mcs/tools/Makefile +++ b/mcs/tools/Makefile @@ -53,11 +53,10 @@ net_2_0_dirs := \ $(per_profile_dirs) build_SUBDIRS = gacutil security culevel -net_2_0_SUBDIRS := $(basic_SUBDIRS) $(net_2_0_dirs) net_4_0_SUBDIRS := $(net_4_0_dirs) $(basic_SUBDIRS) net_4_5_SUBDIRS := $(net_4_0_SUBDIRS) -SUBDIRS = $(basic_SUBDIRS) $(net_2_0_SUBDIRS) +SUBDIRS = $(basic_SUBDIRS) $(net_2_0_dirs) DIST_SUBDIRS = $(SUBDIRS) $(net_4_0_dirs) include ../build/rules.make diff --git a/mcs/tools/corcompare/mono-api-html/ApiChange.cs b/mcs/tools/corcompare/mono-api-html/ApiChange.cs new file mode 100644 index 00000000000..8cb19621e81 --- /dev/null +++ b/mcs/tools/corcompare/mono-api-html/ApiChange.cs @@ -0,0 +1,85 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Xml.Linq; + +namespace Xamarin.ApiDiff +{ + public class ApiChange + { + public string Header; + public StringBuilder Member = new StringBuilder (); + public bool Breaking; + public bool AnyChange; + public bool HasIgnoredChanges; + + public ApiChange Append (string text) + { + Member.Append (text); + return this; + } + + public ApiChange AppendAdded (string text, bool breaking = false) + { + if (breaking) + Member.Append (""); + if (State.Colorize) + Member.Append (breaking ? "" : ""); + Member.Append (text); + if (State.Colorize) + Member.Append (breaking ? "" : ""); + if (breaking) + Member.Append (""); + Breaking |= breaking; + AnyChange = true; + return this; + } + + public ApiChange AppendRemoved (string text, bool breaking = true) + { + Member.Append (""); + if (State.Colorize && breaking) + Member.Append (""); + Member.Append (text); + if (State.Colorize && breaking) + Member.Append (""); + Member.Append (""); + Breaking |= breaking; + AnyChange = true; + return this; + } + + public ApiChange AppendModified (string old, string @new, bool breaking = true) + { + if (old.Length > 0) + AppendRemoved (old, breaking); + if (old.Length > 0 && @new.Length > 0) + Append (" "); + if (@new.Length > 0) + AppendAdded (@new); + Breaking |= breaking; + AnyChange = true; + return this; + } + } + + public class ApiChanges : Dictionary> { + public void Add (XElement source, XElement target, ApiChange change) + { + if (!change.AnyChange) { + // This is most likely because the rendering doesn't take into account something that's different (solution: fix rendering). + if (!change.HasIgnoredChanges) + Console.WriteLine ("Comparison resulting in no changes (src: {2} dst: {3}) :\n{0}\n{1}\n\n", source.ToString (), target.ToString (), source.GetMethodAttributes (), target.GetMethodAttributes ()); + return; + } + + List list; + if (!TryGetValue (change.Header, out list)) { + list = new List (); + base.Add (change.Header, list); + } + list.Add (change); + } + } +} + diff --git a/mcs/tools/corcompare/mono-api-html/ApiDiff.cs b/mcs/tools/corcompare/mono-api-html/ApiDiff.cs index fb326624ba5..69454e1184c 100644 --- a/mcs/tools/corcompare/mono-api-html/ApiDiff.cs +++ b/mcs/tools/corcompare/mono-api-html/ApiDiff.cs @@ -79,6 +79,7 @@ namespace Xamarin.ApiDiff { public static bool IgnoreAddedPropertySetters { get; set; } public static bool Lax; + public static bool Colorize = true; } class Program { @@ -118,6 +119,7 @@ namespace Xamarin.ApiDiff { { "ignore-changes-virtual", "Ignore changing non-`virtual` to `virtual` or adding `override`.", v => State.IgnoreVirtualChanges = v != null }, + { "c|colorize:", "Colorize HTML output", v => State.Colorize = string.IsNullOrEmpty (v) ? true : bool.Parse (v) }, { "x|lax", "Ignore duplicate XML entries", v => State.Lax = true } }; diff --git a/mcs/tools/corcompare/mono-api-html/AssemblyComparer.cs b/mcs/tools/corcompare/mono-api-html/AssemblyComparer.cs index e083c270850..ff5326d9c8b 100644 --- a/mcs/tools/corcompare/mono-api-html/AssemblyComparer.cs +++ b/mcs/tools/corcompare/mono-api-html/AssemblyComparer.cs @@ -25,6 +25,7 @@ // using System; +using System.Collections.Generic; using System.Xml.Linq; namespace Xamarin.ApiDiff { @@ -61,7 +62,7 @@ namespace Xamarin.ApiDiff { // one assembly per xml file } - public override void Modified (XElement source, XElement target) + public override void Modified (XElement source, XElement target, ApiChanges diff) { SourceAssembly = source.GetAttribute ("name"); TargetAssembly = target.GetAttribute ("name"); diff --git a/mcs/tools/corcompare/mono-api-html/ClassComparer.cs b/mcs/tools/corcompare/mono-api-html/ClassComparer.cs index d96613c3e8a..87680c02950 100644 --- a/mcs/tools/corcompare/mono-api-html/ClassComparer.cs +++ b/mcs/tools/corcompare/mono-api-html/ClassComparer.cs @@ -74,8 +74,12 @@ namespace Xamarin.ApiDiff { return; Output.WriteLine ("

New Type {0}.{1}

", State.Namespace, name); Output.WriteLine ("
");
+			if (State.Colorize)
+				Output.WriteLine ("");
 			State.Indent = 0;
 			AddedInner (target);
+			if (State.Colorize)
+				Output.WriteLine ("");
 			Output.WriteLine ("
"); } @@ -196,7 +200,7 @@ namespace Xamarin.ApiDiff { Indent ().WriteLine ("}"); } - public override void Modified (XElement source, XElement target) + public override void Modified (XElement source, XElement target, ApiChanges diff) { // hack - there could be changes that we're not monitoring (e.g. attributes properties) var output = Output; diff --git a/mcs/tools/corcompare/mono-api-html/Comparer.cs b/mcs/tools/corcompare/mono-api-html/Comparer.cs index 3cf678f7fff..8c692a03a9a 100644 --- a/mcs/tools/corcompare/mono-api-html/Comparer.cs +++ b/mcs/tools/corcompare/mono-api-html/Comparer.cs @@ -35,7 +35,7 @@ namespace Xamarin.ApiDiff { public abstract class Comparer { protected List removed = new List (); - protected List obsoleted = new List (); + protected ApiChanges modified = new ApiChanges (); public TextWriter Output { get { return State.Output; } @@ -49,10 +49,10 @@ namespace Xamarin.ApiDiff { } public abstract void Added (XElement target); - public abstract void Modified (XElement source, XElement target); + public abstract void Modified (XElement source, XElement target, ApiChanges changes); public abstract void Removed (XElement source); - public virtual bool Equals (XElement source, XElement target) + public virtual bool Equals (XElement source, XElement target, ApiChanges changes) { return XNode.DeepEquals (source, target); } @@ -62,6 +62,7 @@ namespace Xamarin.ApiDiff { public virtual void Compare (IEnumerable source, IEnumerable target) { removed.Clear (); + modified.Clear (); foreach (var s in source) { SetContext (s); @@ -73,11 +74,11 @@ namespace Xamarin.ApiDiff { } else { t.Remove (); // possibly modified - if (Equals (s, t)) + if (Equals (s, t, modified)) continue; // still in target so will be part of Added - Modified (s, t); + Modified (s, t, modified); } } // delayed, that way we show "Modified", "Added" and then "Removed" diff --git a/mcs/tools/corcompare/mono-api-html/ConstructorComparer.cs b/mcs/tools/corcompare/mono-api-html/ConstructorComparer.cs index 66dfeb00437..9bd837e241f 100644 --- a/mcs/tools/corcompare/mono-api-html/ConstructorComparer.cs +++ b/mcs/tools/corcompare/mono-api-html/ConstructorComparer.cs @@ -32,6 +32,7 @@ using System.Xml.Linq; namespace Xamarin.ApiDiff { + // MethodComparer inherits from this one public class ConstructorComparer : MemberComparer { public override string GroupName { @@ -47,6 +48,39 @@ namespace Xamarin.ApiDiff { return (e.Attribute ("name").Value == Source.Attribute ("name").Value); } + void RenderReturnType (XElement source, XElement target, ApiChange change) + { + var srcType = source.GetTypeName ("returntype"); + var tgtType = target.GetTypeName ("returntype"); + + if (srcType != tgtType) { + change.AppendModified (srcType, tgtType, true); + change.Append (" "); + } else if (srcType != null) { + // ctor don't have a return type + change.Append (srcType); + change.Append (" "); + } + } + + public override bool Equals (XElement source, XElement target, ApiChanges changes) + { + if (base.Equals (source, target, changes)) + return true; + + var change = new ApiChange (); + change.Header = "Modified " + GroupName; + RenderMethodAttributes (source, target, change); + RenderReturnType (source, target, change); + RenderName (source, target, change); + RenderGenericParameters (source, target, change); + RenderParameters (source, target, change); + + changes.Add (source, target, change); + + return false; + } + public override string GetDescription (XElement e) { var sb = new StringBuilder (); diff --git a/mcs/tools/corcompare/mono-api-html/EventComparer.cs b/mcs/tools/corcompare/mono-api-html/EventComparer.cs index c7d1e8bc886..693f16f5342 100644 --- a/mcs/tools/corcompare/mono-api-html/EventComparer.cs +++ b/mcs/tools/corcompare/mono-api-html/EventComparer.cs @@ -40,9 +40,31 @@ namespace Xamarin.ApiDiff { get { return "event"; } } + public override bool Equals (XElement source, XElement target, ApiChanges changes) + { + if (base.Equals (source, target, changes)) + return true; + + var change = new ApiChange (); + change.Header = "Modified " + GroupName; + change.Append ("public event "); + + var srcEventType = source.GetTypeName ("eventtype"); + var tgtEventType = target.GetTypeName ("eventtype"); + + if (srcEventType != tgtEventType) { + change.AppendModified (srcEventType, tgtEventType, true); + } else { + change.Append (srcEventType); + } + change.Append (" "); + change.Append (source.GetAttribute ("name")).Append (";"); + return false; + } + public override string GetDescription (XElement e) { - StringBuilder sb = GetObsoleteMessage (e); + StringBuilder sb = new StringBuilder (); // TODO: attribs sb.Append ("public event "); sb.Append (e.GetTypeName ("eventtype")).Append (' '); diff --git a/mcs/tools/corcompare/mono-api-html/FieldComparer.cs b/mcs/tools/corcompare/mono-api-html/FieldComparer.cs index 0916ed53963..c8a6e0a7772 100644 --- a/mcs/tools/corcompare/mono-api-html/FieldComparer.cs +++ b/mcs/tools/corcompare/mono-api-html/FieldComparer.cs @@ -43,6 +43,96 @@ namespace Xamarin.ApiDiff { get { return "field"; } } + void RenderFieldAttributes (FieldAttributes source, FieldAttributes target, ApiChange change) + { + // the visibility values are the same for MethodAttributes and FieldAttributes, so just use the same method. + RenderVisibility ((MethodAttributes) source, (MethodAttributes) target, change); + // same for the static flag + RenderStatic ((MethodAttributes) source, (MethodAttributes) target, change); + + var srcLiteral = (source & FieldAttributes.Literal) != 0; + var tgtLiteral = (target & FieldAttributes.Literal) != 0; + + if (srcLiteral) { + if (tgtLiteral) { + change.Append ("const "); + } else { + change.AppendRemoved ("const", true).Append (" "); + } + } else if (tgtLiteral) { + change.AppendAdded ("const", true).Append (" "); + } + + var srcInitOnly = (source & FieldAttributes.InitOnly) != 0; + var tgtInitOnly = (target & FieldAttributes.InitOnly) != 0; + if (srcInitOnly) { + if (tgtInitOnly) { + change.Append ("readonly "); + } else { + change.AppendRemoved ("readonly", false).Append (" "); + } + } else if (tgtInitOnly) { + change.AppendAdded ("readonly", true).Append (" "); + } + } + + public override bool Equals (XElement source, XElement target, ApiChanges changes) + { + if (base.Equals (source, target, changes)) + return true; + + var name = source.GetAttribute ("name"); + var srcValue = source.GetAttribute ("value"); + var tgtValue = target.GetAttribute ("value"); + var change = new ApiChange (); + change.Header = "Modified " + GroupName; + + if (State.BaseType == "System.Enum") { + change.Append (name).Append (" = "); + if (srcValue != tgtValue) { + change.AppendModified (srcValue, tgtValue, true); + } else { + change.Append (srcValue); + } + } else { + RenderFieldAttributes (source.GetFieldAttributes (), target.GetFieldAttributes (), change); + + var srcType = source.GetTypeName ("fieldtype"); + var tgtType = target.GetTypeName ("fieldtype"); + + if (srcType != tgtType) { + change.AppendModified (srcType, tgtType, true); + } else { + change.Append (srcType); + } + change.Append (" "); + change.Append (name); + + if (srcType == "string" && srcValue != null) + srcValue = "\"" + srcValue + "\""; + + if (tgtType == "string" && tgtValue != null) + tgtValue = "\"" + tgtValue + "\""; + + if (srcValue != tgtValue) { + change.Append (" = "); + if (srcValue == null) + srcValue = "null"; + if (tgtValue == null) + tgtValue = "null"; + change.AppendModified (srcValue, tgtValue, true); + } else if (srcValue != null) { + change.Append (" = "); + change.Append (srcValue); + } + change.Append (";"); + } + + changes.Add (source, target, change); + + return false; + } + public override string GetDescription (XElement e) { var sb = new StringBuilder (); @@ -87,19 +177,25 @@ namespace Xamarin.ApiDiff { public override void BeforeAdding (IEnumerable list) { first = true; - if (State.BaseType == "System.Enum") + if (State.BaseType == "System.Enum") { Output.WriteLine ("

Added value{0}:

", list.Count () > 1 ? "s" : String.Empty);
-			else
+				if (State.Colorize)
+					Output.Write ("");
+			} else {
 				base.BeforeAdding (list);
+			}
 		}
 
 		public override void BeforeRemoving (IEnumerable list)
 		{
 			first = true;
-			if (State.BaseType == "System.Enum")
+			if (State.BaseType == "System.Enum") {
 				Output.WriteLine ("

Removed value{0}:

", list.Count () > 1 ? "s" : String.Empty);
-			else
+				if (State.Colorize)
+					Output.Write ("");
+			} else {
 				base.BeforeRemoving (list);
+			}
 		}
 	}
 }
\ No newline at end of file
diff --git a/mcs/tools/corcompare/mono-api-html/Helpers.cs b/mcs/tools/corcompare/mono-api-html/Helpers.cs
index 91afedc4814..8769785c478 100644
--- a/mcs/tools/corcompare/mono-api-html/Helpers.cs
+++ b/mcs/tools/corcompare/mono-api-html/Helpers.cs
@@ -25,13 +25,15 @@
 //
 
 using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
 using System.Text;
 using System.Xml.Linq;
 
 namespace Xamarin.ApiDiff {
 
 	public static class Helper {
-
 		public static bool IsTrue (this XElement self, string name)
 		{
 			return (self.GetAttribute (name) == "true");
@@ -67,6 +69,28 @@ namespace Xamarin.ApiDiff {
 			return null;
 		}
 
+		public static IEnumerable Descendants (this XElement self, params string[] names)
+		{
+			XElement el = self;
+			if (el == null)
+				return null;
+
+			for (int i = 0; i < names.Length - 1; i++) {
+				el = el.Element (names [i]);
+				if (el == null)
+					return null;
+			}
+			return el.Elements (names [names.Length - 1]);
+		}
+
+		public static List DescendantList (this XElement self, params string[] names)
+		{
+			var descendants = self.Descendants (names);
+			if (descendants == null)
+				return null;
+			return descendants.ToList ();
+		}
+
 		// make it beautiful (.NET -> C#)
 		public static string GetTypeName (this XElement self, string name)
 		{
@@ -153,11 +177,31 @@ namespace Xamarin.ApiDiff {
 				return "ushort";
 			case "System.Char":
 				return "char";
+			case "System.nint":
+				return "nint";
+			case "System.nuint":
+				return "uint";
+			case "System.nfloat":
+				return "nfloat";
+			case "System.IntPtr":
+				return "IntPtr";
 			default:
 				if (type.StartsWith (State.Namespace, StringComparison.Ordinal))
 					type = type.Substring (State.Namespace.Length + 1);
 				return type;
 			}
 		}
+
+		public static MethodAttributes GetMethodAttributes (this XElement element)
+		{
+			var srcAttribs = element.Attribute ("attrib");
+			return (MethodAttributes) (srcAttribs != null ? Int32.Parse (srcAttribs.Value) : 0);
+		}
+
+		public static FieldAttributes GetFieldAttributes (this XElement element)
+		{
+			var srcAttribs = element.Attribute ("attrib");
+			return (FieldAttributes) (srcAttribs != null ? Int32.Parse (srcAttribs.Value) : 0);
+		}
 	}
 }
\ No newline at end of file
diff --git a/mcs/tools/corcompare/mono-api-html/MemberComparer.cs b/mcs/tools/corcompare/mono-api-html/MemberComparer.cs
index 839de88a4a2..e21273873cb 100644
--- a/mcs/tools/corcompare/mono-api-html/MemberComparer.cs
+++ b/mcs/tools/corcompare/mono-api-html/MemberComparer.cs
@@ -27,6 +27,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Reflection;
 using System.Text;
 using System.Xml.Linq;
 
@@ -75,7 +76,7 @@ namespace Xamarin.ApiDiff {
 		public override void Compare (IEnumerable source, IEnumerable target)
 		{
 			removed.Clear ();
-			obsoleted.Clear ();
+			modified.Clear ();
 
 			foreach (var s in source) {
 				SetContext (s);
@@ -85,40 +86,21 @@ namespace Xamarin.ApiDiff {
 					// not in target, it was removed
 					removed.Add (s);
 				} else {
+					t.Remove ();
 					// possibly modified
-					if (Equals (s, t)) {
-						if (IsNowObsoleted (s, t)) {
-							obsoleted.Add (t);
-						}
-						t.Remove ();
+					if (Equals (s, t, modified))
 						continue;
-					}
 
-					// still in target so will be part of Added
-					removed.Add (s);
-					Modified (s, t);
+					Modified (s, t, modified);
 				}
 			}
 			// delayed, that way we show "Modified", "Added" and then "Removed"
 			Remove (removed);
 
+			Modify (modified);
+
 			// remaining == newly added in target
 			Add (target);
-
-			// obsolete (considering as added, they were not obsolete before, wrt regex)
-			bool o = false;
-			foreach (var item in obsoleted) {
-				SetContext (item);
-				if (State.IgnoreAdded.Any (re => re.IsMatch (GetDescription (item))))
-					continue;
-				if (!o) {
-					BeforeObsoleting (obsoleted);
-					o = true;
-				}
-				Obsoleted (item);
-			}
-			if (o)
-				AfterObsoleting ();
 		}
 
 		void Add (IEnumerable elements)
@@ -138,6 +120,20 @@ namespace Xamarin.ApiDiff {
 				AfterAdding ();
 		}
 
+		void Modify (ApiChanges modified)
+		{
+			foreach (var changes in modified) {
+				Output.WriteLine ("

{0}:

", changes.Key); + Output.WriteLine ("
");
+				foreach (var element in changes.Value) {
+					foreach (var line in element.Member.ToString ().Split ('\n'))
+						Output.WriteLine ("\t{0}", line);
+
+				}
+				Output.WriteLine ("
"); + } + } + void Remove (IEnumerable elements) { bool r = false; @@ -154,7 +150,7 @@ namespace Xamarin.ApiDiff { if (r) AfterRemoving (); } - + public abstract string GetDescription (XElement e); protected StringBuilder GetObsoleteMessage (XElement e) @@ -172,44 +168,23 @@ namespace Xamarin.ApiDiff { return sb; } - public override bool Equals (XElement source, XElement target) + public override bool Equals (XElement source, XElement target, ApiChanges changes) { - if (base.Equals (source, target)) - return true; - - string sourceDescription = GetDescription (source); - string targetDescription = GetDescription (target); - - return CheckVirtualChanges (sourceDescription, targetDescription) || - (State.IgnoreAddedPropertySetters && - CheckVirtualChanges (sourceDescription, targetDescription.Replace (" set; ", " "))); - } + RenderAttributes (source, target, changes); - static bool CheckVirtualChanges (string sourceDescription, string targetDescription) - { - return (sourceDescription == targetDescription) || - // *adding* virtual or override to target is acceptable; *removing* them is NOT - (State.IgnoreVirtualChanges && - // non-virtual to virtual is fine - (sourceDescription == targetDescription.Replace ("virtual ", "")) || - // non-virtual to override is fine - (sourceDescription == targetDescription.Replace ("override ", "")) || - // virtual to override is fine - (sourceDescription.Replace (" virtual ", " override ") == targetDescription)); - } + // We don't want to compare attributes. + RemoveAttributes (source); + RemoveAttributes (target); - bool IsNowObsoleted (XElement source, XElement target) - { - var s = GetObsoleteMessage (source).ToString (); - var t = GetObsoleteMessage (target).ToString (); - // true if it was no [Obsolete] in the source but now is [Obsolete] in the target - return (s.Length == 0 && t.Length > 0); + return base.Equals (source, target, changes); } public virtual void BeforeAdding (IEnumerable list) { first = true; Output.WriteLine ("

Added {0}:

", list.Count () > 1 ? GroupName : ElementName);
+			if (State.Colorize)
+				Output.Write ("");
 		}
 
 		public override void Added (XElement target)
@@ -223,32 +198,21 @@ namespace Xamarin.ApiDiff {
 
 		public virtual void AfterAdding ()
 		{
+			if (State.Colorize)
+				Output.Write ("");
 			Output.WriteLine ("
"); } - public virtual void BeforeObsoleting (IEnumerable list) - { - Output.WriteLine ("

Obsoleted {0}:

", list.Count () > 1 ? GroupName : ElementName);
-		}
-
-		public void Obsoleted (XElement target)
-		{
-			Indent ().WriteLine ("\t{0}{1}{2}", GetObsoleteMessage (target), GetDescription (target), Environment.NewLine);
-		}
-
-		public virtual void AfterObsoleting ()
-		{
-			Output.WriteLine ("
"); - } - - public override void Modified (XElement source, XElement target) + public override void Modified (XElement source, XElement target, ApiChanges change) { } public virtual void BeforeRemoving (IEnumerable list) { first = true; - Output.WriteLine ("

Removed {0}:

", list.Count () > 1 ? GroupName : ElementName);
+			Output.WriteLine ("

Removed {0}:

\n
", list.Count () > 1 ? GroupName : ElementName);
+			if (State.Colorize)
+				Output.Write ("");
 		}
 
 		public override void Removed (XElement source)
@@ -262,7 +226,334 @@ namespace Xamarin.ApiDiff {
 
 		public virtual void AfterRemoving ()
 		{
+			if (State.Colorize)
+				Output.Write ("");
 			Output.WriteLine ("
"); } + + protected void RenderGenericParameters (XElement source, XElement target, ApiChange change) + { + var src = source.DescendantList ("generic-parameters", "generic-parameter"); + var tgt = target.DescendantList ("generic-parameters", "generic-parameter"); + var srcCount = src == null ? 0 : src.Count; + var tgtCount = tgt == null ? 0 : tgt.Count; + + if (srcCount == 0 && tgtCount == 0) + return; + + change.Append ("<"); + for (int i = 0; i < Math.Max (srcCount, tgtCount); i++) { + if (i > 0) + change.Append (", "); + if (i >= srcCount) { + change.AppendAdded (tgt [i].GetTypeName ("name"), true); + } else if (i >= tgtCount) { + change.AppendRemoved (src [i].GetTypeName ("name"), true); + } else { + var srcName = src [i].GetTypeName ("name"); + var tgtName = tgt [i].GetTypeName ("name"); + + if (srcName != tgtName) { + change.AppendModified (srcName, tgtName, true); + } else { + change.Append (srcName); + } + } + } + change.Append (">"); + } + + protected string FormatValue (string type, string value) + { + if (value == null) + return "null"; + + if (type == "string") + return "\"" + value + "\""; + else if (type == "bool") { + switch (value) { + case "True": + return "true"; + case "False": + return "false"; + default: + return value; + } + } + + return value; + } + + protected void RenderParameters (XElement source, XElement target, ApiChange change) + { + var src = source.DescendantList ("parameters", "parameter"); + var tgt = target.DescendantList ("parameters", "parameter"); + var srcCount = src == null ? 0 : src.Count; + var tgtCount = tgt == null ? 0 : tgt.Count; + + change.Append (" ("); + for (int i = 0; i < Math.Max (srcCount, tgtCount); i++) { + if (i > 0) + change.Append (", "); + + if (i >= srcCount) { + change.AppendAdded (tgt [i].GetTypeName ("type") + " " + tgt [i].GetAttribute ("name"), true); + } else if (i >= tgtCount) { + change.AppendRemoved (src [i].GetTypeName ("type") + " " + src [i].GetAttribute ("name"), true); + } else { + var paramSourceType = src [i].GetTypeName ("type"); + var paramTargetType = tgt [i].GetTypeName ("type"); + + var paramSourceName = src [i].GetAttribute ("name"); + var paramTargetName = tgt [i].GetAttribute ("name"); + + if (paramSourceType != paramTargetType) { + change.AppendModified (paramSourceType, paramTargetType, true); + } else { + change.Append (paramSourceType); + } + change.Append (" "); + if (paramSourceName != paramTargetName) { + change.AppendModified (paramSourceName, paramTargetName, false); + } else { + change.Append (paramSourceName); + } + + var optSource = src [i].Attribute ("optional"); + var optTarget = tgt [i].Attribute ("optional"); + var srcValue = FormatValue (paramSourceType, src [i].GetAttribute ("defaultValue")); + var tgtValue = FormatValue (paramTargetType, tgt [i].GetAttribute ("defaultValue")); + + if (optSource != null) { + if (optTarget != null) { + change.Append (" = "); + if (srcValue != tgtValue) { + change.AppendModified (srcValue, tgtValue, false); + } else { + change.Append (tgtValue); + } + } else { + change.AppendRemoved (" = " + srcValue); + } + } else { + if (optTarget != null) + change.AppendAdded (" = " + tgtValue); + } + } + } + + change.Append (")"); + + // Ignore any parameter name changes if requested. + if (State.IgnoreParameterNameChanges && !change.Breaking) { + change.AnyChange = false; + change.HasIgnoredChanges = true; + } + } + + void RenderVTable (MethodAttributes source, MethodAttributes target, ApiChange change) + { + var srcAbstract = (source & MethodAttributes.Abstract) == MethodAttributes.Abstract; + var tgtAbstract = (target & MethodAttributes.Abstract) == MethodAttributes.Abstract; + var srcFinal = (source & MethodAttributes.Final) == MethodAttributes.Final; + var tgtFinal = (target & MethodAttributes.Final) == MethodAttributes.Final; + var srcVirtual = (source & MethodAttributes.Virtual) == MethodAttributes.Virtual; + var tgtVirtual = (target & MethodAttributes.Virtual) == MethodAttributes.Virtual; + var srcOverride = (source & MethodAttributes.VtableLayoutMask) != MethodAttributes.NewSlot; + var tgtOverride = (target & MethodAttributes.VtableLayoutMask) != MethodAttributes.NewSlot; + + var srcWord = srcVirtual ? (srcOverride ? "override" : "virtual") : string.Empty; + var tgtWord = tgtVirtual ? (tgtOverride ? "override" : "virtual") : string.Empty; + var breaking = srcWord.Length > 0 && tgtWord.Length == 0; + + if (srcAbstract) { + if (tgtAbstract) { + change.Append ("abstract "); + } else if (tgtVirtual) { + change.AppendModified ("abstract", tgtWord, false).Append (" "); + } else { + change.AppendRemoved ("abstract").Append (" "); + } + } else { + if (tgtAbstract) { + change.AppendAdded ("abstract", true).Append (" "); + } else if (srcWord != tgtWord) { + if (!tgtFinal) + change.AppendModified (srcWord, tgtWord, breaking).Append (" "); + } else if (tgtWord.Length > 0) { + change.Append (tgtWord).Append (" "); + } else if (srcWord.Length > 0) { + change.AppendRemoved (srcWord, breaking).Append (" "); + } + } + + if (srcFinal) { + if (tgtFinal) { + change.Append ("final "); + } else { + change.AppendRemoved ("final", false).Append (" "); // removing 'final' is not a breaking change. + } + } else { + if (tgtFinal && srcVirtual) { + change.AppendModified ("virtual", "final", true).Append (" "); // adding 'final' is a breaking change if the member was virtual + } + } + + if (!srcVirtual && !srcFinal && tgtVirtual && tgtFinal) { + // existing member implements a member from a new interface + // this would show up as 'virtual final', which is redundant, so show nothing at all. + change.HasIgnoredChanges = true; + } + + // Ignore non-breaking virtual changes. + if (State.IgnoreVirtualChanges && !change.Breaking) { + change.AnyChange = false; + change.HasIgnoredChanges = true; + } + } + + protected string GetVisibility (MethodAttributes attr) + { + switch (attr) { + case MethodAttributes.Private: + case MethodAttributes.PrivateScope: + return "private"; + case MethodAttributes.Assembly: + return "internal"; + case MethodAttributes.FamANDAssem: + return "private internal"; + case MethodAttributes.FamORAssem: + return "protected"; // customers don't care about 'internal'; + case MethodAttributes.Family: + return "protected"; + case MethodAttributes.Public: + return "public"; + default: + throw new NotImplementedException (); + } + } + + protected void RenderVisibility (MethodAttributes source, MethodAttributes target, ApiChange diff) + { + source = source & MethodAttributes.MemberAccessMask; + target = target & MethodAttributes.MemberAccessMask; + + if (source == target) { + diff.Append (GetVisibility (target)); + } else { + var breaking = false; + switch (source) { + case MethodAttributes.Private: + case MethodAttributes.Assembly: + case MethodAttributes.FamANDAssem: + break; // these are not publicly visible, thus not breaking + case MethodAttributes.FamORAssem: + case MethodAttributes.Family: + switch (target) { + case MethodAttributes.Public: + // to public is not a breaking change + break; + case MethodAttributes.Family: + case MethodAttributes.FamORAssem: + // not a breaking change, but should still show up in diff + break; + default: + // anything else is a breaking change + breaking = true; + break; + } + break; + case MethodAttributes.Public: + default: + // any change from public is breaking. + breaking = true; + break; + } + + diff.AppendModified (GetVisibility (source), GetVisibility (target), breaking); + } + diff.Append (" "); + } + + protected void RenderStatic (MethodAttributes src, MethodAttributes tgt, ApiChange diff) + { + var srcStatic = (src & MethodAttributes.Static) == MethodAttributes.Static; + var tgtStatic = (tgt & MethodAttributes.Static) == MethodAttributes.Static; + + if (srcStatic != tgtStatic) { + if (srcStatic) { + diff.AppendRemoved ("static", true).Append (" "); + } else { + diff.AppendAdded ("static", true).Append (" "); + } + } + } + + protected void RenderMethodAttributes (MethodAttributes src, MethodAttributes tgt, ApiChange diff) + { + RenderStatic (src, tgt, diff); + RenderVisibility (src & MethodAttributes.MemberAccessMask, tgt & MethodAttributes.MemberAccessMask, diff); + RenderVTable (src, tgt, diff); + } + + protected void RenderMethodAttributes (XElement source, XElement target, ApiChange diff) + { + RenderMethodAttributes (source.GetMethodAttributes (), target.GetMethodAttributes (), diff); + } + + protected void RemoveAttributes (XElement element) + { + var srcAttributes = element.Element ("attributes"); + if (srcAttributes != null) + srcAttributes.Remove (); + + foreach (var el in element.Elements ()) + RemoveAttributes (el); + } + + protected void RenderAttributes (XElement source, XElement target, ApiChanges changes) + { + var srcObsolete = source.GetObsoleteMessage (); + var tgtObsolete = target.GetObsoleteMessage (); + + if (srcObsolete == tgtObsolete) + return; // nothing changed + + if (srcObsolete == null) { + if (tgtObsolete == null) + return; // neither is obsolete + var change = new ApiChange (); + change.Header = "Obsoleted " + GroupName; + if (State.Colorize) + change.Append (""); + change.Append ("[Obsolete ("); + if (tgtObsolete != string.Empty) + change.Append ("\"").Append (tgtObsolete).Append ("\""); + change.Append ("]\n"); + change.Append (GetDescription (target)); + if (State.Colorize) + change.Append (""); + change.AnyChange = true; + changes.Add (source, target, change); + } else if (tgtObsolete == null) { + // Made non-obsolete. Do we care to report this? + } else { + // Obsolete message changed. Do we care to report this? + } + } + + protected void RenderName (XElement source, XElement target, ApiChange change) + { + var name = target.GetAttribute ("name"); + // show the constructor as it would be defined in C# + name = name.Replace (".ctor", State.Type); + + var p = name.IndexOf ('('); + if (p >= 0) + name = name.Substring (0, p); + + change.Append (name); + } + } } diff --git a/mcs/tools/corcompare/mono-api-html/NamespaceComparer.cs b/mcs/tools/corcompare/mono-api-html/NamespaceComparer.cs index 427df66e6eb..258374c6b9d 100644 --- a/mcs/tools/corcompare/mono-api-html/NamespaceComparer.cs +++ b/mcs/tools/corcompare/mono-api-html/NamespaceComparer.cs @@ -25,6 +25,7 @@ // using System; +using System.Collections.Generic; using System.IO; using System.Linq; using System.Xml.Linq; @@ -68,7 +69,7 @@ namespace Xamarin.ApiDiff { Output.WriteLine (); } - public override void Modified (XElement source, XElement target) + public override void Modified (XElement source, XElement target, ApiChanges differences) { var output = Output; State.Output = new StringWriter (); diff --git a/mcs/tools/corcompare/mono-api-html/PropertyComparer.cs b/mcs/tools/corcompare/mono-api-html/PropertyComparer.cs index 4a5f34fd2ec..4fbd864d994 100644 --- a/mcs/tools/corcompare/mono-api-html/PropertyComparer.cs +++ b/mcs/tools/corcompare/mono-api-html/PropertyComparer.cs @@ -25,6 +25,7 @@ // using System; +using System.Collections.Generic; using System.Reflection; using System.Text; using System.Xml.Linq; @@ -49,30 +50,146 @@ namespace Xamarin.ApiDiff { return e.GetAttribute ("params") == Source.GetAttribute ("params"); } - public override string GetDescription (XElement e) + void GetAccessors (XElement element, out XElement getter, out XElement setter) { - string name = e.Attribute ("name").Value; - string ptype = e.GetTypeName ("ptype"); + var methods = element.Element ("methods"); + + getter = null; + setter = null; + + if (methods == null) + return; + + foreach (var m in methods.Elements ("method")) { + var n = m.GetAttribute ("name"); + if (n.StartsWith ("get_", StringComparison.Ordinal)) { + getter = m; + } else if (n.StartsWith ("set_", StringComparison.Ordinal)) { + setter = m; + } + } + } + + MethodAttributes GetMethodAttributes (XElement getter, XElement setter) + { + if (getter == null) + return setter.GetMethodAttributes (); + else if (setter == null) + return getter.GetMethodAttributes (); + + var gAttr = getter.GetMethodAttributes (); + var sAttr = setter.GetMethodAttributes (); + var g = gAttr & MethodAttributes.MemberAccessMask; + var s = sAttr & MethodAttributes.MemberAccessMask; + // Visibility is ordered numerically (higher value = more visible). + // We want the most visible. + var visibility = (MethodAttributes) Math.Max ((int) g, (int) s); + // Do a bitwise or with the rest of the flags + var g_no_visibility = gAttr & ~MethodAttributes.MemberAccessMask; + var s_no_visibility = sAttr & ~MethodAttributes.MemberAccessMask; + return g_no_visibility | s_no_visibility | visibility; + } + + void RenderPropertyType (XElement source, XElement target, ApiChange change) + { + var srcType = source.GetTypeName ("ptype"); + var tgtType = target.GetTypeName ("ptype"); + + if (srcType == tgtType) { + change.Append (tgtType); + } else { + change.AppendModified (srcType, tgtType, true); + } + change.Append (" "); + } + + void RenderAccessors (XElement srcGetter, XElement tgtGetter, XElement srcSetter, XElement tgtSetter, ApiChange change) + { + // FIXME: this doesn't render changes in the accessor visibility (a protected setter can become public for instance). + change.Append (" {"); + if (tgtGetter != null) { + if (srcGetter != null) { + change.Append (" ").Append ("get;"); + } else { + change.Append (" ").AppendAdded ("get;"); + } + } else if (srcGetter != null) { + change.Append (" ").AppendRemoved ("get;"); + } + + if (tgtSetter != null) { + if (srcSetter != null) { + change.Append (" ").Append ("set;"); + } else { + change.Append (" ").AppendAdded ("set;"); + } + } else if (srcSetter != null) { + change.Append (" ").AppendRemoved ("set;"); + } + + change.Append (" }"); + + // Ignore added property setters if asked to + if (srcSetter == null && tgtSetter != null && State.IgnoreAddedPropertySetters && !change.Breaking) { + change.AnyChange = false; + change.HasIgnoredChanges = true; + } + } + + public override bool Equals (XElement source, XElement target, ApiChanges changes) + { + if (base.Equals (source, target, changes)) + return true; + + XElement srcGetter, srcSetter; + XElement tgtGetter, tgtSetter; + GetAccessors (source, out srcGetter, out srcSetter); + GetAccessors (target, out tgtGetter, out tgtSetter); + + var change = new ApiChange (); + change.Header = "Modified " + GroupName; + RenderMethodAttributes (GetMethodAttributes (srcGetter, srcSetter), GetMethodAttributes (tgtGetter, tgtSetter), change); + RenderPropertyType (source, target, change); + RenderName (source, target, change); + RenderGenericParameters (source, target, change); + RenderAccessors (srcGetter, tgtGetter, srcSetter, tgtSetter, change); + + changes.Add (source, target, change); + + return false; + } + + void GetProperties (XElement e, out bool @virtual, out bool @override, out bool @static, out bool getter, out bool setter, out bool family) + { + @virtual = @override = @static = getter = setter = family = false; - bool virt = false; - bool over = false; - bool stat = false; - bool getter = false; - bool setter = false; - bool family = false; var methods = e.Element ("methods"); if (methods != null) { foreach (var m in methods.Elements ("method")) { - virt |= m.IsTrue ("virtual"); - stat |= m.IsTrue ("static"); + @virtual |= m.IsTrue ("virtual"); + @static |= m.IsTrue ("static"); var n = m.GetAttribute ("name"); getter |= n.StartsWith ("get_", StringComparison.Ordinal); setter |= n.StartsWith ("set_", StringComparison.Ordinal); var attribs = (MethodAttributes) Int32.Parse (m.GetAttribute ("attrib")); family = ((attribs & MethodAttributes.Public) != MethodAttributes.Public); - over |= (attribs & MethodAttributes.VtableLayoutMask) == 0; + @override |= (attribs & MethodAttributes.NewSlot) == 0; } } + } + + public override string GetDescription (XElement e) + { + string name = e.Attribute ("name").Value; + string ptype = e.GetTypeName ("ptype"); + + bool virt = false; + bool over = false; + bool stat = false; + bool getter = false; + bool setter = false; + bool family = false; + GetProperties (e, out virt, out over, out stat, out getter, out setter, out family); var sb = new StringBuilder (); diff --git a/mcs/tools/corcompare/mono-api-html/mono-api-html.csproj b/mcs/tools/corcompare/mono-api-html/mono-api-html.csproj index 989dde67477..286a4d0192a 100644 --- a/mcs/tools/corcompare/mono-api-html/mono-api-html.csproj +++ b/mcs/tools/corcompare/mono-api-html/mono-api-html.csproj @@ -19,7 +19,7 @@ prompt 4 false - /Developer/MonoTouch/Source/monotouch/tools/apidiff/references/monotouch.xml /Developer/MonoTouch/Source/monotouch/tools/apidiff/temp/monotouch.xml + /Developer/MonoTouch/Source/monotouch/tools/apidiff/references/compat/monotouch.xml /Developer/MonoTouch/Source/monotouch/tools/apidiff/temp/compat/monotouch.xml -i INSObjectProtocol /tmp/diff.html full @@ -52,6 +52,7 @@ Options.cs + diff --git a/mcs/tools/resgen/Makefile b/mcs/tools/resgen/Makefile index 9e047cd1031..2450c069400 100644 --- a/mcs/tools/resgen/Makefile +++ b/mcs/tools/resgen/Makefile @@ -6,7 +6,7 @@ PROGRAM = resgen.exe CLEAN_FILES = resgen.exe -INSTALL_PROFILE := $(filter net_2_0 net_4_5, $(PROFILE)) +INSTALL_PROFILE := $(filter net_4_5, $(PROFILE)) ifndef INSTALL_PROFILE NO_INSTALL = yes endif diff --git a/mcs/tools/xbuild/xbuild_test.make b/mcs/tools/xbuild/xbuild_test.make index 033cf4fede9..0538de0894c 100644 --- a/mcs/tools/xbuild/xbuild_test.make +++ b/mcs/tools/xbuild/xbuild_test.make @@ -25,24 +25,10 @@ copy-targets: copy-targets-$(XBUILD_VERSION) clean-targets: clean-targets-$(XBUILD_VERSION) -XBUILD_2_0_PROFILE_DIR=$(topdir)/class/lib/net_2_0 -XBUILD_3_5_PROFILE_DIR=$(topdir)/class/lib/net_3_5 XBUILD_4_0_PROFILE_DIR=$(topdir)/class/lib/net_4_5 XBUILD_12_0_PROFILE_DIR=$(topdir)/class/lib/xbuild_12 XBUILD_14_0_PROFILE_DIR=$(topdir)/class/lib/xbuild_14 -copy-targets-2.0: - cp $(XBUILD_DATA_DIR)/2.0/Microsoft.Common.targets $(XBUILD_2_0_PROFILE_DIR) - cp $(XBUILD_DATA_DIR)/2.0/Microsoft.Common.tasks $(XBUILD_2_0_PROFILE_DIR) - cp $(XBUILD_DATA_DIR)/2.0/Microsoft.CSharp.targets $(XBUILD_2_0_PROFILE_DIR) - cp $(XBUILD_DATA_DIR)/Microsoft.VisualBasic.targets $(XBUILD_2_0_PROFILE_DIR) - -copy-targets-3.5: - cp $(XBUILD_DATA_DIR)/3.5/Microsoft.Common.targets $(XBUILD_3_5_PROFILE_DIR) - cp $(XBUILD_DATA_DIR)/3.5/Microsoft.Common.tasks $(XBUILD_3_5_PROFILE_DIR) - cp $(XBUILD_DATA_DIR)/3.5/Microsoft.CSharp.targets $(XBUILD_3_5_PROFILE_DIR) - cp $(XBUILD_DATA_DIR)/Microsoft.VisualBasic.targets $(XBUILD_3_5_PROFILE_DIR) - copy-targets-4.0: cp $(XBUILD_DATA_DIR)/4.0/Microsoft.Common.targets $(XBUILD_4_0_PROFILE_DIR) cp $(XBUILD_DATA_DIR)/4.0/Microsoft.Common.tasks $(XBUILD_4_0_PROFILE_DIR) @@ -61,18 +47,6 @@ copy-targets-14.0: cp $(XBUILD_DATA_DIR)/14.0/Microsoft.CSharp.targets $(XBUILD_14_0_PROFILE_DIR) cp $(XBUILD_DATA_DIR)/Microsoft.VisualBasic.targets $(XBUILD_14_0_PROFILE_DIR) -clean-targets-2.0: - rm -f $(XBUILD_2_0_PROFILE_DIR)/Microsoft.Common.targets - rm -f $(XBUILD_2_0_PROFILE_DIR)/Microsoft.Common.tasks - rm -f $(XBUILD_2_0_PROFILE_DIR)/Microsoft.CSharp.targets - rm -f $(XBUILD_2_0_PROFILE_DIR)/Microsoft.VisualBasic.targets - -clean-targets-3.5: - rm -f $(XBUILD_3_5_PROFILE_DIR)/Microsoft.Common.targets - rm -f $(XBUILD_3_5_PROFILE_DIR)/Microsoft.Common.tasks - rm -f $(XBUILD_3_5_PROFILE_DIR)/Microsoft.CSharp.targets - rm -f $(XBUILD_3_5_PROFILE_DIR)/Microsoft.VisualBasic.targets - clean-targets-4.0: rm -f $(XBUILD_4_0_PROFILE_DIR)/Microsoft.Common.targets rm -f $(XBUILD_4_0_PROFILE_DIR)/Microsoft.Common.tasks @@ -92,18 +66,8 @@ clean-targets-14.0: rm -f $(XBUILD_14_0_PROFILE_DIR)/Microsoft.VisualBasic.targets #allow tests to find older versions of libs and targets -ifneq (2.0, $(XBUILD_VERSION)) -TEST_MONO_PATH := $(topdir)/class/lib/net_2_0 -copy-targets: copy-targets-2.0 -clean-targets: clean-targets-2.0 -ifneq (3.5, $(XBUILD_VERSION)) -TEST_MONO_PATH := $(topdir)/class/lib/net_3_5$(PLATFORM_PATH_SEPARATOR)$(TEST_MONO_PATH) -copy-targets: copy-targets-3.5 -clean-targets: clean-targets-3.5 ifneq (4.0, $(XBUILD_VERSION)) TEST_MONO_PATH := $(topdir)/class/lib/net_4_5$(PLATFORM_PATH_SEPARATOR)$(TEST_MONO_PATH) copy-targets: copy-targets-4.0 clean-targets: clean-targets-4.0 endif -endif -endif diff --git a/mono/arch/ppc/ppc-codegen.h b/mono/arch/ppc/ppc-codegen.h index 55b506006ff..d4d25a254f9 100644 --- a/mono/arch/ppc/ppc-codegen.h +++ b/mono/arch/ppc/ppc-codegen.h @@ -123,7 +123,7 @@ enum { PPC_TRAP_GE_UN = 16 + PPC_TRAP_EQ }; -#define ppc_emit32(c,x) do { *((guint32 *) (c)) = GUINT32_TO_BE (x); (c) = (gpointer)((guint8 *)(c) + sizeof (guint32));} while (0) +#define ppc_emit32(c,x) do { *((guint32 *) (c)) = (guint32) (x); (c) = (gpointer)((guint8 *)(c) + sizeof (guint32));} while (0) #define ppc_is_imm16(val) ((((val)>> 15) == 0) || (((val)>> 15) == -1)) #define ppc_is_uimm16(val) ((glong)(val) >= 0L && (glong)(val) <= 65535L) @@ -806,11 +806,15 @@ my and Ximian's copyright to this code. ;) } \ } G_STMT_END +#if _CALL_ELF == 2 +#define ppc_load_func(c,D,V) ppc_load_sequence ((c), (D), (V)) +#else #define ppc_load_func(c,D,v) G_STMT_START { \ - ppc_load_sequence ((c), ppc_r11, (guint64)(gsize)(v)); \ - ppc_ldptr ((c), ppc_r2, sizeof (gpointer), ppc_r11); \ - ppc_ldptr ((c), (D), 0, ppc_r11); \ + ppc_load_sequence ((c), ppc_r12, (guint64)(gsize)(v)); \ + ppc_ldptr ((c), ppc_r2, sizeof (gpointer), ppc_r12); \ + ppc_ldptr ((c), (D), 0, ppc_r12); \ } G_STMT_END +#endif #define ppc_load_multiple_regs(c,D,d,A) G_STMT_START { \ int __i, __o = (d); \ diff --git a/mono/arch/sparc/Makefile.am b/mono/arch/sparc/Makefile.am index a8889040a3c..272d0c5990b 100644 --- a/mono/arch/sparc/Makefile.am +++ b/mono/arch/sparc/Makefile.am @@ -1,7 +1,2 @@ - -AM_CPPFLAGS = $(GLIB_CFLAGS) -I$(top_srcdir) - -noinst_LTLIBRARIES = libmonoarch-sparc.la - -libmonoarch_sparc_la_SOURCES = tramp.c sparc-codegen.h +EXTRA_DIST = sparc-codegen.h diff --git a/mono/arch/sparc/tramp.c b/mono/arch/sparc/tramp.c deleted file mode 100644 index 19c0a781fe1..00000000000 --- a/mono/arch/sparc/tramp.c +++ /dev/null @@ -1,1080 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Create trampolines to invoke arbitrary functions. - * - * Copyright (C) Ximian Inc. - * - * Authors: Paolo Molaro (lupus@ximian.com) - * Jeffrey Stedfast - * Mark Crichton - * - */ - -#include "config.h" -#include -#include -#include "sparc-codegen.h" -#include "mono/metadata/class.h" -#include "mono/metadata/tabledefs.h" -#include "mono/interpreter/interp.h" -#include "mono/metadata/appdomain.h" -#include "mono/metadata/debug-helpers.h" -#include "mono/metadata/marshal.h" - - -#define ARG_SIZE sizeof (stackval) -#define PROLOG_INS 1 -#define CALL_INS 3 /* Max 3. 1 for the jmpl and 1 for the nop and 1 for the possible unimp */ -#define EPILOG_INS 2 -#define FLOAT_REGS 32 -#define OUT_REGS 6 -#define LOCAL_REGS 8 -#define SLOT_SIZE sizeof(gpointer) -#if SPARCV9 -#define MINIMAL_STACK_SIZE 22 -#define BIAS 2047 -#define FRAME_ALIGN 16 -#else -#define MINIMAL_STACK_SIZE 23 -#define BIAS 0 -#define FRAME_ALIGN 8 -#endif - -#define NOT_IMPL(x) g_error("FIXME: %s", x); -/*#define DEBUG(a) a*/ -#define DEBUG(a) - -/* Some assembly... */ -#ifdef __GNUC__ -#define flushi(addr) __asm__ __volatile__ ("flush %0"::"r"(addr):"memory") -#else -static void flushi(void *addr) -{ - asm("flush %i0"); -} -#endif - -static char* -sig_to_name (MonoMethodSignature *sig, const char *prefix) -{ - int i; - char *result; - GString *res = g_string_new (""); - char *p; - - if (prefix) { - g_string_append (res, prefix); - g_string_append_c (res, '_'); - } - - mono_type_get_desc (res, sig->ret, TRUE); - - for (i = 0; i < sig->param_count; ++i) { - g_string_append_c (res, '_'); - mono_type_get_desc (res, sig->params [i], TRUE); - } - result = res->str; - p = result; - /* remove chars Sun's asssembler doesn't like */ - while (*p != '\0') { - if (*p == '.' || *p == '/') - *p = '_'; - else if (*p == '&') - *p = '$'; - else if (*p == '[' || *p == ']') - *p = 'X'; - p++; - } - g_string_free (res, FALSE); - return result; -} - -static void -sparc_disassemble_code (guint32 *code_buffer, guint32 *p, const char *id) -{ - guchar *cp; - FILE *ofd; - - if (!(ofd = fopen ("/tmp/test.s", "w"))) - g_assert_not_reached(); - - fprintf (ofd, "%s:\n", id); - - for (cp = (guchar *)code_buffer; cp < (guchar *)p; cp++) - fprintf (ofd, ".byte %d\n", *cp); - - fclose (ofd); - -#ifdef __GNUC__ - system ("as /tmp/test.s -o /tmp/test.o;objdump -d /tmp/test.o"); -#else - /* this assumes we are using Sun tools as we aren't GCC */ -#if SPARCV9 - system ("as -xarch=v9 /tmp/test.s -o /tmp/test.o;dis /tmp/test.o"); -#else - system ("as /tmp/test.s -o /tmp/test.o;dis /tmp/test.o"); -#endif -#endif -} - - -static void -add_general (guint *gr, guint *stack_size, guint *code_size, gboolean simple) -{ - if (simple) { - if (*gr >= OUT_REGS) { - *stack_size += SLOT_SIZE; - *code_size += 12; - } else { - *code_size += 4; - } - } else { - if (*gr >= OUT_REGS - 1) { - *stack_size += 8 + (*stack_size % 8); /* ???64 */ - *code_size += 16; - } else { - *code_size += 16; - } - (*gr)++; - } - (*gr)++; -} - -static void -calculate_sizes (MonoMethodSignature *sig, guint *stack_size, guint *code_size, - gboolean string_ctor, gboolean *use_memcpy) -{ - guint i, fr, gr; - guint32 simpletype; - - fr = gr = 0; - *stack_size = MINIMAL_STACK_SIZE * SLOT_SIZE; - *code_size = (PROLOG_INS + CALL_INS + EPILOG_INS) * 4; - - /* function arguments */ - if (sig->hasthis) - add_general (&gr, stack_size, code_size, TRUE); - - for (i = 0; i < sig->param_count; i++) { - if (sig->params[i]->byref) { - add_general (&gr, stack_size, code_size, TRUE); - continue; - } - simpletype = sig->params[i]->type; - enum_calc_size: - switch (simpletype) { - case MONO_TYPE_R4: -#if SPARCV9 - (*code_size) += 4; /* for the fdtos */ -#else - (*code_size) += 12; - (*stack_size) += 4; -#endif - case MONO_TYPE_BOOLEAN: - case MONO_TYPE_CHAR: - case MONO_TYPE_I1: - case MONO_TYPE_U1: - case MONO_TYPE_I2: - case MONO_TYPE_U2: - case MONO_TYPE_I4: - case MONO_TYPE_U4: - case MONO_TYPE_I: - case MONO_TYPE_U: - case MONO_TYPE_PTR: - case MONO_TYPE_CLASS: - case MONO_TYPE_OBJECT: - case MONO_TYPE_STRING: - case MONO_TYPE_SZARRAY: - add_general (&gr, stack_size, code_size, TRUE); - break; - case MONO_TYPE_VALUETYPE: { - gint size; - guint32 align; - if (sig->params[i]->data.klass->enumtype) { - simpletype = sig->params[i]->data.klass->enum_basetype->type; - goto enum_calc_size; - } - size = mono_class_native_size (sig->params[i]->data.klass, &align); -#if SPARCV9 - if (size != 4) { -#else - if (1) { -#endif - DEBUG(fprintf(stderr, "copy %d byte struct on stack\n", size)); - *use_memcpy = TRUE; - *code_size += 8*4; - - *stack_size = (*stack_size + (align - 1)) & (~(align -1)); - *stack_size += (size + 3) & (~3); - if (gr > OUT_REGS) { - *code_size += 4; - *stack_size += 4; - } - } else { - add_general (&gr, stack_size, code_size, TRUE); -#if SPARCV9 - *code_size += 8; -#else - *code_size += 4; -#endif - } - break; - } - case MONO_TYPE_I8: - case MONO_TYPE_R8: - add_general (&gr, stack_size, code_size, FALSE); - break; - default: - g_error ("Can't trampoline 0x%x", sig->params[i]->type); - } - } - - /* function return value */ - if (sig->ret->byref || string_ctor) { - *code_size += 8; - } else { - simpletype = sig->ret->type; - enum_retvalue: - switch (simpletype) { - case MONO_TYPE_BOOLEAN: - case MONO_TYPE_I1: - case MONO_TYPE_U1: - case MONO_TYPE_I2: - case MONO_TYPE_U2: - case MONO_TYPE_CHAR: - case MONO_TYPE_I4: - case MONO_TYPE_U4: - case MONO_TYPE_I: - case MONO_TYPE_U: - case MONO_TYPE_CLASS: - case MONO_TYPE_OBJECT: - case MONO_TYPE_PTR: - case MONO_TYPE_STRING: - case MONO_TYPE_R4: - case MONO_TYPE_R8: - case MONO_TYPE_SZARRAY: - case MONO_TYPE_ARRAY: - *code_size += 8; - break; - case MONO_TYPE_I8: - *code_size += 12; - break; - case MONO_TYPE_VALUETYPE: { - gint size; - if (sig->ret->data.klass->enumtype) { - simpletype = sig->ret->data.klass->enum_basetype->type; - goto enum_retvalue; - } - size = mono_class_native_size (sig->ret->data.klass, NULL); -#if SPARCV9 - if (size <= 32) - *code_size += 8 + (size + 7) / 2; - else - *code_size += 8; -#else - *code_size += 8; -#endif - break; - } - case MONO_TYPE_VOID: - break; - default: - g_error ("Can't handle as return value 0x%x", sig->ret->type); - } - } - - if (*use_memcpy) { - *stack_size += 8; - *code_size += 24; - if (sig->hasthis) { - *stack_size += SLOT_SIZE; - *code_size += 4; - } - } - - *stack_size = (*stack_size + (FRAME_ALIGN - 1)) & (~(FRAME_ALIGN -1)); -} - -static inline guint32 * -emit_epilog (guint32 *p, MonoMethodSignature *sig, guint stack_size) -{ - int ret_offset = 8; - - /* - * Standard epilog. - * 8 may be 12 when returning structures (to skip unimp opcode). - */ -#if !SPARCV9 - if (sig != NULL && !sig->ret->byref && sig->ret->type == MONO_TYPE_VALUETYPE && !sig->ret->data.klass->enumtype) - ret_offset = 12; -#endif - sparc_jmpl_imm (p, sparc_i7, ret_offset, sparc_zero); - sparc_restore (p, sparc_zero, sparc_zero, sparc_zero); - - return p; -} - -static inline guint32 * -emit_prolog (guint32 *p, MonoMethodSignature *sig, guint stack_size) -{ - /* yes kids, it is this simple! */ - sparc_save_imm (p, sparc_sp, -stack_size, sparc_sp); - return p; -} - -#if SPARCV9 -#define sparc_st_ptr(a,b,c,d) sparc_stx(a,b,c,d) -#define sparc_st_imm_ptr(a,b,c,d) sparc_stx_imm(a,b,c,d) -#define sparc_ld_ptr(a,b,c,d) sparc_ldx(a,b,c,d) -#define sparc_ld_imm_ptr(a,b,c,d) sparc_ldx_imm(a,b,c,d) -#else -#define sparc_st_ptr(a,b,c,d) sparc_st(a,b,c,d) -#define sparc_st_imm_ptr(a,b,c,d) sparc_st_imm(a,b,c,d) -#define sparc_ld_ptr(a,b,c,d) sparc_ld(a,b,c,d) -#define sparc_ld_imm_ptr(a,b,c,d) sparc_ld_imm(a,b,c,d) -#endif - -/* synonyms for when values are really widened scalar values */ -#define sparc_st_imm_word sparc_st_imm_ptr - -#define ARG_BASE sparc_i3 /* pointer to args in i3 */ -#define SAVE_PTR_IN_GENERIC_REGISTER \ - if (gr < OUT_REGS) { \ - sparc_ld_imm_ptr (p, ARG_BASE, i*ARG_SIZE, sparc_o0 + gr); \ - gr++; \ - } else { \ - sparc_ld_imm_ptr (p, ARG_BASE, i*ARG_SIZE, sparc_l0); \ - sparc_st_imm_ptr (p, sparc_l0, sparc_sp, stack_par_pos); \ - stack_par_pos += SLOT_SIZE; \ - } - -#if SPARCV9 -/* This is a half hearted attempt at coping with structs by value - the - actual convention is complicated when floats & doubles are involved as - you end up with fields in different registers on/off the stack. - It will take more time to get right... */ -static guint32 * -v9_struct_arg(guint32 *p, int arg_index, MonoClass *klass, int size, guint *p_gr) -{ - MonoMarshalType *info = mono_marshal_load_type_info (klass); - int off = 0; - int index = 0; - guint gr = *p_gr; - sparc_ld_imm_ptr (p, ARG_BASE, arg_index*ARG_SIZE, sparc_l0); - if (size > 8) { - if (info->fields [index].field->type->type == MONO_TYPE_R8) { - sparc_lddf_imm (p, sparc_l0, 0, sparc_f0 + 2 * gr); - index++; - } - else { - sparc_ldx_imm (p, sparc_l0, 0, sparc_o0 + gr); - index++; /* FIXME could be multiple fields in one register */ - } - gr++; - size -= 8; - off = 8; - } - if (size > 0) { - if (info->fields [index].field->type->type == MONO_TYPE_R8) { - sparc_lddf_imm (p, sparc_l0, off, sparc_f0 + 2 * gr); - index++; - } - else { - /* will load extra garbage off end of short structs ... */ - sparc_ldx_imm (p, sparc_l0, off, sparc_o0 + gr); - } - gr++; - } - *p_gr = gr; - return p; -} -#endif - -static inline guint32* -emit_save_parameters (guint32 *p, MonoMethodSignature *sig, guint stack_size, - gboolean use_memcpy) -{ - guint i, fr, gr, stack_par_pos, struct_pos, cur_struct_pos; - guint32 simpletype; - - fr = gr = 0; - stack_par_pos = MINIMAL_STACK_SIZE * SLOT_SIZE + BIAS; - - if (sig->hasthis) { - if (use_memcpy) { - /* we don't need to save a thing. */ - } else - sparc_mov_reg_reg (p, sparc_i2, sparc_o0); - gr ++; - } - - if (use_memcpy) { - cur_struct_pos = struct_pos = stack_par_pos; - for (i = 0; i < sig->param_count; i++) { - if (sig->params[i]->byref) - continue; - if (sig->params[i]->type == MONO_TYPE_VALUETYPE && - !sig->params[i]->data.klass->enumtype) { - gint size; - guint32 align; - - size = mono_class_native_size (sig->params[i]->data.klass, &align); -#if SPARCV9 - if (size != 4) { -#else - if (1) { -#endif - /* Add alignment */ - stack_par_pos = (stack_par_pos + (align - 1)) & (~(align - 1)); - /* need to call memcpy here */ - sparc_add_imm (p, 0, sparc_sp, stack_par_pos, sparc_o0); - sparc_ld_imm_ptr (p, sparc_i3, i*16, sparc_o1); - sparc_set (p, (guint32)size, sparc_o2); - sparc_set_ptr (p, (void *)memmove, sparc_l0); - sparc_jmpl_imm (p, sparc_l0, 0, sparc_callsite); - sparc_nop (p); - stack_par_pos += (size + (SLOT_SIZE - 1)) & (~(SLOT_SIZE - 1)); - } - } - } - } - - if (sig->ret->type == MONO_TYPE_VALUETYPE && !sig->ret->byref) { - MonoClass *klass = sig->ret->data.klass; - if (!klass->enumtype) { - gint size = mono_class_native_size (klass, NULL); - - DEBUG(fprintf(stderr, "retval value type size: %d\n", size)); -#if SPARCV9 - if (size > 32) { -#else - { -#endif - /* pass on buffer in interp.c to called function */ - sparc_ld_imm_ptr (p, sparc_i1, 0, sparc_l0); - sparc_st_imm_ptr (p, sparc_l0, sparc_sp, 64); - } - } - } - - DEBUG(fprintf(stderr, "%s\n", sig_to_name(sig, FALSE))); - - for (i = 0; i < sig->param_count; i++) { - if (sig->params[i]->byref) { - SAVE_PTR_IN_GENERIC_REGISTER; - continue; - } - simpletype = sig->params[i]->type; - enum_calc_size: - switch (simpletype) { - case MONO_TYPE_BOOLEAN: - case MONO_TYPE_I1: - case MONO_TYPE_U1: - case MONO_TYPE_I2: - case MONO_TYPE_U2: - case MONO_TYPE_CHAR: - case MONO_TYPE_I4: - case MONO_TYPE_U4: - if (gr < OUT_REGS) { - sparc_ld_imm (p, ARG_BASE, i*ARG_SIZE, sparc_o0 + gr); - gr++; - } else { - sparc_ld_imm (p, ARG_BASE, i*ARG_SIZE, sparc_l0); - sparc_st_imm_word (p, sparc_l0, sparc_sp, stack_par_pos); - stack_par_pos += SLOT_SIZE; - } - break; - - case MONO_TYPE_R4: -#if SPARCV9 - sparc_lddf_imm (p, ARG_BASE, i*ARG_SIZE, sparc_f30); /* fix using this fixed reg */ - sparc_fdtos(p, sparc_f30, sparc_f0 + 2 * gr + 1); - gr++; - break; -#else - /* Convert from double to single */ - sparc_lddf_imm (p, ARG_BASE, i*ARG_SIZE, sparc_f0); - sparc_fdtos (p, sparc_f0, sparc_f0); - - /* - * FIXME: Is there an easier way to do an - * freg->ireg move ? - */ - sparc_stf_imm (p, sparc_f0, sparc_sp, stack_par_pos); - - if (gr < OUT_REGS) { - sparc_ld_imm (p, sparc_sp, stack_par_pos, sparc_o0 + gr); - gr++; - } else { - sparc_ldf_imm (p, sparc_sp, stack_par_pos, sparc_f0); - sparc_stf_imm (p, sparc_f0, sparc_sp, stack_par_pos); - stack_par_pos += SLOT_SIZE; - } - break; -#endif - - case MONO_TYPE_I: - case MONO_TYPE_U: - case MONO_TYPE_PTR: - case MONO_TYPE_CLASS: - case MONO_TYPE_OBJECT: - case MONO_TYPE_STRING: - case MONO_TYPE_SZARRAY: - SAVE_PTR_IN_GENERIC_REGISTER; - break; - case MONO_TYPE_VALUETYPE: { - gint size; - guint32 align; - MonoClass *klass = sig->params[i]->data.klass; - if (klass->enumtype) { - simpletype = klass->enum_basetype->type; - goto enum_calc_size; - } - size = mono_class_native_size (klass, &align); -#if SPARCV9 - if (size <= 16) { - if (gr < OUT_REGS) { - p = v9_struct_arg(p, i, klass, size, &gr); - } else { - sparc_ld_imm_ptr (p, ARG_BASE, i*ARG_SIZE, sparc_l0); - sparc_ld_imm (p, sparc_l0, 0, sparc_l0); - sparc_st_imm_word (p, sparc_l0, sparc_sp, stack_par_pos); - stack_par_pos += SLOT_SIZE; - } - break; - } -#else - /* - * FIXME: The 32bit ABI docs do not mention that small - * structures are passed in registers. - */ - - /* - if (size == 4) { - if (gr < OUT_REGS) { - sparc_ld_imm_ptr (p, ARG_BASE, i*ARG_SIZE, sparc_l0); - sparc_ld_imm (p, sparc_l0, 0, sparc_o0 + gr); - gr++; - } else { - sparc_ld_imm_ptr (p, ARG_BASE, i*ARG_SIZE, sparc_l0); - sparc_ld_imm (p, sparc_l0, 0, sparc_l0); - sparc_st_imm_word (p, sparc_l0, sparc_sp, stack_par_pos); - stack_par_pos += SLOT_SIZE; - } - break; - } - */ -#endif - - cur_struct_pos = (cur_struct_pos + (align - 1)) & (~(align - 1)); - if (gr < OUT_REGS) { - sparc_add_imm (p, 0, sparc_sp, - cur_struct_pos, sparc_o0 + gr); - gr ++; - } else { - sparc_ld_imm_ptr (p, sparc_sp, - cur_struct_pos, - sparc_l1); - sparc_st_imm_ptr (p, sparc_l1, - sparc_sp, - stack_par_pos); - } - cur_struct_pos += (size + (SLOT_SIZE - 1)) & (~(SLOT_SIZE - 1)); - break; - } - -#if SPARCV9 - case MONO_TYPE_I8: - if (gr < OUT_REGS) { - sparc_ldx_imm (p, ARG_BASE, i*ARG_SIZE, sparc_o0 + gr); - gr++; - } else { - sparc_ldx_imm (p, ARG_BASE, i*ARG_SIZE, sparc_l0); - sparc_stx_imm (p, sparc_l0, sparc_sp, stack_par_pos); - stack_par_pos += SLOT_SIZE; - } - break; - case MONO_TYPE_R8: - sparc_lddf_imm (p, ARG_BASE, i*ARG_SIZE, sparc_f0 + 2 * i); - break; -#else - case MONO_TYPE_I8: - case MONO_TYPE_R8: - if (gr < (OUT_REGS - 1)) { - sparc_ld_imm (p, ARG_BASE, i*ARG_SIZE, sparc_o0 + gr); - gr ++; - - sparc_ld_imm (p, ARG_BASE, - (i*ARG_SIZE) + 4, - sparc_o0 + gr); - gr ++; - } else if (gr == (OUT_REGS - 1)) { - /* Split register/stack */ - sparc_ld_imm (p, ARG_BASE, i*ARG_SIZE, sparc_o0 + gr); - gr ++; - - sparc_ld_imm (p, ARG_BASE, (i*ARG_SIZE) + 4, sparc_l0); - sparc_st_imm (p, sparc_l0, sparc_sp, stack_par_pos); - stack_par_pos += SLOT_SIZE; - } else { - sparc_ld_imm (p, ARG_BASE, i*ARG_SIZE, sparc_l0); - sparc_st_imm (p, sparc_l0, sparc_sp, stack_par_pos); - stack_par_pos += SLOT_SIZE; - - sparc_ld_imm (p, ARG_BASE, (i*ARG_SIZE) + 4, sparc_l0); - sparc_st_imm (p, sparc_l0, sparc_sp, stack_par_pos); - stack_par_pos += SLOT_SIZE; - } - break; -#endif - default: - g_error ("Can't trampoline 0x%x", sig->params[i]->type); - } - } - - g_assert ((stack_par_pos - BIAS) <= stack_size); - - return p; -} - -static inline guint32 * -alloc_code_memory (guint code_size) -{ - guint32 *p; - - p = g_malloc(code_size); - - return p; -} - -static inline guint32 * -emit_call_and_store_retval (guint32 *p, MonoMethodSignature *sig, - guint stack_size, gboolean string_ctor) -{ - guint32 simpletype; - - /* call "callme" */ - sparc_jmpl_imm (p, sparc_i0, 0, sparc_callsite); - sparc_nop (p); -#if !SPARCV9 - if (sig->ret->type == MONO_TYPE_VALUETYPE && !sig->ret->data.klass->enumtype) { - int size = mono_class_native_size (sig->ret->data.klass, NULL); - sparc_unimp (p, size & 4095); - } -#endif - - /* get return value */ - if (sig->ret->byref || string_ctor) { - sparc_st_ptr (p, sparc_o0, sparc_i1, 0); - } else { - simpletype = sig->ret->type; - enum_retval: - switch (simpletype) { - case MONO_TYPE_BOOLEAN: - case MONO_TYPE_I1: - case MONO_TYPE_U1: - sparc_stb (p, sparc_o0, sparc_i1, 0); - break; - case MONO_TYPE_CHAR: - case MONO_TYPE_I2: - case MONO_TYPE_U2: - sparc_sth (p, sparc_o0, sparc_i1, 0); - break; - case MONO_TYPE_I4: - case MONO_TYPE_U4: - sparc_st (p, sparc_o0, sparc_i1, 0); - break; - case MONO_TYPE_I: - case MONO_TYPE_U: - case MONO_TYPE_CLASS: - case MONO_TYPE_OBJECT: - case MONO_TYPE_SZARRAY: - case MONO_TYPE_ARRAY: - case MONO_TYPE_STRING: - case MONO_TYPE_PTR: - sparc_st_ptr (p, sparc_o0, sparc_i1, 0); - break; - case MONO_TYPE_R4: - sparc_stf (p, sparc_f0, sparc_i1, 0); - break; - case MONO_TYPE_R8: - sparc_stdf (p, sparc_f0, sparc_i1, 0); - break; - case MONO_TYPE_I8: -#if SPARCV9 - sparc_stx (p, sparc_o0, sparc_i1, 0); -#else - sparc_std (p, sparc_o0, sparc_i1, 0); -#endif - break; - case MONO_TYPE_VALUETYPE: { - gint size; - if (sig->ret->data.klass->enumtype) { - simpletype = sig->ret->data.klass->enum_basetype->type; - goto enum_retval; - } -#if SPARCV9 - size = mono_class_native_size (sig->ret->data.klass, NULL); - if (size <= 32) { - int n_regs = size / 8; - int j; - sparc_ldx_imm (p, sparc_i1, 0, sparc_i1); - /* wrong if there are floating values in the struct... */ - for (j = 0; j < n_regs; j++) { - sparc_stx_imm (p, sparc_o0 + j, sparc_i1, j * 8); - } - size -= n_regs * 8; - if (size > 0) { - int last_reg = sparc_o0 + n_regs; - /* get value right aligned in register */ - sparc_srlx_imm(p, last_reg, 64 - 8 * size, last_reg); - if ((size & 1) != 0) { - sparc_stb_imm (p, last_reg, sparc_i1, n_regs * 8 + size - 1); - size--; - if (size > 0) - sparc_srlx_imm(p, last_reg, 8, last_reg); - } - if ((size & 2) != 0) { - sparc_sth_imm (p, last_reg, sparc_i1, n_regs * 8 + size - 2); - size -= 2; - if (size > 0) - sparc_srlx_imm(p, last_reg, 16, last_reg); - } - if ((size & 4) != 0) - sparc_st_imm (p, last_reg, sparc_i1, n_regs * 8); - } - } -#endif - } - case MONO_TYPE_VOID: - break; - default: - g_error ("Can't handle as return value 0x%x", sig->ret->type); - } - } - return p; -} - -MonoPIFunc -mono_arch_create_trampoline (MonoMethodSignature *sig, gboolean string_ctor) -{ - guint32 *p, *code_buffer; - guint stack_size, code_size, i; - gboolean use_memcpy = FALSE; - static GHashTable *cache = NULL; - MonoPIFunc res; - - if (!cache) - cache = g_hash_table_new ((GHashFunc)mono_signature_hash, - (GCompareFunc)mono_metadata_signature_equal); - - if ((res = (MonoPIFunc)g_hash_table_lookup(cache, sig))) - return res; - - calculate_sizes (sig, &stack_size, &code_size, - string_ctor, &use_memcpy); - - p = code_buffer = alloc_code_memory (code_size); - p = emit_prolog (p, sig, stack_size); - p = emit_save_parameters (p, sig, stack_size, use_memcpy); - p = emit_call_and_store_retval (p, sig, stack_size, string_ctor); - /* we don't return structs here so pass in NULL as signature */ - p = emit_epilog (p, NULL, stack_size); - - g_assert(p <= code_buffer + (code_size / 4)); - - DEBUG(sparc_disassemble_code (code_buffer, p, sig_to_name(sig, NULL))); - - /* So here's the deal... - * UltraSPARC will flush a whole cache line at a time - * BUT, older SPARCs won't. - * So, be compatable and flush dwords at a time... - */ - - for (i = 0; i < ((p - code_buffer)/2); i++) - flushi((code_buffer + (i*8))); - - g_hash_table_insert(cache, sig, code_buffer); - - return (MonoPIFunc)code_buffer; -} - -#define MINV_POS (MINIMAL_STACK_SIZE * SLOT_SIZE + BIAS) - -void * -mono_arch_create_method_pointer (MonoMethod *method) -{ - MonoMethodSignature *sig; - MonoJitInfo *ji; - guint stack_size, code_size, stackval_arg_pos, local_pos; - guint i, local_start, reg_param = 0, stack_param, cpos, vt_cur; - guint32 align = 0; - guint32 *p, *code_buffer; - gint *vtbuf; - gint32 simpletype; - - code_size = 1024; /* these should be calculated... */ - stack_size = 1024; - stack_param = 0; - - sig = method->signature; - - p = code_buffer = g_malloc (code_size); - - DEBUG(fprintf(stderr, "Delegate [start emiting] %s\n", method->name)); - DEBUG(fprintf(stderr, "%s\n", sig_to_name(sig, FALSE))); - - p = emit_prolog (p, sig, stack_size); - - /* fill MonoInvocation */ - sparc_st_imm_ptr (p, sparc_g0, sparc_sp, - (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, ex))); - sparc_st_imm_ptr (p, sparc_g0, sparc_sp, - (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, ex_handler))); - sparc_st_imm_ptr (p, sparc_g0, sparc_sp, - (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, parent))); - - sparc_set_ptr (p, (void *)method, sparc_l0); - sparc_st_imm_ptr (p, sparc_l0, sparc_sp, - (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, method))); - - stackval_arg_pos = MINV_POS + sizeof (MonoInvocation); - local_start = local_pos = stackval_arg_pos + (sig->param_count + 1) * sizeof (stackval); - - if (sig->hasthis) { - sparc_st_imm_ptr (p, sparc_i0, sparc_sp, - (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, obj))); - reg_param = 1; - } - - if (sig->param_count) { - gint save_count = MIN (OUT_REGS, sig->param_count + sig->hasthis); - for (i = reg_param; i < save_count; i++) { - sparc_st_imm_ptr (p, sparc_i0 + i, sparc_sp, local_pos); - local_pos += SLOT_SIZE; - } - } - - /* prepare space for valuetypes */ - vt_cur = local_pos; - vtbuf = alloca (sizeof(int)*sig->param_count); - cpos = 0; - for (i = 0; i < sig->param_count; i++) { - MonoType *type = sig->params [i]; - vtbuf [i] = -1; - if (!sig->params[i]->byref && type->type == MONO_TYPE_VALUETYPE) { - MonoClass *klass = type->data.klass; - gint size; - - if (klass->enumtype) - continue; - size = mono_class_native_size (klass, &align); - cpos += align - 1; - cpos &= ~(align - 1); - vtbuf [i] = cpos; - cpos += size; - } - } - cpos += SLOT_SIZE - 1; - cpos &= ~(SLOT_SIZE - 1); - - local_pos += cpos; - - /* set MonoInvocation::stack_args */ - sparc_add_imm (p, 0, sparc_sp, stackval_arg_pos, sparc_l0); - sparc_st_imm_ptr (p, sparc_l0, sparc_sp, - (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, stack_args))); - - /* add stackval arguments */ - for (i=0; i < sig->param_count; i++) { - int stack_offset; - int type; - if (reg_param < OUT_REGS) { - stack_offset = local_start + i * SLOT_SIZE; - reg_param++; - } else { - stack_offset = stack_size + 8 + stack_param; - stack_param++; - } - - if (!sig->params[i]->byref) { - type = sig->params[i]->type; - enum_arg: - switch (type) { - case MONO_TYPE_I8: - case MONO_TYPE_U8: - case MONO_TYPE_I: - case MONO_TYPE_U: - case MONO_TYPE_STRING: - case MONO_TYPE_OBJECT: - case MONO_TYPE_CLASS: - case MONO_TYPE_SZARRAY: - case MONO_TYPE_PTR: - case MONO_TYPE_R8: - break; - case MONO_TYPE_I4: - case MONO_TYPE_U4: - stack_offset += SLOT_SIZE - 4; - break; - case MONO_TYPE_CHAR: - case MONO_TYPE_I2: - case MONO_TYPE_U2: - stack_offset += SLOT_SIZE - 2; - break; - case MONO_TYPE_I1: - case MONO_TYPE_U1: - case MONO_TYPE_BOOLEAN: - stack_offset += SLOT_SIZE - 1; - break; - case MONO_TYPE_VALUETYPE: - if (sig->params[i]->data.klass->enumtype) { - type = sig->params[i]->data.klass->enum_basetype->type; - goto enum_arg; - } - g_assert(vtbuf[i] >= 0); - break; - default: - g_error ("can not cope with delegate arg type %d", type); - } - } - - sparc_add_imm (p, 0, sparc_sp, stack_offset, sparc_o2); - - if (vtbuf[i] >= 0) { - sparc_add_imm (p, 0, sparc_sp, vt_cur, sparc_o1); - sparc_st_imm_ptr (p, sparc_o1, sparc_sp, stackval_arg_pos); - sparc_add_imm (p, 0, sparc_sp, stackval_arg_pos, - sparc_o1); - sparc_ld_imm_ptr (p, sparc_o2, 0, sparc_o2); - vt_cur += vtbuf[i]; - } else { - sparc_add_imm (p, 0, sparc_sp, stackval_arg_pos, - sparc_o1); - } - - sparc_set_ptr (p, (void *)sig->params[i], sparc_o0); - sparc_set (p, (guint32)sig->pinvoke, sparc_o3); - - /* YOU make the CALL! */ - sparc_set_ptr (p, (void *)stackval_from_data, sparc_l0); - sparc_jmpl_imm (p, sparc_l0, 0, sparc_callsite); - sparc_nop (p); - stackval_arg_pos += sizeof(stackval); - } - - /* return value storage */ - /* Align to dword */ - stackval_arg_pos = (stackval_arg_pos + (8 - 1)) & (~(8 -1)); - if (sig->param_count) { - sparc_add_imm (p, 0, sparc_sp, stackval_arg_pos, sparc_l0); - } - if (!sig->ret->byref && sig->ret->type == MONO_TYPE_VALUETYPE && !sig->ret->data.klass->enumtype) { -#if !SPARCV9 - /* pass on callers buffer */ - sparc_ld_imm_ptr (p, sparc_fp, 64, sparc_l1); - sparc_st_imm_ptr (p, sparc_l1, sparc_l0, 0); -#else - sparc_add_imm (p, 0, sparc_l0, sizeof(stackval), sparc_l1); - sparc_st_imm_ptr (p, sparc_l1, sparc_l0, 0); -#endif - } - - sparc_st_imm_ptr (p, sparc_l0, sparc_sp, - (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, retval))); - - /* call ves_exec_method */ - sparc_add_imm (p, 0, sparc_sp, MINV_POS, sparc_o0); - sparc_set_ptr (p, (void *)ves_exec_method, sparc_l0); - sparc_jmpl_imm (p, sparc_l0, 0, sparc_callsite); - sparc_nop (p); - - /* move retval from stackval to proper place (r3/r4/...) */ - if (sig->ret->byref) { - sparc_ld_imm_ptr (p, sparc_sp, stackval_arg_pos, sparc_i0 ); - } else { - enum_retvalue: - switch (sig->ret->type) { - case MONO_TYPE_VOID: - break; - case MONO_TYPE_BOOLEAN: - case MONO_TYPE_I1: - case MONO_TYPE_U1: - case MONO_TYPE_I2: - case MONO_TYPE_U2: - case MONO_TYPE_I4: - case MONO_TYPE_U4: - sparc_ld_imm (p, sparc_sp, stackval_arg_pos, sparc_i0); - break; - case MONO_TYPE_I: - case MONO_TYPE_U: - case MONO_TYPE_OBJECT: - case MONO_TYPE_STRING: - case MONO_TYPE_CLASS: - sparc_ld_imm_ptr (p, sparc_sp, stackval_arg_pos, sparc_i0); - break; - case MONO_TYPE_I8: - case MONO_TYPE_U8: -#if SPARCV9 - sparc_ldx_imm (p, sparc_sp, stackval_arg_pos, sparc_i0); -#else - sparc_ld_imm (p, sparc_sp, stackval_arg_pos, sparc_i0); - sparc_ld_imm (p, sparc_sp, stackval_arg_pos + 4, sparc_i1); -#endif - break; - case MONO_TYPE_R4: - sparc_lddf_imm (p, sparc_sp, stackval_arg_pos, sparc_f0); - sparc_fdtos(p, sparc_f0, sparc_f0); - break; - case MONO_TYPE_R8: - sparc_lddf_imm (p, sparc_sp, stackval_arg_pos, sparc_f0); - break; - case MONO_TYPE_VALUETYPE: { - gint size; - gint reg = sparc_i0; - if (sig->ret->data.klass->enumtype) { - simpletype = sig->ret->data.klass->enum_basetype->type; - goto enum_retvalue; - } -#if SPARCV9 - size = mono_class_native_size (sig->ret->data.klass, NULL); - sparc_ldx_imm (p, sparc_sp, stackval_arg_pos, sparc_l0); - if (size <= 16) { - gint off = 0; - if (size >= 8) { - sparc_ldx_imm (p, sparc_l0, 0, reg); - size -= 8; - off += 8; - reg++; - } - if (size > 0) - sparc_ldx_imm (p, sparc_l0, off, reg); - } else - NOT_IMPL("value type as ret val from delegate"); -#endif - break; - } - default: - g_error ("Type 0x%x not handled yet in thunk creation", - sig->ret->type); - break; - } - } - - p = emit_epilog (p, sig, stack_size); - - for (i = 0; i < ((p - code_buffer)/2); i++) - flushi((code_buffer + (i*8))); - - ji = g_new0 (MonoJitInfo, 1); - ji->method = method; - ji->code_size = p - code_buffer; - ji->code_start = code_buffer; - - mono_jit_info_table_add (mono_get_root_domain (), ji); - - DEBUG(sparc_disassemble_code (code_buffer, p, method->name)); - - DEBUG(fprintf(stderr, "Delegate [end emiting] %s\n", method->name)); - - return ji->code_start; -} diff --git a/mono/io-layer/handles.c b/mono/io-layer/handles.c index 5e706fb7280..31733990923 100644 --- a/mono/io-layer/handles.c +++ b/mono/io-layer/handles.c @@ -42,6 +42,7 @@ #include #include +#include #undef DEBUG_REFS #if 0 @@ -286,12 +287,12 @@ wapi_init (void) wapi_processes_init (); - /* Using g_atexit here instead of an explicit function call in + /* Using atexit here instead of an explicit function call in * a cleanup routine lets us cope when a third-party library * calls exit (eg if an X client loses the connection to its * server.) */ - g_atexit (handle_cleanup); + mono_atexit (handle_cleanup); } void diff --git a/mono/metadata/Makefile.am b/mono/metadata/Makefile.am index 335484ae676..cb83933ec1d 100644 --- a/mono/metadata/Makefile.am +++ b/mono/metadata/Makefile.am @@ -148,7 +148,6 @@ common_sources = \ mono-debug.h \ mono-debug.c \ mono-debug-debugger.h \ - mono-debug-debugger.c \ mono-endian.c \ mono-endian.h \ mono-hash.h \ @@ -174,6 +173,8 @@ common_sources = \ profiler-private.h \ rand.h \ rand.c \ + remoting.h \ + remoting.c \ runtime.c \ security.c \ security.h \ @@ -249,8 +250,9 @@ sgen_sources = \ sgen-major-copy-object.h \ sgen-minor-copy-object.h \ sgen-copy-object.h \ - sgen-major-scan-object.h \ + sgen-marksweep-scan-object-concurrent.h \ sgen-minor-scan-object.h \ + sgen-marksweep-drain-gray-stack.h \ sgen-protocol.h \ sgen-scan-object.h \ sgen-nursery-allocator.c \ diff --git a/mono/metadata/class-internals.h b/mono/metadata/class-internals.h index 2bf904143f1..227d76ee12c 100644 --- a/mono/metadata/class-internals.h +++ b/mono/metadata/class-internals.h @@ -209,7 +209,9 @@ enum { MONO_EXCEPTION_BAD_IMAGE = 12, MONO_EXCEPTION_OBJECT_SUPPLIED = 13, /*The exception object is already created.*/ MONO_EXCEPTION_OUT_OF_MEMORY = 14, - MONO_EXCEPTION_INLINE_FAILED = 15 + MONO_EXCEPTION_INLINE_FAILED = 15, + MONO_EXCEPTION_MONO_ERROR = 16, + /* add other exception type */ }; /* This struct collects the info needed for the runtime use of a class, @@ -1394,4 +1396,7 @@ mono_class_get_and_inflate_typespec_checked (MonoImage *image, guint32 type_toke MonoClass * mono_class_from_name_case_checked (MonoImage *image, const char* name_space, const char *name, MonoError *error) MONO_INTERNAL; +MonoClassField* +mono_field_from_token_checked (MonoImage *image, uint32_t token, MonoClass **retklass, MonoGenericContext *context, MonoError *error) MONO_INTERNAL; + #endif /* __MONO_METADATA_CLASS_INTERBALS_H__ */ diff --git a/mono/metadata/class.c b/mono/metadata/class.c index d2bf676bfc3..9ae7c6e3325 100644 --- a/mono/metadata/class.c +++ b/mono/metadata/class.c @@ -72,10 +72,6 @@ static guint32 mono_field_resolve_flags (MonoClassField *field); static void mono_class_setup_vtable_full (MonoClass *class, GList *in_setup); static void mono_generic_class_setup_parent (MonoClass *klass, MonoClass *gklass); - -void (*mono_debugger_class_init_func) (MonoClass *klass) = NULL; - - /* We use gclass recording to allow recursive system f types to be referenced by a parent. @@ -5246,9 +5242,6 @@ mono_class_init (MonoClass *class) mono_loader_unlock (); - if (mono_debugger_class_init_func) - mono_debugger_class_init_func (class); - return class->exception_type == MONO_EXCEPTION_NONE; } @@ -8473,11 +8466,16 @@ mono_ldtoken (MonoImage *image, guint32 token, MonoClass **handle_class, sig = mono_metadata_blob_heap (image, cols [MONO_MEMBERREF_SIGNATURE]); mono_metadata_decode_blob_size (sig, &sig); if (*sig == 0x6) { /* it's a field */ + MonoError error; MonoClass *klass; MonoClassField *field; - field = mono_field_from_token (image, token, &klass, context); + field = mono_field_from_token_checked (image, token, &klass, context, &error); if (handle_class) *handle_class = mono_defaults.fieldhandle_class; + if (!field) { + mono_loader_set_error_from_mono_error (&error); + mono_error_cleanup (&error); /* FIXME Don't swallow the error */ + } return field; } else { MonoMethod *meth; diff --git a/mono/metadata/console-unix.c b/mono/metadata/console-unix.c index dffba190e31..1de9a002e0a 100644 --- a/mono/metadata/console-unix.c +++ b/mono/metadata/console-unix.c @@ -35,6 +35,7 @@ #include #include #include +#include /* On solaris, curses.h must come before both termios.h and term.h */ #ifdef HAVE_CURSES_H @@ -502,7 +503,7 @@ ves_icall_System_ConsoleDriver_TtySetup (MonoString *keypad, MonoString *teardow if (teardown != NULL) teardown_str = mono_string_to_utf8 (teardown); - atexit (tty_teardown); + mono_atexit (tty_teardown); } return TRUE; diff --git a/mono/metadata/domain.c b/mono/metadata/domain.c index e30c0345c0a..c251ff9d99c 100755 --- a/mono/metadata/domain.c +++ b/mono/metadata/domain.c @@ -130,7 +130,7 @@ static const MonoRuntimeInfo supported_runtimes[] = { /* The stable runtime version */ -#define DEFAULT_RUNTIME_VERSION "v2.0.50727" +#define DEFAULT_RUNTIME_VERSION "v4.0.30319" /* Callbacks installed by the JIT */ static MonoCreateDomainFunc create_domain_hook; @@ -139,9 +139,6 @@ static MonoFreeDomainFunc free_domain_hook; /* AOT cache configuration */ static MonoAotCacheConfig aot_cache_config; -/* This is intentionally not in the header file, so people don't misuse it. */ -extern void _mono_debug_init_corlib (MonoDomain *domain); - static void get_runtimes_from_exe (const char *exe_file, MonoImage **exe_image, const MonoRuntimeInfo** runtimes); @@ -512,6 +509,7 @@ mono_init_internal (const char *filename, const char *exe_filename, const char * #ifndef DISABLE_PERFCOUNTERS mono_perfcounters_init (); #endif + mono_counters_init (); mono_counters_register ("Max native code in a domain", MONO_COUNTER_INT|MONO_COUNTER_JIT, &max_domain_code_size); mono_counters_register ("Max code space allocated in a domain", MONO_COUNTER_INT|MONO_COUNTER_JIT, &max_domain_code_alloc); @@ -835,8 +833,6 @@ mono_init_internal (const char *filename, const char *exe_filename, const char * mono_defaults.customattribute_data_class = mono_class_from_name ( mono_defaults.corlib, "System.Reflection", "CustomAttributeData"); - /* these are initialized lazily when COM features are used */ - mono_class_init (mono_defaults.array_class); mono_defaults.generic_nullable_class = mono_class_from_name ( mono_defaults.corlib, "System", "Nullable`1"); @@ -847,8 +843,6 @@ mono_init_internal (const char *filename, const char *exe_filename, const char * domain->friendly_name = g_path_get_basename (filename); - _mono_debug_init_corlib (domain); - return domain; } diff --git a/mono/metadata/gc-internal.h b/mono/metadata/gc-internal.h index 7b8836363f8..79032578afa 100644 --- a/mono/metadata/gc-internal.h +++ b/mono/metadata/gc-internal.h @@ -16,11 +16,11 @@ #include typedef struct { - int minor_gc_count; - int major_gc_count; - long long minor_gc_time; - long long major_gc_time; - long long major_gc_time_concurrent; + guint minor_gc_count; + guint major_gc_count; + guint64 minor_gc_time; + guint64 major_gc_time; + guint64 major_gc_time_concurrent; } GCStats; #define mono_domain_finalizers_lock(domain) mono_mutex_lock (&(domain)->finalizable_objects_hash_lock); diff --git a/mono/metadata/gc.c b/mono/metadata/gc.c index 4e025385b76..921898a4442 100644 --- a/mono/metadata/gc.c +++ b/mono/metadata/gc.c @@ -1149,12 +1149,11 @@ mono_gc_init (void) MONO_GC_REGISTER_ROOT_FIXED (gc_handles [HANDLE_NORMAL].entries); MONO_GC_REGISTER_ROOT_FIXED (gc_handles [HANDLE_PINNED].entries); - mono_counters_register ("Created object count", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &mono_stats.new_object_count); - mono_counters_register ("Minor GC collections", MONO_COUNTER_GC | MONO_COUNTER_INT, &gc_stats.minor_gc_count); - mono_counters_register ("Major GC collections", MONO_COUNTER_GC | MONO_COUNTER_INT, &gc_stats.major_gc_count); - mono_counters_register ("Minor GC time", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &gc_stats.minor_gc_time); - mono_counters_register ("Major GC time", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &gc_stats.major_gc_time); - mono_counters_register ("Major GC time concurrent", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &gc_stats.major_gc_time_concurrent); + mono_counters_register ("Minor GC collections", MONO_COUNTER_GC | MONO_COUNTER_UINT, &gc_stats.minor_gc_count); + mono_counters_register ("Major GC collections", MONO_COUNTER_GC | MONO_COUNTER_UINT, &gc_stats.major_gc_count); + mono_counters_register ("Minor GC time", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &gc_stats.minor_gc_time); + mono_counters_register ("Major GC time", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &gc_stats.major_gc_time); + mono_counters_register ("Major GC time concurrent", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &gc_stats.major_gc_time_concurrent); mono_gc_base_init (); diff --git a/mono/metadata/icall.c b/mono/metadata/icall.c index 763b2f638bf..e3241865924 100644 --- a/mono/metadata/icall.c +++ b/mono/metadata/icall.c @@ -5559,19 +5559,20 @@ ves_icall_System_Reflection_Module_ResolveStringToken (MonoImage *image, guint32 } ICALL_EXPORT MonoClassField* -ves_icall_System_Reflection_Module_ResolveFieldToken (MonoImage *image, guint32 token, MonoArray *type_args, MonoArray *method_args, MonoResolveTokenError *error) +ves_icall_System_Reflection_Module_ResolveFieldToken (MonoImage *image, guint32 token, MonoArray *type_args, MonoArray *method_args, MonoResolveTokenError *resolve_error) { + MonoError error; MonoClass *klass; int table = mono_metadata_token_table (token); int index = mono_metadata_token_index (token); MonoGenericContext context; MonoClassField *field; - *error = ResolveTokenError_Other; + *resolve_error = ResolveTokenError_Other; /* Validate token */ if ((table != MONO_TABLE_FIELD) && (table != MONO_TABLE_MEMBERREF)) { - *error = ResolveTokenError_BadTable; + *resolve_error = ResolveTokenError_BadTable; return NULL; } @@ -5580,7 +5581,7 @@ ves_icall_System_Reflection_Module_ResolveFieldToken (MonoImage *image, guint32 return mono_lookup_dynamic_token_class (image, token, FALSE, NULL, NULL); if (mono_memberref_is_method (image, token)) { - *error = ResolveTokenError_BadTable; + *resolve_error = ResolveTokenError_BadTable; return NULL; } @@ -5589,19 +5590,17 @@ ves_icall_System_Reflection_Module_ResolveFieldToken (MonoImage *image, guint32 } if ((index <= 0) || (index > image->tables [table].rows)) { - *error = ResolveTokenError_OutOfRange; + *resolve_error = ResolveTokenError_OutOfRange; return NULL; } if ((table == MONO_TABLE_MEMBERREF) && (mono_memberref_is_method (image, token))) { - *error = ResolveTokenError_BadTable; + *resolve_error = ResolveTokenError_BadTable; return NULL; } init_generic_context_from_args (&context, type_args, method_args); - field = mono_field_from_token (image, token, &klass, &context); - - if (mono_loader_get_last_error ()) - mono_raise_exception (mono_loader_error_prepare_exception (mono_loader_get_last_error ())); + field = mono_field_from_token_checked (image, token, &klass, &context, &error); + mono_error_raise_exception (&error); return field; } diff --git a/mono/metadata/loader.c b/mono/metadata/loader.c index a6b94357c37..c3c9a5288e6 100644 --- a/mono/metadata/loader.c +++ b/mono/metadata/loader.c @@ -440,9 +440,9 @@ cache_memberref_sig (MonoImage *image, guint32 sig_idx, gpointer sig) static MonoClassField* field_from_memberref (MonoImage *image, guint32 token, MonoClass **retklass, - MonoGenericContext *context) + MonoGenericContext *context, MonoError *error) { - MonoClass *klass; + MonoClass *klass = NULL; MonoClassField *field; MonoTableInfo *tables = image->tables; MonoType *sig_type; @@ -451,7 +451,8 @@ field_from_memberref (MonoImage *image, guint32 token, MonoClass **retklass, const char *fname; const char *ptr; guint32 idx = mono_metadata_token_index (token); - MonoError error; + + mono_error_init (error); mono_metadata_decode_row (&tables [MONO_TABLE_MEMBERREF], idx-1, cols, MONO_MEMBERREF_SIZE); nindex = cols [MONO_MEMBERREF_CLASS] >> MONO_MEMBERREF_PARENT_BITS; @@ -460,60 +461,39 @@ field_from_memberref (MonoImage *image, guint32 token, MonoClass **retklass, fname = mono_metadata_string_heap (image, cols [MONO_MEMBERREF_NAME]); if (!mono_verifier_verify_memberref_field_signature (image, cols [MONO_MEMBERREF_SIGNATURE], NULL)) { - mono_loader_set_error_bad_image (g_strdup_printf ("Bad field signature class token 0x%08x field name %s token 0x%08x on image %s", class, fname, token, image->name)); + mono_error_set_bad_image (error, image, "Bad field '%s' signature 0x%08x", class, token); return NULL; } switch (class) { case MONO_MEMBERREF_PARENT_TYPEDEF: class_table = MONO_TOKEN_TYPE_DEF; - klass = mono_class_get_checked (image, MONO_TOKEN_TYPE_DEF | nindex, &error); - if (!mono_error_ok (&error)) { - /*FIXME don't swallow the error message*/ - mono_error_cleanup (&error); - } - + klass = mono_class_get_checked (image, MONO_TOKEN_TYPE_DEF | nindex, error); break; case MONO_MEMBERREF_PARENT_TYPEREF: class_table = MONO_TOKEN_TYPE_REF; - klass = mono_class_from_typeref_checked (image, MONO_TOKEN_TYPE_REF | nindex, &error); - if (!mono_error_ok (&error)) { - /*FIXME don't swallow the error message*/ - mono_error_cleanup (&error); - } - + klass = mono_class_from_typeref_checked (image, MONO_TOKEN_TYPE_REF | nindex, error); break; case MONO_MEMBERREF_PARENT_TYPESPEC: class_table = MONO_TOKEN_TYPE_SPEC; - klass = mono_class_get_and_inflate_typespec_checked (image, MONO_TOKEN_TYPE_SPEC | nindex, context, &error); - if (!mono_error_ok (&error)) { - /*FIXME don't swallow the error message*/ - mono_error_cleanup (&error); - } + klass = mono_class_get_and_inflate_typespec_checked (image, MONO_TOKEN_TYPE_SPEC | nindex, context, error); break; default: - /*FIXME this must set a loader error!*/ - g_warning ("field load from %x", class); - return NULL; + mono_error_set_bad_image (error, image, "Bad field field '%s' signature 0x%08x", class, token); } - if (!klass) { - char *name = mono_class_name_from_token (image, class_table | nindex); - g_warning ("Missing field %s in class %s (type token %d)", fname, name, class_table | nindex); - mono_loader_set_error_type_load (name, image->assembly_name); - g_free (name); + if (!klass) return NULL; - } ptr = mono_metadata_blob_heap (image, cols [MONO_MEMBERREF_SIGNATURE]); mono_metadata_decode_blob_size (ptr, &ptr); /* we may want to check the signature here... */ if (*ptr++ != 0x6) { - g_warning ("Bad field signature class token %08x field name %s token %08x", class, fname, token); - mono_loader_set_error_field_load (klass, fname); + mono_error_set_field_load (error, klass, fname, "Bad field signature class token %08x field name %s token %08x", class, fname, token); return NULL; } + /* FIXME: This needs a cache, especially for generic instances, since * mono_metadata_parse_type () allocates everything from a mempool. */ @@ -521,7 +501,7 @@ field_from_memberref (MonoImage *image, guint32 token, MonoClass **retklass, if (!sig_type) { sig_type = mono_metadata_parse_type (image, MONO_PARSE_TYPE, 0, ptr, &ptr); if (sig_type == NULL) { - mono_loader_set_error_field_load (klass, fname); + mono_error_set_field_load (error, klass, fname, "Could not parse field '%s' signature %08x", fname, token); return NULL; } sig_type = cache_memberref_sig (image, cols [MONO_MEMBERREF_SIGNATURE], sig_type); @@ -532,21 +512,40 @@ field_from_memberref (MonoImage *image, guint32 token, MonoClass **retklass, *retklass = klass; field = mono_class_get_field_from_name_full (klass, fname, sig_type); - if (!field) - mono_loader_set_error_field_load (klass, fname); + if (!field) { + g_assert (!mono_loader_get_last_error ()); + mono_error_set_field_load (error, klass, fname, "Could not find field '%s'", fname); + } return field; } +/* + * mono_field_from_token: + * @deprecated use the _checked variant +*/ MonoClassField* -mono_field_from_token (MonoImage *image, guint32 token, MonoClass **retklass, - MonoGenericContext *context) +mono_field_from_token (MonoImage *image, guint32 token, MonoClass **retklass, MonoGenericContext *context) { MonoError error; + MonoClassField *res = mono_field_from_token_checked (image, token, retklass, context, &error); + g_assert (!mono_loader_get_last_error ()); + if (!mono_error_ok (&error)) { + mono_loader_set_error_from_mono_error (&error); + mono_error_cleanup (&error); + } + return res; +} + +MonoClassField* +mono_field_from_token_checked (MonoImage *image, guint32 token, MonoClass **retklass, MonoGenericContext *context, MonoError *error) +{ MonoClass *k; guint32 type; MonoClassField *field; + mono_error_init (error); + if (image_is_dynamic (image)) { MonoClassField *result; MonoClass *handle_class; @@ -555,7 +554,7 @@ mono_field_from_token (MonoImage *image, guint32 token, MonoClass **retklass, result = mono_lookup_dynamic_token_class (image, token, TRUE, &handle_class, context); // This checks the memberref type as well if (!result || handle_class != mono_defaults.fieldhandle_class) { - mono_loader_set_error_bad_image (g_strdup_printf ("Bad field token 0x%08x on image %s.", token, image->name)); + mono_error_set_bad_image (error, image, "Bad field token 0x%08x", token); return NULL; } *retklass = result->parent; @@ -567,27 +566,35 @@ mono_field_from_token (MonoImage *image, guint32 token, MonoClass **retklass, return field; } - if (mono_metadata_token_table (token) == MONO_TABLE_MEMBERREF) - field = field_from_memberref (image, token, retklass, context); - else { + if (mono_metadata_token_table (token) == MONO_TABLE_MEMBERREF) { + field = field_from_memberref (image, token, retklass, context, error); + g_assert (!mono_loader_get_last_error ()); + } else { type = mono_metadata_typedef_from_field (image, mono_metadata_token_index (token)); - if (!type) - return NULL; - k = mono_class_get_checked (image, MONO_TOKEN_TYPE_DEF | type, &error); - if (!k) { - mono_loader_set_error_from_mono_error (&error); - mono_error_cleanup (&error); /*FIXME don't swallow the error message*/ + if (!type) { + mono_error_set_bad_image (error, image, "Invalid field token 0x%08x", token); return NULL; } + k = mono_class_get_checked (image, MONO_TOKEN_TYPE_DEF | type, error); + if (!k) + return NULL; + mono_class_init (k); if (retklass) *retklass = k; field = mono_class_get_field (k, token); + if (!field) { + if (mono_loader_get_last_error ()) + mono_loader_set_error_from_mono_error (error); + else + mono_error_set_bad_image (error, image, "Could not resolve field token 0x%08x", token); + } } if (field && field->parent && !field->parent->generic_class && !field->parent->generic_container) mono_conc_hashtable_insert (image->field_cache, GUINT_TO_POINTER (token), field); + g_assert (!mono_loader_get_last_error ()); return field; } @@ -861,6 +868,22 @@ inflate_generic_header (MonoMethodHeader *header, MonoGenericContext *context) */ MonoMethodSignature* mono_method_get_signature_full (MonoMethod *method, MonoImage *image, guint32 token, MonoGenericContext *context) +{ + MonoError error; + MonoMethodSignature *res = mono_method_get_signature_checked (method, image, token, context, &error); + + g_assert (!mono_loader_get_last_error ()); + + if (!res) { + g_assert (!mono_error_ok (&error)); + mono_loader_set_error_from_mono_error (&error); + mono_error_cleanup (&error); /* FIXME Don't swallow the error */ + } + return res; +} + +MonoMethodSignature* +mono_method_get_signature_checked (MonoMethod *method, MonoImage *image, guint32 token, MonoGenericContext *context, MonoError *error) { int table = mono_metadata_token_table (token); int idx = mono_metadata_token_index (token); @@ -869,23 +892,27 @@ mono_method_get_signature_full (MonoMethod *method, MonoImage *image, guint32 to MonoMethodSignature *sig; const char *ptr; + mono_error_init (error); + /* !table is for wrappers: we should really assign their own token to them */ if (!table || table == MONO_TABLE_METHOD) - return mono_method_signature (method); + return mono_method_signature_checked (method, error); if (table == MONO_TABLE_METHODSPEC) { /* the verifier (do_invoke_method) will turn the NULL into a verifier error */ if ((method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) || !method->is_inflated) return NULL; - return mono_method_signature (method); + return mono_method_signature_checked (method, error); } if (method->klass->generic_class) - return mono_method_signature (method); + return mono_method_signature_checked (method, error); if (image_is_dynamic (image)) { - sig = mono_reflection_lookup_signature (image, method, token); + sig = mono_reflection_lookup_signature (image, method, token, error); + if (!sig) + return NULL; } else { mono_metadata_decode_row (&image->tables [MONO_TABLE_MEMBERREF], idx-1, cols, MONO_MEMBERREF_SIZE); sig_idx = cols [MONO_MEMBERREF_SIGNATURE]; @@ -896,15 +923,24 @@ mono_method_get_signature_full (MonoMethod *method, MonoImage *image, guint32 to guint32 class = cols [MONO_MEMBERREF_CLASS] & MONO_MEMBERREF_PARENT_MASK; const char *fname = mono_metadata_string_heap (image, cols [MONO_MEMBERREF_NAME]); - mono_loader_set_error_bad_image (g_strdup_printf ("Bad method signature class token 0x%08x field name %s token 0x%08x on image %s", class, fname, token, image->name)); + //FIXME include the verification error + mono_error_set_bad_image (error, image, "Bad method signature class token 0x%08x field name %s token 0x%08x", class, fname, token); return NULL; } ptr = mono_metadata_blob_heap (image, sig_idx); mono_metadata_decode_blob_size (ptr, &ptr); + /* FIXME make type/signature parsing not produce loader errors */ sig = mono_metadata_parse_method_signature (image, 0, ptr, NULL); - if (!sig) + g_assert (!mono_loader_get_last_error ()); + + if (!sig) { + guint32 class = cols [MONO_MEMBERREF_CLASS] & MONO_MEMBERREF_PARENT_MASK; + const char *fname = mono_metadata_string_heap (image, cols [MONO_MEMBERREF_NAME]); + //FIXME include the decoding error + mono_error_set_bad_image (error, image, "Bad method signature class token 0x%08x field name %s token 0x%08x", class, fname, token); return NULL; + } sig = cache_memberref_sig (image, sig_idx, sig); } /* FIXME: we probably should verify signature compat in the dynamic case too*/ @@ -912,22 +948,18 @@ mono_method_get_signature_full (MonoMethod *method, MonoImage *image, guint32 to guint32 class = cols [MONO_MEMBERREF_CLASS] & MONO_MEMBERREF_PARENT_MASK; const char *fname = mono_metadata_string_heap (image, cols [MONO_MEMBERREF_NAME]); - mono_loader_set_error_bad_image (g_strdup_printf ("Incompatible method signature class token 0x%08x field name %s token 0x%08x on image %s", class, fname, token, image->name)); + mono_error_set_bad_image (error, image, "Incompatible method signature class token 0x%08x field name %s token 0x%08x", class, fname, token); return NULL; } } if (context) { - MonoError error; MonoMethodSignature *cached; /* This signature is not owned by a MonoMethod, so need to cache */ - sig = inflate_generic_signature_checked (image, sig, context, &error); - if (!mono_error_ok (&error)) {/*XXX bubble up this and kill one use of loader errors */ - mono_loader_set_error_bad_image (g_strdup_printf ("Could not inflate signature %s", mono_error_get_message (&error))); - mono_error_cleanup (&error); + sig = inflate_generic_signature_checked (image, sig, context, error); + if (!mono_error_ok (error)) return NULL; - } cached = mono_metadata_get_inflated_signature (sig, context); if (cached != sig) @@ -937,13 +969,24 @@ mono_method_get_signature_full (MonoMethod *method, MonoImage *image, guint32 to sig = cached; } + g_assert (mono_error_ok (error)); return sig; } MonoMethodSignature* mono_method_get_signature (MonoMethod *method, MonoImage *image, guint32 token) { - return mono_method_get_signature_full (method, image, token, NULL); + MonoError error; + MonoMethodSignature *res = mono_method_get_signature_checked (method, image, token, NULL, &error); + + g_assert (!mono_loader_get_last_error ()); + + if (!res) { + g_assert (!mono_error_ok (&error)); + mono_loader_set_error_from_mono_error (&error); + mono_error_cleanup (&error); /* FIXME Don't swallow the error */ + } + return res; } /* this is only for the typespec array methods */ diff --git a/mono/metadata/marshal.c b/mono/metadata/marshal.c index 5ee8be3031a..904e4041a68 100644 --- a/mono/metadata/marshal.c +++ b/mono/metadata/marshal.c @@ -36,6 +36,7 @@ #include "mono/metadata/attrdefs.h" #include "mono/metadata/gc-internal.h" #include "mono/metadata/cominterop.h" +#include "mono/metadata/remoting.h" #include "mono/metadata/reflection-internals.h" #include "mono/utils/mono-counters.h" #include "mono/utils/mono-tls.h" @@ -49,28 +50,12 @@ #define OPDEF(a,b,c,d,e,f,g,h,i,j) \ a = i, -typedef enum { - MONO_MARSHAL_NONE, /* No marshalling needed */ - MONO_MARSHAL_COPY, /* Can be copied by value to the new domain */ - MONO_MARSHAL_COPY_OUT, /* out parameter that needs to be copied back to the original instance */ - MONO_MARSHAL_SERIALIZE /* Value needs to be serialized into the new domain */ -} MonoXDomainMarshalType; - enum { #include "mono/cil/opcode.def" LAST = 0xff }; #undef OPDEF -struct _MonoRemotingMethods { - MonoMethod *invoke; - MonoMethod *invoke_with_check; - MonoMethod *xdomain_invoke; - MonoMethod *xdomain_dispatch; -}; - -typedef struct _MonoRemotingMethods MonoRemotingMethods; - /* * This mutex protects the various marshalling related caches in MonoImage * and a few other data structures static to this file. @@ -143,27 +128,6 @@ mono_delegate_begin_invoke (MonoDelegate *delegate, gpointer *params); static MonoObject * mono_delegate_end_invoke (MonoDelegate *delegate, gpointer *params); -static void -mono_marshal_xdomain_copy_out_value (MonoObject *src, MonoObject *dst); - -static gint32 -mono_marshal_set_domain_by_id (gint32 id, MonoBoolean push); - -static gboolean -mono_marshal_check_domain_image (gint32 domain_id, MonoImage *image); - -#ifndef DISABLE_REMOTING -static MonoObject * -mono_remoting_wrapper (MonoMethod *method, gpointer *params); - -MONO_API void -mono_upgrade_remote_class_wrapper (MonoReflectionType *rtype, MonoTransparentProxy *tproxy); - -#endif - -static MonoReflectionType * -type_from_handle (MonoType *handle); - static void mono_marshal_set_last_error_windows (int error); @@ -274,22 +238,14 @@ mono_marshal_init (void) register_icall (mono_struct_delete_old, "mono_struct_delete_old", "void ptr ptr", FALSE); register_icall (mono_delegate_begin_invoke, "mono_delegate_begin_invoke", "object object ptr", FALSE); register_icall (mono_delegate_end_invoke, "mono_delegate_end_invoke", "object object ptr", FALSE); - register_icall (mono_marshal_xdomain_copy_value, "mono_marshal_xdomain_copy_value", "object object", FALSE); - register_icall (mono_marshal_xdomain_copy_out_value, "mono_marshal_xdomain_copy_out_value", "void object object", FALSE); - register_icall (mono_marshal_set_domain_by_id, "mono_marshal_set_domain_by_id", "int32 int32 int32", FALSE); - register_icall (mono_marshal_check_domain_image, "mono_marshal_check_domain_image", "int32 int32 ptr", FALSE); register_icall (mono_compile_method, "mono_compile_method", "ptr ptr", FALSE); register_icall (mono_context_get, "mono_context_get", "object", FALSE); register_icall (mono_context_set, "mono_context_set", "void object", FALSE); - register_icall (type_from_handle, "type_from_handle", "object ptr", FALSE); register_icall (mono_gc_wbarrier_generic_nostore, "wb_generic", "void ptr", FALSE); register_icall (mono_gchandle_get_target, "mono_gchandle_get_target", "object int32", TRUE); -#ifndef DISABLE_REMOTING - register_icall (mono_remoting_wrapper, "mono_remoting_wrapper", "object ptr ptr", FALSE); - register_icall (mono_upgrade_remote_class_wrapper, "mono_upgrade_remote_class_wrapper", "void object object", FALSE); -#endif mono_cominterop_init (); + mono_remoting_init (); } } @@ -304,42 +260,17 @@ mono_marshal_cleanup (void) marshal_mutex_initialized = FALSE; } -#ifndef DISABLE_REMOTING -static MonoClass *byte_array_class; -static MonoMethod *method_rs_serialize, *method_rs_deserialize, *method_exc_fixexc, *method_rs_appdomain_target; -static MonoMethod *method_set_call_context, *method_needs_context_sink, *method_rs_serialize_exc; - -static void -mono_remoting_marshal_init (void) +void +mono_marshal_lock_internal (void) { - MonoClass *klass; - - static gboolean module_initialized = FALSE; - - if (!module_initialized) { - klass = mono_class_from_name (mono_defaults.corlib, "System.Runtime.Remoting", "RemotingServices"); - method_rs_serialize = mono_class_get_method_from_name (klass, "SerializeCallData", -1); - method_rs_deserialize = mono_class_get_method_from_name (klass, "DeserializeCallData", -1); - method_rs_serialize_exc = mono_class_get_method_from_name (klass, "SerializeExceptionData", -1); - - klass = mono_defaults.real_proxy_class; - method_rs_appdomain_target = mono_class_get_method_from_name (klass, "GetAppDomainTarget", -1); - - klass = mono_defaults.exception_class; - method_exc_fixexc = mono_class_get_method_from_name (klass, "FixRemotingException", -1); - - byte_array_class = mono_array_class_get (mono_defaults.byte_class, 1); - - klass = mono_class_from_name (mono_defaults.corlib, "System.Runtime.Remoting.Messaging", "CallContext"); - method_set_call_context = mono_class_get_method_from_name (klass, "SetCurrentCallContext", -1); - - klass = mono_class_from_name (mono_defaults.corlib, "System.Runtime.Remoting.Contexts", "Context"); - method_needs_context_sink = mono_class_get_method_from_name (klass, "get_NeedsContextSink", -1); + mono_marshal_lock (); +} - module_initialized = TRUE; - } +void +mono_marshal_unlock_internal (void) +{ + mono_marshal_unlock (); } -#endif gpointer mono_delegate_to_ftnptr (MonoDelegate *delegate) @@ -1082,57 +1013,6 @@ mono_string_new_len_wrapper (const char *text, guint length) } #ifndef DISABLE_JIT -#ifndef DISABLE_REMOTING -static int -mono_mb_emit_proxy_check (MonoMethodBuilder *mb, int branch_code) -{ - int pos; - mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoObject, vtable)); - mono_mb_emit_byte (mb, CEE_LDIND_I); - mono_mb_emit_icon (mb, MONO_STRUCT_OFFSET (MonoVTable, klass)); - mono_mb_emit_byte (mb, CEE_ADD); - mono_mb_emit_byte (mb, CEE_LDIND_I); - mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX); - mono_mb_emit_byte (mb, CEE_MONO_CLASSCONST); - mono_mb_emit_i4 (mb, mono_mb_add_data (mb, mono_defaults.transparent_proxy_class)); - pos = mono_mb_emit_branch (mb, branch_code); - return pos; -} - -static int -mono_mb_emit_xdomain_check (MonoMethodBuilder *mb, int branch_code) -{ - int pos; - mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoTransparentProxy, rp)); - mono_mb_emit_byte (mb, CEE_LDIND_REF); - mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoRealProxy, target_domain_id)); - mono_mb_emit_byte (mb, CEE_LDIND_I4); - mono_mb_emit_icon (mb, -1); - pos = mono_mb_emit_branch (mb, branch_code); - return pos; -} - -static int -mono_mb_emit_contextbound_check (MonoMethodBuilder *mb, int branch_code) -{ - static int offset = -1; - static guint8 mask; - - if (offset < 0) - mono_marshal_find_bitfield_offset (MonoClass, contextbound, &offset, &mask); - - mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoTransparentProxy, remote_class)); - mono_mb_emit_byte (mb, CEE_LDIND_REF); - mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoRemoteClass, proxy_class)); - mono_mb_emit_byte (mb, CEE_LDIND_REF); - mono_mb_emit_ldflda (mb, offset); - mono_mb_emit_byte (mb, CEE_LDIND_U1); - mono_mb_emit_icon (mb, mask); - mono_mb_emit_byte (mb, CEE_AND); - mono_mb_emit_icon (mb, 0); - return mono_mb_emit_branch (mb, branch_code); -} -#endif /* DISABLE_REMOTING */ /* * mono_mb_emit_exception_marshal_directive: @@ -2165,6 +2045,12 @@ mono_marshal_emit_thread_interrupt_checkpoint (MonoMethodBuilder *mb) emit_thread_interrupt_checkpoint (mb); } +void +mono_marshal_emit_thread_force_interrupt_checkpoint (MonoMethodBuilder *mb) +{ + emit_thread_force_interrupt_checkpoint (mb); +} + #endif /* DISABLE_JIT */ static MonoAsyncResult * @@ -2229,7 +2115,7 @@ mono_delegate_begin_invoke (MonoDelegate *delegate, gpointer *params) #ifndef DISABLE_JIT -static int +int mono_mb_emit_save_args (MonoMethodBuilder *mb, MonoMethodSignature *sig, gboolean save_this) { int i, params_var, tmp_var; @@ -2513,7 +2399,7 @@ mono_marshal_find_in_cache (GHashTable *cache, gpointer key) * * Create a MonoMethod from MB, set INFO as wrapper info. */ -static MonoMethod* +MonoMethod* mono_mb_create (MonoMethodBuilder *mb, MonoMethodSignature *sig, int max_stack, WrapperInfo *info) { @@ -2526,7 +2412,7 @@ mono_mb_create (MonoMethodBuilder *mb, MonoMethodSignature *sig, } /* Create the method from the builder and place it in the cache */ -static MonoMethod* +MonoMethod* mono_mb_create_and_cache_full (GHashTable *cache, gpointer key, MonoMethodBuilder *mb, MonoMethodSignature *sig, int max_stack, WrapperInfo *info, gboolean *out_found) @@ -2571,78 +2457,6 @@ mono_mb_create_and_cache (GHashTable *cache, gpointer key, return mono_mb_create_and_cache_full (cache, key, mb, sig, max_stack, NULL, NULL); } -static inline MonoMethod* -mono_marshal_remoting_find_in_cache (MonoMethod *method, int wrapper_type) -{ - MonoMethod *res = NULL; - MonoRemotingMethods *wrps; - - mono_marshal_lock (); - if (method->klass->image->remoting_invoke_cache) - wrps = g_hash_table_lookup (method->klass->image->remoting_invoke_cache, method); - else - wrps = NULL; - - if (wrps) { - switch (wrapper_type) { - case MONO_WRAPPER_REMOTING_INVOKE: res = wrps->invoke; break; - case MONO_WRAPPER_REMOTING_INVOKE_WITH_CHECK: res = wrps->invoke_with_check; break; - case MONO_WRAPPER_XDOMAIN_INVOKE: res = wrps->xdomain_invoke; break; - case MONO_WRAPPER_XDOMAIN_DISPATCH: res = wrps->xdomain_dispatch; break; - } - } - - /* it is important to do the unlock after the load from wrps, since in - * mono_remoting_mb_create_and_cache () we drop the marshal lock to be able - * to take the loader lock and some other thread may set the fields. - */ - mono_marshal_unlock (); - return res; -} - -/* Create the method from the builder and place it in the cache */ -static inline MonoMethod* -mono_remoting_mb_create_and_cache (MonoMethod *key, MonoMethodBuilder *mb, - MonoMethodSignature *sig, int max_stack) -{ - MonoMethod **res = NULL; - MonoRemotingMethods *wrps; - GHashTable *cache = get_cache_full (&key->klass->image->remoting_invoke_cache, mono_aligned_addr_hash, NULL, NULL, g_free); - - mono_marshal_lock (); - wrps = g_hash_table_lookup (cache, key); - if (!wrps) { - wrps = g_new0 (MonoRemotingMethods, 1); - g_hash_table_insert (cache, key, wrps); - } - - switch (mb->method->wrapper_type) { - case MONO_WRAPPER_REMOTING_INVOKE: res = &wrps->invoke; break; - case MONO_WRAPPER_REMOTING_INVOKE_WITH_CHECK: res = &wrps->invoke_with_check; break; - case MONO_WRAPPER_XDOMAIN_INVOKE: res = &wrps->xdomain_invoke; break; - case MONO_WRAPPER_XDOMAIN_DISPATCH: res = &wrps->xdomain_dispatch; break; - default: g_assert_not_reached (); break; - } - mono_marshal_unlock (); - - if (*res == NULL) { - MonoMethod *newm; - newm = mono_mb_create_method (mb, sig, max_stack); - - mono_marshal_lock (); - if (!*res) { - *res = newm; - mono_marshal_set_wrapper_info (*res, key); - mono_marshal_unlock (); - } else { - mono_marshal_unlock (); - mono_free_method (newm); - } - } - - return *res; -} - MonoMethod * mono_marshal_method_from_wrapper (MonoMethod *wrapper) { @@ -2721,7 +2535,7 @@ mono_marshal_set_wrapper_info (MonoMethod *method, gpointer data) datav [1] = data; } -static WrapperInfo* +WrapperInfo* mono_wrapper_info_create (MonoMethodBuilder *mb, WrapperSubtype subtype) { WrapperInfo *info; @@ -3037,7 +2851,7 @@ mono_delegate_end_invoke (MonoDelegate *delegate, gpointer *params) #ifndef DISABLE_JIT -static void +void mono_mb_emit_restore_result (MonoMethodBuilder *mb, MonoType *return_type) { MonoType *t = mono_type_get_underlying_type (return_type); @@ -3178,2712 +2992,1111 @@ mono_marshal_get_delegate_end_invoke (MonoMethod *method) return res; } -#ifndef DISABLE_REMOTING - -static MonoObject * -mono_remoting_wrapper (MonoMethod *method, gpointer *params) +typedef struct { - MonoMethodMessage *msg; - MonoTransparentProxy *this; - MonoObject *res, *exc; - MonoArray *out_args; - - this = *((MonoTransparentProxy **)params [0]); - - g_assert (this); - g_assert (((MonoObject *)this)->vtable->klass == mono_defaults.transparent_proxy_class); - - /* skip the this pointer */ - params++; - - if (mono_class_is_contextbound (this->remote_class->proxy_class) && this->rp->context == (MonoObject *) mono_context_get ()) - { - int i; - MonoMethodSignature *sig = mono_method_signature (method); - int count = sig->param_count; - gpointer* mparams = (gpointer*) alloca(count*sizeof(gpointer)); - - for (i=0; iparams [i]); - if (class->valuetype) { - if (sig->params [i]->byref) { - mparams[i] = *((gpointer *)params [i]); - } else { - /* runtime_invoke expects a boxed instance */ - if (mono_class_is_nullable (mono_class_from_mono_type (sig->params [i]))) - mparams[i] = mono_nullable_box (params [i], class); - else - mparams[i] = params [i]; - } - } else { - mparams[i] = *((gpointer**)params [i]); - } - } + MonoMethodSignature *sig; + MonoMethod *method; +} SignatureMethodPair; - return mono_runtime_invoke (method, method->klass->valuetype? mono_object_unbox ((MonoObject*)this): this, mparams, NULL); - } +static guint +signature_method_pair_hash (gconstpointer data) +{ + SignatureMethodPair *pair = (SignatureMethodPair*)data; - msg = mono_method_call_message_new (method, params, NULL, NULL, NULL); + return mono_signature_hash (pair->sig) ^ mono_aligned_addr_hash (pair->method); +} - res = mono_remoting_invoke ((MonoObject *)this->rp, msg, &exc, &out_args); +static gboolean +signature_method_pair_equal (SignatureMethodPair *pair1, SignatureMethodPair *pair2) +{ + return mono_metadata_signature_equal (pair1->sig, pair2->sig) && (pair1->method == pair2->method); +} - if (exc) - mono_raise_exception ((MonoException *)exc); +static gboolean +signature_method_pair_matches_method (gpointer key, gpointer value, gpointer user_data) +{ + SignatureMethodPair *pair = (SignatureMethodPair*)key; + MonoMethod *method = (MonoMethod*)user_data; - mono_method_return_message_restore (method, params, out_args); + return pair->method == method; +} - return res; -} +static void +free_signature_method_pair (SignatureMethodPair *pair) +{ + g_free (pair); +} -MonoMethod * -mono_marshal_get_remoting_invoke (MonoMethod *method) +static MonoMethod * +mono_marshal_get_delegate_invoke_internal (MonoMethod *method, gboolean callvirt, gboolean static_method_with_first_arg_bound, MonoMethod *target_method) { - MonoMethodSignature *sig; + MonoMethodSignature *sig, *static_sig, *invoke_sig; + int i; MonoMethodBuilder *mb; MonoMethod *res; - int params_var; + GHashTable *cache; + gpointer cache_key = NULL; + SignatureMethodPair key; + SignatureMethodPair *new_key; + int local_prev, local_target; + int pos0; + char *name; + MonoClass *target_class = NULL; + gboolean closed_over_null = FALSE; + MonoGenericContext *ctx = NULL; + MonoGenericContainer *container = NULL; + MonoMethod *orig_method = NULL; + WrapperInfo *info; + WrapperSubtype subtype = WRAPPER_SUBTYPE_NONE; + gboolean found; - g_assert (method); + g_assert (method && method->klass->parent == mono_defaults.multicastdelegate_class && + !strcmp (method->name, "Invoke")); - if (method->wrapper_type == MONO_WRAPPER_REMOTING_INVOKE || method->wrapper_type == MONO_WRAPPER_XDOMAIN_INVOKE) - return method; + invoke_sig = sig = mono_signature_no_pinvoke (method); - /* this seems to be the best plase to put this, as all remoting invokes seem to get filtered through here */ -#ifndef DISABLE_COM - if (mono_class_is_com_object (method->klass) || method->klass == mono_class_get_com_object_class ()) { - MonoVTable *vtable = mono_class_vtable (mono_domain_get (), method->klass); - g_assert (vtable); /*FIXME do proper error handling*/ + /* + * If the delegate target is null, and the target method is not static, a virtual + * call is made to that method with the first delegate argument as this. This is + * a non-documented .NET feature. + */ + if (callvirt) { + subtype = WRAPPER_SUBTYPE_DELEGATE_INVOKE_VIRTUAL; + if (target_method->is_inflated) { + MonoType *target_type; - if (!mono_vtable_is_remote (vtable)) { - return mono_cominterop_get_invoke (method); + g_assert (method->signature->hasthis); + target_type = mono_class_inflate_generic_type (method->signature->params [0], + mono_method_get_context (method)); + target_class = mono_class_from_mono_type (target_type); + } else { + target_class = target_method->klass; } - } -#endif - - sig = mono_signature_no_pinvoke (method); - - /* we cant remote methods without this pointer */ - if (!sig->hasthis) - return method; - - if ((res = mono_marshal_remoting_find_in_cache (method, MONO_WRAPPER_REMOTING_INVOKE))) - return res; - - mb = mono_mb_new (method->klass, method->name, MONO_WRAPPER_REMOTING_INVOKE); - -#ifndef DISABLE_JIT - mb->method->save_lmf = 1; - - params_var = mono_mb_emit_save_args (mb, sig, TRUE); - - mono_mb_emit_ptr (mb, method); - mono_mb_emit_ldloc (mb, params_var); - mono_mb_emit_icall (mb, mono_remoting_wrapper); - emit_thread_interrupt_checkpoint (mb); - if (sig->ret->type == MONO_TYPE_VOID) { - mono_mb_emit_byte (mb, CEE_POP); - mono_mb_emit_byte (mb, CEE_RET); - } else { - mono_mb_emit_restore_result (mb, sig->ret); + closed_over_null = sig->param_count == mono_method_signature (target_method)->param_count; } -#endif - res = mono_remoting_mb_create_and_cache (method, mb, sig, sig->param_count + 16); - mono_mb_free (mb); + if (static_method_with_first_arg_bound) { + subtype = WRAPPER_SUBTYPE_DELEGATE_INVOKE_BOUND; + g_assert (!callvirt); + invoke_sig = mono_method_signature (target_method); + } - return res; -} + /* + * For generic delegates, create a generic wrapper, and return an instance to help AOT. + */ + if (method->is_inflated && subtype == WRAPPER_SUBTYPE_NONE) { + orig_method = method; + ctx = &((MonoMethodInflated*)method)->context; + method = ((MonoMethodInflated*)method)->declaring; -#endif /* DISABLE_REMOTING */ + container = mono_method_get_generic_container (method); + if (!container) + container = method->klass->generic_container; + g_assert (container); + invoke_sig = sig = mono_signature_no_pinvoke (method); + } -/* mono_get_xdomain_marshal_type() - * Returns the kind of marshalling that a type needs for cross domain calls. - */ -static MonoXDomainMarshalType -mono_get_xdomain_marshal_type (MonoType *t) -{ - switch (t->type) { - case MONO_TYPE_VOID: - g_assert_not_reached (); - break; - case MONO_TYPE_U1: - case MONO_TYPE_I1: - case MONO_TYPE_BOOLEAN: - case MONO_TYPE_U2: - case MONO_TYPE_I2: - case MONO_TYPE_CHAR: - case MONO_TYPE_U4: - case MONO_TYPE_I4: - case MONO_TYPE_I8: - case MONO_TYPE_U8: - case MONO_TYPE_R4: - case MONO_TYPE_R8: - return MONO_MARSHAL_NONE; - case MONO_TYPE_STRING: - return MONO_MARSHAL_COPY; - case MONO_TYPE_ARRAY: - case MONO_TYPE_SZARRAY: { - MonoClass *elem_class = mono_class_from_mono_type (t)->element_class; - if (mono_get_xdomain_marshal_type (&(elem_class->byval_arg)) != MONO_MARSHAL_SERIALIZE) - return MONO_MARSHAL_COPY; - break; - } - } - - return MONO_MARSHAL_SERIALIZE; -} - - -/* mono_marshal_xdomain_copy_value - * Makes a copy of "val" suitable for the current domain. - */ -MonoObject * -mono_marshal_xdomain_copy_value (MonoObject *val) -{ - MonoDomain *domain; - if (val == NULL) return NULL; - - domain = mono_domain_get (); - - switch (mono_object_class (val)->byval_arg.type) { - case MONO_TYPE_VOID: - g_assert_not_reached (); - break; - case MONO_TYPE_U1: - case MONO_TYPE_I1: - case MONO_TYPE_BOOLEAN: - case MONO_TYPE_U2: - case MONO_TYPE_I2: - case MONO_TYPE_CHAR: - case MONO_TYPE_U4: - case MONO_TYPE_I4: - case MONO_TYPE_I8: - case MONO_TYPE_U8: - case MONO_TYPE_R4: - case MONO_TYPE_R8: { - return mono_value_box (domain, mono_object_class (val), ((char*)val) + sizeof(MonoObject)); - } - case MONO_TYPE_STRING: { - MonoString *str = (MonoString *) val; - return (MonoObject *) mono_string_new_utf16 (domain, mono_string_chars (str), mono_string_length (str)); - } - case MONO_TYPE_ARRAY: - case MONO_TYPE_SZARRAY: { - MonoArray *acopy; - MonoXDomainMarshalType mt = mono_get_xdomain_marshal_type (&(mono_object_class (val)->element_class->byval_arg)); - if (mt == MONO_MARSHAL_SERIALIZE) return NULL; - acopy = mono_array_clone_in_domain (domain, (MonoArray *) val); - if (mt == MONO_MARSHAL_COPY) { - int i, len = mono_array_length (acopy); - for (i = 0; i < len; i++) { - MonoObject *item = mono_array_get (acopy, gpointer, i); - mono_array_setref (acopy, i, mono_marshal_xdomain_copy_value (item)); - } - } - return (MonoObject *) acopy; - } - } - - if (mono_object_class (val) == mono_defaults.stringbuilder_class) { - MonoStringBuilder *oldsb = (MonoStringBuilder *) val; - MonoStringBuilder *newsb = (MonoStringBuilder *) mono_object_new (domain, mono_defaults.stringbuilder_class); - MONO_OBJECT_SETREF (newsb, str, mono_string_new_utf16 (domain, mono_string_chars (oldsb->str), mono_string_length (oldsb->str))); - newsb->length = oldsb->length; - newsb->max_capacity = (gint32)0x7fffffff; - return (MonoObject *) newsb; - } - return NULL; -} - -/* mono_marshal_xdomain_copy_out_value() - * Copies the contents of the src instance into the dst instance. src and dst - * must have the same type, and if they are arrays, the same size. - */ -static void -mono_marshal_xdomain_copy_out_value (MonoObject *src, MonoObject *dst) -{ - if (src == NULL || dst == NULL) return; - - g_assert (mono_object_class (src) == mono_object_class (dst)); + /* + * Check cache + */ + if (ctx) { + cache = get_cache (&method->klass->image->delegate_invoke_generic_cache, mono_aligned_addr_hash, NULL); + res = check_generic_delegate_wrapper_cache (cache, orig_method, method, ctx); + if (res) + return res; + cache_key = method->klass; + } else if (static_method_with_first_arg_bound) { + cache = get_cache (&method->klass->image->delegate_bound_static_invoke_cache, + (GHashFunc)mono_signature_hash, + (GCompareFunc)mono_metadata_signature_equal); + /* + * The wrapper is based on sig+invoke_sig, but sig can be derived from invoke_sig. + */ + res = mono_marshal_find_in_cache (cache, invoke_sig); + if (res) + return res; + cache_key = invoke_sig; + } else if (callvirt) { + GHashTable **cache_ptr; - switch (mono_object_class (src)->byval_arg.type) { - case MONO_TYPE_ARRAY: - case MONO_TYPE_SZARRAY: { - int mt = mono_get_xdomain_marshal_type (&(mono_object_class (src)->element_class->byval_arg)); - if (mt == MONO_MARSHAL_SERIALIZE) return; - if (mt == MONO_MARSHAL_COPY) { - int i, len = mono_array_length ((MonoArray *)dst); - for (i = 0; i < len; i++) { - MonoObject *item = mono_array_get ((MonoArray *)src, gpointer, i); - mono_array_setref ((MonoArray *)dst, i, mono_marshal_xdomain_copy_value (item)); - } - } else { - mono_array_full_copy ((MonoArray *)src, (MonoArray *)dst); - } - return; - } - } + cache_ptr = &method->klass->image->delegate_abstract_invoke_cache; - if (mono_object_class (src) == mono_defaults.stringbuilder_class) { - MonoStringBuilder *src_sb = (MonoStringBuilder *) src; - MonoStringBuilder *dst_sb = (MonoStringBuilder *) dst; - - MONO_OBJECT_SETREF (dst_sb, str, mono_string_new_utf16 (mono_object_domain (dst), mono_string_chars (src_sb->str), mono_string_length (src_sb->str))); - dst_sb->cached_str = NULL; - dst_sb->length = src_sb->length; + /* We need to cache the signature+method pair */ + mono_marshal_lock (); + if (!*cache_ptr) + *cache_ptr = g_hash_table_new_full (signature_method_pair_hash, (GEqualFunc)signature_method_pair_equal, (GDestroyNotify)free_signature_method_pair, NULL); + cache = *cache_ptr; + key.sig = invoke_sig; + key.method = target_method; + res = g_hash_table_lookup (cache, &key); + mono_marshal_unlock (); + if (res) + return res; + } else { + cache = get_cache (&method->klass->image->delegate_invoke_cache, + (GHashFunc)mono_signature_hash, + (GCompareFunc)mono_metadata_signature_equal); + res = mono_marshal_find_in_cache (cache, sig); + if (res) + return res; + cache_key = sig; } -} - - -#if !(defined (DISABLE_JIT) || defined (DISABLE_REMOTING)) - -static void -mono_marshal_emit_xdomain_copy_value (MonoMethodBuilder *mb, MonoClass *pclass) -{ - mono_mb_emit_icall (mb, mono_marshal_xdomain_copy_value); - mono_mb_emit_op (mb, CEE_CASTCLASS, pclass); -} - -static void -mono_marshal_emit_xdomain_copy_out_value (MonoMethodBuilder *mb, MonoClass *pclass) -{ - mono_mb_emit_icall (mb, mono_marshal_xdomain_copy_out_value); -} -#endif - -#ifndef DISABLE_REMOTING -/* mono_marshal_supports_fast_xdomain() - * Returns TRUE if the method can use the fast xdomain wrapper. - */ -static gboolean -mono_marshal_supports_fast_xdomain (MonoMethod *method) -{ - return !mono_class_is_contextbound (method->klass) && - !((method->flags & METHOD_ATTRIBUTE_SPECIAL_NAME) && (strcmp (".ctor", method->name) == 0)); -} -#endif - -static gint32 -mono_marshal_set_domain_by_id (gint32 id, MonoBoolean push) -{ - MonoDomain *current_domain = mono_domain_get (); - MonoDomain *domain = mono_domain_get_by_id (id); - if (!domain || !mono_domain_set (domain, FALSE)) - mono_raise_exception (mono_get_exception_appdomain_unloaded ()); + static_sig = signature_dup (method->klass->image, sig); + static_sig->hasthis = 0; + if (!static_method_with_first_arg_bound) + invoke_sig = static_sig; - if (push) - mono_thread_push_appdomain_ref (domain); + if (static_method_with_first_arg_bound) + name = mono_signature_to_name (invoke_sig, "invoke_bound"); + else if (closed_over_null) + name = mono_signature_to_name (invoke_sig, "invoke_closed_over_null"); + else if (callvirt) + name = mono_signature_to_name (invoke_sig, "invoke_callvirt"); else - mono_thread_pop_appdomain_ref (); - - return current_domain->domain_id; -} - -#if !(defined (DISABLE_JIT) || defined (DISABLE_REMOTING)) -static void -mono_marshal_emit_switch_domain (MonoMethodBuilder *mb) -{ - mono_mb_emit_icall (mb, mono_marshal_set_domain_by_id); -} + name = mono_signature_to_name (invoke_sig, "invoke"); + if (ctx) + mb = mono_mb_new (method->klass, name, MONO_WRAPPER_DELEGATE_INVOKE); + else + mb = mono_mb_new (get_wrapper_target_class (method->klass->image), name, MONO_WRAPPER_DELEGATE_INVOKE); + g_free (name); -/* mono_marshal_emit_load_domain_method () - * Loads into the stack a pointer to the code of the provided method for - * the current domain. - */ -static void -mono_marshal_emit_load_domain_method (MonoMethodBuilder *mb, MonoMethod *method) -{ - /* We need a pointer to the method for the running domain (not the domain - * that compiles the method). - */ - mono_mb_emit_ptr (mb, method); - mono_mb_emit_icall (mb, mono_compile_method); -} -#endif +#ifndef DISABLE_JIT + /* allocate local 0 (object) */ + local_target = mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg); + local_prev = mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg); -/* mono_marshal_check_domain_image () - * Returns TRUE if the image is loaded in the specified - * application domain. - */ -static gboolean -mono_marshal_check_domain_image (gint32 domain_id, MonoImage *image) -{ - MonoAssembly* ass; - GSList *tmp; + g_assert (sig->hasthis); - MonoDomain *domain = mono_domain_get_by_id (domain_id); - if (!domain) - return FALSE; + /* + * if (prev != null) + * prev.Invoke( args .. ); + * return this.( args .. ); + */ - mono_domain_assemblies_lock (domain); - for (tmp = domain->domain_assemblies; tmp; tmp = tmp->next) { - ass = tmp->data; - if (ass->image == image) - break; - } - mono_domain_assemblies_unlock (domain); + /* this wrapper can be used in unmanaged-managed transitions */ + emit_thread_interrupt_checkpoint (mb); - return tmp != NULL; -} + /* get this->prev */ + mono_mb_emit_ldarg (mb, 0); + mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoMulticastDelegate, prev)); + mono_mb_emit_byte (mb, CEE_LDIND_REF); + mono_mb_emit_stloc (mb, local_prev); + mono_mb_emit_ldloc (mb, local_prev); -#ifndef DISABLE_REMOTING + /* if prev != null */ + pos0 = mono_mb_emit_branch (mb, CEE_BRFALSE); -/* mono_marshal_get_xappdomain_dispatch () - * Generates a method that dispatches a method call from another domain into - * the current domain. - */ -static MonoMethod * -mono_marshal_get_xappdomain_dispatch (MonoMethod *method, int *marshal_types, int complex_count, int complex_out_count, int ret_marshal_type) -{ - MonoMethodSignature *sig, *csig; - MonoMethodBuilder *mb; - MonoMethod *res; - int i, j, param_index, copy_locals_base; - MonoClass *ret_class = NULL; - int loc_array=0, loc_return=0, loc_serialized_exc=0; - MonoExceptionClause *main_clause; - int pos, pos_leave; - gboolean copy_return; - - if ((res = mono_marshal_remoting_find_in_cache (method, MONO_WRAPPER_XDOMAIN_DISPATCH))) - return res; + /* then recurse */ - sig = mono_method_signature (method); - copy_return = (sig->ret->type != MONO_TYPE_VOID && ret_marshal_type != MONO_MARSHAL_SERIALIZE); + mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX); + mono_mb_emit_byte (mb, CEE_MONO_NOT_TAKEN); - j = 0; - csig = mono_metadata_signature_alloc (mono_defaults.corlib, 3 + sig->param_count - complex_count); - csig->params [j++] = &mono_defaults.object_class->byval_arg; - csig->params [j++] = &byte_array_class->this_arg; - csig->params [j++] = &byte_array_class->this_arg; - for (i = 0; i < sig->param_count; i++) { - if (marshal_types [i] != MONO_MARSHAL_SERIALIZE) - csig->params [j++] = sig->params [i]; - } - if (copy_return) - csig->ret = sig->ret; + mono_mb_emit_ldloc (mb, local_prev); + for (i = 0; i < sig->param_count; i++) + mono_mb_emit_ldarg (mb, i + 1); + if (ctx) + mono_mb_emit_op (mb, CEE_CALLVIRT, mono_class_inflate_generic_method (method, &container->context)); else - csig->ret = &mono_defaults.void_class->byval_arg; - csig->pinvoke = 1; - csig->hasthis = FALSE; - - mb = mono_mb_new (method->klass, method->name, MONO_WRAPPER_XDOMAIN_DISPATCH); - mb->method->save_lmf = 1; - -#ifndef DISABLE_JIT - /* Locals */ - - loc_serialized_exc = mono_mb_add_local (mb, &byte_array_class->byval_arg); - if (complex_count > 0) - loc_array = mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg); - if (sig->ret->type != MONO_TYPE_VOID) { - loc_return = mono_mb_add_local (mb, sig->ret); - ret_class = mono_class_from_mono_type (sig->ret); - } - - /* try */ - - main_clause = mono_image_alloc0 (method->klass->image, sizeof (MonoExceptionClause)); - main_clause->try_offset = mono_mb_get_label (mb); - - /* Clean the call context */ - - mono_mb_emit_byte (mb, CEE_LDNULL); - mono_mb_emit_managed_call (mb, method_set_call_context, NULL); - mono_mb_emit_byte (mb, CEE_POP); + mono_mb_emit_op (mb, CEE_CALLVIRT, method); + if (sig->ret->type != MONO_TYPE_VOID) + mono_mb_emit_byte (mb, CEE_POP); - /* Deserialize call data */ + /* continued or prev == null */ + mono_mb_patch_branch (mb, pos0); - mono_mb_emit_ldarg (mb, 1); + /* get this->target */ + mono_mb_emit_ldarg (mb, 0); + mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoDelegate, target)); mono_mb_emit_byte (mb, CEE_LDIND_REF); - mono_mb_emit_byte (mb, CEE_DUP); - pos = mono_mb_emit_short_branch (mb, CEE_BRFALSE_S); - - mono_marshal_emit_xdomain_copy_value (mb, byte_array_class); - mono_mb_emit_managed_call (mb, method_rs_deserialize, NULL); - - if (complex_count > 0) - mono_mb_emit_stloc (mb, loc_array); - else - mono_mb_emit_byte (mb, CEE_POP); + mono_mb_emit_stloc (mb, local_target); - mono_mb_patch_short_branch (mb, pos); + /*static methods with bound first arg can have null target and still be bound*/ + if (!static_method_with_first_arg_bound) { + /* if target != null */ + mono_mb_emit_ldloc (mb, local_target); + pos0 = mono_mb_emit_branch (mb, CEE_BRFALSE); - /* Get the target object */ - - mono_mb_emit_ldarg (mb, 0); - mono_mb_emit_managed_call (mb, method_rs_appdomain_target, NULL); + /* then call this->method_ptr nonstatic */ + if (callvirt) { + // FIXME: + mono_mb_emit_exception_full (mb, "System", "NotImplementedException", ""); + } else { + mono_mb_emit_ldloc (mb, local_target); + for (i = 0; i < sig->param_count; ++i) + mono_mb_emit_ldarg (mb, i + 1); + mono_mb_emit_ldarg (mb, 0); + mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoDelegate, method_ptr)); + mono_mb_emit_byte (mb, CEE_LDIND_I ); + mono_mb_emit_op (mb, CEE_CALLI, sig); - /* Load the arguments */ + mono_mb_emit_byte (mb, CEE_RET); + } - copy_locals_base = mb->locals; - param_index = 3; // Index of the first non-serialized parameter of this wrapper - j = 0; - for (i = 0; i < sig->param_count; i++) { - MonoType *pt = sig->params [i]; - MonoClass *pclass = mono_class_from_mono_type (pt); - switch (marshal_types [i]) { - case MONO_MARSHAL_SERIALIZE: { - /* take the value from the serialized array */ - mono_mb_emit_ldloc (mb, loc_array); - mono_mb_emit_icon (mb, j++); - if (pt->byref) { - if (pclass->valuetype) { - mono_mb_emit_byte (mb, CEE_LDELEM_REF); - mono_mb_emit_op (mb, CEE_UNBOX, pclass); - } else { - mono_mb_emit_op (mb, CEE_LDELEMA, pclass); - } - } else { - if (pclass->valuetype) { - mono_mb_emit_byte (mb, CEE_LDELEM_REF); - mono_mb_emit_op (mb, CEE_UNBOX, pclass); - mono_mb_emit_op (mb, CEE_LDOBJ, pclass); - } else { - mono_mb_emit_byte (mb, CEE_LDELEM_REF); - if (pclass != mono_defaults.object_class) { - mono_mb_emit_op (mb, CEE_CASTCLASS, pclass); - } - } - } - break; - } - case MONO_MARSHAL_COPY_OUT: { - /* Keep a local copy of the value since we need to copy it back after the call */ - int copy_local = mono_mb_add_local (mb, &(pclass->byval_arg)); - mono_mb_emit_ldarg (mb, param_index++); - mono_marshal_emit_xdomain_copy_value (mb, pclass); - mono_mb_emit_byte (mb, CEE_DUP); - mono_mb_emit_stloc (mb, copy_local); - break; - } - case MONO_MARSHAL_COPY: { - mono_mb_emit_ldarg (mb, param_index); - if (pt->byref) { - mono_mb_emit_byte (mb, CEE_DUP); - mono_mb_emit_byte (mb, CEE_DUP); - mono_mb_emit_byte (mb, CEE_LDIND_REF); - mono_marshal_emit_xdomain_copy_value (mb, pclass); - mono_mb_emit_byte (mb, CEE_STIND_REF); - } else { - mono_marshal_emit_xdomain_copy_value (mb, pclass); - } - param_index++; - break; - } - case MONO_MARSHAL_NONE: - mono_mb_emit_ldarg (mb, param_index++); - break; - } - } - - /* Make the call to the real object */ - - emit_thread_force_interrupt_checkpoint (mb); - - mono_mb_emit_op (mb, CEE_CALLVIRT, method); - - if (sig->ret->type != MONO_TYPE_VOID) - mono_mb_emit_stloc (mb, loc_return); - - /* copy back MONO_MARSHAL_COPY_OUT parameters */ - - j = 0; - param_index = 3; - for (i = 0; i < sig->param_count; i++) { - if (marshal_types [i] == MONO_MARSHAL_SERIALIZE) continue; - if (marshal_types [i] == MONO_MARSHAL_COPY_OUT) { - mono_mb_emit_ldloc (mb, copy_locals_base + (j++)); - mono_mb_emit_ldarg (mb, param_index); - mono_marshal_emit_xdomain_copy_out_value (mb, mono_class_from_mono_type (sig->params [i])); - } - param_index++; - } - - /* Serialize the return values */ - - if (complex_out_count > 0) { - /* Reset parameters in the array that don't need to be serialized back */ - j = 0; - for (i = 0; i < sig->param_count; i++) { - if (marshal_types[i] != MONO_MARSHAL_SERIALIZE) continue; - if (!sig->params [i]->byref) { - mono_mb_emit_ldloc (mb, loc_array); - mono_mb_emit_icon (mb, j); - mono_mb_emit_byte (mb, CEE_LDNULL); - mono_mb_emit_byte (mb, CEE_STELEM_REF); - } - j++; - } - - /* Add the return value to the array */ - - if (ret_marshal_type == MONO_MARSHAL_SERIALIZE) { - mono_mb_emit_ldloc (mb, loc_array); - mono_mb_emit_icon (mb, complex_count); /* The array has an additional slot to hold the ret value */ - mono_mb_emit_ldloc (mb, loc_return); - - g_assert (ret_class); /*FIXME properly fail here*/ - if (ret_class->valuetype) { - mono_mb_emit_op (mb, CEE_BOX, ret_class); - } - mono_mb_emit_byte (mb, CEE_STELEM_REF); - } - - /* Serialize */ - - mono_mb_emit_ldarg (mb, 1); - mono_mb_emit_ldloc (mb, loc_array); - mono_mb_emit_managed_call (mb, method_rs_serialize, NULL); - mono_mb_emit_byte (mb, CEE_STIND_REF); - } else if (ret_marshal_type == MONO_MARSHAL_SERIALIZE) { - mono_mb_emit_ldarg (mb, 1); - mono_mb_emit_ldloc (mb, loc_return); - if (ret_class->valuetype) { - mono_mb_emit_op (mb, CEE_BOX, ret_class); - } - mono_mb_emit_managed_call (mb, method_rs_serialize, NULL); - mono_mb_emit_byte (mb, CEE_STIND_REF); - } else { - mono_mb_emit_ldarg (mb, 1); - mono_mb_emit_byte (mb, CEE_LDNULL); - mono_mb_emit_managed_call (mb, method_rs_serialize, NULL); - mono_mb_emit_byte (mb, CEE_STIND_REF); - } - - mono_mb_emit_ldarg (mb, 2); - mono_mb_emit_byte (mb, CEE_LDNULL); - mono_mb_emit_byte (mb, CEE_STIND_REF); - pos_leave = mono_mb_emit_branch (mb, CEE_LEAVE); - - /* Main exception catch */ - main_clause->flags = MONO_EXCEPTION_CLAUSE_NONE; - main_clause->try_len = mono_mb_get_pos (mb) - main_clause->try_offset; - main_clause->data.catch_class = mono_defaults.object_class; - - /* handler code */ - main_clause->handler_offset = mono_mb_get_label (mb); - mono_mb_emit_managed_call (mb, method_rs_serialize_exc, NULL); - mono_mb_emit_stloc (mb, loc_serialized_exc); - mono_mb_emit_ldarg (mb, 2); - mono_mb_emit_ldloc (mb, loc_serialized_exc); - mono_mb_emit_byte (mb, CEE_STIND_REF); - mono_mb_emit_branch (mb, CEE_LEAVE); - main_clause->handler_len = mono_mb_get_pos (mb) - main_clause->handler_offset; - /* end catch */ - - mono_mb_patch_branch (mb, pos_leave); - - if (copy_return) - mono_mb_emit_ldloc (mb, loc_return); - - mono_mb_emit_byte (mb, CEE_RET); - - mono_mb_set_clauses (mb, 1, main_clause); -#endif - - res = mono_remoting_mb_create_and_cache (method, mb, csig, csig->param_count + 16); - mono_mb_free (mb); - - return res; -} - -/* mono_marshal_get_xappdomain_invoke () - * Generates a fast remoting wrapper for cross app domain calls. - */ -MonoMethod * -mono_marshal_get_xappdomain_invoke (MonoMethod *method) -{ - MonoMethodSignature *sig; - MonoMethodBuilder *mb; - MonoMethod *res; - int i, j, complex_count, complex_out_count, copy_locals_base; - int *marshal_types; - MonoClass *ret_class = NULL; - MonoMethod *xdomain_method; - int ret_marshal_type = MONO_MARSHAL_NONE; - int loc_array=0, loc_serialized_data=-1, loc_real_proxy; - int loc_old_domainid, loc_domainid, loc_return=0, loc_serialized_exc=0, loc_context; - int pos, pos_dispatch, pos_noex; - gboolean copy_return = FALSE; - - g_assert (method); - - if (method->wrapper_type == MONO_WRAPPER_REMOTING_INVOKE || method->wrapper_type == MONO_WRAPPER_XDOMAIN_INVOKE) - return method; - - /* we cant remote methods without this pointer */ - if (!mono_method_signature (method)->hasthis) - return method; - - if (!mono_marshal_supports_fast_xdomain (method)) - return mono_marshal_get_remoting_invoke (method); - - mono_remoting_marshal_init (); - - if ((res = mono_marshal_remoting_find_in_cache (method, MONO_WRAPPER_XDOMAIN_INVOKE))) - return res; - - sig = mono_signature_no_pinvoke (method); - - mb = mono_mb_new (method->klass, method->name, MONO_WRAPPER_XDOMAIN_INVOKE); - mb->method->save_lmf = 1; - - /* Count the number of parameters that need to be serialized */ - - marshal_types = alloca (sizeof (int) * sig->param_count); - complex_count = complex_out_count = 0; - for (i = 0; i < sig->param_count; i++) { - MonoType *ptype = sig->params[i]; - int mt = mono_get_xdomain_marshal_type (ptype); - - /* If the [Out] attribute is applied to a parameter that can be internally copied, - * the copy will be made by reusing the original object instance - */ - if ((ptype->attrs & PARAM_ATTRIBUTE_OUT) != 0 && mt == MONO_MARSHAL_COPY && !ptype->byref) - mt = MONO_MARSHAL_COPY_OUT; - else if (mt == MONO_MARSHAL_SERIALIZE) { - complex_count++; - if (ptype->byref) complex_out_count++; - } - marshal_types [i] = mt; - } - - if (sig->ret->type != MONO_TYPE_VOID) { - ret_marshal_type = mono_get_xdomain_marshal_type (sig->ret); - ret_class = mono_class_from_mono_type (sig->ret); - copy_return = ret_marshal_type != MONO_MARSHAL_SERIALIZE; - } - - /* Locals */ - -#ifndef DISABLE_JIT - if (complex_count > 0) - loc_array = mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg); - loc_serialized_data = mono_mb_add_local (mb, &byte_array_class->byval_arg); - loc_real_proxy = mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg); - if (copy_return) - loc_return = mono_mb_add_local (mb, sig->ret); - loc_old_domainid = mono_mb_add_local (mb, &mono_defaults.int32_class->byval_arg); - loc_domainid = mono_mb_add_local (mb, &mono_defaults.int32_class->byval_arg); - loc_serialized_exc = mono_mb_add_local (mb, &byte_array_class->byval_arg); - loc_context = mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg); - - /* Save thread domain data */ - - mono_mb_emit_icall (mb, mono_context_get); - mono_mb_emit_byte (mb, CEE_DUP); - mono_mb_emit_stloc (mb, loc_context); - - /* If the thread is not running in the default context, it needs to go - * through the whole remoting sink, since the context is going to change - */ - mono_mb_emit_managed_call (mb, method_needs_context_sink, NULL); - pos = mono_mb_emit_short_branch (mb, CEE_BRTRUE_S); - - /* Another case in which the fast path can't be used: when the target domain - * has a different image for the same assembly. - */ - - /* Get the target domain id */ - - mono_mb_emit_ldarg (mb, 0); - mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoTransparentProxy, rp)); - mono_mb_emit_byte (mb, CEE_LDIND_REF); - mono_mb_emit_byte (mb, CEE_DUP); - mono_mb_emit_stloc (mb, loc_real_proxy); - - mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoRealProxy, target_domain_id)); - mono_mb_emit_byte (mb, CEE_LDIND_I4); - mono_mb_emit_stloc (mb, loc_domainid); - - /* Check if the target domain has the same image for the required assembly */ - - mono_mb_emit_ldloc (mb, loc_domainid); - mono_mb_emit_ptr (mb, method->klass->image); - mono_mb_emit_icall (mb, mono_marshal_check_domain_image); - pos_dispatch = mono_mb_emit_short_branch (mb, CEE_BRTRUE_S); - - /* Use the whole remoting sink to dispatch this message */ - - mono_mb_patch_short_branch (mb, pos); - - mono_mb_emit_ldarg (mb, 0); - for (i = 0; i < sig->param_count; i++) - mono_mb_emit_ldarg (mb, i + 1); - - mono_mb_emit_managed_call (mb, mono_marshal_get_remoting_invoke (method), NULL); - mono_mb_emit_byte (mb, CEE_RET); - mono_mb_patch_short_branch (mb, pos_dispatch); - - /* Create the array that will hold the parameters to be serialized */ - - if (complex_count > 0) { - mono_mb_emit_icon (mb, (ret_marshal_type == MONO_MARSHAL_SERIALIZE && complex_out_count > 0) ? complex_count + 1 : complex_count); /* +1 for the return type */ - mono_mb_emit_op (mb, CEE_NEWARR, mono_defaults.object_class); - - j = 0; - for (i = 0; i < sig->param_count; i++) { - MonoClass *pclass; - if (marshal_types [i] != MONO_MARSHAL_SERIALIZE) continue; - pclass = mono_class_from_mono_type (sig->params[i]); - mono_mb_emit_byte (mb, CEE_DUP); - mono_mb_emit_icon (mb, j); - mono_mb_emit_ldarg (mb, i + 1); /* 0=this */ - if (sig->params[i]->byref) { - if (pclass->valuetype) - mono_mb_emit_op (mb, CEE_LDOBJ, pclass); - else - mono_mb_emit_byte (mb, CEE_LDIND_REF); - } - if (pclass->valuetype) - mono_mb_emit_op (mb, CEE_BOX, pclass); - mono_mb_emit_byte (mb, CEE_STELEM_REF); - j++; - } - mono_mb_emit_stloc (mb, loc_array); - - /* Serialize parameters */ - - mono_mb_emit_ldloc (mb, loc_array); - mono_mb_emit_managed_call (mb, method_rs_serialize, NULL); - mono_mb_emit_stloc (mb, loc_serialized_data); - } else { - mono_mb_emit_byte (mb, CEE_LDNULL); - mono_mb_emit_managed_call (mb, method_rs_serialize, NULL); - mono_mb_emit_stloc (mb, loc_serialized_data); - } - - /* switch domain */ - - mono_mb_emit_ldloc (mb, loc_domainid); - mono_mb_emit_byte (mb, CEE_LDC_I4_1); - mono_marshal_emit_switch_domain (mb); - mono_mb_emit_stloc (mb, loc_old_domainid); - - /* Load the arguments */ - - mono_mb_emit_ldloc (mb, loc_real_proxy); - mono_mb_emit_ldloc_addr (mb, loc_serialized_data); - mono_mb_emit_ldloc_addr (mb, loc_serialized_exc); - - copy_locals_base = mb->locals; - for (i = 0; i < sig->param_count; i++) { - switch (marshal_types [i]) { - case MONO_MARSHAL_SERIALIZE: - continue; - case MONO_MARSHAL_COPY: { - mono_mb_emit_ldarg (mb, i+1); - if (sig->params [i]->byref) { - /* make a local copy of the byref parameter. The real parameter - * will be updated after the xdomain call - */ - MonoClass *pclass = mono_class_from_mono_type (sig->params [i]); - int copy_local = mono_mb_add_local (mb, &(pclass->byval_arg)); - mono_mb_emit_byte (mb, CEE_LDIND_REF); - mono_mb_emit_stloc (mb, copy_local); - mono_mb_emit_ldloc_addr (mb, copy_local); - } - break; - } - case MONO_MARSHAL_COPY_OUT: - case MONO_MARSHAL_NONE: - mono_mb_emit_ldarg (mb, i+1); - break; - } - } - - /* Make the call to the invoke wrapper in the target domain */ - - xdomain_method = mono_marshal_get_xappdomain_dispatch (method, marshal_types, complex_count, complex_out_count, ret_marshal_type); - mono_marshal_emit_load_domain_method (mb, xdomain_method); - mono_mb_emit_calli (mb, mono_method_signature (xdomain_method)); - - if (copy_return) - mono_mb_emit_stloc (mb, loc_return); - - /* Switch domain */ - - mono_mb_emit_ldloc (mb, loc_old_domainid); - mono_mb_emit_byte (mb, CEE_LDC_I4_0); - mono_marshal_emit_switch_domain (mb); - mono_mb_emit_byte (mb, CEE_POP); - - /* Restore thread domain data */ - - mono_mb_emit_ldloc (mb, loc_context); - mono_mb_emit_icall (mb, mono_context_set); - - /* if (loc_serialized_exc != null) ... */ - - mono_mb_emit_ldloc (mb, loc_serialized_exc); - pos_noex = mono_mb_emit_short_branch (mb, CEE_BRFALSE_S); - - mono_mb_emit_ldloc (mb, loc_serialized_exc); - mono_marshal_emit_xdomain_copy_value (mb, byte_array_class); - mono_mb_emit_managed_call (mb, method_rs_deserialize, NULL); - mono_mb_emit_op (mb, CEE_CASTCLASS, mono_defaults.exception_class); - mono_mb_emit_managed_call (mb, method_exc_fixexc, NULL); - mono_mb_emit_byte (mb, CEE_THROW); - mono_mb_patch_short_branch (mb, pos_noex); - - /* copy back non-serialized output parameters */ - - j = 0; - for (i = 0; i < sig->param_count; i++) { - if (!sig->params [i]->byref || marshal_types [i] != MONO_MARSHAL_COPY) continue; - mono_mb_emit_ldarg (mb, i + 1); - mono_mb_emit_ldloc (mb, copy_locals_base + (j++)); - mono_marshal_emit_xdomain_copy_value (mb, mono_class_from_mono_type (sig->params [i])); - mono_mb_emit_byte (mb, CEE_STIND_REF); + /* else [target == null] call this->method_ptr static */ + mono_mb_patch_branch (mb, pos0); } - /* Deserialize out parameters */ - - if (complex_out_count > 0) { - mono_mb_emit_ldloc (mb, loc_serialized_data); - mono_marshal_emit_xdomain_copy_value (mb, byte_array_class); - mono_mb_emit_managed_call (mb, method_rs_deserialize, NULL); - mono_mb_emit_stloc (mb, loc_array); - - /* Copy back output parameters and return type */ - - j = 0; - for (i = 0; i < sig->param_count; i++) { - if (marshal_types [i] != MONO_MARSHAL_SERIALIZE) continue; - if (sig->params[i]->byref) { - MonoClass *pclass = mono_class_from_mono_type (sig->params [i]); + if (callvirt) { + if (!closed_over_null) { + mono_mb_emit_ldarg (mb, 1); + mono_mb_emit_op (mb, CEE_CASTCLASS, target_class); + for (i = 1; i < sig->param_count; ++i) mono_mb_emit_ldarg (mb, i + 1); - mono_mb_emit_ldloc (mb, loc_array); - mono_mb_emit_icon (mb, j); - mono_mb_emit_byte (mb, CEE_LDELEM_REF); - if (pclass->valuetype) { - mono_mb_emit_op (mb, CEE_UNBOX, pclass); - mono_mb_emit_op (mb, CEE_LDOBJ, pclass); - mono_mb_emit_op (mb, CEE_STOBJ, pclass); - } else { - if (pclass != mono_defaults.object_class) - mono_mb_emit_op (mb, CEE_CASTCLASS, pclass); - mono_mb_emit_byte (mb, CEE_STIND_REF); - } - } - j++; - } - - if (ret_marshal_type == MONO_MARSHAL_SERIALIZE) { - mono_mb_emit_ldloc (mb, loc_array); - mono_mb_emit_icon (mb, complex_count); - mono_mb_emit_byte (mb, CEE_LDELEM_REF); - if (ret_class->valuetype) { - mono_mb_emit_op (mb, CEE_UNBOX, ret_class); - mono_mb_emit_op (mb, CEE_LDOBJ, ret_class); - } - } - } else if (ret_marshal_type == MONO_MARSHAL_SERIALIZE) { - mono_mb_emit_ldloc (mb, loc_serialized_data); - mono_marshal_emit_xdomain_copy_value (mb, byte_array_class); - mono_mb_emit_managed_call (mb, method_rs_deserialize, NULL); - if (ret_class->valuetype) { - mono_mb_emit_op (mb, CEE_UNBOX, ret_class); - mono_mb_emit_op (mb, CEE_LDOBJ, ret_class); - } else if (ret_class != mono_defaults.object_class) { - mono_mb_emit_op (mb, CEE_CASTCLASS, ret_class); + mono_mb_emit_op (mb, CEE_CALLVIRT, target_method); + } else { + mono_mb_emit_byte (mb, CEE_LDNULL); + for (i = 0; i < sig->param_count; ++i) + mono_mb_emit_ldarg (mb, i + 1); + mono_mb_emit_op (mb, CEE_CALL, target_method); } - } else { - mono_mb_emit_ldloc (mb, loc_serialized_data); - mono_mb_emit_byte (mb, CEE_DUP); - pos = mono_mb_emit_short_branch (mb, CEE_BRFALSE_S); - mono_marshal_emit_xdomain_copy_value (mb, byte_array_class); - - mono_mb_patch_short_branch (mb, pos); - mono_mb_emit_managed_call (mb, method_rs_deserialize, NULL); - mono_mb_emit_byte (mb, CEE_POP); - } - - if (copy_return) { - mono_mb_emit_ldloc (mb, loc_return); - if (ret_marshal_type == MONO_MARSHAL_COPY) - mono_marshal_emit_xdomain_copy_value (mb, ret_class); - } - - mono_mb_emit_byte (mb, CEE_RET); -#endif /* DISABLE_JIT */ - - res = mono_remoting_mb_create_and_cache (method, mb, sig, sig->param_count + 16); - mono_mb_free (mb); - - return res; -} - -MonoMethod * -mono_marshal_get_remoting_invoke_for_target (MonoMethod *method, MonoRemotingTarget target_type) -{ - if (target_type == MONO_REMOTING_TARGET_APPDOMAIN) { - return mono_marshal_get_xappdomain_invoke (method); - } else if (target_type == MONO_REMOTING_TARGET_COMINTEROP) { -#ifndef DISABLE_COM - return mono_cominterop_get_invoke (method); -#else - g_assert_not_reached (); -#endif - } else { - return mono_marshal_get_remoting_invoke (method); - } - /* Not erached */ - return NULL; -} - -G_GNUC_UNUSED static gpointer -mono_marshal_load_remoting_wrapper (MonoRealProxy *rp, MonoMethod *method) -{ - if (rp->target_domain_id != -1) - return mono_compile_method (mono_marshal_get_xappdomain_invoke (method)); - else - return mono_compile_method (mono_marshal_get_remoting_invoke (method)); -} - -MonoMethod * -mono_marshal_get_remoting_invoke_with_check (MonoMethod *method) -{ - MonoMethodSignature *sig; - MonoMethodBuilder *mb; - MonoMethod *res, *native; - int i, pos, pos_rem; - - g_assert (method); - - if (method->wrapper_type == MONO_WRAPPER_REMOTING_INVOKE_WITH_CHECK) - return method; - - /* we cant remote methods without this pointer */ - g_assert (mono_method_signature (method)->hasthis); - - if ((res = mono_marshal_remoting_find_in_cache (method, MONO_WRAPPER_REMOTING_INVOKE_WITH_CHECK))) - return res; - - sig = mono_signature_no_pinvoke (method); - - mb = mono_mb_new (method->klass, method->name, MONO_WRAPPER_REMOTING_INVOKE_WITH_CHECK); - -#ifndef DISABLE_JIT - for (i = 0; i <= sig->param_count; i++) - mono_mb_emit_ldarg (mb, i); - - mono_mb_emit_ldarg (mb, 0); - pos = mono_mb_emit_proxy_check (mb, CEE_BNE_UN); - - if (mono_marshal_supports_fast_xdomain (method)) { - mono_mb_emit_ldarg (mb, 0); - pos_rem = mono_mb_emit_xdomain_check (mb, CEE_BEQ); - - /* wrapper for cross app domain calls */ - native = mono_marshal_get_xappdomain_invoke (method); - mono_mb_emit_managed_call (mb, native, mono_method_signature (native)); - mono_mb_emit_byte (mb, CEE_RET); - - mono_mb_patch_branch (mb, pos_rem); - } - /* wrapper for normal remote calls */ - native = mono_marshal_get_remoting_invoke (method); - mono_mb_emit_managed_call (mb, native, mono_method_signature (native)); - mono_mb_emit_byte (mb, CEE_RET); - - /* not a proxy */ - mono_mb_patch_branch (mb, pos); - mono_mb_emit_managed_call (mb, method, mono_method_signature (method)); - mono_mb_emit_byte (mb, CEE_RET); -#endif - - res = mono_remoting_mb_create_and_cache (method, mb, sig, sig->param_count + 16); - mono_mb_free (mb); - - return res; -} - -#endif /* DISABLE_REMOTING */ - -typedef struct -{ - MonoMethodSignature *sig; - MonoMethod *method; -} SignatureMethodPair; - -static guint -signature_method_pair_hash (gconstpointer data) -{ - SignatureMethodPair *pair = (SignatureMethodPair*)data; - - return mono_signature_hash (pair->sig) ^ mono_aligned_addr_hash (pair->method); -} - -static gboolean -signature_method_pair_equal (SignatureMethodPair *pair1, SignatureMethodPair *pair2) -{ - return mono_metadata_signature_equal (pair1->sig, pair2->sig) && (pair1->method == pair2->method); -} - -static gboolean -signature_method_pair_matches_method (gpointer key, gpointer value, gpointer user_data) -{ - SignatureMethodPair *pair = (SignatureMethodPair*)key; - MonoMethod *method = (MonoMethod*)user_data; - - return pair->method == method; -} - -static void -free_signature_method_pair (SignatureMethodPair *pair) -{ - g_free (pair); -} - -static MonoMethod * -mono_marshal_get_delegate_invoke_internal (MonoMethod *method, gboolean callvirt, gboolean static_method_with_first_arg_bound, MonoMethod *target_method) -{ - MonoMethodSignature *sig, *static_sig, *invoke_sig; - int i; - MonoMethodBuilder *mb; - MonoMethod *res; - GHashTable *cache; - gpointer cache_key = NULL; - SignatureMethodPair key; - SignatureMethodPair *new_key; - int local_prev, local_target; - int pos0; - char *name; - MonoClass *target_class = NULL; - gboolean closed_over_null = FALSE; - MonoGenericContext *ctx = NULL; - MonoGenericContainer *container = NULL; - MonoMethod *orig_method = NULL; - WrapperInfo *info; - WrapperSubtype subtype = WRAPPER_SUBTYPE_NONE; - gboolean found; - - g_assert (method && method->klass->parent == mono_defaults.multicastdelegate_class && - !strcmp (method->name, "Invoke")); - - invoke_sig = sig = mono_signature_no_pinvoke (method); - - /* - * If the delegate target is null, and the target method is not static, a virtual - * call is made to that method with the first delegate argument as this. This is - * a non-documented .NET feature. - */ - if (callvirt) { - subtype = WRAPPER_SUBTYPE_DELEGATE_INVOKE_VIRTUAL; - if (target_method->is_inflated) { - MonoType *target_type; - - g_assert (method->signature->hasthis); - target_type = mono_class_inflate_generic_type (method->signature->params [0], - mono_method_get_context (method)); - target_class = mono_class_from_mono_type (target_type); - } else { - target_class = target_method->klass; - } - - closed_over_null = sig->param_count == mono_method_signature (target_method)->param_count; - } - - if (static_method_with_first_arg_bound) { - subtype = WRAPPER_SUBTYPE_DELEGATE_INVOKE_BOUND; - g_assert (!callvirt); - invoke_sig = mono_method_signature (target_method); - } - - /* - * For generic delegates, create a generic wrapper, and return an instance to help AOT. - */ - if (method->is_inflated && subtype == WRAPPER_SUBTYPE_NONE) { - orig_method = method; - ctx = &((MonoMethodInflated*)method)->context; - method = ((MonoMethodInflated*)method)->declaring; - - container = mono_method_get_generic_container (method); - if (!container) - container = method->klass->generic_container; - g_assert (container); - - invoke_sig = sig = mono_signature_no_pinvoke (method); - } - - /* - * Check cache - */ - if (ctx) { - cache = get_cache (&method->klass->image->delegate_invoke_generic_cache, mono_aligned_addr_hash, NULL); - res = check_generic_delegate_wrapper_cache (cache, orig_method, method, ctx); - if (res) - return res; - cache_key = method->klass; - } else if (static_method_with_first_arg_bound) { - cache = get_cache (&method->klass->image->delegate_bound_static_invoke_cache, - (GHashFunc)mono_signature_hash, - (GCompareFunc)mono_metadata_signature_equal); - /* - * The wrapper is based on sig+invoke_sig, but sig can be derived from invoke_sig. - */ - res = mono_marshal_find_in_cache (cache, invoke_sig); - if (res) - return res; - cache_key = invoke_sig; - } else if (callvirt) { - GHashTable **cache_ptr; - - cache_ptr = &method->klass->image->delegate_abstract_invoke_cache; - - /* We need to cache the signature+method pair */ - mono_marshal_lock (); - if (!*cache_ptr) - *cache_ptr = g_hash_table_new_full (signature_method_pair_hash, (GEqualFunc)signature_method_pair_equal, (GDestroyNotify)free_signature_method_pair, NULL); - cache = *cache_ptr; - key.sig = invoke_sig; - key.method = target_method; - res = g_hash_table_lookup (cache, &key); - mono_marshal_unlock (); - if (res) - return res; - } else { - cache = get_cache (&method->klass->image->delegate_invoke_cache, - (GHashFunc)mono_signature_hash, - (GCompareFunc)mono_metadata_signature_equal); - res = mono_marshal_find_in_cache (cache, sig); - if (res) - return res; - cache_key = sig; - } - - static_sig = signature_dup (method->klass->image, sig); - static_sig->hasthis = 0; - if (!static_method_with_first_arg_bound) - invoke_sig = static_sig; - - if (static_method_with_first_arg_bound) - name = mono_signature_to_name (invoke_sig, "invoke_bound"); - else if (closed_over_null) - name = mono_signature_to_name (invoke_sig, "invoke_closed_over_null"); - else if (callvirt) - name = mono_signature_to_name (invoke_sig, "invoke_callvirt"); - else - name = mono_signature_to_name (invoke_sig, "invoke"); - if (ctx) - mb = mono_mb_new (method->klass, name, MONO_WRAPPER_DELEGATE_INVOKE); - else - mb = mono_mb_new (get_wrapper_target_class (method->klass->image), name, MONO_WRAPPER_DELEGATE_INVOKE); - g_free (name); - -#ifndef DISABLE_JIT - /* allocate local 0 (object) */ - local_target = mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg); - local_prev = mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg); - - g_assert (sig->hasthis); - - /* - * if (prev != null) - * prev.Invoke( args .. ); - * return this.( args .. ); - */ - - /* this wrapper can be used in unmanaged-managed transitions */ - emit_thread_interrupt_checkpoint (mb); - - /* get this->prev */ - mono_mb_emit_ldarg (mb, 0); - mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoMulticastDelegate, prev)); - mono_mb_emit_byte (mb, CEE_LDIND_REF); - mono_mb_emit_stloc (mb, local_prev); - mono_mb_emit_ldloc (mb, local_prev); - - /* if prev != null */ - pos0 = mono_mb_emit_branch (mb, CEE_BRFALSE); - - /* then recurse */ - - mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX); - mono_mb_emit_byte (mb, CEE_MONO_NOT_TAKEN); - - mono_mb_emit_ldloc (mb, local_prev); - for (i = 0; i < sig->param_count; i++) - mono_mb_emit_ldarg (mb, i + 1); - if (ctx) - mono_mb_emit_op (mb, CEE_CALLVIRT, mono_class_inflate_generic_method (method, &container->context)); - else - mono_mb_emit_op (mb, CEE_CALLVIRT, method); - if (sig->ret->type != MONO_TYPE_VOID) - mono_mb_emit_byte (mb, CEE_POP); - - /* continued or prev == null */ - mono_mb_patch_branch (mb, pos0); - - /* get this->target */ - mono_mb_emit_ldarg (mb, 0); - mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoDelegate, target)); - mono_mb_emit_byte (mb, CEE_LDIND_REF); - mono_mb_emit_stloc (mb, local_target); - - /*static methods with bound first arg can have null target and still be bound*/ - if (!static_method_with_first_arg_bound) { - /* if target != null */ - mono_mb_emit_ldloc (mb, local_target); - pos0 = mono_mb_emit_branch (mb, CEE_BRFALSE); - - /* then call this->method_ptr nonstatic */ - if (callvirt) { - // FIXME: - mono_mb_emit_exception_full (mb, "System", "NotImplementedException", ""); - } else { - mono_mb_emit_ldloc (mb, local_target); - for (i = 0; i < sig->param_count; ++i) - mono_mb_emit_ldarg (mb, i + 1); - mono_mb_emit_ldarg (mb, 0); - mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoDelegate, method_ptr)); - mono_mb_emit_byte (mb, CEE_LDIND_I ); - mono_mb_emit_op (mb, CEE_CALLI, sig); - - mono_mb_emit_byte (mb, CEE_RET); - } - - /* else [target == null] call this->method_ptr static */ - mono_mb_patch_branch (mb, pos0); - } - - if (callvirt) { - if (!closed_over_null) { - mono_mb_emit_ldarg (mb, 1); - mono_mb_emit_op (mb, CEE_CASTCLASS, target_class); - for (i = 1; i < sig->param_count; ++i) - mono_mb_emit_ldarg (mb, i + 1); - mono_mb_emit_op (mb, CEE_CALLVIRT, target_method); - } else { - mono_mb_emit_byte (mb, CEE_LDNULL); - for (i = 0; i < sig->param_count; ++i) - mono_mb_emit_ldarg (mb, i + 1); - mono_mb_emit_op (mb, CEE_CALL, target_method); - } - } else { - if (static_method_with_first_arg_bound) { - mono_mb_emit_ldloc (mb, local_target); - if (!MONO_TYPE_IS_REFERENCE (invoke_sig->params[0])) - mono_mb_emit_op (mb, CEE_UNBOX_ANY, mono_class_from_mono_type (invoke_sig->params[0])); - } - for (i = 0; i < sig->param_count; ++i) - mono_mb_emit_ldarg (mb, i + 1); - mono_mb_emit_ldarg (mb, 0); - mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoDelegate, method_ptr)); - mono_mb_emit_byte (mb, CEE_LDIND_I ); - mono_mb_emit_op (mb, CEE_CALLI, invoke_sig); - } - - mono_mb_emit_byte (mb, CEE_RET); - - mb->skip_visibility = 1; -#endif /* DISABLE_JIT */ - - if (ctx) { - MonoMethod *def; - - def = mono_mb_create_and_cache (cache, cache_key, mb, sig, sig->param_count + 16); - res = cache_generic_delegate_wrapper (cache, orig_method, def, ctx); - } else if (callvirt) { - new_key = g_new0 (SignatureMethodPair, 1); - *new_key = key; - - info = mono_wrapper_info_create (mb, subtype); - - res = mono_mb_create_and_cache_full (cache, new_key, mb, sig, sig->param_count + 16, info, &found); - if (found) - g_free (new_key); - } else { - info = mono_wrapper_info_create (mb, subtype); - - res = mono_mb_create_and_cache_full (cache, cache_key, mb, sig, sig->param_count + 16, info, NULL); - } - mono_mb_free (mb); - - return res; -} - -/* - * the returned method invokes all methods in a multicast delegate. - */ -MonoMethod * -mono_marshal_get_delegate_invoke (MonoMethod *method, MonoDelegate *del) -{ - gboolean callvirt = FALSE; - gboolean static_method_with_first_arg_bound = FALSE; - MonoMethod *target_method = NULL; - MonoMethodSignature *sig; - - sig = mono_signature_no_pinvoke (method); - - if (del && !del->target && del->method && mono_method_signature (del->method)->hasthis) { - callvirt = TRUE; - target_method = del->method; - } - - if (del && del->method && mono_method_signature (del->method)->param_count == sig->param_count + 1 && (del->method->flags & METHOD_ATTRIBUTE_STATIC)) { - static_method_with_first_arg_bound = TRUE; - target_method = del->method; - } - - return mono_marshal_get_delegate_invoke_internal (method, callvirt, static_method_with_first_arg_bound, target_method); -} - -/* - * signature_dup_add_this: - * - * Make a copy of @sig, adding an explicit this argument. - */ -static MonoMethodSignature* -signature_dup_add_this (MonoImage *image, MonoMethodSignature *sig, MonoClass *klass) -{ - MonoMethodSignature *res; - int i; - - res = mono_metadata_signature_alloc (image, sig->param_count + 1); - memcpy (res, sig, MONO_SIZEOF_METHOD_SIGNATURE); - res->param_count = sig->param_count + 1; - res->hasthis = FALSE; - for (i = sig->param_count - 1; i >= 0; i --) - res->params [i + 1] = sig->params [i]; - res->params [0] = klass->valuetype ? &klass->this_arg : &klass->byval_arg; - - return res; -} - -typedef struct { - MonoMethodSignature *ctor_sig; - MonoMethodSignature *sig; -} CtorSigPair; - -/* protected by the marshal lock, contains CtorSigPair pointers */ -static GSList *strsig_list = NULL; - -static MonoMethodSignature * -lookup_string_ctor_signature (MonoMethodSignature *sig) -{ - MonoMethodSignature *callsig; - CtorSigPair *cs; - GSList *item; - - mono_marshal_lock (); - callsig = NULL; - for (item = strsig_list; item; item = item->next) { - cs = item->data; - /* mono_metadata_signature_equal () is safe to call with the marshal lock - * because it is lock-free. - */ - if (mono_metadata_signature_equal (sig, cs->ctor_sig)) { - callsig = cs->sig; - break; - } - } - mono_marshal_unlock (); - return callsig; -} - -static MonoMethodSignature * -add_string_ctor_signature (MonoMethod *method) -{ - MonoMethodSignature *callsig; - CtorSigPair *cs; - - callsig = signature_dup (method->klass->image, mono_method_signature (method)); - callsig->ret = &mono_defaults.string_class->byval_arg; - cs = g_new (CtorSigPair, 1); - cs->sig = callsig; - cs->ctor_sig = mono_method_signature (method); - - mono_marshal_lock (); - strsig_list = g_slist_prepend (strsig_list, cs); - mono_marshal_unlock (); - return callsig; -} - -/* - * mono_marshal_get_string_ctor_signature: - * - * Return the modified signature used by string ctors (they return the newly created - * string). - */ -MonoMethodSignature* -mono_marshal_get_string_ctor_signature (MonoMethod *method) -{ - MonoMethodSignature *sig = lookup_string_ctor_signature (mono_method_signature (method)); - if (!sig) - sig = add_string_ctor_signature (method); - - return sig; -} - -static MonoType* -get_runtime_invoke_type (MonoType *t, gboolean ret) -{ - if (t->byref) { - if (t->type == MONO_TYPE_GENERICINST && mono_class_is_nullable (mono_class_from_mono_type (t))) - return t; - /* Can't share this with 'I' as that needs another indirection */ - return &mono_defaults.int_class->this_arg; - } - - if (MONO_TYPE_IS_REFERENCE (t)) - return &mono_defaults.object_class->byval_arg; - - if (ret) - /* The result needs to be boxed */ - return t; - -handle_enum: - switch (t->type) { - /* Can't share these as the argument needs to be loaded using sign/zero extension */ - /* - case MONO_TYPE_U1: - return &mono_defaults.sbyte_class->byval_arg; - case MONO_TYPE_U2: - return &mono_defaults.int16_class->byval_arg; - case MONO_TYPE_U4: - return &mono_defaults.int32_class->byval_arg; - */ - case MONO_TYPE_U8: - return &mono_defaults.int64_class->byval_arg; - case MONO_TYPE_BOOLEAN: - return &mono_defaults.byte_class->byval_arg; - case MONO_TYPE_CHAR: - return &mono_defaults.uint16_class->byval_arg; - case MONO_TYPE_U: - case MONO_TYPE_PTR: - return &mono_defaults.int_class->byval_arg; - case MONO_TYPE_VALUETYPE: - if (t->data.klass->enumtype) { - t = mono_class_enum_basetype (t->data.klass); - goto handle_enum; - } - return t; - default: - return t; - } -} - -/* - * mono_marshal_get_runtime_invoke_sig: - * - * Return a common signature used for sharing runtime invoke wrappers. - */ -static MonoMethodSignature* -mono_marshal_get_runtime_invoke_sig (MonoMethodSignature *sig) -{ - MonoMethodSignature *res = mono_metadata_signature_dup (sig); - int i; - - res->generic_param_count = 0; - res->ret = get_runtime_invoke_type (sig->ret, TRUE); - for (i = 0; i < res->param_count; ++i) - res->params [i] = get_runtime_invoke_type (sig->params [i], FALSE); - - return res; -} - -static gboolean -runtime_invoke_signature_equal (MonoMethodSignature *sig1, MonoMethodSignature *sig2) -{ - /* Can't share wrappers which return a vtype since it needs to be boxed */ - if (sig1->ret != sig2->ret && !(MONO_TYPE_IS_REFERENCE (sig1->ret) && MONO_TYPE_IS_REFERENCE (sig2->ret)) && !mono_metadata_type_equal (sig1->ret, sig2->ret)) - return FALSE; - else - return mono_metadata_signature_equal (sig1, sig2); -} - -#ifndef DISABLE_JIT - -/* - * emit_invoke_call: - * - * Emit the call to the wrapper method from a runtime invoke wrapper. - */ -static void -emit_invoke_call (MonoMethodBuilder *mb, MonoMethod *method, - MonoMethodSignature *sig, MonoMethodSignature *callsig, - int loc_res, - gboolean virtual, gboolean need_direct_wrapper) -{ - static MonoString *string_dummy = NULL; - int i; - int *tmp_nullable_locals; - gboolean void_ret = FALSE; - - /* to make it work with our special string constructors */ - if (!string_dummy) { - MONO_GC_REGISTER_ROOT_SINGLE (string_dummy); - string_dummy = mono_string_new_wrapper ("dummy"); - } - - if (virtual) { - g_assert (sig->hasthis); - g_assert (method->flags & METHOD_ATTRIBUTE_VIRTUAL); - } - - if (sig->hasthis) { - if (method->string_ctor) { - if (mono_gc_is_moving ()) { - mono_mb_emit_ptr (mb, &string_dummy); - mono_mb_emit_byte (mb, CEE_LDIND_REF); - } else { - mono_mb_emit_ptr (mb, string_dummy); - } - } else { - mono_mb_emit_ldarg (mb, 0); - } - } - - tmp_nullable_locals = g_new0 (int, sig->param_count); - - for (i = 0; i < sig->param_count; i++) { - MonoType *t = sig->params [i]; - int type; - - mono_mb_emit_ldarg (mb, 1); - if (i) { - mono_mb_emit_icon (mb, sizeof (gpointer) * i); - mono_mb_emit_byte (mb, CEE_ADD); - } - - if (t->byref) { - mono_mb_emit_byte (mb, CEE_LDIND_I); - /* A Nullable type don't have a boxed form, it's either null or a boxed T. - * So to make this work we unbox it to a local variablee and push a reference to that. - */ - if (t->type == MONO_TYPE_GENERICINST && mono_class_is_nullable (mono_class_from_mono_type (t))) { - tmp_nullable_locals [i] = mono_mb_add_local (mb, &mono_class_from_mono_type (t)->byval_arg); - - mono_mb_emit_op (mb, CEE_UNBOX_ANY, mono_class_from_mono_type (t)); - mono_mb_emit_stloc (mb, tmp_nullable_locals [i]); - mono_mb_emit_ldloc_addr (mb, tmp_nullable_locals [i]); - } - continue; - } - - /*FIXME 'this doesn't handle generic enums. Shouldn't we?*/ - type = sig->params [i]->type; -handle_enum: - switch (type) { - case MONO_TYPE_I1: - case MONO_TYPE_BOOLEAN: - case MONO_TYPE_U1: - case MONO_TYPE_I2: - case MONO_TYPE_U2: - case MONO_TYPE_CHAR: - case MONO_TYPE_I: - case MONO_TYPE_U: - case MONO_TYPE_I4: - case MONO_TYPE_U4: - case MONO_TYPE_R4: - case MONO_TYPE_R8: - case MONO_TYPE_I8: - case MONO_TYPE_U8: - mono_mb_emit_byte (mb, CEE_LDIND_I); - mono_mb_emit_byte (mb, mono_type_to_ldind (sig->params [i])); - break; - case MONO_TYPE_STRING: - case MONO_TYPE_CLASS: - case MONO_TYPE_ARRAY: - case MONO_TYPE_PTR: - case MONO_TYPE_SZARRAY: - case MONO_TYPE_OBJECT: - mono_mb_emit_byte (mb, mono_type_to_ldind (sig->params [i])); - break; - case MONO_TYPE_GENERICINST: - if (!mono_type_generic_inst_is_valuetype (sig->params [i])) { - mono_mb_emit_byte (mb, mono_type_to_ldind (sig->params [i])); - break; - } - - /* fall through */ - case MONO_TYPE_VALUETYPE: - if (type == MONO_TYPE_VALUETYPE && t->data.klass->enumtype) { - type = mono_class_enum_basetype (t->data.klass)->type; - goto handle_enum; - } - mono_mb_emit_byte (mb, CEE_LDIND_I); - if (mono_class_is_nullable (mono_class_from_mono_type (sig->params [i]))) { - /* Need to convert a boxed vtype to an mp to a Nullable struct */ - mono_mb_emit_op (mb, CEE_UNBOX, mono_class_from_mono_type (sig->params [i])); - mono_mb_emit_op (mb, CEE_LDOBJ, mono_class_from_mono_type (sig->params [i])); - } else { - mono_mb_emit_op (mb, CEE_LDOBJ, mono_class_from_mono_type (sig->params [i])); - } - break; - default: - g_assert_not_reached (); - } - } - - if (virtual) { - mono_mb_emit_op (mb, CEE_CALLVIRT, method); - } else if (need_direct_wrapper) { - mono_mb_emit_op (mb, CEE_CALL, method); - } else { - mono_mb_emit_ldarg (mb, 3); - mono_mb_emit_calli (mb, callsig); - } - - if (sig->ret->byref) { - /* fixme: */ - g_assert_not_reached (); - } - - switch (sig->ret->type) { - case MONO_TYPE_VOID: - if (!method->string_ctor) - void_ret = TRUE; - break; - case MONO_TYPE_BOOLEAN: - case MONO_TYPE_CHAR: - case MONO_TYPE_I1: - case MONO_TYPE_U1: - case MONO_TYPE_I2: - case MONO_TYPE_U2: - case MONO_TYPE_I4: - case MONO_TYPE_U4: - case MONO_TYPE_I: - case MONO_TYPE_U: - case MONO_TYPE_R4: - case MONO_TYPE_R8: - case MONO_TYPE_I8: - case MONO_TYPE_U8: - case MONO_TYPE_VALUETYPE: - case MONO_TYPE_TYPEDBYREF: - case MONO_TYPE_GENERICINST: - /* box value types */ - mono_mb_emit_op (mb, CEE_BOX, mono_class_from_mono_type (sig->ret)); - break; - case MONO_TYPE_STRING: - case MONO_TYPE_CLASS: - case MONO_TYPE_ARRAY: - case MONO_TYPE_SZARRAY: - case MONO_TYPE_OBJECT: - /* nothing to do */ - break; - case MONO_TYPE_PTR: - /* The result is an IntPtr */ - mono_mb_emit_op (mb, CEE_BOX, mono_defaults.int_class); - break; - default: - g_assert_not_reached (); - } - - if (!void_ret) - mono_mb_emit_stloc (mb, loc_res); - - /* Convert back nullable-byref arguments */ - for (i = 0; i < sig->param_count; i++) { - MonoType *t = sig->params [i]; - - /* - * Box the result and put it back into the array, the caller will have - * to obtain it from there. - */ - if (t->byref && t->type == MONO_TYPE_GENERICINST && mono_class_is_nullable (mono_class_from_mono_type (t))) { - mono_mb_emit_ldarg (mb, 1); - mono_mb_emit_icon (mb, sizeof (gpointer) * i); - mono_mb_emit_byte (mb, CEE_ADD); - - mono_mb_emit_ldloc (mb, tmp_nullable_locals [i]); - mono_mb_emit_op (mb, CEE_BOX, mono_class_from_mono_type (t)); - - mono_mb_emit_byte (mb, CEE_STIND_REF); - } - } - - g_free (tmp_nullable_locals); -} - -static void -emit_runtime_invoke_body (MonoMethodBuilder *mb, MonoClass *target_klass, MonoMethod *method, - MonoMethodSignature *sig, MonoMethodSignature *callsig, - gboolean virtual, gboolean need_direct_wrapper) -{ - gint32 labels [16]; - MonoExceptionClause *clause; - int loc_res, loc_exc; - - /* The wrapper looks like this: - * - * - * if (exc) { - * try { - * return - * } catch (Exception e) { - * *exc = e; - * } - * } else { - * return - * } - */ - - /* allocate local 0 (object) tmp */ - loc_res = mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg); - /* allocate local 1 (object) exc */ - loc_exc = mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg); - - /* *exc is assumed to be initialized to NULL by the caller */ - - mono_mb_emit_byte (mb, CEE_LDARG_2); - labels [0] = mono_mb_emit_branch (mb, CEE_BRFALSE); - - /* - * if (exc) case - */ - labels [1] = mono_mb_get_label (mb); - emit_thread_force_interrupt_checkpoint (mb); - emit_invoke_call (mb, method, sig, callsig, loc_res, virtual, need_direct_wrapper); - - labels [2] = mono_mb_emit_branch (mb, CEE_LEAVE); - - /* Add a try clause around the call */ - clause = mono_image_alloc0 (target_klass->image, sizeof (MonoExceptionClause)); - clause->flags = MONO_EXCEPTION_CLAUSE_NONE; - clause->data.catch_class = mono_defaults.exception_class; - clause->try_offset = labels [1]; - clause->try_len = mono_mb_get_label (mb) - labels [1]; - - clause->handler_offset = mono_mb_get_label (mb); - - /* handler code */ - mono_mb_emit_stloc (mb, loc_exc); - mono_mb_emit_byte (mb, CEE_LDARG_2); - mono_mb_emit_ldloc (mb, loc_exc); - mono_mb_emit_byte (mb, CEE_STIND_REF); - - mono_mb_emit_branch (mb, CEE_LEAVE); - - clause->handler_len = mono_mb_get_pos (mb) - clause->handler_offset; - - mono_mb_set_clauses (mb, 1, clause); - - mono_mb_patch_branch (mb, labels [2]); - mono_mb_emit_ldloc (mb, loc_res); - mono_mb_emit_byte (mb, CEE_RET); - - /* - * if (!exc) case - */ - mono_mb_patch_branch (mb, labels [0]); - emit_thread_force_interrupt_checkpoint (mb); - emit_invoke_call (mb, method, sig, callsig, loc_res, virtual, need_direct_wrapper); - - mono_mb_emit_ldloc (mb, 0); - mono_mb_emit_byte (mb, CEE_RET); -} -#endif - -/* - * generates IL code for the runtime invoke function - * MonoObject *runtime_invoke (MonoObject *this, void **params, MonoObject **exc, void* method) - * - * we also catch exceptions if exc != null - * If VIRTUAL is TRUE, then METHOD is invoked virtually on THIS. This is useful since - * it means that the compiled code for METHOD does not have to be looked up - * before calling the runtime invoke wrapper. In this case, the wrapper ignores - * its METHOD argument. - */ -MonoMethod * -mono_marshal_get_runtime_invoke (MonoMethod *method, gboolean virtual) -{ - MonoMethodSignature *sig, *csig, *callsig; - MonoMethodBuilder *mb; - GHashTable *cache = NULL; - MonoClass *target_klass; - MonoMethod *res = NULL; - static MonoMethodSignature *cctor_signature = NULL; - static MonoMethodSignature *finalize_signature = NULL; - char *name; - const char *param_names [16]; - gboolean need_direct_wrapper = FALSE; - WrapperInfo *info; - - g_assert (method); - - if (!cctor_signature) { - cctor_signature = mono_metadata_signature_alloc (mono_defaults.corlib, 0); - cctor_signature->ret = &mono_defaults.void_class->byval_arg; - } - if (!finalize_signature) { - finalize_signature = mono_metadata_signature_alloc (mono_defaults.corlib, 0); - finalize_signature->ret = &mono_defaults.void_class->byval_arg; - finalize_signature->hasthis = 1; - } - - if (virtual) - need_direct_wrapper = TRUE; - - /* - * Use a separate cache indexed by methods to speed things up and to avoid the - * boundless mempool growth caused by the signature_dup stuff below. - */ - if (virtual) - cache = get_cache (&method->klass->image->runtime_invoke_vcall_cache, mono_aligned_addr_hash, NULL); - else - cache = get_cache (&method->klass->image->runtime_invoke_direct_cache, mono_aligned_addr_hash, NULL); - res = mono_marshal_find_in_cache (cache, method); - if (res) - return res; - - if (method->klass->rank && (method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) && - (method->iflags & METHOD_IMPL_ATTRIBUTE_NATIVE)) { - /* - * Array Get/Set/Address methods. The JIT implements them using inline code - * so we need to create an invoke wrapper which calls the method directly. - */ - need_direct_wrapper = TRUE; - } - - if (method->string_ctor) { - callsig = lookup_string_ctor_signature (mono_method_signature (method)); - if (!callsig) - callsig = add_string_ctor_signature (method); - /* Can't share this as we push a string as this */ - need_direct_wrapper = TRUE; - } else { - if (method_is_dynamic (method)) - callsig = signature_dup (method->klass->image, mono_method_signature (method)); - else - callsig = mono_method_signature (method); - } - - target_klass = get_wrapper_target_class (method->klass->image); - - /* Try to share wrappers for non-corlib methods with simple signatures */ - if (mono_metadata_signature_equal (callsig, cctor_signature)) { - callsig = cctor_signature; - target_klass = mono_defaults.object_class; - } else if (mono_metadata_signature_equal (callsig, finalize_signature)) { - callsig = finalize_signature; - target_klass = mono_defaults.object_class; - } - - if (need_direct_wrapper) { - /* Already searched at the start */ - } else { - MonoMethodSignature *tmp_sig; - - callsig = mono_marshal_get_runtime_invoke_sig (callsig); - - if (method->klass->valuetype && mono_method_signature (method)->hasthis) - /* These have a different csig */ - cache = get_cache (&target_klass->image->runtime_invoke_vtype_cache, - (GHashFunc)mono_signature_hash, - (GCompareFunc)runtime_invoke_signature_equal); - else - cache = get_cache (&target_klass->image->runtime_invoke_cache, - (GHashFunc)mono_signature_hash, - (GCompareFunc)runtime_invoke_signature_equal); - - /* from mono_marshal_find_in_cache */ - mono_marshal_lock (); - res = g_hash_table_lookup (cache, callsig); - mono_marshal_unlock (); - - if (res) { - g_free (callsig); - return res; - } - - /* Make a copy of the signature from the image mempool */ - tmp_sig = callsig; - callsig = mono_metadata_signature_dup_full (target_klass->image, callsig); - g_free (tmp_sig); - } - - sig = mono_method_signature (method); - - csig = mono_metadata_signature_alloc (target_klass->image, 4); - - csig->ret = &mono_defaults.object_class->byval_arg; - if (method->klass->valuetype && mono_method_signature (method)->hasthis) - csig->params [0] = get_runtime_invoke_type (&method->klass->this_arg, FALSE); - else - csig->params [0] = &mono_defaults.object_class->byval_arg; - csig->params [1] = &mono_defaults.int_class->byval_arg; - csig->params [2] = &mono_defaults.int_class->byval_arg; - csig->params [3] = &mono_defaults.int_class->byval_arg; - csig->pinvoke = 1; -#if TARGET_WIN32 - /* This is called from runtime code so it has to be cdecl */ - csig->call_convention = MONO_CALL_C; -#endif - - name = mono_signature_to_name (callsig, virtual ? "runtime_invoke_virtual" : "runtime_invoke"); - mb = mono_mb_new (target_klass, name, MONO_WRAPPER_RUNTIME_INVOKE); - g_free (name); - -#ifndef DISABLE_JIT - param_names [0] = "this"; - param_names [1] = "params"; - param_names [2] = "exc"; - param_names [3] = "method"; - mono_mb_set_param_names (mb, param_names); - - emit_runtime_invoke_body (mb, target_klass, method, sig, callsig, virtual, need_direct_wrapper); -#endif - - if (need_direct_wrapper) { -#ifndef DISABLE_JIT - mb->skip_visibility = 1; -#endif - info = mono_wrapper_info_create (mb, virtual ? WRAPPER_SUBTYPE_RUNTIME_INVOKE_VIRTUAL : WRAPPER_SUBTYPE_RUNTIME_INVOKE_DIRECT); - info->d.runtime_invoke.method = method; - res = mono_mb_create_and_cache_full (cache, method, mb, csig, sig->param_count + 16, info, NULL); - } else { - /* taken from mono_mb_create_and_cache */ - mono_marshal_lock (); - res = g_hash_table_lookup (cache, callsig); - mono_marshal_unlock (); - - info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_RUNTIME_INVOKE_NORMAL); - info->d.runtime_invoke.sig = callsig; - - /* Somebody may have created it before us */ - if (!res) { - MonoMethod *newm; - newm = mono_mb_create (mb, csig, sig->param_count + 16, info); - - mono_marshal_lock (); - res = g_hash_table_lookup (cache, callsig); - if (!res) { - res = newm; - g_hash_table_insert (cache, callsig, res); - /* Can't insert it into wrapper_hash since the key is a signature */ - g_hash_table_insert (method->klass->image->runtime_invoke_direct_cache, method, res); - } else { - mono_free_method (newm); - } - mono_marshal_unlock (); - } - - /* end mono_mb_create_and_cache */ - } - - mono_mb_free (mb); - - return res; -} - -/* - * mono_marshal_get_runtime_invoke_dynamic: - * - * Return a method which can be used to invoke managed methods from native code - * dynamically. - * The signature of the returned method is given by RuntimeInvokeDynamicFunction: - * void runtime_invoke (void *args, MonoObject **exc, void *compiled_method) - * ARGS should point to an architecture specific structure containing - * the arguments and space for the return value. - * The other arguments are the same as for runtime_invoke (), except that - * ARGS should contain the this argument too. - * This wrapper serves the same purpose as the runtime-invoke wrappers, but there - * is only one copy of it, which is useful in full-aot. - * The wrapper info for the wrapper is a WrapperInfo structure. - */ -MonoMethod* -mono_marshal_get_runtime_invoke_dynamic (void) -{ - static MonoMethod *method; - MonoMethodSignature *csig; - MonoExceptionClause *clause; - MonoMethodBuilder *mb; - int pos, posna; - char *name; - WrapperInfo *info; - - if (method) - return method; - - csig = mono_metadata_signature_alloc (mono_defaults.corlib, 4); - - csig->ret = &mono_defaults.void_class->byval_arg; - csig->params [0] = &mono_defaults.int_class->byval_arg; - csig->params [1] = &mono_defaults.int_class->byval_arg; - csig->params [2] = &mono_defaults.int_class->byval_arg; - csig->params [3] = &mono_defaults.int_class->byval_arg; - - name = g_strdup ("runtime_invoke_dynamic"); - mb = mono_mb_new (mono_defaults.object_class, name, MONO_WRAPPER_RUNTIME_INVOKE); - g_free (name); - -#ifndef DISABLE_JIT - /* allocate local 0 (object) tmp */ - mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg); - /* allocate local 1 (object) exc */ - mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg); - - /* cond set *exc to null */ - mono_mb_emit_byte (mb, CEE_LDARG_1); - mono_mb_emit_byte (mb, CEE_BRFALSE_S); - mono_mb_emit_byte (mb, 3); - mono_mb_emit_byte (mb, CEE_LDARG_1); - mono_mb_emit_byte (mb, CEE_LDNULL); - mono_mb_emit_byte (mb, CEE_STIND_REF); - - emit_thread_force_interrupt_checkpoint (mb); - - mono_mb_emit_byte (mb, CEE_LDARG_0); - mono_mb_emit_byte (mb, CEE_LDARG_2); - mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX); - mono_mb_emit_byte (mb, CEE_MONO_DYN_CALL); - - pos = mono_mb_emit_branch (mb, CEE_LEAVE); - - clause = mono_image_alloc0 (mono_defaults.corlib, sizeof (MonoExceptionClause)); - clause->flags = MONO_EXCEPTION_CLAUSE_FILTER; - clause->try_len = mono_mb_get_label (mb); - - /* filter code */ - clause->data.filter_offset = mono_mb_get_label (mb); - - mono_mb_emit_byte (mb, CEE_POP); - mono_mb_emit_byte (mb, CEE_LDARG_1); - mono_mb_emit_byte (mb, CEE_LDC_I4_0); - mono_mb_emit_byte (mb, CEE_PREFIX1); - mono_mb_emit_byte (mb, CEE_CGT_UN); - mono_mb_emit_byte (mb, CEE_PREFIX1); - mono_mb_emit_byte (mb, CEE_ENDFILTER); - - clause->handler_offset = mono_mb_get_label (mb); - - /* handler code */ - /* store exception */ - mono_mb_emit_stloc (mb, 1); - - mono_mb_emit_byte (mb, CEE_LDARG_1); - mono_mb_emit_ldloc (mb, 1); - mono_mb_emit_byte (mb, CEE_STIND_REF); - - mono_mb_emit_byte (mb, CEE_LDNULL); - mono_mb_emit_stloc (mb, 0); - - /* Check for the abort exception */ - mono_mb_emit_ldloc (mb, 1); - mono_mb_emit_op (mb, CEE_ISINST, mono_defaults.threadabortexception_class); - posna = mono_mb_emit_short_branch (mb, CEE_BRFALSE_S); - - /* Delay the abort exception */ - mono_mb_emit_icall (mb, ves_icall_System_Threading_Thread_ResetAbort); - - mono_mb_patch_short_branch (mb, posna); - mono_mb_emit_branch (mb, CEE_LEAVE); - - clause->handler_len = mono_mb_get_pos (mb) - clause->handler_offset; - - mono_mb_set_clauses (mb, 1, clause); + } else { + if (static_method_with_first_arg_bound) { + mono_mb_emit_ldloc (mb, local_target); + if (!MONO_TYPE_IS_REFERENCE (invoke_sig->params[0])) + mono_mb_emit_op (mb, CEE_UNBOX_ANY, mono_class_from_mono_type (invoke_sig->params[0])); + } + for (i = 0; i < sig->param_count; ++i) + mono_mb_emit_ldarg (mb, i + 1); + mono_mb_emit_ldarg (mb, 0); + mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoDelegate, method_ptr)); + mono_mb_emit_byte (mb, CEE_LDIND_I ); + mono_mb_emit_op (mb, CEE_CALLI, invoke_sig); + } - /* return result */ - mono_mb_patch_branch (mb, pos); - //mono_mb_emit_ldloc (mb, 0); mono_mb_emit_byte (mb, CEE_RET); + + mb->skip_visibility = 1; #endif /* DISABLE_JIT */ - info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_RUNTIME_INVOKE_DYNAMIC); + if (ctx) { + MonoMethod *def; - mono_marshal_lock (); - /* double-checked locking */ - if (!method) - method = mono_mb_create (mb, csig, 16, info); + def = mono_mb_create_and_cache (cache, cache_key, mb, sig, sig->param_count + 16); + res = cache_generic_delegate_wrapper (cache, orig_method, def, ctx); + } else if (callvirt) { + new_key = g_new0 (SignatureMethodPair, 1); + *new_key = key; - mono_marshal_unlock (); + info = mono_wrapper_info_create (mb, subtype); + res = mono_mb_create_and_cache_full (cache, new_key, mb, sig, sig->param_count + 16, info, &found); + if (found) + g_free (new_key); + } else { + info = mono_wrapper_info_create (mb, subtype); + + res = mono_mb_create_and_cache_full (cache, cache_key, mb, sig, sig->param_count + 16, info, NULL); + } mono_mb_free (mb); - return method; + return res; } -#ifndef DISABLE_JIT -static void -mono_mb_emit_auto_layout_exception (MonoMethodBuilder *mb, MonoClass *klass) +/* + * the returned method invokes all methods in a multicast delegate. + */ +MonoMethod * +mono_marshal_get_delegate_invoke (MonoMethod *method, MonoDelegate *del) { - char *msg = g_strdup_printf ("The type `%s.%s' layout needs to be Sequential or Explicit", - klass->name_space, klass->name); + gboolean callvirt = FALSE; + gboolean static_method_with_first_arg_bound = FALSE; + MonoMethod *target_method = NULL; + MonoMethodSignature *sig; - mono_mb_emit_exception_marshal_directive (mb, msg); + sig = mono_signature_no_pinvoke (method); + + if (del && !del->target && del->method && mono_method_signature (del->method)->hasthis) { + callvirt = TRUE; + target_method = del->method; + } + + if (del && del->method && mono_method_signature (del->method)->param_count == sig->param_count + 1 && (del->method->flags & METHOD_ATTRIBUTE_STATIC)) { + static_method_with_first_arg_bound = TRUE; + target_method = del->method; + } + + return mono_marshal_get_delegate_invoke_internal (method, callvirt, static_method_with_first_arg_bound, target_method); } -#endif -#ifndef DISABLE_REMOTING /* - * mono_marshal_get_ldfld_remote_wrapper: - * @klass: The return type + * signature_dup_add_this: * - * This method generates a wrapper for calling mono_load_remote_field_new. - * The return type is ignored for now, as mono_load_remote_field_new () always - * returns an object. In the future, to optimize some codepaths, we might - * call a different function that takes a pointer to a valuetype, instead. + * Make a copy of @sig, adding an explicit this argument. */ -MonoMethod * -mono_marshal_get_ldfld_remote_wrapper (MonoClass *klass) +static MonoMethodSignature* +signature_dup_add_this (MonoImage *image, MonoMethodSignature *sig, MonoClass *klass) { - MonoMethodSignature *sig, *csig; - MonoMethodBuilder *mb; - MonoMethod *res; - static MonoMethod* cached = NULL; + MonoMethodSignature *res; + int i; + + res = mono_metadata_signature_alloc (image, sig->param_count + 1); + memcpy (res, sig, MONO_SIZEOF_METHOD_SIGNATURE); + res->param_count = sig->param_count + 1; + res->hasthis = FALSE; + for (i = sig->param_count - 1; i >= 0; i --) + res->params [i + 1] = sig->params [i]; + res->params [0] = klass->valuetype ? &klass->this_arg : &klass->byval_arg; + + return res; +} + +typedef struct { + MonoMethodSignature *ctor_sig; + MonoMethodSignature *sig; +} CtorSigPair; + +/* protected by the marshal lock, contains CtorSigPair pointers */ +static GSList *strsig_list = NULL; + +static MonoMethodSignature * +lookup_string_ctor_signature (MonoMethodSignature *sig) +{ + MonoMethodSignature *callsig; + CtorSigPair *cs; + GSList *item; mono_marshal_lock (); - if (cached) { - mono_marshal_unlock (); - return cached; + callsig = NULL; + for (item = strsig_list; item; item = item->next) { + cs = item->data; + /* mono_metadata_signature_equal () is safe to call with the marshal lock + * because it is lock-free. + */ + if (mono_metadata_signature_equal (sig, cs->ctor_sig)) { + callsig = cs->sig; + break; + } } mono_marshal_unlock (); + return callsig; +} - mb = mono_mb_new_no_dup_name (mono_defaults.object_class, "__mono_load_remote_field_new_wrapper", MONO_WRAPPER_LDFLD_REMOTE); +static MonoMethodSignature * +add_string_ctor_signature (MonoMethod *method) +{ + MonoMethodSignature *callsig; + CtorSigPair *cs; - mb->method->save_lmf = 1; + callsig = signature_dup (method->klass->image, mono_method_signature (method)); + callsig->ret = &mono_defaults.string_class->byval_arg; + cs = g_new (CtorSigPair, 1); + cs->sig = callsig; + cs->ctor_sig = mono_method_signature (method); - sig = mono_metadata_signature_alloc (mono_defaults.corlib, 3); - sig->params [0] = &mono_defaults.object_class->byval_arg; - sig->params [1] = &mono_defaults.int_class->byval_arg; - sig->params [2] = &mono_defaults.int_class->byval_arg; - sig->ret = &mono_defaults.object_class->byval_arg; + mono_marshal_lock (); + strsig_list = g_slist_prepend (strsig_list, cs); + mono_marshal_unlock (); + return callsig; +} -#ifndef DISABLE_JIT - mono_mb_emit_ldarg (mb, 0); - mono_mb_emit_ldarg (mb, 1); - mono_mb_emit_ldarg (mb, 2); +/* + * mono_marshal_get_string_ctor_signature: + * + * Return the modified signature used by string ctors (they return the newly created + * string). + */ +MonoMethodSignature* +mono_marshal_get_string_ctor_signature (MonoMethod *method) +{ + MonoMethodSignature *sig = lookup_string_ctor_signature (mono_method_signature (method)); + if (!sig) + sig = add_string_ctor_signature (method); - csig = mono_metadata_signature_alloc (mono_defaults.corlib, 3); - csig->params [0] = &mono_defaults.object_class->byval_arg; - csig->params [1] = &mono_defaults.int_class->byval_arg; - csig->params [2] = &mono_defaults.int_class->byval_arg; - csig->ret = &mono_defaults.object_class->byval_arg; - csig->pinvoke = 1; + return sig; +} - mono_mb_emit_native_call (mb, csig, mono_load_remote_field_new); - emit_thread_interrupt_checkpoint (mb); +static MonoType* +get_runtime_invoke_type (MonoType *t, gboolean ret) +{ + if (t->byref) { + if (t->type == MONO_TYPE_GENERICINST && mono_class_is_nullable (mono_class_from_mono_type (t))) + return t; + /* Can't share this with 'I' as that needs another indirection */ + return &mono_defaults.int_class->this_arg; + } - mono_mb_emit_byte (mb, CEE_RET); -#endif + if (MONO_TYPE_IS_REFERENCE (t)) + return &mono_defaults.object_class->byval_arg; - mono_marshal_lock (); - res = cached; - mono_marshal_unlock (); - if (!res) { - MonoMethod *newm; - newm = mono_mb_create (mb, sig, 4, NULL); - mono_marshal_lock (); - res = cached; - if (!res) { - res = newm; - cached = res; - mono_marshal_unlock (); - } else { - mono_marshal_unlock (); - mono_free_method (newm); + if (ret) + /* The result needs to be boxed */ + return t; + +handle_enum: + switch (t->type) { + /* Can't share these as the argument needs to be loaded using sign/zero extension */ + /* + case MONO_TYPE_U1: + return &mono_defaults.sbyte_class->byval_arg; + case MONO_TYPE_U2: + return &mono_defaults.int16_class->byval_arg; + case MONO_TYPE_U4: + return &mono_defaults.int32_class->byval_arg; + */ + case MONO_TYPE_U8: + return &mono_defaults.int64_class->byval_arg; + case MONO_TYPE_BOOLEAN: + return &mono_defaults.byte_class->byval_arg; + case MONO_TYPE_CHAR: + return &mono_defaults.uint16_class->byval_arg; + case MONO_TYPE_U: + case MONO_TYPE_PTR: + return &mono_defaults.int_class->byval_arg; + case MONO_TYPE_VALUETYPE: + if (t->data.klass->enumtype) { + t = mono_class_enum_basetype (t->data.klass); + goto handle_enum; } + return t; + default: + return t; } - mono_mb_free (mb); +} + +/* + * mono_marshal_get_runtime_invoke_sig: + * + * Return a common signature used for sharing runtime invoke wrappers. + */ +static MonoMethodSignature* +mono_marshal_get_runtime_invoke_sig (MonoMethodSignature *sig) +{ + MonoMethodSignature *res = mono_metadata_signature_dup (sig); + int i; + + res->generic_param_count = 0; + res->ret = get_runtime_invoke_type (sig->ret, TRUE); + for (i = 0; i < res->param_count; ++i) + res->params [i] = get_runtime_invoke_type (sig->params [i], FALSE); return res; } +static gboolean +runtime_invoke_signature_equal (MonoMethodSignature *sig1, MonoMethodSignature *sig2) +{ + /* Can't share wrappers which return a vtype since it needs to be boxed */ + if (sig1->ret != sig2->ret && !(MONO_TYPE_IS_REFERENCE (sig1->ret) && MONO_TYPE_IS_REFERENCE (sig2->ret)) && !mono_metadata_type_equal (sig1->ret, sig2->ret)) + return FALSE; + else + return mono_metadata_signature_equal (sig1, sig2); +} + +#ifndef DISABLE_JIT + /* - * mono_marshal_get_ldfld_wrapper: - * @type: the type of the field + * emit_invoke_call: * - * This method generates a function which can be use to load a field with type - * @type from an object. The generated function has the following signature: - * <@type> ldfld_wrapper (MonoObject *this, MonoClass *class, MonoClassField *field, int offset) + * Emit the call to the wrapper method from a runtime invoke wrapper. */ -MonoMethod * -mono_marshal_get_ldfld_wrapper (MonoType *type) +static void +emit_invoke_call (MonoMethodBuilder *mb, MonoMethod *method, + MonoMethodSignature *sig, MonoMethodSignature *callsig, + int loc_res, + gboolean virtual, gboolean need_direct_wrapper) { - MonoMethodSignature *sig; - MonoMethodBuilder *mb; - MonoMethod *res; - MonoClass *klass; - GHashTable *cache; - WrapperInfo *info; - char *name; - int t, pos0, pos1 = 0; + static MonoString *string_dummy = NULL; + int i; + int *tmp_nullable_locals; + gboolean void_ret = FALSE; - type = mono_type_get_underlying_type (type); + /* to make it work with our special string constructors */ + if (!string_dummy) { + MONO_GC_REGISTER_ROOT_SINGLE (string_dummy); + string_dummy = mono_string_new_wrapper ("dummy"); + } - t = type->type; + if (virtual) { + g_assert (sig->hasthis); + g_assert (method->flags & METHOD_ATTRIBUTE_VIRTUAL); + } - if (!type->byref) { - if (type->type == MONO_TYPE_SZARRAY) { - klass = mono_defaults.array_class; - } else if (type->type == MONO_TYPE_VALUETYPE) { - klass = type->data.klass; - } else if (t == MONO_TYPE_OBJECT || t == MONO_TYPE_CLASS || t == MONO_TYPE_STRING) { - klass = mono_defaults.object_class; - } else if (t == MONO_TYPE_PTR || t == MONO_TYPE_FNPTR) { - klass = mono_defaults.int_class; - } else if (t == MONO_TYPE_GENERICINST) { - if (mono_type_generic_inst_is_valuetype (type)) - klass = mono_class_from_mono_type (type); - else - klass = mono_defaults.object_class; + if (sig->hasthis) { + if (method->string_ctor) { + if (mono_gc_is_moving ()) { + mono_mb_emit_ptr (mb, &string_dummy); + mono_mb_emit_byte (mb, CEE_LDIND_REF); + } else { + mono_mb_emit_ptr (mb, string_dummy); + } } else { - klass = mono_class_from_mono_type (type); + mono_mb_emit_ldarg (mb, 0); } - } else { - klass = mono_defaults.int_class; } - cache = get_cache (&klass->image->ldfld_wrapper_cache, mono_aligned_addr_hash, NULL); - if ((res = mono_marshal_find_in_cache (cache, klass))) - return res; - - /* we add the %p pointer value of klass because class names are not unique */ - name = g_strdup_printf ("__ldfld_wrapper_%p_%s.%s", klass, klass->name_space, klass->name); - mb = mono_mb_new (mono_defaults.object_class, name, MONO_WRAPPER_LDFLD); - g_free (name); - - sig = mono_metadata_signature_alloc (mono_defaults.corlib, 4); - sig->params [0] = &mono_defaults.object_class->byval_arg; - sig->params [1] = &mono_defaults.int_class->byval_arg; - sig->params [2] = &mono_defaults.int_class->byval_arg; - sig->params [3] = &mono_defaults.int_class->byval_arg; - sig->ret = &klass->byval_arg; + tmp_nullable_locals = g_new0 (int, sig->param_count); -#ifndef DISABLE_JIT - mono_mb_emit_ldarg (mb, 0); - pos0 = mono_mb_emit_proxy_check (mb, CEE_BNE_UN); + for (i = 0; i < sig->param_count; i++) { + MonoType *t = sig->params [i]; + int type; - mono_mb_emit_ldarg (mb, 0); - mono_mb_emit_ldarg (mb, 1); - mono_mb_emit_ldarg (mb, 2); + mono_mb_emit_ldarg (mb, 1); + if (i) { + mono_mb_emit_icon (mb, sizeof (gpointer) * i); + mono_mb_emit_byte (mb, CEE_ADD); + } - mono_mb_emit_managed_call (mb, mono_marshal_get_ldfld_remote_wrapper (klass), NULL); + if (t->byref) { + mono_mb_emit_byte (mb, CEE_LDIND_I); + /* A Nullable type don't have a boxed form, it's either null or a boxed T. + * So to make this work we unbox it to a local variablee and push a reference to that. + */ + if (t->type == MONO_TYPE_GENERICINST && mono_class_is_nullable (mono_class_from_mono_type (t))) { + tmp_nullable_locals [i] = mono_mb_add_local (mb, &mono_class_from_mono_type (t)->byval_arg); - /* - csig = mono_metadata_signature_alloc (mono_defaults.corlib, 3); - csig->params [0] = &mono_defaults.object_class->byval_arg; - csig->params [1] = &mono_defaults.int_class->byval_arg; - csig->params [2] = &mono_defaults.int_class->byval_arg; - csig->ret = &klass->this_arg; - csig->pinvoke = 1; + mono_mb_emit_op (mb, CEE_UNBOX_ANY, mono_class_from_mono_type (t)); + mono_mb_emit_stloc (mb, tmp_nullable_locals [i]); + mono_mb_emit_ldloc_addr (mb, tmp_nullable_locals [i]); + } + continue; + } - mono_mb_emit_native_call (mb, csig, mono_load_remote_field_new); - emit_thread_interrupt_checkpoint (mb); - */ + /*FIXME 'this doesn't handle generic enums. Shouldn't we?*/ + type = sig->params [i]->type; +handle_enum: + switch (type) { + case MONO_TYPE_I1: + case MONO_TYPE_BOOLEAN: + case MONO_TYPE_U1: + case MONO_TYPE_I2: + case MONO_TYPE_U2: + case MONO_TYPE_CHAR: + case MONO_TYPE_I: + case MONO_TYPE_U: + case MONO_TYPE_I4: + case MONO_TYPE_U4: + case MONO_TYPE_R4: + case MONO_TYPE_R8: + case MONO_TYPE_I8: + case MONO_TYPE_U8: + mono_mb_emit_byte (mb, CEE_LDIND_I); + mono_mb_emit_byte (mb, mono_type_to_ldind (sig->params [i])); + break; + case MONO_TYPE_STRING: + case MONO_TYPE_CLASS: + case MONO_TYPE_ARRAY: + case MONO_TYPE_PTR: + case MONO_TYPE_SZARRAY: + case MONO_TYPE_OBJECT: + mono_mb_emit_byte (mb, mono_type_to_ldind (sig->params [i])); + break; + case MONO_TYPE_GENERICINST: + if (!mono_type_generic_inst_is_valuetype (sig->params [i])) { + mono_mb_emit_byte (mb, mono_type_to_ldind (sig->params [i])); + break; + } - if (klass->valuetype) { - mono_mb_emit_op (mb, CEE_UNBOX, klass); - pos1 = mono_mb_emit_branch (mb, CEE_BR); + /* fall through */ + case MONO_TYPE_VALUETYPE: + if (type == MONO_TYPE_VALUETYPE && t->data.klass->enumtype) { + type = mono_class_enum_basetype (t->data.klass)->type; + goto handle_enum; + } + mono_mb_emit_byte (mb, CEE_LDIND_I); + if (mono_class_is_nullable (mono_class_from_mono_type (sig->params [i]))) { + /* Need to convert a boxed vtype to an mp to a Nullable struct */ + mono_mb_emit_op (mb, CEE_UNBOX, mono_class_from_mono_type (sig->params [i])); + mono_mb_emit_op (mb, CEE_LDOBJ, mono_class_from_mono_type (sig->params [i])); + } else { + mono_mb_emit_op (mb, CEE_LDOBJ, mono_class_from_mono_type (sig->params [i])); + } + break; + default: + g_assert_not_reached (); + } + } + + if (virtual) { + mono_mb_emit_op (mb, CEE_CALLVIRT, method); + } else if (need_direct_wrapper) { + mono_mb_emit_op (mb, CEE_CALL, method); } else { - mono_mb_emit_byte (mb, CEE_RET); + mono_mb_emit_ldarg (mb, 3); + mono_mb_emit_calli (mb, callsig); } + if (sig->ret->byref) { + /* fixme: */ + g_assert_not_reached (); + } - mono_mb_patch_branch (mb, pos0); - - mono_mb_emit_ldarg (mb, 0); - mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX); - mono_mb_emit_byte (mb, CEE_MONO_OBJADDR); - mono_mb_emit_ldarg (mb, 3); - mono_mb_emit_byte (mb, CEE_ADD); - - if (klass->valuetype) - mono_mb_patch_branch (mb, pos1); - - switch (t) { - case MONO_TYPE_I1: - case MONO_TYPE_U1: + switch (sig->ret->type) { + case MONO_TYPE_VOID: + if (!method->string_ctor) + void_ret = TRUE; + break; case MONO_TYPE_BOOLEAN: case MONO_TYPE_CHAR: + case MONO_TYPE_I1: + case MONO_TYPE_U1: case MONO_TYPE_I2: case MONO_TYPE_U2: case MONO_TYPE_I4: case MONO_TYPE_U4: - case MONO_TYPE_I8: - case MONO_TYPE_U8: + case MONO_TYPE_I: + case MONO_TYPE_U: case MONO_TYPE_R4: case MONO_TYPE_R8: + case MONO_TYPE_I8: + case MONO_TYPE_U8: + case MONO_TYPE_VALUETYPE: + case MONO_TYPE_TYPEDBYREF: + case MONO_TYPE_GENERICINST: + /* box value types */ + mono_mb_emit_op (mb, CEE_BOX, mono_class_from_mono_type (sig->ret)); + break; + case MONO_TYPE_STRING: + case MONO_TYPE_CLASS: case MONO_TYPE_ARRAY: case MONO_TYPE_SZARRAY: case MONO_TYPE_OBJECT: - case MONO_TYPE_CLASS: - case MONO_TYPE_STRING: - case MONO_TYPE_I: - case MONO_TYPE_U: - case MONO_TYPE_PTR: - case MONO_TYPE_FNPTR: - mono_mb_emit_byte (mb, mono_type_to_ldind (type)); - break; - case MONO_TYPE_VALUETYPE: - g_assert (!klass->enumtype); - mono_mb_emit_op (mb, CEE_LDOBJ, klass); - break; - case MONO_TYPE_GENERICINST: - if (mono_type_generic_inst_is_valuetype (type)) { - mono_mb_emit_op (mb, CEE_LDOBJ, klass); - } else { - mono_mb_emit_byte (mb, CEE_LDIND_REF); - } + /* nothing to do */ break; - case MONO_TYPE_VAR: - case MONO_TYPE_MVAR: - mono_mb_emit_op (mb, CEE_LDOBJ, klass); + case MONO_TYPE_PTR: + /* The result is an IntPtr */ + mono_mb_emit_op (mb, CEE_BOX, mono_defaults.int_class); break; default: - g_warning ("type %x not implemented", type->type); g_assert_not_reached (); } - mono_mb_emit_byte (mb, CEE_RET); -#endif /* DISABLE_JIT */ + if (!void_ret) + mono_mb_emit_stloc (mb, loc_res); - info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NONE); - info->d.proxy.klass = klass; - res = mono_mb_create_and_cache_full (cache, klass, - mb, sig, sig->param_count + 16, info, NULL); - mono_mb_free (mb); - - return res; -} + /* Convert back nullable-byref arguments */ + for (i = 0; i < sig->param_count; i++) { + MonoType *t = sig->params [i]; -/* - * mono_marshal_get_ldflda_wrapper: - * @type: the type of the field - * - * This method generates a function which can be used to load a field address - * from an object. The generated function has the following signature: - * gpointer ldflda_wrapper (MonoObject *this, MonoClass *class, MonoClassField *field, int offset); - */ -MonoMethod * -mono_marshal_get_ldflda_wrapper (MonoType *type) -{ - MonoMethodSignature *sig; - MonoMethodBuilder *mb; - MonoMethod *res; - MonoClass *klass; - GHashTable *cache; - WrapperInfo *info; - char *name; - int t, pos0, pos1, pos2, pos3; + /* + * Box the result and put it back into the array, the caller will have + * to obtain it from there. + */ + if (t->byref && t->type == MONO_TYPE_GENERICINST && mono_class_is_nullable (mono_class_from_mono_type (t))) { + mono_mb_emit_ldarg (mb, 1); + mono_mb_emit_icon (mb, sizeof (gpointer) * i); + mono_mb_emit_byte (mb, CEE_ADD); - type = mono_type_get_underlying_type (type); - t = type->type; + mono_mb_emit_ldloc (mb, tmp_nullable_locals [i]); + mono_mb_emit_op (mb, CEE_BOX, mono_class_from_mono_type (t)); - if (!type->byref) { - if (type->type == MONO_TYPE_SZARRAY) { - klass = mono_defaults.array_class; - } else if (type->type == MONO_TYPE_VALUETYPE) { - klass = type->data.klass; - } else if (t == MONO_TYPE_OBJECT || t == MONO_TYPE_CLASS || t == MONO_TYPE_STRING || - t == MONO_TYPE_CLASS) { - klass = mono_defaults.object_class; - } else if (t == MONO_TYPE_PTR || t == MONO_TYPE_FNPTR) { - klass = mono_defaults.int_class; - } else if (t == MONO_TYPE_GENERICINST) { - if (mono_type_generic_inst_is_valuetype (type)) - klass = mono_class_from_mono_type (type); - else - klass = mono_defaults.object_class; - } else { - klass = mono_class_from_mono_type (type); + mono_mb_emit_byte (mb, CEE_STIND_REF); } - } else { - klass = mono_defaults.int_class; } - cache = get_cache (&klass->image->ldflda_wrapper_cache, mono_aligned_addr_hash, NULL); - if ((res = mono_marshal_find_in_cache (cache, klass))) - return res; + g_free (tmp_nullable_locals); +} + +static void +emit_runtime_invoke_body (MonoMethodBuilder *mb, MonoClass *target_klass, MonoMethod *method, + MonoMethodSignature *sig, MonoMethodSignature *callsig, + gboolean virtual, gboolean need_direct_wrapper) +{ + gint32 labels [16]; + MonoExceptionClause *clause; + int loc_res, loc_exc; + + /* The wrapper looks like this: + * + * + * if (exc) { + * try { + * return + * } catch (Exception e) { + * *exc = e; + * } + * } else { + * return + * } + */ + + /* allocate local 0 (object) tmp */ + loc_res = mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg); + /* allocate local 1 (object) exc */ + loc_exc = mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg); - /* we add the %p pointer value of klass because class names are not unique */ - name = g_strdup_printf ("__ldflda_wrapper_%p_%s.%s", klass, klass->name_space, klass->name); - mb = mono_mb_new (mono_defaults.object_class, name, MONO_WRAPPER_LDFLDA); - g_free (name); + /* *exc is assumed to be initialized to NULL by the caller */ - sig = mono_metadata_signature_alloc (mono_defaults.corlib, 4); - sig->params [0] = &mono_defaults.object_class->byval_arg; - sig->params [1] = &mono_defaults.int_class->byval_arg; - sig->params [2] = &mono_defaults.int_class->byval_arg; - sig->params [3] = &mono_defaults.int_class->byval_arg; - sig->ret = &mono_defaults.int_class->byval_arg; + mono_mb_emit_byte (mb, CEE_LDARG_2); + labels [0] = mono_mb_emit_branch (mb, CEE_BRFALSE); -#ifndef DISABLE_JIT - /* if typeof (this) != transparent_proxy goto pos0 */ - mono_mb_emit_ldarg (mb, 0); - pos0 = mono_mb_emit_proxy_check (mb, CEE_BNE_UN); + /* + * if (exc) case + */ + labels [1] = mono_mb_get_label (mb); + emit_thread_force_interrupt_checkpoint (mb); + emit_invoke_call (mb, method, sig, callsig, loc_res, virtual, need_direct_wrapper); - /* if same_appdomain goto pos1 */ - mono_mb_emit_ldarg (mb, 0); - pos1 = mono_mb_emit_xdomain_check (mb, CEE_BEQ); + labels [2] = mono_mb_emit_branch (mb, CEE_LEAVE); - mono_mb_emit_exception_full (mb, "System", "InvalidOperationException", "Attempt to load field address from object in another appdomain."); + /* Add a try clause around the call */ + clause = mono_image_alloc0 (target_klass->image, sizeof (MonoExceptionClause)); + clause->flags = MONO_EXCEPTION_CLAUSE_NONE; + clause->data.catch_class = mono_defaults.exception_class; + clause->try_offset = labels [1]; + clause->try_len = mono_mb_get_label (mb) - labels [1]; - /* same app domain */ - mono_mb_patch_branch (mb, pos1); + clause->handler_offset = mono_mb_get_label (mb); - /* if typeof (this) != contextbound goto pos2 */ - mono_mb_emit_ldarg (mb, 0); - pos2 = mono_mb_emit_contextbound_check (mb, CEE_BEQ); + /* handler code */ + mono_mb_emit_stloc (mb, loc_exc); + mono_mb_emit_byte (mb, CEE_LDARG_2); + mono_mb_emit_ldloc (mb, loc_exc); + mono_mb_emit_byte (mb, CEE_STIND_REF); - /* if this->rp->context == mono_context_get goto pos3 */ - mono_mb_emit_ldarg (mb, 0); - mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoTransparentProxy, rp)); - mono_mb_emit_byte (mb, CEE_LDIND_REF); - mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoRealProxy, context)); - mono_mb_emit_byte (mb, CEE_LDIND_REF); - mono_mb_emit_icall (mb, mono_context_get); - pos3 = mono_mb_emit_branch (mb, CEE_BEQ); + mono_mb_emit_branch (mb, CEE_LEAVE); - mono_mb_emit_exception_full (mb, "System", "InvalidOperationException", "Attempt to load field address from object in another context."); + clause->handler_len = mono_mb_get_pos (mb) - clause->handler_offset; - mono_mb_patch_branch (mb, pos2); - mono_mb_patch_branch (mb, pos3); + mono_mb_set_clauses (mb, 1, clause); - /* return the address of the field from this->rp->unwrapped_server */ - mono_mb_emit_ldarg (mb, 0); - mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoTransparentProxy, rp)); - mono_mb_emit_byte (mb, CEE_LDIND_REF); - mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoRealProxy, unwrapped_server)); - mono_mb_emit_byte (mb, CEE_LDIND_REF); - mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX); - mono_mb_emit_byte (mb, CEE_MONO_OBJADDR); - mono_mb_emit_ldarg (mb, 3); - mono_mb_emit_byte (mb, CEE_ADD); + mono_mb_patch_branch (mb, labels [2]); + mono_mb_emit_ldloc (mb, loc_res); mono_mb_emit_byte (mb, CEE_RET); - /* not a proxy: return the address of the field directly */ - mono_mb_patch_branch (mb, pos0); - - mono_mb_emit_ldarg (mb, 0); - mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX); - mono_mb_emit_byte (mb, CEE_MONO_OBJADDR); - mono_mb_emit_ldarg (mb, 3); - mono_mb_emit_byte (mb, CEE_ADD); + /* + * if (!exc) case + */ + mono_mb_patch_branch (mb, labels [0]); + emit_thread_force_interrupt_checkpoint (mb); + emit_invoke_call (mb, method, sig, callsig, loc_res, virtual, need_direct_wrapper); + mono_mb_emit_ldloc (mb, 0); mono_mb_emit_byte (mb, CEE_RET); -#endif - - info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NONE); - info->d.proxy.klass = klass; - res = mono_mb_create_and_cache_full (cache, klass, - mb, sig, sig->param_count + 16, - info, NULL); - mono_mb_free (mb); - - return res; } +#endif /* - * mono_marshal_get_stfld_remote_wrapper: - * klass: The type of the field + * generates IL code for the runtime invoke function + * MonoObject *runtime_invoke (MonoObject *this, void **params, MonoObject **exc, void* method) * - * This function generates a wrapper for calling mono_store_remote_field_new - * with the appropriate signature. - * Similarly to mono_marshal_get_ldfld_remote_wrapper () this doesn't depend on the - * klass argument anymore. + * we also catch exceptions if exc != null + * If VIRTUAL is TRUE, then METHOD is invoked virtually on THIS. This is useful since + * it means that the compiled code for METHOD does not have to be looked up + * before calling the runtime invoke wrapper. In this case, the wrapper ignores + * its METHOD argument. */ MonoMethod * -mono_marshal_get_stfld_remote_wrapper (MonoClass *klass) +mono_marshal_get_runtime_invoke (MonoMethod *method, gboolean virtual) { - MonoMethodSignature *sig, *csig; + MonoMethodSignature *sig, *csig, *callsig; MonoMethodBuilder *mb; - MonoMethod *res; - static MonoMethod *cached = NULL; + GHashTable *cache = NULL; + MonoClass *target_klass; + MonoMethod *res = NULL; + static MonoMethodSignature *cctor_signature = NULL; + static MonoMethodSignature *finalize_signature = NULL; + char *name; + const char *param_names [16]; + gboolean need_direct_wrapper = FALSE; + WrapperInfo *info; - mono_marshal_lock (); - if (cached) { - mono_marshal_unlock (); - return cached; + g_assert (method); + + if (!cctor_signature) { + cctor_signature = mono_metadata_signature_alloc (mono_defaults.corlib, 0); + cctor_signature->ret = &mono_defaults.void_class->byval_arg; + } + if (!finalize_signature) { + finalize_signature = mono_metadata_signature_alloc (mono_defaults.corlib, 0); + finalize_signature->ret = &mono_defaults.void_class->byval_arg; + finalize_signature->hasthis = 1; } - mono_marshal_unlock (); - mb = mono_mb_new_no_dup_name (mono_defaults.object_class, "__mono_store_remote_field_new_wrapper", MONO_WRAPPER_STFLD_REMOTE); + if (virtual) + need_direct_wrapper = TRUE; - mb->method->save_lmf = 1; + /* + * Use a separate cache indexed by methods to speed things up and to avoid the + * boundless mempool growth caused by the signature_dup stuff below. + */ + if (virtual) + cache = get_cache (&method->klass->image->runtime_invoke_vcall_cache, mono_aligned_addr_hash, NULL); + else + cache = get_cache (&method->klass->image->runtime_invoke_direct_cache, mono_aligned_addr_hash, NULL); + res = mono_marshal_find_in_cache (cache, method); + if (res) + return res; + + if (method->klass->rank && (method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) && + (method->iflags & METHOD_IMPL_ATTRIBUTE_NATIVE)) { + /* + * Array Get/Set/Address methods. The JIT implements them using inline code + * so we need to create an invoke wrapper which calls the method directly. + */ + need_direct_wrapper = TRUE; + } + + if (method->string_ctor) { + callsig = lookup_string_ctor_signature (mono_method_signature (method)); + if (!callsig) + callsig = add_string_ctor_signature (method); + /* Can't share this as we push a string as this */ + need_direct_wrapper = TRUE; + } else { + if (method_is_dynamic (method)) + callsig = signature_dup (method->klass->image, mono_method_signature (method)); + else + callsig = mono_method_signature (method); + } - sig = mono_metadata_signature_alloc (mono_defaults.corlib, 4); - sig->params [0] = &mono_defaults.object_class->byval_arg; - sig->params [1] = &mono_defaults.int_class->byval_arg; - sig->params [2] = &mono_defaults.int_class->byval_arg; - sig->params [3] = &mono_defaults.object_class->byval_arg; - sig->ret = &mono_defaults.void_class->byval_arg; + target_klass = get_wrapper_target_class (method->klass->image); -#ifndef DISABLE_JIT - mono_mb_emit_ldarg (mb, 0); - mono_mb_emit_ldarg (mb, 1); - mono_mb_emit_ldarg (mb, 2); - mono_mb_emit_ldarg (mb, 3); + /* Try to share wrappers for non-corlib methods with simple signatures */ + if (mono_metadata_signature_equal (callsig, cctor_signature)) { + callsig = cctor_signature; + target_klass = mono_defaults.object_class; + } else if (mono_metadata_signature_equal (callsig, finalize_signature)) { + callsig = finalize_signature; + target_klass = mono_defaults.object_class; + } - csig = mono_metadata_signature_alloc (mono_defaults.corlib, 4); - csig->params [0] = &mono_defaults.object_class->byval_arg; + if (need_direct_wrapper) { + /* Already searched at the start */ + } else { + MonoMethodSignature *tmp_sig; + + callsig = mono_marshal_get_runtime_invoke_sig (callsig); + + if (method->klass->valuetype && mono_method_signature (method)->hasthis) + /* These have a different csig */ + cache = get_cache (&target_klass->image->runtime_invoke_vtype_cache, + (GHashFunc)mono_signature_hash, + (GCompareFunc)runtime_invoke_signature_equal); + else + cache = get_cache (&target_klass->image->runtime_invoke_cache, + (GHashFunc)mono_signature_hash, + (GCompareFunc)runtime_invoke_signature_equal); + + /* from mono_marshal_find_in_cache */ + mono_marshal_lock (); + res = g_hash_table_lookup (cache, callsig); + mono_marshal_unlock (); + + if (res) { + g_free (callsig); + return res; + } + + /* Make a copy of the signature from the image mempool */ + tmp_sig = callsig; + callsig = mono_metadata_signature_dup_full (target_klass->image, callsig); + g_free (tmp_sig); + } + + sig = mono_method_signature (method); + + csig = mono_metadata_signature_alloc (target_klass->image, 4); + + csig->ret = &mono_defaults.object_class->byval_arg; + if (method->klass->valuetype && mono_method_signature (method)->hasthis) + csig->params [0] = get_runtime_invoke_type (&method->klass->this_arg, FALSE); + else + csig->params [0] = &mono_defaults.object_class->byval_arg; csig->params [1] = &mono_defaults.int_class->byval_arg; csig->params [2] = &mono_defaults.int_class->byval_arg; - csig->params [3] = &mono_defaults.object_class->byval_arg; - csig->ret = &mono_defaults.void_class->byval_arg; + csig->params [3] = &mono_defaults.int_class->byval_arg; csig->pinvoke = 1; +#if TARGET_WIN32 + /* This is called from runtime code so it has to be cdecl */ + csig->call_convention = MONO_CALL_C; +#endif - mono_mb_emit_native_call (mb, csig, mono_store_remote_field_new); - emit_thread_interrupt_checkpoint (mb); + name = mono_signature_to_name (callsig, virtual ? "runtime_invoke_virtual" : "runtime_invoke"); + mb = mono_mb_new (target_klass, name, MONO_WRAPPER_RUNTIME_INVOKE); + g_free (name); - mono_mb_emit_byte (mb, CEE_RET); +#ifndef DISABLE_JIT + param_names [0] = "this"; + param_names [1] = "params"; + param_names [2] = "exc"; + param_names [3] = "method"; + mono_mb_set_param_names (mb, param_names); + + emit_runtime_invoke_body (mb, target_klass, method, sig, callsig, virtual, need_direct_wrapper); #endif - mono_marshal_lock (); - res = cached; - mono_marshal_unlock (); - if (!res) { - MonoMethod *newm; - newm = mono_mb_create (mb, sig, 6, NULL); + if (need_direct_wrapper) { +#ifndef DISABLE_JIT + mb->skip_visibility = 1; +#endif + info = mono_wrapper_info_create (mb, virtual ? WRAPPER_SUBTYPE_RUNTIME_INVOKE_VIRTUAL : WRAPPER_SUBTYPE_RUNTIME_INVOKE_DIRECT); + info->d.runtime_invoke.method = method; + res = mono_mb_create_and_cache_full (cache, method, mb, csig, sig->param_count + 16, info, NULL); + } else { + /* taken from mono_mb_create_and_cache */ mono_marshal_lock (); - res = cached; + res = g_hash_table_lookup (cache, callsig); + mono_marshal_unlock (); + + info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_RUNTIME_INVOKE_NORMAL); + info->d.runtime_invoke.sig = callsig; + + /* Somebody may have created it before us */ if (!res) { - res = newm; - cached = res; - mono_marshal_unlock (); - } else { + MonoMethod *newm; + newm = mono_mb_create (mb, csig, sig->param_count + 16, info); + + mono_marshal_lock (); + res = g_hash_table_lookup (cache, callsig); + if (!res) { + res = newm; + g_hash_table_insert (cache, callsig, res); + /* Can't insert it into wrapper_hash since the key is a signature */ + g_hash_table_insert (method->klass->image->runtime_invoke_direct_cache, method, res); + } else { + mono_free_method (newm); + } mono_marshal_unlock (); - mono_free_method (newm); } + + /* end mono_mb_create_and_cache */ } + mono_mb_free (mb); - - return res; + + return res; } /* - * mono_marshal_get_stfld_wrapper: - * @type: the type of the field + * mono_marshal_get_runtime_invoke_dynamic: * - * This method generates a function which can be use to store a field with type - * @type. The generated function has the following signature: - * void stfld_wrapper (MonoObject *this, MonoClass *class, MonoClassField *field, int offset, <@type> val) + * Return a method which can be used to invoke managed methods from native code + * dynamically. + * The signature of the returned method is given by RuntimeInvokeDynamicFunction: + * void runtime_invoke (void *args, MonoObject **exc, void *compiled_method) + * ARGS should point to an architecture specific structure containing + * the arguments and space for the return value. + * The other arguments are the same as for runtime_invoke (), except that + * ARGS should contain the this argument too. + * This wrapper serves the same purpose as the runtime-invoke wrappers, but there + * is only one copy of it, which is useful in full-aot. + * The wrapper info for the wrapper is a WrapperInfo structure. */ -MonoMethod * -mono_marshal_get_stfld_wrapper (MonoType *type) +MonoMethod* +mono_marshal_get_runtime_invoke_dynamic (void) { - MonoMethodSignature *sig; + static MonoMethod *method; + MonoMethodSignature *csig; + MonoExceptionClause *clause; MonoMethodBuilder *mb; - MonoMethod *res; - MonoClass *klass; - GHashTable *cache; - WrapperInfo *info; + int pos, posna; char *name; - int t, pos; + WrapperInfo *info; - type = mono_type_get_underlying_type (type); - t = type->type; + if (method) + return method; - if (!type->byref) { - if (type->type == MONO_TYPE_SZARRAY) { - klass = mono_defaults.array_class; - } else if (type->type == MONO_TYPE_VALUETYPE) { - klass = type->data.klass; - } else if (t == MONO_TYPE_OBJECT || t == MONO_TYPE_CLASS || t == MONO_TYPE_STRING) { - klass = mono_defaults.object_class; - } else if (t == MONO_TYPE_PTR || t == MONO_TYPE_FNPTR) { - klass = mono_defaults.int_class; - } else if (t == MONO_TYPE_GENERICINST) { - if (mono_type_generic_inst_is_valuetype (type)) - klass = mono_class_from_mono_type (type); - else - klass = mono_defaults.object_class; - } else { - klass = mono_class_from_mono_type (type); - } - } else { - klass = mono_defaults.int_class; - } + csig = mono_metadata_signature_alloc (mono_defaults.corlib, 4); - cache = get_cache (&klass->image->stfld_wrapper_cache, mono_aligned_addr_hash, NULL); - if ((res = mono_marshal_find_in_cache (cache, klass))) - return res; + csig->ret = &mono_defaults.void_class->byval_arg; + csig->params [0] = &mono_defaults.int_class->byval_arg; + csig->params [1] = &mono_defaults.int_class->byval_arg; + csig->params [2] = &mono_defaults.int_class->byval_arg; + csig->params [3] = &mono_defaults.int_class->byval_arg; - /* we add the %p pointer value of klass because class names are not unique */ - name = g_strdup_printf ("__stfld_wrapper_%p_%s.%s", klass, klass->name_space, klass->name); - mb = mono_mb_new (mono_defaults.object_class, name, MONO_WRAPPER_STFLD); + name = g_strdup ("runtime_invoke_dynamic"); + mb = mono_mb_new (mono_defaults.object_class, name, MONO_WRAPPER_RUNTIME_INVOKE); g_free (name); - sig = mono_metadata_signature_alloc (mono_defaults.corlib, 5); - sig->params [0] = &mono_defaults.object_class->byval_arg; - sig->params [1] = &mono_defaults.int_class->byval_arg; - sig->params [2] = &mono_defaults.int_class->byval_arg; - sig->params [3] = &mono_defaults.int_class->byval_arg; - sig->params [4] = &klass->byval_arg; - sig->ret = &mono_defaults.void_class->byval_arg; - #ifndef DISABLE_JIT - mono_mb_emit_ldarg (mb, 0); - pos = mono_mb_emit_proxy_check (mb, CEE_BNE_UN); + /* allocate local 0 (object) tmp */ + mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg); + /* allocate local 1 (object) exc */ + mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg); - mono_mb_emit_ldarg (mb, 0); - mono_mb_emit_ldarg (mb, 1); - mono_mb_emit_ldarg (mb, 2); - mono_mb_emit_ldarg (mb, 4); - if (klass->valuetype) - mono_mb_emit_op (mb, CEE_BOX, klass); + /* cond set *exc to null */ + mono_mb_emit_byte (mb, CEE_LDARG_1); + mono_mb_emit_byte (mb, CEE_BRFALSE_S); + mono_mb_emit_byte (mb, 3); + mono_mb_emit_byte (mb, CEE_LDARG_1); + mono_mb_emit_byte (mb, CEE_LDNULL); + mono_mb_emit_byte (mb, CEE_STIND_REF); - mono_mb_emit_managed_call (mb, mono_marshal_get_stfld_remote_wrapper (klass), NULL); + emit_thread_force_interrupt_checkpoint (mb); - mono_mb_emit_byte (mb, CEE_RET); + mono_mb_emit_byte (mb, CEE_LDARG_0); + mono_mb_emit_byte (mb, CEE_LDARG_2); + mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX); + mono_mb_emit_byte (mb, CEE_MONO_DYN_CALL); - mono_mb_patch_branch (mb, pos); + pos = mono_mb_emit_branch (mb, CEE_LEAVE); - mono_mb_emit_ldarg (mb, 0); - mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX); - mono_mb_emit_byte (mb, CEE_MONO_OBJADDR); - mono_mb_emit_ldarg (mb, 3); - mono_mb_emit_byte (mb, CEE_ADD); - mono_mb_emit_ldarg (mb, 4); + clause = mono_image_alloc0 (mono_defaults.corlib, sizeof (MonoExceptionClause)); + clause->flags = MONO_EXCEPTION_CLAUSE_FILTER; + clause->try_len = mono_mb_get_label (mb); - switch (t) { - case MONO_TYPE_I1: - case MONO_TYPE_U1: - case MONO_TYPE_BOOLEAN: - case MONO_TYPE_CHAR: - case MONO_TYPE_I2: - case MONO_TYPE_U2: - case MONO_TYPE_I4: - case MONO_TYPE_U4: - case MONO_TYPE_I8: - case MONO_TYPE_U8: - case MONO_TYPE_R4: - case MONO_TYPE_R8: - case MONO_TYPE_ARRAY: - case MONO_TYPE_SZARRAY: - case MONO_TYPE_OBJECT: - case MONO_TYPE_CLASS: - case MONO_TYPE_STRING: - case MONO_TYPE_I: - case MONO_TYPE_U: - case MONO_TYPE_PTR: - case MONO_TYPE_FNPTR: - mono_mb_emit_byte (mb, mono_type_to_stind (type)); - break; - case MONO_TYPE_VALUETYPE: - g_assert (!klass->enumtype); - mono_mb_emit_op (mb, CEE_STOBJ, klass); - break; - case MONO_TYPE_GENERICINST: - case MONO_TYPE_VAR: - case MONO_TYPE_MVAR: - mono_mb_emit_op (mb, CEE_STOBJ, klass); - break; - default: - g_warning ("type %x not implemented", type->type); - g_assert_not_reached (); - } + /* filter code */ + clause->data.filter_offset = mono_mb_get_label (mb); + + mono_mb_emit_byte (mb, CEE_POP); + mono_mb_emit_byte (mb, CEE_LDARG_1); + mono_mb_emit_byte (mb, CEE_LDC_I4_0); + mono_mb_emit_byte (mb, CEE_PREFIX1); + mono_mb_emit_byte (mb, CEE_CGT_UN); + mono_mb_emit_byte (mb, CEE_PREFIX1); + mono_mb_emit_byte (mb, CEE_ENDFILTER); + + clause->handler_offset = mono_mb_get_label (mb); + + /* handler code */ + /* store exception */ + mono_mb_emit_stloc (mb, 1); + + mono_mb_emit_byte (mb, CEE_LDARG_1); + mono_mb_emit_ldloc (mb, 1); + mono_mb_emit_byte (mb, CEE_STIND_REF); + + mono_mb_emit_byte (mb, CEE_LDNULL); + mono_mb_emit_stloc (mb, 0); + + /* Check for the abort exception */ + mono_mb_emit_ldloc (mb, 1); + mono_mb_emit_op (mb, CEE_ISINST, mono_defaults.threadabortexception_class); + posna = mono_mb_emit_short_branch (mb, CEE_BRFALSE_S); + + /* Delay the abort exception */ + mono_mb_emit_icall (mb, ves_icall_System_Threading_Thread_ResetAbort); + + mono_mb_patch_short_branch (mb, posna); + mono_mb_emit_branch (mb, CEE_LEAVE); + + clause->handler_len = mono_mb_get_pos (mb) - clause->handler_offset; + + mono_mb_set_clauses (mb, 1, clause); + /* return result */ + mono_mb_patch_branch (mb, pos); + //mono_mb_emit_ldloc (mb, 0); mono_mb_emit_byte (mb, CEE_RET); -#endif +#endif /* DISABLE_JIT */ + + info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_RUNTIME_INVOKE_DYNAMIC); + + mono_marshal_lock (); + /* double-checked locking */ + if (!method) + method = mono_mb_create (mb, csig, 16, info); + + mono_marshal_unlock (); - info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NONE); - info->d.proxy.klass = klass; - res = mono_mb_create_and_cache_full (cache, klass, - mb, sig, sig->param_count + 16, - info, NULL); mono_mb_free (mb); - - return res; + + return method; } -#endif /* DISABLE_REMOTING */ + +#ifndef DISABLE_JIT +static void +mono_mb_emit_auto_layout_exception (MonoMethodBuilder *mb, MonoClass *klass) +{ + char *msg = g_strdup_printf ("The type `%s.%s' layout needs to be Sequential or Explicit", + klass->name_space, klass->name); + + mono_mb_emit_exception_marshal_directive (mb, msg); +} +#endif /* * generates IL code for the icall wrapper (the generated method @@ -9760,18 +7973,6 @@ mono_marshal_get_vtfixup_ftnptr (MonoImage *image, guint32 token, guint16 type) return mono_compile_method (method); } -static MonoReflectionType * -type_from_handle (MonoType *handle) -{ - MonoDomain *domain = mono_domain_get (); - MonoClass *klass = mono_class_from_mono_type (handle); - - MONO_ARCH_SAVE_REGS; - - mono_class_init (klass); - return mono_type_get_object (domain, handle); -} - /* * This does the equivalent of mono_object_castclass_with_cache. * The wrapper info for the wrapper is a WrapperInfo structure. @@ -10177,100 +8378,6 @@ mono_marshal_get_castclass (MonoClass *klass) return res; } -#ifndef DISABLE_REMOTING -MonoMethod * -mono_marshal_get_proxy_cancast (MonoClass *klass) -{ - static MonoMethodSignature *isint_sig = NULL; - GHashTable *cache; - MonoMethod *res; - WrapperInfo *info; - int pos_failed, pos_end; - char *name, *klass_name; - MonoMethod *can_cast_to; - MonoMethodDesc *desc; - MonoMethodBuilder *mb; - - cache = get_cache (&klass->image->proxy_isinst_cache, mono_aligned_addr_hash, NULL); - if ((res = mono_marshal_find_in_cache (cache, klass))) - return res; - - if (!isint_sig) { - isint_sig = mono_metadata_signature_alloc (mono_defaults.corlib, 1); - isint_sig->params [0] = &mono_defaults.object_class->byval_arg; - isint_sig->ret = &mono_defaults.object_class->byval_arg; - isint_sig->pinvoke = 0; - } - - klass_name = mono_type_full_name (&klass->byval_arg); - name = g_strdup_printf ("__proxy_isinst_wrapper_%s", klass_name); - mb = mono_mb_new (mono_defaults.object_class, name, MONO_WRAPPER_PROXY_ISINST); - g_free (klass_name); - g_free (name); - - mb->method->save_lmf = 1; - -#ifndef DISABLE_JIT - /* get the real proxy from the transparent proxy*/ - mono_mb_emit_ldarg (mb, 0); - mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoTransparentProxy, rp)); - mono_mb_emit_byte (mb, CEE_LDIND_REF); - - /* get the reflection type from the type handle */ - mono_mb_emit_ptr (mb, &klass->byval_arg); - mono_mb_emit_icall (mb, type_from_handle); - - mono_mb_emit_ldarg (mb, 0); - - /* make the call to CanCastTo (type, ob) */ - desc = mono_method_desc_new ("IRemotingTypeInfo:CanCastTo", FALSE); - can_cast_to = mono_method_desc_search_in_class (desc, mono_defaults.iremotingtypeinfo_class); - g_assert (can_cast_to); - mono_method_desc_free (desc); - mono_mb_emit_op (mb, CEE_CALLVIRT, can_cast_to); - - pos_failed = mono_mb_emit_branch (mb, CEE_BRFALSE); - - /* Upgrade the proxy vtable by calling: mono_upgrade_remote_class_wrapper (type, ob)*/ - mono_mb_emit_ptr (mb, &klass->byval_arg); - mono_mb_emit_icall (mb, type_from_handle); - mono_mb_emit_ldarg (mb, 0); - - mono_mb_emit_icall (mb, mono_upgrade_remote_class_wrapper); - emit_thread_interrupt_checkpoint (mb); - - mono_mb_emit_ldarg (mb, 0); - pos_end = mono_mb_emit_branch (mb, CEE_BR); - - /* fail */ - - mono_mb_patch_branch (mb, pos_failed); - mono_mb_emit_byte (mb, CEE_LDNULL); - - /* the end */ - - mono_mb_patch_branch (mb, pos_end); - mono_mb_emit_byte (mb, CEE_RET); -#endif - - info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NONE); - info->d.proxy.klass = klass; - res = mono_mb_create_and_cache_full (cache, klass, mb, isint_sig, isint_sig->param_count + 16, info, NULL); - mono_mb_free (mb); - - return res; -} - -void -mono_upgrade_remote_class_wrapper (MonoReflectionType *rtype, MonoTransparentProxy *tproxy) -{ - MonoClass *klass; - MonoDomain *domain = ((MonoObject*)tproxy)->vtable->domain; - klass = mono_class_from_mono_type (rtype->type); - mono_upgrade_remote_class (domain, (MonoObject*)tproxy, klass); -} -#endif /*DISABLE_REMOTING */ - /** * mono_marshal_get_struct_to_ptr: * @klass: diff --git a/mono/metadata/marshal.h b/mono/metadata/marshal.h index 3ba8addbda7..eb10aebac1f 100644 --- a/mono/metadata/marshal.h +++ b/mono/metadata/marshal.h @@ -18,6 +18,7 @@ #include #include #include +#include #define mono_marshal_find_bitfield_offset(type, elem, byte_offset, bitmask) \ do { \ @@ -289,6 +290,9 @@ mono_type_to_stind (MonoType *type) MONO_INTERNAL; MonoMethod * mono_marshal_method_from_wrapper (MonoMethod *wrapper) MONO_INTERNAL; +WrapperInfo* +mono_wrapper_info_create (MonoMethodBuilder *mb, WrapperSubtype subtype) MONO_INTERNAL; + void mono_marshal_set_wrapper_info (MonoMethod *method, gpointer data) MONO_INTERNAL; @@ -392,6 +396,12 @@ mono_marshal_free_dynamic_wrappers (MonoMethod *method) MONO_INTERNAL; void mono_marshal_free_inflated_wrappers (MonoMethod *method) MONO_INTERNAL; +void +mono_marshal_lock_internal (void) MONO_INTERNAL; + +void +mono_marshal_unlock_internal (void) MONO_INTERNAL; + /* marshaling internal calls */ void * @@ -552,7 +562,7 @@ mono_marshal_find_nonzero_bit_offset (guint8 *buf, int len, int *byte_offset, gu MonoMethodSignature* mono_signature_no_pinvoke (MonoMethod *method) MONO_INTERNAL; -/* Called from cominterop.c */ +/* Called from cominterop.c/remoting.c */ void mono_marshal_emit_native_wrapper (MonoImage *image, MonoMethodBuilder *mb, MonoMethodSignature *sig, MonoMethodPInvoke *piinfo, MonoMarshalSpec **mspecs, gpointer func, gboolean aot, gboolean check_exceptions, gboolean func_param) MONO_INTERNAL; @@ -573,46 +583,29 @@ mono_mb_create_and_cache (GHashTable *cache, gpointer key, void mono_marshal_emit_thread_interrupt_checkpoint (MonoMethodBuilder *mb) MONO_INTERNAL; +void +mono_marshal_emit_thread_force_interrupt_checkpoint (MonoMethodBuilder *mb) MONO_INTERNAL; + void mono_marshal_use_aot_wrappers (gboolean use) MONO_INTERNAL; MonoObject * mono_marshal_xdomain_copy_value (MonoObject *val) MONO_INTERNAL; +int +mono_mb_emit_save_args (MonoMethodBuilder *mb, MonoMethodSignature *sig, gboolean save_this) MONO_INTERNAL; -#ifndef DISABLE_REMOTING - -MonoMethod * -mono_marshal_get_remoting_invoke (MonoMethod *method) MONO_INTERNAL; - -MonoMethod * -mono_marshal_get_xappdomain_invoke (MonoMethod *method) MONO_INTERNAL; - -MonoMethod * -mono_marshal_get_remoting_invoke_for_target (MonoMethod *method, MonoRemotingTarget target_type) MONO_INTERNAL; - -MonoMethod * -mono_marshal_get_remoting_invoke_with_check (MonoMethod *method) MONO_INTERNAL; - -MonoMethod * -mono_marshal_get_stfld_wrapper (MonoType *type) MONO_INTERNAL; - -MonoMethod * -mono_marshal_get_ldfld_wrapper (MonoType *type) MONO_INTERNAL; - -MonoMethod * -mono_marshal_get_ldflda_wrapper (MonoType *type) MONO_INTERNAL; - -MonoMethod * -mono_marshal_get_ldfld_remote_wrapper (MonoClass *klass) MONO_INTERNAL; - -MonoMethod * -mono_marshal_get_stfld_remote_wrapper (MonoClass *klass) MONO_INTERNAL; +void +mono_mb_emit_restore_result (MonoMethodBuilder *mb, MonoType *return_type) MONO_INTERNAL; -MonoMethod * -mono_marshal_get_proxy_cancast (MonoClass *klass) MONO_INTERNAL; +MonoMethod* +mono_mb_create (MonoMethodBuilder *mb, MonoMethodSignature *sig, + int max_stack, WrapperInfo *info) MONO_INTERNAL; -#endif +MonoMethod* +mono_mb_create_and_cache_full (GHashTable *cache, gpointer key, + MonoMethodBuilder *mb, MonoMethodSignature *sig, + int max_stack, WrapperInfo *info, gboolean *out_found) MONO_INTERNAL; G_END_DECLS diff --git a/mono/metadata/mempool.c b/mono/metadata/mempool.c index dbf38777a71..f02703a31fa 100644 --- a/mono/metadata/mempool.c +++ b/mono/metadata/mempool.c @@ -29,6 +29,8 @@ */ #define MEM_ALIGN 8 +#define ALIGN_SIZE(s) (((s) + MEM_ALIGN - 1) & ~(MEM_ALIGN - 1)) +#define SIZEOF_MEM_POOL (ALIGN_SIZE (sizeof (MonoMemPool))) #if MONO_SMALL_CONFIG #define MONO_MEMPOOL_PAGESIZE 4096 @@ -91,8 +93,8 @@ mono_mempool_new_size (int initial_size) pool = g_malloc (initial_size); pool->next = NULL; - pool->pos = (guint8*)pool + sizeof (MonoMemPool); - pool->end = pool->pos + initial_size - sizeof (MonoMemPool); + pool->pos = (guint8*)pool + SIZEOF_MEM_POOL; + pool->end = pool->pos + initial_size - SIZEOF_MEM_POOL; pool->d.allocated = pool->size = initial_size; total_bytes_allocated += initial_size; return pool; @@ -165,8 +167,8 @@ mono_mempool_empty (MonoMemPool *pool) pool->allocated = 0; #else - pool->pos = (guint8*)pool + sizeof (MonoMemPool); - pool->end = pool->pos + pool->size - sizeof (MonoMemPool); + pool->pos = (guint8*)pool + SIZEOF_MEM_POOL; + pool->end = pool->pos + pool->size - SIZEOF_MEM_POOL; #endif } @@ -239,7 +241,7 @@ static int get_next_size (MonoMemPool *pool, int size) { int target = pool->next? pool->next->size: pool->size; - size += sizeof (MonoMemPool); + size += SIZEOF_MEM_POOL; /* increase the size */ target += target / 2; while (target < size) { @@ -264,8 +266,8 @@ gpointer mono_mempool_alloc (MonoMemPool *pool, guint size) { gpointer rval; - - size = (size + MEM_ALIGN - 1) & ~(MEM_ALIGN - 1); + + size = ALIGN_SIZE (size); #ifdef MALLOC_ALLOCATION { @@ -291,25 +293,25 @@ mono_mempool_alloc (MonoMemPool *pool, guint size) if (G_UNLIKELY (pool->pos >= pool->end)) { pool->pos -= size; if (size >= 4096) { - MonoMemPool *np = g_malloc (sizeof (MonoMemPool) + size); + MonoMemPool *np = g_malloc (SIZEOF_MEM_POOL + size); np->next = pool->next; pool->next = np; - np->pos = (guint8*)np + sizeof (MonoMemPool); - np->size = sizeof (MonoMemPool) + size; - np->end = np->pos + np->size - sizeof (MonoMemPool); - pool->d.allocated += sizeof (MonoMemPool) + size; - total_bytes_allocated += sizeof (MonoMemPool) + size; - return (guint8*)np + sizeof (MonoMemPool); + np->pos = (guint8*)np + SIZEOF_MEM_POOL; + np->size = SIZEOF_MEM_POOL + size; + np->end = np->pos + np->size - SIZEOF_MEM_POOL; + pool->d.allocated += SIZEOF_MEM_POOL + size; + total_bytes_allocated += SIZEOF_MEM_POOL + size; + return (guint8*)np + SIZEOF_MEM_POOL; } else { int new_size = get_next_size (pool, size); MonoMemPool *np = g_malloc (new_size); np->next = pool->next; pool->next = np; - pool->pos = (guint8*)np + sizeof (MonoMemPool); - np->pos = (guint8*)np + sizeof (MonoMemPool); + pool->pos = (guint8*)np + SIZEOF_MEM_POOL; + np->pos = (guint8*)np + SIZEOF_MEM_POOL; np->size = new_size; np->end = np->pos; - pool->end = pool->pos + new_size - sizeof (MonoMemPool); + pool->end = pool->pos + new_size - SIZEOF_MEM_POOL; pool->d.allocated += new_size; total_bytes_allocated += new_size; @@ -335,7 +337,7 @@ mono_mempool_alloc0 (MonoMemPool *pool, guint size) #ifdef MALLOC_ALLOCATION rval = mono_mempool_alloc (pool, size); #else - size = (size + MEM_ALIGN - 1) & ~(MEM_ALIGN - 1); + size = ALIGN_SIZE (size); rval = pool->pos; pool->pos = (guint8*)rval + size; diff --git a/mono/metadata/metadata-internals.h b/mono/metadata/metadata-internals.h index a5c89917445..ea35f5b7c63 100644 --- a/mono/metadata/metadata-internals.h +++ b/mono/metadata/metadata-internals.h @@ -804,5 +804,9 @@ MonoAotCacheConfig *mono_get_aot_cache_config (void) MONO_INTERNAL; MonoType * mono_type_create_from_typespec_checked (MonoImage *image, guint32 type_spec, MonoError *error) MONO_INTERNAL; +MonoMethodSignature* +mono_method_get_signature_checked (MonoMethod *method, MonoImage *image, guint32 token, MonoGenericContext *context, MonoError *error) MONO_INTERNAL; + + #endif /* __MONO_METADATA_INTERNALS_H__ */ diff --git a/mono/metadata/mono-debug-debugger.c b/mono/metadata/mono-debug-debugger.c deleted file mode 100644 index 8168b2cf15a..00000000000 --- a/mono/metadata/mono-debug-debugger.c +++ /dev/null @@ -1,115 +0,0 @@ -/* - * mono-debug-debugger.c: - * - * Author: - * Mono Project (http://www.mono-project.com) - * - * Copyright 2001-2003 Ximian, Inc (http://www.ximian.com) - * Copyright 2004-2009 Novell, Inc (http://www.novell.com) - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static guint32 debugger_lock_level = 0; -static mono_mutex_t debugger_lock_mutex; - -typedef struct -{ - guint32 index; - MonoMethod *method; - MonoDebugMethodAddressList *address_list; -} MethodBreakpointInfo; - -static int initialized = 0; - -void -mono_debugger_lock (void) -{ - g_assert (initialized); - mono_mutex_lock (&debugger_lock_mutex); - debugger_lock_level++; -} - -void -mono_debugger_unlock (void) -{ - g_assert (initialized); - debugger_lock_level--; - mono_mutex_unlock (&debugger_lock_mutex); -} - -void -mono_debugger_initialize () -{ - mono_mutex_init_recursive (&debugger_lock_mutex); - initialized = 1; -} - -/* - * Debugger breakpoint interface. - * - * This interface is used to insert breakpoints on methods which are not yet JITed. - * The debugging code keeps a list of all such breakpoints and automatically inserts the - * breakpoint when the method is JITed. - */ - -static GPtrArray *method_breakpoints = NULL; - -MonoDebugMethodAddressList * -mono_debugger_insert_method_breakpoint (MonoMethod *method, guint64 index) -{ - MethodBreakpointInfo *info; - - info = g_new0 (MethodBreakpointInfo, 1); - info->method = method; - info->index = index; - - info->address_list = mono_debug_lookup_method_addresses (method); - - if (!method_breakpoints) - method_breakpoints = g_ptr_array_new (); - - g_ptr_array_add (method_breakpoints, info); - - return info->address_list; -} - -int -mono_debugger_remove_method_breakpoint (guint64 index) -{ - int i; - - if (!method_breakpoints) - return 0; - - for (i = 0; i < method_breakpoints->len; i++) { - MethodBreakpointInfo *info = g_ptr_array_index (method_breakpoints, i); - - if (info->index != index) - continue; - - g_ptr_array_remove (method_breakpoints, info); - g_free (info->address_list); - g_free (info); - return 1; - } - - return 0; -} diff --git a/mono/metadata/mono-debug-debugger.h b/mono/metadata/mono-debug-debugger.h index b8d13b6eec2..c61a504be15 100644 --- a/mono/metadata/mono-debug-debugger.h +++ b/mono/metadata/mono-debug-debugger.h @@ -20,10 +20,4 @@ void mono_debugger_unlock (void) MONO_INTERNAL gchar * mono_debugger_check_runtime_version (const char *filename) MONO_INTERNAL; -MonoDebugMethodAddressList * -mono_debugger_insert_method_breakpoint (MonoMethod *method, guint64 idx) MONO_INTERNAL; - -int -mono_debugger_remove_method_breakpoint (guint64 index) MONO_INTERNAL; - #endif /* __MONO_DEBUG_DEBUGGER_H__ */ diff --git a/mono/metadata/mono-debug.c b/mono/metadata/mono-debug.c index 5e5173f9323..1cfc8cf65f4 100644 --- a/mono/metadata/mono-debug.c +++ b/mono/metadata/mono-debug.c @@ -19,174 +19,79 @@ #include #include #include +#include #include -#define DATA_TABLE_CHUNK_SIZE (16384-sizeof (MonoDebugDataChunk)) - #define ALIGN_TO(val,align) ((((guint64)val) + ((align) - 1)) & ~((align) - 1)) #if NO_UNALIGNED_ACCESS -#define RETURN_UNALIGNED(type, addr) \ - { \ - type val; \ - memcpy(&val, p + offset, sizeof(val)); \ - return val; \ - } #define WRITE_UNALIGNED(type, addr, val) \ memcpy(addr, &val, sizeof(type)) #define READ_UNALIGNED(type, addr, val) \ memcpy(&val, addr, sizeof(type)) #else -#define RETURN_UNALIGNED(type, addr) \ - return *(type*)(p + offset); #define WRITE_UNALIGNED(type, addr, val) \ (*(type *)(addr) = (val)) #define READ_UNALIGNED(type, addr, val) \ val = (*(type *)(addr)) #endif -typedef enum { - MONO_DEBUG_DATA_ITEM_UNKNOWN = 0, - MONO_DEBUG_DATA_ITEM_CLASS, - MONO_DEBUG_DATA_ITEM_METHOD, - MONO_DEBUG_DATA_ITEM_DELEGATE_TRAMPOLINE -} MonoDebugDataItemType; - -typedef struct _MonoDebugDataChunk MonoDebugDataChunk; - -struct _MonoDebugDataChunk { - guint32 total_size; - guint32 allocated_size; - guint32 current_offset; - guint32 dummy; - MonoDebugDataChunk *next; - guint8 data [MONO_ZERO_LEN_ARRAY]; -}; - +/* This contains per-domain info */ struct _MonoDebugDataTable { - gint32 domain; - gint32 _dummy; /* alignment for next field. */ - MonoDebugDataChunk *first_chunk; - MonoDebugDataChunk *current_chunk; - GHashTable *method_hash; + MonoMemPool *mp; GHashTable *method_address_hash; }; -typedef struct { - const gchar *method_name; - const gchar *obsolete_cil_code; - guint32 wrapper_type; -} MonoDebugWrapperData; - -typedef struct { - guint32 size; - guint32 symfile_id; - guint32 domain_id; - guint32 method_id; - MonoDebugWrapperData *wrapper_data; - MonoMethod *method; - GSList *address_list; -} MonoDebugMethodHeader; - +/* This contains JIT debugging information about a method in serialized format */ struct _MonoDebugMethodAddress { - MonoDebugMethodHeader header; const guint8 *code_start; - const guint8 *wrapper_addr; guint32 code_size; guint8 data [MONO_ZERO_LEN_ARRAY]; }; -struct _MonoDebugClassEntry { - guint32 size; - guint8 data [MONO_ZERO_LEN_ARRAY]; -}; - -typedef struct { - gpointer code; - guint32 size; -} MonoDebugDelegateTrampolineEntry; - -static MonoSymbolTable *mono_symbol_table = NULL; static MonoDebugFormat mono_debug_format = MONO_DEBUG_FORMAT_NONE; -static gint32 mono_debug_debugger_version = 5; static gboolean mono_debug_initialized = FALSE; -static GHashTable *mono_debug_handles = NULL; +/* Maps MonoImage -> MonoMonoDebugHandle */ +static GHashTable *mono_debug_handles; +/* Maps MonoDomain -> MonoDataTable */ +static GHashTable *data_table_hash; + +static mono_mutex_t debugger_lock_mutex; -static GHashTable *data_table_hash = NULL; -static int next_symbol_file_id = 0; +static int initialized = 0; +static gboolean is_attached = FALSE; static MonoDebugHandle *mono_debug_open_image (MonoImage *image, const guint8 *raw_contents, int size); -static MonoDebugHandle *_mono_debug_get_image (MonoImage *image); +static MonoDebugHandle *mono_debug_get_image (MonoImage *image); static void mono_debug_add_assembly (MonoAssembly *assembly, gpointer user_data); -static void mono_debug_add_type (MonoClass *klass); static MonoDebugHandle *open_symfile_from_bundle (MonoImage *image); -void _mono_debug_init_corlib (MonoDomain *domain); - -extern void (*mono_debugger_class_init_func) (MonoClass *klass); - static MonoDebugDataTable * create_data_table (MonoDomain *domain) { MonoDebugDataTable *table; - MonoDebugDataChunk *chunk; table = g_new0 (MonoDebugDataTable, 1); - table->domain = domain ? mono_domain_get_id (domain) : -1; + table->mp = mono_mempool_new (); table->method_address_hash = g_hash_table_new (NULL, NULL); - table->method_hash = g_hash_table_new (NULL, NULL); - chunk = g_malloc0 (sizeof (MonoDebugDataChunk) + DATA_TABLE_CHUNK_SIZE); - chunk->total_size = DATA_TABLE_CHUNK_SIZE; - - table->first_chunk = table->current_chunk = chunk; - - if (domain) { - mono_debug_list_add (&mono_symbol_table->data_tables, table); + if (domain) g_hash_table_insert (data_table_hash, domain, table); - } return table; } -static void -free_header_data (gpointer key, gpointer value, gpointer user_data) -{ - MonoDebugMethodHeader *header = (MonoDebugMethodHeader*)value; - - if (header->wrapper_data) { - g_free ((gpointer)header->wrapper_data->method_name); - g_free (header->wrapper_data); - } - g_slist_free (header->address_list); -} - static void free_data_table (MonoDebugDataTable *table) { - MonoDebugDataChunk *chunk, *next_chunk; - - g_hash_table_foreach (table->method_hash, free_header_data, NULL); - g_hash_table_destroy (table->method_hash); + mono_mempool_destroy (table->mp); g_hash_table_destroy (table->method_address_hash); - table->method_hash = NULL; - table->method_address_hash = NULL; - - chunk = table->first_chunk; - while (chunk) { - next_chunk = chunk->next; - g_free (chunk); - chunk = next_chunk; - } - - table->first_chunk = table->current_chunk = NULL; - mono_debug_list_remove (&mono_symbol_table->data_tables, table); g_free (table); } @@ -209,9 +114,7 @@ free_debug_handle (MonoDebugHandle *handle) if (handle->symfile) mono_debug_close_mono_symbol_file (handle->symfile); /* decrease the refcount added with mono_image_addref () */ - free_data_table (handle->type_table); mono_image_close (handle->image); - g_free (handle->image_file); g_free (handle); } @@ -229,53 +132,24 @@ mono_debug_init (MonoDebugFormat format) if (format == MONO_DEBUG_FORMAT_DEBUGGER) g_error ("The mdb debugger is no longer supported."); - mono_debug_initialized = TRUE; mono_debug_format = format; - /* - * This must be called before mono_debugger_initialize(), because the - * latter registers GC roots. - */ - mono_gc_base_init (); - mono_debugger_initialize (); mono_debugger_lock (); - mono_symbol_table = g_new0 (MonoSymbolTable, 1); - mono_symbol_table->magic = MONO_DEBUGGER_MAGIC; - mono_symbol_table->version = MONO_DEBUGGER_MAJOR_VERSION; - mono_symbol_table->total_size = sizeof (MonoSymbolTable); - mono_debug_handles = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) free_debug_handle); data_table_hash = g_hash_table_new_full ( NULL, NULL, NULL, (GDestroyNotify) free_data_table); - /* FIXME this is a disgusting hack. Kill it */ - mono_debugger_class_init_func = mono_debug_add_type; mono_install_assembly_load_hook (mono_debug_add_assembly, NULL); - mono_symbol_table->global_data_table = create_data_table (NULL); - mono_debugger_unlock (); } -/* - * INTERNAL USE ONLY ! - * FIXME this can have a decent name and exist in an internal header - */ -void -_mono_debug_init_corlib (MonoDomain *domain) -{ - if (!mono_debug_initialized) - return; - - mono_symbol_table->corlib = mono_debug_open_image (mono_defaults.corlib, NULL, 0); -} - void mono_debug_open_image_from_memory (MonoImage *image, const guint8 *raw_contents, int size) { @@ -296,14 +170,6 @@ mono_debug_cleanup (void) g_hash_table_destroy (data_table_hash); data_table_hash = NULL; } - - if (mono_symbol_table) { - if (mono_symbol_table->global_data_table) - free_data_table (mono_symbol_table->global_data_table); - - g_free (mono_symbol_table); - mono_symbol_table = NULL; - } } void @@ -348,7 +214,7 @@ mono_debug_domain_unload (MonoDomain *domain) * LOCKING: Assumes the debug lock is held. */ static MonoDebugHandle * -_mono_debug_get_image (MonoImage *image) +mono_debug_get_image (MonoImage *image) { return g_hash_table_lookup (mono_debug_handles, image); } @@ -363,13 +229,12 @@ mono_debug_close_image (MonoImage *image) mono_debugger_lock (); - handle = _mono_debug_get_image (image); + handle = mono_debug_get_image (image); if (!handle) { mono_debugger_unlock (); return; } - mono_debug_list_remove (&mono_symbol_table->symbol_files, handle); g_hash_table_remove (mono_debug_handles, image); mono_debugger_unlock (); @@ -385,26 +250,20 @@ mono_debug_open_image (MonoImage *image, const guint8 *raw_contents, int size) mono_debugger_lock (); - handle = _mono_debug_get_image (image); + handle = mono_debug_get_image (image); if (handle != NULL) { mono_debugger_unlock (); return handle; } handle = g_new0 (MonoDebugHandle, 1); - handle->index = ++next_symbol_file_id; handle->image = image; mono_image_addref (image); - handle->image_file = g_strdup (mono_image_get_filename (image)); - - handle->type_table = create_data_table (NULL); handle->symfile = mono_debug_open_mono_symbols ( handle, raw_contents, size, FALSE); - mono_debug_list_add (&mono_symbol_table->symbol_files, handle); - g_hash_table_insert (mono_debug_handles, image, handle); mono_debugger_unlock (); @@ -426,51 +285,6 @@ mono_debug_add_assembly (MonoAssembly *assembly, gpointer user_data) mono_debugger_unlock (); } -static guint8 * -allocate_data_item (MonoDebugDataTable *table, MonoDebugDataItemType type, guint32 size) -{ - guint32 chunk_size; - guint8 *data; - - size = ALIGN_TO (size, sizeof (gpointer)); - - if (size + 16 < DATA_TABLE_CHUNK_SIZE) - chunk_size = DATA_TABLE_CHUNK_SIZE; - else - chunk_size = size + 16; - - g_assert (table->current_chunk->current_offset == table->current_chunk->allocated_size); - - if (table->current_chunk->allocated_size + size + 8 >= table->current_chunk->total_size) { - MonoDebugDataChunk *new_chunk; - - new_chunk = g_malloc0 (sizeof (MonoDebugDataChunk) + chunk_size); - new_chunk->total_size = chunk_size; - - table->current_chunk->next = new_chunk; - table->current_chunk = new_chunk; - } - - data = &table->current_chunk->data [table->current_chunk->allocated_size]; - table->current_chunk->allocated_size += size + 8; - - * ((guint32 *) data) = size; - data += 4; - * ((guint32 *) data) = type; - data += 4; - return data; -} - -static void -write_data_item (MonoDebugDataTable *table, const guint8 *data) -{ - MonoDebugDataChunk *current_chunk = table->current_chunk; - guint32 size = * ((guint32 *) (data - 8)); - - g_assert (current_chunk->current_offset + size + 8 == current_chunk->allocated_size); - current_chunk->current_offset = current_chunk->allocated_size; -} - struct LookupMethodData { MonoDebugMethodInfo *minfo; @@ -491,7 +305,7 @@ lookup_method_func (gpointer key, gpointer value, gpointer user_data) } static MonoDebugMethodInfo * -_mono_debug_lookup_method (MonoMethod *method) +mono_debug_lookup_method_internal (MonoMethod *method) { struct LookupMethodData data; @@ -518,7 +332,7 @@ mono_debug_lookup_method (MonoMethod *method) MonoDebugMethodInfo *minfo; mono_debugger_lock (); - minfo = _mono_debug_lookup_method (method); + minfo = mono_debug_lookup_method_internal (method); mono_debugger_unlock (); return minfo; } @@ -572,31 +386,20 @@ write_variable (MonoDebugVarInfo *var, guint8 *ptr, guint8 **rptr) MonoDebugMethodAddress * mono_debug_add_method (MonoMethod *method, MonoDebugMethodJitInfo *jit, MonoDomain *domain) { - MonoMethod *declaring; MonoDebugDataTable *table; - MonoDebugMethodHeader *header; MonoDebugMethodAddress *address; MonoDebugMethodInfo *minfo; MonoDebugHandle *handle; guint8 buffer [BUFSIZ]; guint8 *ptr, *oldptr; guint32 i, size, total_size, max_size; - gboolean is_wrapper = FALSE; mono_debugger_lock (); table = lookup_data_table (domain); - handle = _mono_debug_get_image (method->klass->image); - minfo = _mono_debug_lookup_method (method); - - if (!minfo || (method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) || - (method->iflags & METHOD_IMPL_ATTRIBUTE_RUNTIME) || - (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) || - (method->flags & METHOD_ATTRIBUTE_ABSTRACT) || - (method->wrapper_type != MONO_WRAPPER_NONE)) { - is_wrapper = TRUE; - } + handle = mono_debug_get_image (method->klass->image); + minfo = mono_debug_lookup_method_internal (method); max_size = (5 * 5) + 1 + (10 * jit->num_line_numbers) + (25 + sizeof (gpointer)) * (1 + jit->num_params + jit->num_locals); @@ -642,16 +445,9 @@ mono_debug_add_method (MonoMethod *method, MonoDebugMethodJitInfo *jit, MonoDoma if (method_is_dynamic (method)) { address = g_malloc0 (total_size); } else { - address = (MonoDebugMethodAddress *) allocate_data_item ( - table, MONO_DEBUG_DATA_ITEM_METHOD, total_size); + address = mono_mempool_alloc (table->mp, total_size); } - address->header.size = total_size; - address->header.symfile_id = handle ? handle->index : 0; - address->header.domain_id = mono_domain_get_id (domain); - address->header.method_id = is_wrapper ? 0 : minfo->index; - address->header.method = method; - address->code_start = jit->code_start; address->code_size = jit->code_size; @@ -659,32 +455,8 @@ mono_debug_add_method (MonoMethod *method, MonoDebugMethodJitInfo *jit, MonoDoma if (max_size > BUFSIZ) g_free (oldptr); - declaring = method->is_inflated ? ((MonoMethodInflated *) method)->declaring : method; - header = g_hash_table_lookup (table->method_hash, declaring); - - if (!header) { - header = &address->header; - g_hash_table_insert (table->method_hash, declaring, header); - - if (is_wrapper) { - MonoDebugWrapperData *wrapper; - - header->wrapper_data = wrapper = g_new0 (MonoDebugWrapperData, 1); - - wrapper->wrapper_type = method->wrapper_type; - wrapper->method_name = mono_method_full_name (declaring, TRUE); - wrapper->obsolete_cil_code = ""; - } - } else { - address->header.wrapper_data = header->wrapper_data; - header->address_list = g_slist_prepend (header->address_list, address); - } - g_hash_table_insert (table->method_address_hash, method, address); - if (!method_is_dynamic (method)) - write_data_item (table, (guint8 *) address); - mono_debugger_unlock (); return address; } @@ -692,9 +464,7 @@ mono_debug_add_method (MonoMethod *method, MonoDebugMethodJitInfo *jit, MonoDoma void mono_debug_remove_method (MonoMethod *method, MonoDomain *domain) { - MonoMethod *declaring; MonoDebugDataTable *table; - MonoDebugMethodHeader *header; MonoDebugMethodAddress *address; if (!mono_debug_initialized) @@ -706,19 +476,9 @@ mono_debug_remove_method (MonoMethod *method, MonoDomain *domain) table = lookup_data_table (domain); - declaring = method->is_inflated ? ((MonoMethodInflated *) method)->declaring : method; - g_hash_table_remove (table->method_hash, declaring); - address = g_hash_table_lookup (table->method_address_hash, method); - if (address) { - header = &address->header; - - if (header->wrapper_data) { - g_free ((char*)header->wrapper_data->method_name); - g_free (header->wrapper_data); - } + if (address) g_free (address); - } g_hash_table_remove (table->method_address_hash, method); @@ -728,22 +488,6 @@ mono_debug_remove_method (MonoMethod *method, MonoDomain *domain) void mono_debug_add_delegate_trampoline (gpointer code, int size) { - MonoDebugDelegateTrampolineEntry *entry; - - if (!mono_debug_initialized) - return; - - mono_debugger_lock (); - - entry = (MonoDebugDelegateTrampolineEntry *) allocate_data_item ( - mono_symbol_table->global_data_table, MONO_DEBUG_DATA_ITEM_DELEGATE_TRAMPOLINE, - sizeof (MonoDebugDelegateTrampolineEntry)); - entry->code = code; - entry->size = size; - - write_data_item (mono_symbol_table->global_data_table, (guint8 *) entry); - - mono_debugger_unlock (); } static inline guint32 @@ -825,7 +569,6 @@ mono_debug_read_method (MonoDebugMethodAddress *address) jit = g_new0 (MonoDebugMethodJitInfo, 1); jit->code_start = address->code_start; jit->code_size = address->code_size; - jit->wrapper_addr = address->wrapper_addr; ptr = (guint8 *) &address->data; @@ -866,63 +609,6 @@ mono_debug_read_method (MonoDebugMethodAddress *address) return jit; } -static void -mono_debug_add_type (MonoClass *klass) -{ - MonoDebugHandle *handle; - MonoDebugClassEntry *entry; - guint8 buffer [BUFSIZ]; - guint8 *ptr, *oldptr; - guint32 size, total_size, max_size; - int base_offset = 0; - - if (klass->generic_class || klass->rank || - (klass->byval_arg.type == MONO_TYPE_VAR) || (klass->byval_arg.type == MONO_TYPE_MVAR)) - return; - - mono_debugger_lock (); - - handle = _mono_debug_get_image (klass->image); - if (!handle) { - mono_debugger_unlock (); - return; - } - - max_size = 12 + sizeof (gpointer); - if (max_size > BUFSIZ) - ptr = oldptr = g_malloc (max_size); - else - ptr = oldptr = buffer; - - if (klass->valuetype) - base_offset = - (int)(sizeof (MonoObject)); - - write_leb128 (klass->type_token, ptr, &ptr); - write_leb128 (klass->instance_size + base_offset, ptr, &ptr); - WRITE_UNALIGNED (gpointer, ptr, klass); - ptr += sizeof (gpointer); - - size = ptr - oldptr; - g_assert (size < max_size); - total_size = size + sizeof (MonoDebugClassEntry); - - g_assert (total_size + 9 < DATA_TABLE_CHUNK_SIZE); - - entry = (MonoDebugClassEntry *) allocate_data_item ( - handle->type_table, MONO_DEBUG_DATA_ITEM_CLASS, total_size); - - entry->size = total_size; - - memcpy (&entry->data, oldptr, size); - - write_data_item (handle->type_table, (guint8 *) entry); - - if (max_size > BUFSIZ) - g_free (oldptr); - - mono_debugger_unlock (); -} - static MonoDebugMethodJitInfo * find_method (MonoMethod *method, MonoDomain *domain) { @@ -952,71 +638,11 @@ mono_debug_find_method (MonoMethod *method, MonoDomain *domain) return res; } -struct LookupMethodAddressData -{ - MonoMethod *method; - MonoDebugMethodHeader *result; -}; - -static void -lookup_method_address_func (gpointer key, gpointer value, gpointer user_data) -{ - MonoDebugDataTable *table = (MonoDebugDataTable *) value; - struct LookupMethodAddressData *data = (struct LookupMethodAddressData *) user_data; - MonoDebugMethodHeader *header; - - header = g_hash_table_lookup (table->method_hash, data->method); - if (header) - data->result = header; -} - MonoDebugMethodAddressList * mono_debug_lookup_method_addresses (MonoMethod *method) { - MonoDebugMethodAddressList *info; - MonoDebugMethodHeader *header = NULL; - struct LookupMethodAddressData data; - MonoMethod *declaring; - int count, size; - GSList *list; - guint8 *ptr; - - g_assert ((mono_debug_debugger_version == 4) || (mono_debug_debugger_version == 5)); - - mono_debugger_lock (); - - declaring = method->is_inflated ? ((MonoMethodInflated *) method)->declaring : method; - - data.method = declaring; - data.result = NULL; - - g_hash_table_foreach (data_table_hash, lookup_method_address_func, &data); - header = data.result; - - if (!header) { - mono_debugger_unlock (); - return NULL; - } - - count = g_slist_length (header->address_list) + 1; - size = sizeof (MonoDebugMethodAddressList) + count * sizeof (gpointer); - - info = g_malloc0 (size); - info->size = size; - info->count = count; - - ptr = info->data; - - WRITE_UNALIGNED (gpointer, ptr, header); - ptr += sizeof (gpointer); - - for (list = header->address_list; list; list = list->next) { - WRITE_UNALIGNED (gpointer, ptr, list->data); - ptr += sizeof (gpointer); - } - - mono_debugger_unlock (); - return info; + g_assert_not_reached (); + return NULL; } static gint32 @@ -1085,7 +711,7 @@ mono_debug_lookup_source_location (MonoMethod *method, guint32 address, MonoDoma return NULL; mono_debugger_lock (); - minfo = _mono_debug_lookup_method (method); + minfo = mono_debug_lookup_method_internal (method); if (!minfo || !minfo->handle || !minfo->handle->symfile || !mono_debug_symfile_is_loaded (minfo->handle->symfile)) { mono_debugger_unlock (); return NULL; @@ -1118,7 +744,7 @@ mono_debug_lookup_locals (MonoMethod *method) return NULL; mono_debugger_lock (); - minfo = _mono_debug_lookup_method (method); + minfo = mono_debug_lookup_method_internal (method); if (!minfo || !minfo->handle || !minfo->handle->symfile || !mono_debug_symfile_is_loaded (minfo->handle->symfile)) { mono_debugger_unlock (); return NULL; @@ -1191,39 +817,6 @@ mono_debug_print_stack_frame (MonoMethod *method, guint32 native_offset, MonoDom return res; } -void -mono_debug_list_add (MonoDebugList **list, gconstpointer data) -{ - MonoDebugList *element, **ptr; - - element = g_new0 (MonoDebugList, 1); - element->data = data; - - for (ptr = list; *ptr; ptr = &(*ptr)->next) - ; - - *ptr = element; -} - -void -mono_debug_list_remove (MonoDebugList **list, gconstpointer data) -{ - MonoDebugList **ptr; - MonoDebugList *next; - - for (ptr = list; *ptr; ptr = &(*ptr)->next) { - if ((*ptr)->data != data) - continue; - - next = (*ptr)->next; - g_free ((*ptr)); - *ptr = next; - break; - } -} - -static gboolean is_attached = FALSE; - void mono_set_is_debugger_attached (gboolean attached) { @@ -1279,6 +872,27 @@ open_symfile_from_bundle (MonoImage *image) return NULL; } +void +mono_debugger_lock (void) +{ + g_assert (initialized); + mono_mutex_lock (&debugger_lock_mutex); +} + +void +mono_debugger_unlock (void) +{ + g_assert (initialized); + mono_mutex_unlock (&debugger_lock_mutex); +} + +void +mono_debugger_initialize () +{ + mono_mutex_init_recursive (&debugger_lock_mutex); + initialized = 1; +} + /** * mono_debug_enabled: * diff --git a/mono/metadata/mono-perfcounters.c b/mono/metadata/mono-perfcounters.c index c9dfc05d3a4..7c95c69a29f 100644 --- a/mono/metadata/mono-perfcounters.c +++ b/mono/metadata/mono-perfcounters.c @@ -912,7 +912,7 @@ mono_mem_counter (ImplVtable *vtable, MonoBoolean only_value, MonoCounterSample sample->counterType = predef_counters [predef_categories [CATEGORY_MONO_MEM].first_counter + id].type; switch (id) { case COUNTER_MEM_NUM_OBJECTS: - sample->rawValue = mono_stats.new_object_count; + sample->rawValue = 0; return TRUE; case COUNTER_MEM_PHYS_TOTAL: sample->rawValue = mono_determine_physical_ram_size ();; diff --git a/mono/metadata/monodiet.c b/mono/metadata/monodiet.c deleted file mode 100644 index 1ad1f538819..00000000000 --- a/mono/metadata/monodiet.c +++ /dev/null @@ -1,638 +0,0 @@ -/* - * monodiet.c: an IL code garbage collector - * - * Author: - * Paolo Molaro (lupus@ximian.com) - * - * (C) 2004 Novell, Inc. - */ - -#include -#include -#include "mono/metadata/class-internals.h" -#include "mono/metadata/assembly.h" -#include "mono/metadata/tokentype.h" -#include "mono/metadata/opcodes.h" -#include "mono/metadata/tabledefs.h" -#include "mono/metadata/mono-endian.h" -#include "mono/metadata/appdomain.h" /* mono_init */ -#include "mono/metadata/debug-helpers.h" - -/* -TODO: -*) handle proprties, events in a smart way. -*) add option that takes a directory and outputs the il files and recompiles automatically -*/ -static GHashTable *type_table; -static GHashTable *method_table; -static GHashTable *field_table; -static GHashTable *image_table; -static GList *virtual_methods; -static int verbose = 0; -static int force_enums = 0; -static FILE *outf = NULL; - -enum { - TYPE_BASIC = 1 << 0, - TYPE_FIELDS = 1 << 1, - TYPE_METHODS = 1 << 2, - TYPE_PROPERTIES = 1 << 3, - TYPE_EVENTS = 1 << 4, - TYPE_ALL = TYPE_BASIC | TYPE_FIELDS | TYPE_METHODS | TYPE_PROPERTIES | TYPE_EVENTS -}; - -static void handle_cattrs (MonoCustomAttrInfo* cattrs); - -static void -add_type (MonoClass* klass) -{ - gpointer val = NULL, oldkey = NULL; - if (g_hash_table_lookup_extended (type_table, klass, &oldkey, &val)) - return; - g_hash_table_insert (type_table, klass, NULL); - g_hash_table_insert (image_table, klass->image, NULL); -} - -static void -add_types_from_signature (MonoMethodSignature *sig) -{ - MonoClass *klass; - int i; - for (i = 0; i < sig->param_count; ++i) { - klass = mono_class_from_mono_type (sig->params [i]); - add_type (klass); - } - klass = mono_class_from_mono_type (sig->ret); - add_type (klass); -} - -static void -add_field (MonoClassField *field) { - MonoClass *k; - MonoCustomAttrInfo* cattrs; - gpointer val = NULL, oldkey = NULL; - - if (g_hash_table_lookup_extended (field_table, field, &oldkey, &val)) - return; - g_hash_table_insert (field_table, field, NULL); - add_type (field->parent); - k = mono_class_from_mono_type (field->type); - add_type (k); - cattrs = mono_custom_attrs_from_field (field->parent, field); - handle_cattrs (cattrs); -} - -static void -add_types_from_method (MonoMethod *method) { - const MonoOpcode *opcode; - MonoMethodHeader *header; - const unsigned char *ip, *il_code_end; - gpointer val = NULL, oldkey = NULL; - int i, n; - guint32 token; - MonoClass *klass; - MonoClassField *field; - MonoCustomAttrInfo* cattrs; - MonoType** locals; - gpointer exc_iter; - MonoExceptionClause clause; - - if (g_hash_table_lookup_extended (method_table, method, &oldkey, &val)) - return; - g_hash_table_insert (method_table, method, NULL); - - g_assert (method->klass); - - if (verbose > 1) - g_print ("#processing method: %s\n", mono_method_full_name (method, TRUE)); - mono_class_init (method->klass); - cattrs = mono_custom_attrs_from_method (method); - handle_cattrs (cattrs); - add_type (method->klass); - add_types_from_signature (mono_method_signature (method)); - for (i = 0; i < mono_method_signature (method)->param_count + 1; ++i) { - cattrs = mono_custom_attrs_from_param (method, i); - handle_cattrs (cattrs); - } - - if (method->flags & METHOD_ATTRIBUTE_VIRTUAL) - virtual_methods = g_list_prepend (virtual_methods, method); - - /* if no IL code to parse, return */ - if (method->iflags & (METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL | METHOD_IMPL_ATTRIBUTE_RUNTIME)) - return; - if (method->flags & (METHOD_ATTRIBUTE_PINVOKE_IMPL | METHOD_ATTRIBUTE_ABSTRACT)) - return; - - header = mono_method_get_header (method); - - locals = mono_method_header_get_locals (header, &n, NULL); - for (i = 0; i < n; ++i) { - klass = mono_class_from_mono_type (locals [i]); - add_type (klass); - } - for (exc_iter = NULL; mono_method_header_get_clauses (header, method, &exc_iter, &clause);) { - if (clause.flags == MONO_EXCEPTION_CLAUSE_NONE) - add_type (clause.data.catch_class); - } - - ip = mono_method_header_get_code (header, &n, NULL); - il_code_end = ip + n; - - while (ip < il_code_end) { - if (verbose > 2) - g_print ("#%s", mono_disasm_code_one (NULL, method, ip, NULL)); - if (*ip == 0xfe) { - ++ip; - i = *ip + 256; - } else { - i = *ip; - } - - opcode = &mono_opcodes [i]; - - switch (opcode->argument) { - case MonoInlineNone: - ip++; - break; - case MonoInlineType: - token = read32 (ip + 1); - add_type (mono_class_get (method->klass->image, token)); - ip += 5; - break; - case MonoInlineField: { - token = read32 (ip + 1); - field = mono_field_from_token (method->klass->image, token, &klass, NULL); - add_field (field); - add_type (klass); - ip += 5; - break; - } - case MonoInlineTok: - case MonoInlineSig: - /* FIXME */ - case MonoInlineString: - case MonoShortInlineR: - case MonoInlineBrTarget: - case MonoInlineI: - ip += 5; - break; - case MonoInlineVar: - ip += 3; - break; - case MonoShortInlineVar: - case MonoShortInlineI: - case MonoShortInlineBrTarget: - ip += 2; - break; - case MonoInlineSwitch: - ++ip; - n = read32 (ip); - ip += 4; - ip += 4 * n; - break; - case MonoInlineI8: - case MonoInlineR: - ip += 9; - break; - case MonoInlineMethod: - { - MonoMethod *cm = mono_get_method (method->klass->image, read32 (ip + 1), NULL); - add_type (cm->klass); - add_types_from_method (cm); - } - ip += 5; - break; - default: - g_assert_not_reached (); - } - } -} - -static void -handle_cattrs (MonoCustomAttrInfo* cattrs) -{ - int i; - if (!cattrs) - return; - for (i = 0; i < cattrs->num_attrs; ++i) { - add_types_from_method (cattrs->attrs [i].ctor); - } - mono_custom_attrs_free (cattrs); -} - -static void -handle_type (MonoClass *klass, guint32 flags) -{ - int i; - guint32 missing; - MonoCustomAttrInfo* cattrs; - gpointer val = NULL, oldkey = NULL; - MonoProperty* prop; - MonoEvent* event; - MonoMethod* method; - MonoClassField* field; - gpointer iter; - - if (g_hash_table_lookup_extended (type_table, klass, &oldkey, &val)) { - missing = flags & ~(GPOINTER_TO_UINT (val)); - } else { - missing = flags; - } - if (!missing) - return; - g_hash_table_insert (type_table, klass, GUINT_TO_POINTER (missing)); - if (verbose) - g_print ("#processing klass: %s.%s\n", klass->name_space, klass->name); - mono_class_init (klass); - if (klass->parent) - add_type (klass->parent); - if (klass->nested_in) - add_type (klass->nested_in); - iter = NULL; - while ((method = mono_class_get_methods (klass, &iter))) { - if ((missing & TYPE_METHODS) || strcmp (method->name, ".cctor") == 0) - add_types_from_method (method); - } - if (klass->enumtype) { - add_field (mono_class_get_field_from_name (klass, "value__")); - } - if (force_enums || (missing & TYPE_FIELDS)) { - iter = NULL; - while ((field = mono_class_get_fields (klass, &iter))) - add_field (field); - } - iter = NULL; - while ((prop = mono_class_get_properties (klass, &iter))) { - cattrs = mono_custom_attrs_from_property (klass, prop); - handle_cattrs (cattrs); - } - iter = NULL; - while ((event = mono_class_get_events (klass, &iter))) { - cattrs = mono_custom_attrs_from_event (klass, event); - handle_cattrs (cattrs); - } - for (i = 0; i < klass->interface_count; ++i) - add_type (klass->interfaces [i]); - cattrs = mono_custom_attrs_from_class (klass); - handle_cattrs (cattrs); -} - -static void -process_image (MonoImage *image, gboolean all) { - int i; - const MonoTableInfo *t; - MonoClass *klass; - MonoMethod *entry; - guint32 eptoken; - - if (verbose) - g_print ("#processing image: %s\n", mono_image_get_name (image)); - eptoken = mono_image_get_entry_point (image); - if (eptoken) { - entry = mono_get_method (image, eptoken, NULL); - add_types_from_method (entry); - } - /* we always add the type */ - klass = mono_class_get (image, MONO_TOKEN_TYPE_DEF | 1); - handle_type (klass, all? TYPE_ALL: TYPE_BASIC); - if (all) { - t = mono_image_get_table_info (image, MONO_TABLE_TYPEDEF); - for (i = 1; i < mono_table_info_get_rows (t); ++i) { - klass = mono_class_get (image, MONO_TOKEN_TYPE_DEF | (i + 1)); - handle_type (klass, all? TYPE_ALL: TYPE_BASIC); - } - } -} - -static void -process_assembly (MonoAssembly *assembly, gboolean all) { - MonoCustomAttrInfo* cattrs; - process_image (mono_assembly_get_image (assembly), all); - cattrs = mono_custom_attrs_from_assembly (assembly); - handle_cattrs (cattrs); -} - -static GList *worklist = NULL; - -static void -collect_type (const gpointer key, const gpointer val, gpointer user_data) -{ - MonoClass *klass = key; - if (klass->rank || klass->byval_arg.type == MONO_TYPE_PTR) - return; - worklist = g_list_prepend (worklist, key); -} - -static void -check_vmethods (MonoClass *klass, MonoMethod *method) -{ - MonoMethod **vtable; - if (method->klass == klass) - return; - mono_class_init (klass); - mono_class_init (method->klass); - vtable = klass->vtable; - /* iface */ - if (!vtable) - return; - if (method->klass->flags & TYPE_ATTRIBUTE_INTERFACE) { - if (MONO_CLASS_IMPLEMENTS_INTERFACE (klass, method->klass->interface_id)) { - int iface_offset = mono_class_interface_offset (klass, method->klass); - g_assert (method->slot != -1); - if (vtable [iface_offset + method->slot]) - add_types_from_method (vtable [iface_offset + method->slot]); - } - } else { - if (mono_class_has_parent (klass, method->klass)) { - g_assert (method->slot != -1); - if (vtable [method->slot]) - add_types_from_method (vtable [method->slot]); - } - } -} - -static void -process_images (void) { - int old_count, new_count; - GList *item, *vmethod; - new_count = g_hash_table_size (type_table); - new_count += g_hash_table_size (method_table); - new_count += g_hash_table_size (field_table); - do { - old_count = new_count; - if (verbose) - g_print ("#processing type table: %d\n", old_count); - g_list_free (worklist); - worklist = NULL; - g_hash_table_foreach (type_table, collect_type, NULL); - for (item = worklist; item; item = item->next) { - for (vmethod = virtual_methods; vmethod; vmethod = vmethod->next) { - check_vmethods (item->data, vmethod->data); - } - } - g_list_free (worklist); - worklist = NULL; - g_hash_table_foreach (type_table, collect_type, NULL); - for (item = worklist; item; item = item->next) { - handle_type (item->data, TYPE_BASIC); - } - new_count = g_hash_table_size (type_table); - new_count += g_hash_table_size (method_table); - new_count += g_hash_table_size (field_table); - } while (old_count != new_count); -} - -static void -foreach_method (const gpointer key, const gpointer val, gpointer user_data) -{ - MonoMethod *method = key; - MonoClass *klass = user_data; - if (method->klass != klass) - return; - /* FIXME: ensure it's the correct token */ - fprintf (outf, "M:0x%x\n", mono_metadata_token_index (method->token)); -} - -static void -foreach_field (const gpointer key, const gpointer val, gpointer user_data) -{ - MonoClassField *field = key; - MonoClass *klass = user_data; - int idx; - if (field->parent != klass) - return; - idx = mono_metadata_token_index (mono_class_get_field_token (field)); - fprintf (outf, "F:0x%x\n", idx); -} - -static void -foreach_type (const gpointer key, const gpointer val, gpointer user_data) -{ - MonoClass *klass = key; - MonoImage *image = user_data; - if (klass->image != image) - return; - if (klass->rank || klass->byval_arg.type == MONO_TYPE_PTR) - return; - fprintf (outf, "T:0x%x\n", mono_metadata_token_index (klass->type_token)); - g_hash_table_foreach (method_table, foreach_method, klass); - g_hash_table_foreach (field_table, foreach_field, klass); -} - -static void -foreach_image (const gpointer key, const gpointer val, gpointer user_data) -{ - MonoImage *image = key; - const char* aname; - aname = mono_image_get_name (image); - /* later print the guid as well to prevent mismatches */ - fprintf (outf, "[%s]\n", aname); - g_hash_table_foreach (type_table, foreach_type, image); -} - -static void -dump_images (const char *filename) -{ - if (filename) { - FILE* f = fopen (filename, "w"); - if (!f) - g_error ("cannot write to file '%s'\n", filename); - else - outf = f; - } else { - outf = stdout; - } - g_hash_table_foreach (image_table, foreach_image, NULL); - if (filename) - fclose (outf); -} - -static void -usage (int code) { - printf ("monodiet 0.1 Copyright (c) 2004 Novell, Inc\n"); - printf ("List the metadata elements used by the named assemblies.\n"); - printf ("Usage: monodiet [options] assembly [assembly2 ...]\n\n"); - printf ("Options:\n"); - printf ("\t-v increase verbose level\n"); - printf ("\t-h show help screen\n"); - printf ("\t-e force inclusion of enum members\n"); - printf ("\t-o FILENAME output the result to filename\n"); - printf ("\t-a FILENAME add metadata elements from description in filename\n"); - printf ("\t-F ASSEMBLY force add all metadata elements from assembly\n"); - exit (code); -} - -static MonoImage* -find_image (char *name) -{ - return mono_image_loaded (name); -} - -static MonoClass* -find_class (MonoImage *image, char *name) -{ - char *p = strrchr (name, '.'); - if (p) { - *p = 0; - return mono_class_from_name (image, name, p + 1); - } - return mono_class_from_name (image, "", name); -} - -static void -load_roots (const char* filename) -{ - FILE *file; - char buf [2048]; - char *p, *s; - int line = 0; - MonoImage *image = NULL; - MonoClass *klass = NULL; - MonoClassField *field; - MonoMethodDesc *mdesc; - MonoMethod *method; - - if (!(file = fopen (filename, "r"))) - return; - - while (fgets (buf, sizeof (buf), file)) { - /* FIXME: - * decide on the format to use to express types, fields, methods, - * maybe the same used on output from the tool, but with explicit - * names and signatures instead of token indexes - * add wildcard support - */ - ++line; - s = buf; - while (*s && g_ascii_isspace (*s)) ++s; - switch (*s) { - case 0: - case '#': - continue; /* comment */ - case '[': - p = strchr (s, ']'); - if (!p) - g_error ("invalid assembly format at line %d\n", line); - *p = 0; - p = s + 1; - image = find_image (p); - if (!image) - g_error ("image not loaded: %s\n", p); - klass = NULL; - break; - case 'T': - if (s [1] != ':') - g_error ("invalid type format at line %d\n", line); - if (!image) - break; - klass = find_class (image, s + 2); - break; - case 'F': - if (s [1] != ':') - g_error ("invalid field format at line %d\n", line); - if (!image || !klass) - break; - p = s + 2; - if (*p == '*') { - handle_type (klass, TYPE_FIELDS); - break; - } - field = mono_class_get_field_from_name (klass, p); - if (!field) - g_warning ("no field '%s' at line %d\n", p, line); - else - add_field (field); - break; - case 'M': - if (s [1] != ':') - g_error ("invalid method format at line %d\n", line); - if (!image || !klass) - break; - p = s + 2; - if (*p == '*') { - handle_type (klass, TYPE_METHODS); - break; - } - mdesc = mono_method_desc_new (p, FALSE); - if (!mdesc) { - g_error ("invalid method desc at line %d\n", line); - } - method = mono_method_desc_search_in_class (mdesc, klass); - if (!method) - g_warning ("no method '%s' at line %d\n", p, line); - else - add_types_from_method (method); - mono_method_desc_free (mdesc); - break; - default: - g_error ("invalid format at line %d\n", line); - } - } - fclose (file); -} - -int -main (int argc, char *argv[]) { - MonoAssembly *assembly = NULL; - const char *aname = NULL; - const char *outfile = NULL; - const char *rootfile = NULL; - int i; - gboolean all_meta = FALSE; - - mono_init (argv [0]); - - type_table = g_hash_table_new (NULL, NULL); - method_table = g_hash_table_new (NULL, NULL); - field_table = g_hash_table_new (NULL, NULL); - image_table = g_hash_table_new (NULL, NULL); - - for (i = 1; i < argc; ++i) { - all_meta = FALSE; - aname = argv [i]; - if (strcmp (aname, "-v") == 0) { - verbose++; - continue; - } else if (strcmp (aname, "-e") == 0) { - force_enums = 1; - continue; - } else if (strcmp (aname, "-h") == 0) { - usage (0); - } else if (strcmp (aname, "-o") == 0) { - i++; - if (i >= argc) - usage (1); - outfile = argv [i]; - continue; - } else if (strcmp (aname, "-F") == 0) { - i++; - if (i >= argc) - usage (1); - all_meta = TRUE; - aname = argv [i]; - } else if (strcmp (aname, "-a") == 0) { - i++; - if (i >= argc) - usage (1); - rootfile = argv [i]; - continue; - } - assembly = mono_assembly_open (aname, NULL); - if (!assembly) { - g_print ("cannot open assembly %s\n", aname); - exit (1); - } - process_assembly (assembly, all_meta); - } - if (!assembly) - usage (1); - if (rootfile) - load_roots (rootfile); - process_images (); - dump_images (outfile); - - return 0; -} - - diff --git a/mono/metadata/object-internals.h b/mono/metadata/object-internals.h index 47e36e2d494..11bb021a36f 100644 --- a/mono/metadata/object-internals.h +++ b/mono/metadata/object-internals.h @@ -1416,7 +1416,7 @@ void mono_reflection_create_unmanaged_type (MonoReflectionType *type) MON void mono_reflection_register_with_runtime (MonoReflectionType *type) MONO_INTERNAL; void mono_reflection_create_custom_attr_data_args (MonoImage *image, MonoMethod *method, const guchar *data, guint32 len, MonoArray **typed_args, MonoArray **named_args, CattrNamedArg **named_arg_info, MonoError *error) MONO_INTERNAL; -MonoMethodSignature * mono_reflection_lookup_signature (MonoImage *image, MonoMethod *method, guint32 token) MONO_INTERNAL; +MonoMethodSignature * mono_reflection_lookup_signature (MonoImage *image, MonoMethod *method, guint32 token, MonoError *error) MONO_INTERNAL; MonoArray* mono_param_get_objects_internal (MonoDomain *domain, MonoMethod *method, MonoClass *refclass) MONO_INTERNAL; diff --git a/mono/metadata/object.c b/mono/metadata/object.c index b9abf073f05..00c013b215c 100644 --- a/mono/metadata/object.c +++ b/mono/metadata/object.c @@ -1860,6 +1860,7 @@ mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *class, gboolean char *t; int i, vtable_slots; int imt_table_bytes = 0; + int alloc_offset; int gc_bits; guint32 vtable_size, class_size; guint32 cindex; @@ -1946,14 +1947,27 @@ mono_class_create_runtime_vtable (MonoDomain *domain, MonoClass *class, gboolean MONO_SIZEOF_VTABLE + vtable_slots * sizeof (gpointer); } + /* + * We want the pointer to the MonoVTable aligned to 8 bytes because SGen uses three + * address bits. The IMT has an odd number of entries, however, so on 32 bits the + * alignment will be off. In that case we allocate 4 more bytes and skip over them. + */ + if (sizeof (gpointer) == 4 && (imt_table_bytes & 7)) { + g_assert ((imt_table_bytes & 7) == 4); + vtable_size += 4; + alloc_offset = 4; + } else { + alloc_offset = 0; + } + mono_stats.used_class_count++; mono_stats.class_vtable_size += vtable_size; - interface_offsets = mono_domain_alloc0 (domain, vtable_size); - if (ARCH_USE_IMT) - vt = (MonoVTable*) ((char*)interface_offsets + imt_table_bytes); - else - vt = (MonoVTable*) (interface_offsets + class->max_interface_id + 1); + interface_offsets = (gpointer*) ((char*)mono_domain_alloc0 (domain, vtable_size) + alloc_offset); + + vt = (MonoVTable*) ((char*)interface_offsets + imt_table_bytes); + g_assert (!((gsize)vt & 7)); + vt->klass = class; vt->rank = class->rank; vt->domain = domain; @@ -4368,7 +4382,6 @@ static inline void * mono_object_allocate (size_t size, MonoVTable *vtable) { MonoObject *o; - mono_stats.new_object_count++; ALLOC_OBJECT (o, vtable, size); return o; @@ -4385,7 +4398,6 @@ static inline void * mono_object_allocate_ptrfree (size_t size, MonoVTable *vtable) { MonoObject *o; - mono_stats.new_object_count++; ALLOC_PTRFREE (o, vtable, size); return o; } @@ -4395,7 +4407,6 @@ mono_object_allocate_spec (size_t size, MonoVTable *vtable) { void *o; ALLOC_TYPED (o, size, vtable); - mono_stats.new_object_count++; return o; } @@ -4879,7 +4890,6 @@ mono_array_new_full (MonoDomain *domain, MonoClass *array_class, uintptr_t *leng else o = mono_gc_alloc_vector (vtable, byte_len, len); array = (MonoArray*)o; - mono_stats.new_object_count++; bounds = array->bounds; #endif @@ -4964,7 +4974,6 @@ mono_array_new_specific (MonoVTable *vtable, uintptr_t n) #else o = mono_gc_alloc_vector (vtable, byte_len, n); ao = (MonoArray*)o; - mono_stats.new_object_count++; #endif if (G_UNLIKELY (profile_allocs)) diff --git a/mono/metadata/pedump.c b/mono/metadata/pedump.c index 496c3c7f5ff..8d0709ced19 100644 --- a/mono/metadata/pedump.c +++ b/mono/metadata/pedump.c @@ -27,6 +27,7 @@ #include #include "mono/utils/mono-digest.h" #include +#include #include #include #ifdef HAVE_UNISTD_H @@ -653,6 +654,7 @@ main (int argc, char *argv []) #ifndef DISABLE_PERFCOUNTERS mono_perfcounters_init (); #endif + mono_counters_init (); mono_metadata_init (); mono_images_init (); mono_assemblies_init (); diff --git a/mono/metadata/reflection.c b/mono/metadata/reflection.c index 6614b01e1e9..0db16c92df4 100644 --- a/mono/metadata/reflection.c +++ b/mono/metadata/reflection.c @@ -11847,16 +11847,18 @@ mono_reflection_is_valid_dynamic_token (MonoDynamicImage *image, guint32 token) } MonoMethodSignature * -mono_reflection_lookup_signature (MonoImage *image, MonoMethod *method, guint32 token) +mono_reflection_lookup_signature (MonoImage *image, MonoMethod *method, guint32 token, MonoError *error) { MonoMethodSignature *sig; g_assert (image_is_dynamic (image)); + mono_error_init (error); + sig = g_hash_table_lookup (((MonoDynamicImage*)image)->vararg_aux_hash, GUINT_TO_POINTER (token)); if (sig) return sig; - return mono_method_signature (method); + return mono_method_signature_checked (method, error); } #ifndef DISABLE_REFLECTION_EMIT diff --git a/mono/metadata/remoting.c b/mono/metadata/remoting.c new file mode 100644 index 00000000000..9002bf0f11e --- /dev/null +++ b/mono/metadata/remoting.c @@ -0,0 +1,1994 @@ +/* + * remoting.c: Remoting support + * + * Copyright 2002-2003 Ximian, Inc (http://www.ximian.com) + * Copyright 2004-2009 Novell, Inc (http://www.novell.com) + * Copyright 2011-2014 Xamarin, Inc (http://www.xamarin.com) + * + */ + +#include "config.h" + +#include "mono/metadata/remoting.h" +#include "mono/metadata/marshal.h" +#include "mono/metadata/abi-details.h" +#include "mono/metadata/cominterop.h" +#include "mono/metadata/tabledefs.h" +#include "mono/metadata/exception.h" +#include "mono/metadata/debug-helpers.h" + +typedef enum { + MONO_MARSHAL_NONE, /* No marshalling needed */ + MONO_MARSHAL_COPY, /* Can be copied by value to the new domain */ + MONO_MARSHAL_COPY_OUT, /* out parameter that needs to be copied back to the original instance */ + MONO_MARSHAL_SERIALIZE /* Value needs to be serialized into the new domain */ +} MonoXDomainMarshalType; + +#ifndef DISABLE_REMOTING + +#define OPDEF(a,b,c,d,e,f,g,h,i,j) \ + a = i, + +enum { +#include "mono/cil/opcode.def" + LAST = 0xff +}; +#undef OPDEF + +struct _MonoRemotingMethods { + MonoMethod *invoke; + MonoMethod *invoke_with_check; + MonoMethod *xdomain_invoke; + MonoMethod *xdomain_dispatch; +}; + +typedef struct _MonoRemotingMethods MonoRemotingMethods; + +static MonoObject * +mono_remoting_wrapper (MonoMethod *method, gpointer *params); + +static gint32 +mono_marshal_set_domain_by_id (gint32 id, MonoBoolean push); + +static gboolean +mono_marshal_check_domain_image (gint32 domain_id, MonoImage *image); + +MONO_API void +mono_upgrade_remote_class_wrapper (MonoReflectionType *rtype, MonoTransparentProxy *tproxy); + +static MonoXDomainMarshalType +mono_get_xdomain_marshal_type (MonoType *t); + +static void +mono_marshal_xdomain_copy_out_value (MonoObject *src, MonoObject *dst); + +static MonoReflectionType * +type_from_handle (MonoType *handle); + +static mono_mutex_t remoting_mutex; +static gboolean remoting_mutex_inited; + +static MonoClass *byte_array_class; +static MonoMethod *method_rs_serialize, *method_rs_deserialize, *method_exc_fixexc, *method_rs_appdomain_target; +static MonoMethod *method_set_call_context, *method_needs_context_sink, *method_rs_serialize_exc; + +static void +register_icall (gpointer func, const char *name, const char *sigstr, gboolean save) +{ + MonoMethodSignature *sig = mono_create_icall_signature (sigstr); + + mono_register_jit_icall (func, name, sig, save); +} + +static inline void +remoting_lock (void) +{ + g_assert (remoting_mutex_inited); + mono_mutex_lock (&remoting_mutex); +} + +static inline void +remoting_unlock (void) +{ + g_assert (remoting_mutex_inited); + mono_mutex_unlock (&remoting_mutex); +} + +/* + * Return the hash table pointed to by VAR, lazily creating it if neccesary. + */ +static GHashTable* +get_cache (GHashTable **var, GHashFunc hash_func, GCompareFunc equal_func) +{ + if (!(*var)) { + remoting_lock (); + if (!(*var)) { + GHashTable *cache = + g_hash_table_new (hash_func, equal_func); + mono_memory_barrier (); + *var = cache; + } + remoting_unlock (); + } + return *var; +} + +static GHashTable* +get_cache_full (GHashTable **var, GHashFunc hash_func, GCompareFunc equal_func, GDestroyNotify key_destroy_func, GDestroyNotify value_destroy_func) +{ + if (!(*var)) { + remoting_lock (); + if (!(*var)) { + GHashTable *cache = + g_hash_table_new_full (hash_func, equal_func, key_destroy_func, value_destroy_func); + mono_memory_barrier (); + *var = cache; + } + remoting_unlock (); + } + return *var; +} + +void +mono_remoting_init (void) +{ + mono_mutex_init (&remoting_mutex); + remoting_mutex_inited = TRUE; +} + +static void +mono_remoting_marshal_init (void) +{ + MonoClass *klass; + + static gboolean module_initialized = FALSE; + + if (module_initialized) + return; + + klass = mono_class_from_name (mono_defaults.corlib, "System.Runtime.Remoting", "RemotingServices"); + method_rs_serialize = mono_class_get_method_from_name (klass, "SerializeCallData", -1); + method_rs_deserialize = mono_class_get_method_from_name (klass, "DeserializeCallData", -1); + method_rs_serialize_exc = mono_class_get_method_from_name (klass, "SerializeExceptionData", -1); + + klass = mono_defaults.real_proxy_class; + method_rs_appdomain_target = mono_class_get_method_from_name (klass, "GetAppDomainTarget", -1); + + klass = mono_defaults.exception_class; + method_exc_fixexc = mono_class_get_method_from_name (klass, "FixRemotingException", -1); + + byte_array_class = mono_array_class_get (mono_defaults.byte_class, 1); + + klass = mono_class_from_name (mono_defaults.corlib, "System.Runtime.Remoting.Messaging", "CallContext"); + method_set_call_context = mono_class_get_method_from_name (klass, "SetCurrentCallContext", -1); + + klass = mono_class_from_name (mono_defaults.corlib, "System.Runtime.Remoting.Contexts", "Context"); + method_needs_context_sink = mono_class_get_method_from_name (klass, "get_NeedsContextSink", -1); + + register_icall (type_from_handle, "type_from_handle", "object ptr", FALSE); + register_icall (mono_marshal_set_domain_by_id, "mono_marshal_set_domain_by_id", "int32 int32 int32", FALSE); + register_icall (mono_marshal_check_domain_image, "mono_marshal_check_domain_image", "int32 int32 ptr", FALSE); + register_icall (mono_marshal_xdomain_copy_value, "mono_marshal_xdomain_copy_value", "object object", FALSE); + register_icall (mono_marshal_xdomain_copy_out_value, "mono_marshal_xdomain_copy_out_value", "void object object", FALSE); + register_icall (mono_remoting_wrapper, "mono_remoting_wrapper", "object ptr ptr", FALSE); + register_icall (mono_upgrade_remote_class_wrapper, "mono_upgrade_remote_class_wrapper", "void object object", FALSE); + + module_initialized = TRUE; +} + +static MonoReflectionType * +type_from_handle (MonoType *handle) +{ + MonoDomain *domain = mono_domain_get (); + MonoClass *klass = mono_class_from_mono_type (handle); + + MONO_ARCH_SAVE_REGS; + + mono_class_init (klass); + return mono_type_get_object (domain, handle); +} + +#ifndef DISABLE_JIT +static int +mono_mb_emit_proxy_check (MonoMethodBuilder *mb, int branch_code) +{ + int pos; + mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoObject, vtable)); + mono_mb_emit_byte (mb, CEE_LDIND_I); + mono_mb_emit_icon (mb, MONO_STRUCT_OFFSET (MonoVTable, klass)); + mono_mb_emit_byte (mb, CEE_ADD); + mono_mb_emit_byte (mb, CEE_LDIND_I); + mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX); + mono_mb_emit_byte (mb, CEE_MONO_CLASSCONST); + mono_mb_emit_i4 (mb, mono_mb_add_data (mb, mono_defaults.transparent_proxy_class)); + pos = mono_mb_emit_branch (mb, branch_code); + return pos; +} + +static int +mono_mb_emit_xdomain_check (MonoMethodBuilder *mb, int branch_code) +{ + int pos; + mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoTransparentProxy, rp)); + mono_mb_emit_byte (mb, CEE_LDIND_REF); + mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoRealProxy, target_domain_id)); + mono_mb_emit_byte (mb, CEE_LDIND_I4); + mono_mb_emit_icon (mb, -1); + pos = mono_mb_emit_branch (mb, branch_code); + return pos; +} + +static int +mono_mb_emit_contextbound_check (MonoMethodBuilder *mb, int branch_code) +{ + static int offset = -1; + static guint8 mask; + + if (offset < 0) + mono_marshal_find_bitfield_offset (MonoClass, contextbound, &offset, &mask); + + mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoTransparentProxy, remote_class)); + mono_mb_emit_byte (mb, CEE_LDIND_REF); + mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoRemoteClass, proxy_class)); + mono_mb_emit_byte (mb, CEE_LDIND_REF); + mono_mb_emit_ldflda (mb, offset); + mono_mb_emit_byte (mb, CEE_LDIND_U1); + mono_mb_emit_icon (mb, mask); + mono_mb_emit_byte (mb, CEE_AND); + mono_mb_emit_icon (mb, 0); + return mono_mb_emit_branch (mb, branch_code); +} +#endif /* !DISABLE_JIT */ + +static inline MonoMethod* +mono_marshal_remoting_find_in_cache (MonoMethod *method, int wrapper_type) +{ + MonoMethod *res = NULL; + MonoRemotingMethods *wrps; + + mono_marshal_lock_internal (); + if (method->klass->image->remoting_invoke_cache) + wrps = g_hash_table_lookup (method->klass->image->remoting_invoke_cache, method); + else + wrps = NULL; + + if (wrps) { + switch (wrapper_type) { + case MONO_WRAPPER_REMOTING_INVOKE: res = wrps->invoke; break; + case MONO_WRAPPER_REMOTING_INVOKE_WITH_CHECK: res = wrps->invoke_with_check; break; + case MONO_WRAPPER_XDOMAIN_INVOKE: res = wrps->xdomain_invoke; break; + case MONO_WRAPPER_XDOMAIN_DISPATCH: res = wrps->xdomain_dispatch; break; + } + } + + /* it is important to do the unlock after the load from wrps, since in + * mono_remoting_mb_create_and_cache () we drop the marshal lock to be able + * to take the loader lock and some other thread may set the fields. + */ + mono_marshal_unlock_internal (); + return res; +} + +/* Create the method from the builder and place it in the cache */ +static inline MonoMethod* +mono_remoting_mb_create_and_cache (MonoMethod *key, MonoMethodBuilder *mb, + MonoMethodSignature *sig, int max_stack) +{ + MonoMethod **res = NULL; + MonoRemotingMethods *wrps; + GHashTable *cache = get_cache_full (&key->klass->image->remoting_invoke_cache, mono_aligned_addr_hash, NULL, NULL, g_free); + + mono_marshal_lock_internal (); + wrps = g_hash_table_lookup (cache, key); + if (!wrps) { + wrps = g_new0 (MonoRemotingMethods, 1); + g_hash_table_insert (cache, key, wrps); + } + + switch (mb->method->wrapper_type) { + case MONO_WRAPPER_REMOTING_INVOKE: res = &wrps->invoke; break; + case MONO_WRAPPER_REMOTING_INVOKE_WITH_CHECK: res = &wrps->invoke_with_check; break; + case MONO_WRAPPER_XDOMAIN_INVOKE: res = &wrps->xdomain_invoke; break; + case MONO_WRAPPER_XDOMAIN_DISPATCH: res = &wrps->xdomain_dispatch; break; + default: g_assert_not_reached (); break; + } + mono_marshal_unlock_internal (); + + if (*res == NULL) { + MonoMethod *newm; + newm = mono_mb_create_method (mb, sig, max_stack); + + mono_marshal_lock_internal (); + if (!*res) { + *res = newm; + mono_marshal_set_wrapper_info (*res, key); + mono_marshal_unlock_internal (); + } else { + mono_marshal_unlock_internal (); + mono_free_method (newm); + } + } + + return *res; +} + +static MonoObject * +mono_remoting_wrapper (MonoMethod *method, gpointer *params) +{ + MonoMethodMessage *msg; + MonoTransparentProxy *this; + MonoObject *res, *exc; + MonoArray *out_args; + + this = *((MonoTransparentProxy **)params [0]); + + g_assert (this); + g_assert (((MonoObject *)this)->vtable->klass == mono_defaults.transparent_proxy_class); + + /* skip the this pointer */ + params++; + + if (mono_class_is_contextbound (this->remote_class->proxy_class) && this->rp->context == (MonoObject *) mono_context_get ()) + { + int i; + MonoMethodSignature *sig = mono_method_signature (method); + int count = sig->param_count; + gpointer* mparams = (gpointer*) alloca(count*sizeof(gpointer)); + + for (i=0; iparams [i]); + if (class->valuetype) { + if (sig->params [i]->byref) { + mparams[i] = *((gpointer *)params [i]); + } else { + /* runtime_invoke expects a boxed instance */ + if (mono_class_is_nullable (mono_class_from_mono_type (sig->params [i]))) + mparams[i] = mono_nullable_box (params [i], class); + else + mparams[i] = params [i]; + } + } else { + mparams[i] = *((gpointer**)params [i]); + } + } + + return mono_runtime_invoke (method, method->klass->valuetype? mono_object_unbox ((MonoObject*)this): this, mparams, NULL); + } + + msg = mono_method_call_message_new (method, params, NULL, NULL, NULL); + + res = mono_remoting_invoke ((MonoObject *)this->rp, msg, &exc, &out_args); + + if (exc) + mono_raise_exception ((MonoException *)exc); + + mono_method_return_message_restore (method, params, out_args); + + return res; +} + +MonoMethod * +mono_marshal_get_remoting_invoke (MonoMethod *method) +{ + MonoMethodSignature *sig; + MonoMethodBuilder *mb; + MonoMethod *res; + int params_var; + + g_assert (method); + + if (method->wrapper_type == MONO_WRAPPER_REMOTING_INVOKE || method->wrapper_type == MONO_WRAPPER_XDOMAIN_INVOKE) + return method; + + /* this seems to be the best plase to put this, as all remoting invokes seem to get filtered through here */ +#ifndef DISABLE_COM + if (mono_class_is_com_object (method->klass) || method->klass == mono_class_get_com_object_class ()) { + MonoVTable *vtable = mono_class_vtable (mono_domain_get (), method->klass); + g_assert (vtable); /*FIXME do proper error handling*/ + + if (!mono_vtable_is_remote (vtable)) { + return mono_cominterop_get_invoke (method); + } + } +#endif + + sig = mono_signature_no_pinvoke (method); + + /* we cant remote methods without this pointer */ + if (!sig->hasthis) + return method; + + if ((res = mono_marshal_remoting_find_in_cache (method, MONO_WRAPPER_REMOTING_INVOKE))) + return res; + + mono_remoting_marshal_init (); + + mb = mono_mb_new (method->klass, method->name, MONO_WRAPPER_REMOTING_INVOKE); + +#ifndef DISABLE_JIT + mb->method->save_lmf = 1; + + params_var = mono_mb_emit_save_args (mb, sig, TRUE); + + mono_mb_emit_ptr (mb, method); + mono_mb_emit_ldloc (mb, params_var); + mono_mb_emit_icall (mb, mono_remoting_wrapper); + mono_marshal_emit_thread_interrupt_checkpoint (mb); + + if (sig->ret->type == MONO_TYPE_VOID) { + mono_mb_emit_byte (mb, CEE_POP); + mono_mb_emit_byte (mb, CEE_RET); + } else { + mono_mb_emit_restore_result (mb, sig->ret); + } +#endif + + res = mono_remoting_mb_create_and_cache (method, mb, sig, sig->param_count + 16); + mono_mb_free (mb); + + return res; +} + +/* mono_marshal_xdomain_copy_out_value() + * Copies the contents of the src instance into the dst instance. src and dst + * must have the same type, and if they are arrays, the same size. + */ +static void +mono_marshal_xdomain_copy_out_value (MonoObject *src, MonoObject *dst) +{ + if (src == NULL || dst == NULL) return; + + g_assert (mono_object_class (src) == mono_object_class (dst)); + + switch (mono_object_class (src)->byval_arg.type) { + case MONO_TYPE_ARRAY: + case MONO_TYPE_SZARRAY: { + int mt = mono_get_xdomain_marshal_type (&(mono_object_class (src)->element_class->byval_arg)); + if (mt == MONO_MARSHAL_SERIALIZE) return; + if (mt == MONO_MARSHAL_COPY) { + int i, len = mono_array_length ((MonoArray *)dst); + for (i = 0; i < len; i++) { + MonoObject *item = mono_array_get ((MonoArray *)src, gpointer, i); + mono_array_setref ((MonoArray *)dst, i, mono_marshal_xdomain_copy_value (item)); + } + } else { + mono_array_full_copy ((MonoArray *)src, (MonoArray *)dst); + } + return; + } + } + + if (mono_object_class (src) == mono_defaults.stringbuilder_class) { + MonoStringBuilder *src_sb = (MonoStringBuilder *) src; + MonoStringBuilder *dst_sb = (MonoStringBuilder *) dst; + + MONO_OBJECT_SETREF (dst_sb, str, mono_string_new_utf16 (mono_object_domain (dst), mono_string_chars (src_sb->str), mono_string_length (src_sb->str))); + dst_sb->cached_str = NULL; + dst_sb->length = src_sb->length; + } +} + + +#if !defined (DISABLE_JIT) +static void +mono_marshal_emit_xdomain_copy_value (MonoMethodBuilder *mb, MonoClass *pclass) +{ + mono_mb_emit_icall (mb, mono_marshal_xdomain_copy_value); + mono_mb_emit_op (mb, CEE_CASTCLASS, pclass); +} + +static void +mono_marshal_emit_xdomain_copy_out_value (MonoMethodBuilder *mb, MonoClass *pclass) +{ + mono_mb_emit_icall (mb, mono_marshal_xdomain_copy_out_value); +} +#endif + +/* mono_marshal_supports_fast_xdomain() + * Returns TRUE if the method can use the fast xdomain wrapper. + */ +static gboolean +mono_marshal_supports_fast_xdomain (MonoMethod *method) +{ + return !mono_class_is_contextbound (method->klass) && + !((method->flags & METHOD_ATTRIBUTE_SPECIAL_NAME) && (strcmp (".ctor", method->name) == 0)); +} + +static gint32 +mono_marshal_set_domain_by_id (gint32 id, MonoBoolean push) +{ + MonoDomain *current_domain = mono_domain_get (); + MonoDomain *domain = mono_domain_get_by_id (id); + + if (!domain || !mono_domain_set (domain, FALSE)) + mono_raise_exception (mono_get_exception_appdomain_unloaded ()); + + if (push) + mono_thread_push_appdomain_ref (domain); + else + mono_thread_pop_appdomain_ref (); + + return current_domain->domain_id; +} + +#if !defined (DISABLE_JIT) +static void +mono_marshal_emit_switch_domain (MonoMethodBuilder *mb) +{ + mono_mb_emit_icall (mb, mono_marshal_set_domain_by_id); +} + +/* mono_marshal_emit_load_domain_method () + * Loads into the stack a pointer to the code of the provided method for + * the current domain. + */ +static void +mono_marshal_emit_load_domain_method (MonoMethodBuilder *mb, MonoMethod *method) +{ + /* We need a pointer to the method for the running domain (not the domain + * that compiles the method). + */ + mono_mb_emit_ptr (mb, method); + mono_mb_emit_icall (mb, mono_compile_method); +} +#endif + +/* mono_marshal_check_domain_image () + * Returns TRUE if the image is loaded in the specified + * application domain. + */ +static gboolean +mono_marshal_check_domain_image (gint32 domain_id, MonoImage *image) +{ + MonoAssembly* ass; + GSList *tmp; + + MonoDomain *domain = mono_domain_get_by_id (domain_id); + if (!domain) + return FALSE; + + mono_domain_assemblies_lock (domain); + for (tmp = domain->domain_assemblies; tmp; tmp = tmp->next) { + ass = tmp->data; + if (ass->image == image) + break; + } + mono_domain_assemblies_unlock (domain); + + return tmp != NULL; +} + +/* mono_marshal_get_xappdomain_dispatch () + * Generates a method that dispatches a method call from another domain into + * the current domain. + */ +static MonoMethod * +mono_marshal_get_xappdomain_dispatch (MonoMethod *method, int *marshal_types, int complex_count, int complex_out_count, int ret_marshal_type) +{ + MonoMethodSignature *sig, *csig; + MonoMethodBuilder *mb; + MonoMethod *res; + int i, j, param_index, copy_locals_base; + MonoClass *ret_class = NULL; + int loc_array=0, loc_return=0, loc_serialized_exc=0; + MonoExceptionClause *main_clause; + int pos, pos_leave; + gboolean copy_return; + + if ((res = mono_marshal_remoting_find_in_cache (method, MONO_WRAPPER_XDOMAIN_DISPATCH))) + return res; + + sig = mono_method_signature (method); + copy_return = (sig->ret->type != MONO_TYPE_VOID && ret_marshal_type != MONO_MARSHAL_SERIALIZE); + + j = 0; + csig = mono_metadata_signature_alloc (mono_defaults.corlib, 3 + sig->param_count - complex_count); + csig->params [j++] = &mono_defaults.object_class->byval_arg; + csig->params [j++] = &byte_array_class->this_arg; + csig->params [j++] = &byte_array_class->this_arg; + for (i = 0; i < sig->param_count; i++) { + if (marshal_types [i] != MONO_MARSHAL_SERIALIZE) + csig->params [j++] = sig->params [i]; + } + if (copy_return) + csig->ret = sig->ret; + else + csig->ret = &mono_defaults.void_class->byval_arg; + csig->pinvoke = 1; + csig->hasthis = FALSE; + + mb = mono_mb_new (method->klass, method->name, MONO_WRAPPER_XDOMAIN_DISPATCH); + mb->method->save_lmf = 1; + +#ifndef DISABLE_JIT + /* Locals */ + + loc_serialized_exc = mono_mb_add_local (mb, &byte_array_class->byval_arg); + if (complex_count > 0) + loc_array = mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg); + if (sig->ret->type != MONO_TYPE_VOID) { + loc_return = mono_mb_add_local (mb, sig->ret); + ret_class = mono_class_from_mono_type (sig->ret); + } + + /* try */ + + main_clause = mono_image_alloc0 (method->klass->image, sizeof (MonoExceptionClause)); + main_clause->try_offset = mono_mb_get_label (mb); + + /* Clean the call context */ + + mono_mb_emit_byte (mb, CEE_LDNULL); + mono_mb_emit_managed_call (mb, method_set_call_context, NULL); + mono_mb_emit_byte (mb, CEE_POP); + + /* Deserialize call data */ + + mono_mb_emit_ldarg (mb, 1); + mono_mb_emit_byte (mb, CEE_LDIND_REF); + mono_mb_emit_byte (mb, CEE_DUP); + pos = mono_mb_emit_short_branch (mb, CEE_BRFALSE_S); + + mono_marshal_emit_xdomain_copy_value (mb, byte_array_class); + mono_mb_emit_managed_call (mb, method_rs_deserialize, NULL); + + if (complex_count > 0) + mono_mb_emit_stloc (mb, loc_array); + else + mono_mb_emit_byte (mb, CEE_POP); + + mono_mb_patch_short_branch (mb, pos); + + /* Get the target object */ + + mono_mb_emit_ldarg (mb, 0); + mono_mb_emit_managed_call (mb, method_rs_appdomain_target, NULL); + + /* Load the arguments */ + + copy_locals_base = mb->locals; + param_index = 3; // Index of the first non-serialized parameter of this wrapper + j = 0; + for (i = 0; i < sig->param_count; i++) { + MonoType *pt = sig->params [i]; + MonoClass *pclass = mono_class_from_mono_type (pt); + switch (marshal_types [i]) { + case MONO_MARSHAL_SERIALIZE: { + /* take the value from the serialized array */ + mono_mb_emit_ldloc (mb, loc_array); + mono_mb_emit_icon (mb, j++); + if (pt->byref) { + if (pclass->valuetype) { + mono_mb_emit_byte (mb, CEE_LDELEM_REF); + mono_mb_emit_op (mb, CEE_UNBOX, pclass); + } else { + mono_mb_emit_op (mb, CEE_LDELEMA, pclass); + } + } else { + if (pclass->valuetype) { + mono_mb_emit_byte (mb, CEE_LDELEM_REF); + mono_mb_emit_op (mb, CEE_UNBOX, pclass); + mono_mb_emit_op (mb, CEE_LDOBJ, pclass); + } else { + mono_mb_emit_byte (mb, CEE_LDELEM_REF); + if (pclass != mono_defaults.object_class) { + mono_mb_emit_op (mb, CEE_CASTCLASS, pclass); + } + } + } + break; + } + case MONO_MARSHAL_COPY_OUT: { + /* Keep a local copy of the value since we need to copy it back after the call */ + int copy_local = mono_mb_add_local (mb, &(pclass->byval_arg)); + mono_mb_emit_ldarg (mb, param_index++); + mono_marshal_emit_xdomain_copy_value (mb, pclass); + mono_mb_emit_byte (mb, CEE_DUP); + mono_mb_emit_stloc (mb, copy_local); + break; + } + case MONO_MARSHAL_COPY: { + mono_mb_emit_ldarg (mb, param_index); + if (pt->byref) { + mono_mb_emit_byte (mb, CEE_DUP); + mono_mb_emit_byte (mb, CEE_DUP); + mono_mb_emit_byte (mb, CEE_LDIND_REF); + mono_marshal_emit_xdomain_copy_value (mb, pclass); + mono_mb_emit_byte (mb, CEE_STIND_REF); + } else { + mono_marshal_emit_xdomain_copy_value (mb, pclass); + } + param_index++; + break; + } + case MONO_MARSHAL_NONE: + mono_mb_emit_ldarg (mb, param_index++); + break; + } + } + + /* Make the call to the real object */ + + mono_marshal_emit_thread_force_interrupt_checkpoint (mb); + + mono_mb_emit_op (mb, CEE_CALLVIRT, method); + + if (sig->ret->type != MONO_TYPE_VOID) + mono_mb_emit_stloc (mb, loc_return); + + /* copy back MONO_MARSHAL_COPY_OUT parameters */ + + j = 0; + param_index = 3; + for (i = 0; i < sig->param_count; i++) { + if (marshal_types [i] == MONO_MARSHAL_SERIALIZE) continue; + if (marshal_types [i] == MONO_MARSHAL_COPY_OUT) { + mono_mb_emit_ldloc (mb, copy_locals_base + (j++)); + mono_mb_emit_ldarg (mb, param_index); + mono_marshal_emit_xdomain_copy_out_value (mb, mono_class_from_mono_type (sig->params [i])); + } + param_index++; + } + + /* Serialize the return values */ + + if (complex_out_count > 0) { + /* Reset parameters in the array that don't need to be serialized back */ + j = 0; + for (i = 0; i < sig->param_count; i++) { + if (marshal_types[i] != MONO_MARSHAL_SERIALIZE) continue; + if (!sig->params [i]->byref) { + mono_mb_emit_ldloc (mb, loc_array); + mono_mb_emit_icon (mb, j); + mono_mb_emit_byte (mb, CEE_LDNULL); + mono_mb_emit_byte (mb, CEE_STELEM_REF); + } + j++; + } + + /* Add the return value to the array */ + + if (ret_marshal_type == MONO_MARSHAL_SERIALIZE) { + mono_mb_emit_ldloc (mb, loc_array); + mono_mb_emit_icon (mb, complex_count); /* The array has an additional slot to hold the ret value */ + mono_mb_emit_ldloc (mb, loc_return); + + g_assert (ret_class); /*FIXME properly fail here*/ + if (ret_class->valuetype) { + mono_mb_emit_op (mb, CEE_BOX, ret_class); + } + mono_mb_emit_byte (mb, CEE_STELEM_REF); + } + + /* Serialize */ + + mono_mb_emit_ldarg (mb, 1); + mono_mb_emit_ldloc (mb, loc_array); + mono_mb_emit_managed_call (mb, method_rs_serialize, NULL); + mono_mb_emit_byte (mb, CEE_STIND_REF); + } else if (ret_marshal_type == MONO_MARSHAL_SERIALIZE) { + mono_mb_emit_ldarg (mb, 1); + mono_mb_emit_ldloc (mb, loc_return); + if (ret_class->valuetype) { + mono_mb_emit_op (mb, CEE_BOX, ret_class); + } + mono_mb_emit_managed_call (mb, method_rs_serialize, NULL); + mono_mb_emit_byte (mb, CEE_STIND_REF); + } else { + mono_mb_emit_ldarg (mb, 1); + mono_mb_emit_byte (mb, CEE_LDNULL); + mono_mb_emit_managed_call (mb, method_rs_serialize, NULL); + mono_mb_emit_byte (mb, CEE_STIND_REF); + } + + mono_mb_emit_ldarg (mb, 2); + mono_mb_emit_byte (mb, CEE_LDNULL); + mono_mb_emit_byte (mb, CEE_STIND_REF); + pos_leave = mono_mb_emit_branch (mb, CEE_LEAVE); + + /* Main exception catch */ + main_clause->flags = MONO_EXCEPTION_CLAUSE_NONE; + main_clause->try_len = mono_mb_get_pos (mb) - main_clause->try_offset; + main_clause->data.catch_class = mono_defaults.object_class; + + /* handler code */ + main_clause->handler_offset = mono_mb_get_label (mb); + mono_mb_emit_managed_call (mb, method_rs_serialize_exc, NULL); + mono_mb_emit_stloc (mb, loc_serialized_exc); + mono_mb_emit_ldarg (mb, 2); + mono_mb_emit_ldloc (mb, loc_serialized_exc); + mono_mb_emit_byte (mb, CEE_STIND_REF); + mono_mb_emit_branch (mb, CEE_LEAVE); + main_clause->handler_len = mono_mb_get_pos (mb) - main_clause->handler_offset; + /* end catch */ + + mono_mb_patch_branch (mb, pos_leave); + + if (copy_return) + mono_mb_emit_ldloc (mb, loc_return); + + mono_mb_emit_byte (mb, CEE_RET); + + mono_mb_set_clauses (mb, 1, main_clause); +#endif + + res = mono_remoting_mb_create_and_cache (method, mb, csig, csig->param_count + 16); + mono_mb_free (mb); + + return res; +} + +/* mono_marshal_get_xappdomain_invoke () + * Generates a fast remoting wrapper for cross app domain calls. + */ +MonoMethod * +mono_marshal_get_xappdomain_invoke (MonoMethod *method) +{ + MonoMethodSignature *sig; + MonoMethodBuilder *mb; + MonoMethod *res; + int i, j, complex_count, complex_out_count, copy_locals_base; + int *marshal_types; + MonoClass *ret_class = NULL; + MonoMethod *xdomain_method; + int ret_marshal_type = MONO_MARSHAL_NONE; + int loc_array=0, loc_serialized_data=-1, loc_real_proxy; + int loc_old_domainid, loc_domainid, loc_return=0, loc_serialized_exc=0, loc_context; + int pos, pos_dispatch, pos_noex; + gboolean copy_return = FALSE; + + g_assert (method); + + if (method->wrapper_type == MONO_WRAPPER_REMOTING_INVOKE || method->wrapper_type == MONO_WRAPPER_XDOMAIN_INVOKE) + return method; + + /* we cant remote methods without this pointer */ + if (!mono_method_signature (method)->hasthis) + return method; + + mono_remoting_marshal_init (); + + if (!mono_marshal_supports_fast_xdomain (method)) + return mono_marshal_get_remoting_invoke (method); + + if ((res = mono_marshal_remoting_find_in_cache (method, MONO_WRAPPER_XDOMAIN_INVOKE))) + return res; + + sig = mono_signature_no_pinvoke (method); + + mb = mono_mb_new (method->klass, method->name, MONO_WRAPPER_XDOMAIN_INVOKE); + mb->method->save_lmf = 1; + + /* Count the number of parameters that need to be serialized */ + + marshal_types = alloca (sizeof (int) * sig->param_count); + complex_count = complex_out_count = 0; + for (i = 0; i < sig->param_count; i++) { + MonoType *ptype = sig->params[i]; + int mt = mono_get_xdomain_marshal_type (ptype); + + /* If the [Out] attribute is applied to a parameter that can be internally copied, + * the copy will be made by reusing the original object instance + */ + if ((ptype->attrs & PARAM_ATTRIBUTE_OUT) != 0 && mt == MONO_MARSHAL_COPY && !ptype->byref) + mt = MONO_MARSHAL_COPY_OUT; + else if (mt == MONO_MARSHAL_SERIALIZE) { + complex_count++; + if (ptype->byref) complex_out_count++; + } + marshal_types [i] = mt; + } + + if (sig->ret->type != MONO_TYPE_VOID) { + ret_marshal_type = mono_get_xdomain_marshal_type (sig->ret); + ret_class = mono_class_from_mono_type (sig->ret); + copy_return = ret_marshal_type != MONO_MARSHAL_SERIALIZE; + } + + /* Locals */ + +#ifndef DISABLE_JIT + if (complex_count > 0) + loc_array = mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg); + loc_serialized_data = mono_mb_add_local (mb, &byte_array_class->byval_arg); + loc_real_proxy = mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg); + if (copy_return) + loc_return = mono_mb_add_local (mb, sig->ret); + loc_old_domainid = mono_mb_add_local (mb, &mono_defaults.int32_class->byval_arg); + loc_domainid = mono_mb_add_local (mb, &mono_defaults.int32_class->byval_arg); + loc_serialized_exc = mono_mb_add_local (mb, &byte_array_class->byval_arg); + loc_context = mono_mb_add_local (mb, &mono_defaults.object_class->byval_arg); + + /* Save thread domain data */ + + mono_mb_emit_icall (mb, mono_context_get); + mono_mb_emit_byte (mb, CEE_DUP); + mono_mb_emit_stloc (mb, loc_context); + + /* If the thread is not running in the default context, it needs to go + * through the whole remoting sink, since the context is going to change + */ + mono_mb_emit_managed_call (mb, method_needs_context_sink, NULL); + pos = mono_mb_emit_short_branch (mb, CEE_BRTRUE_S); + + /* Another case in which the fast path can't be used: when the target domain + * has a different image for the same assembly. + */ + + /* Get the target domain id */ + + mono_mb_emit_ldarg (mb, 0); + mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoTransparentProxy, rp)); + mono_mb_emit_byte (mb, CEE_LDIND_REF); + mono_mb_emit_byte (mb, CEE_DUP); + mono_mb_emit_stloc (mb, loc_real_proxy); + + mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoRealProxy, target_domain_id)); + mono_mb_emit_byte (mb, CEE_LDIND_I4); + mono_mb_emit_stloc (mb, loc_domainid); + + /* Check if the target domain has the same image for the required assembly */ + + mono_mb_emit_ldloc (mb, loc_domainid); + mono_mb_emit_ptr (mb, method->klass->image); + mono_mb_emit_icall (mb, mono_marshal_check_domain_image); + pos_dispatch = mono_mb_emit_short_branch (mb, CEE_BRTRUE_S); + + /* Use the whole remoting sink to dispatch this message */ + + mono_mb_patch_short_branch (mb, pos); + + mono_mb_emit_ldarg (mb, 0); + for (i = 0; i < sig->param_count; i++) + mono_mb_emit_ldarg (mb, i + 1); + + mono_mb_emit_managed_call (mb, mono_marshal_get_remoting_invoke (method), NULL); + mono_mb_emit_byte (mb, CEE_RET); + mono_mb_patch_short_branch (mb, pos_dispatch); + + /* Create the array that will hold the parameters to be serialized */ + + if (complex_count > 0) { + mono_mb_emit_icon (mb, (ret_marshal_type == MONO_MARSHAL_SERIALIZE && complex_out_count > 0) ? complex_count + 1 : complex_count); /* +1 for the return type */ + mono_mb_emit_op (mb, CEE_NEWARR, mono_defaults.object_class); + + j = 0; + for (i = 0; i < sig->param_count; i++) { + MonoClass *pclass; + if (marshal_types [i] != MONO_MARSHAL_SERIALIZE) continue; + pclass = mono_class_from_mono_type (sig->params[i]); + mono_mb_emit_byte (mb, CEE_DUP); + mono_mb_emit_icon (mb, j); + mono_mb_emit_ldarg (mb, i + 1); /* 0=this */ + if (sig->params[i]->byref) { + if (pclass->valuetype) + mono_mb_emit_op (mb, CEE_LDOBJ, pclass); + else + mono_mb_emit_byte (mb, CEE_LDIND_REF); + } + if (pclass->valuetype) + mono_mb_emit_op (mb, CEE_BOX, pclass); + mono_mb_emit_byte (mb, CEE_STELEM_REF); + j++; + } + mono_mb_emit_stloc (mb, loc_array); + + /* Serialize parameters */ + + mono_mb_emit_ldloc (mb, loc_array); + mono_mb_emit_managed_call (mb, method_rs_serialize, NULL); + mono_mb_emit_stloc (mb, loc_serialized_data); + } else { + mono_mb_emit_byte (mb, CEE_LDNULL); + mono_mb_emit_managed_call (mb, method_rs_serialize, NULL); + mono_mb_emit_stloc (mb, loc_serialized_data); + } + + /* switch domain */ + + mono_mb_emit_ldloc (mb, loc_domainid); + mono_mb_emit_byte (mb, CEE_LDC_I4_1); + mono_marshal_emit_switch_domain (mb); + mono_mb_emit_stloc (mb, loc_old_domainid); + + /* Load the arguments */ + + mono_mb_emit_ldloc (mb, loc_real_proxy); + mono_mb_emit_ldloc_addr (mb, loc_serialized_data); + mono_mb_emit_ldloc_addr (mb, loc_serialized_exc); + + copy_locals_base = mb->locals; + for (i = 0; i < sig->param_count; i++) { + switch (marshal_types [i]) { + case MONO_MARSHAL_SERIALIZE: + continue; + case MONO_MARSHAL_COPY: { + mono_mb_emit_ldarg (mb, i+1); + if (sig->params [i]->byref) { + /* make a local copy of the byref parameter. The real parameter + * will be updated after the xdomain call + */ + MonoClass *pclass = mono_class_from_mono_type (sig->params [i]); + int copy_local = mono_mb_add_local (mb, &(pclass->byval_arg)); + mono_mb_emit_byte (mb, CEE_LDIND_REF); + mono_mb_emit_stloc (mb, copy_local); + mono_mb_emit_ldloc_addr (mb, copy_local); + } + break; + } + case MONO_MARSHAL_COPY_OUT: + case MONO_MARSHAL_NONE: + mono_mb_emit_ldarg (mb, i+1); + break; + } + } + + /* Make the call to the invoke wrapper in the target domain */ + + xdomain_method = mono_marshal_get_xappdomain_dispatch (method, marshal_types, complex_count, complex_out_count, ret_marshal_type); + mono_marshal_emit_load_domain_method (mb, xdomain_method); + mono_mb_emit_calli (mb, mono_method_signature (xdomain_method)); + + if (copy_return) + mono_mb_emit_stloc (mb, loc_return); + + /* Switch domain */ + + mono_mb_emit_ldloc (mb, loc_old_domainid); + mono_mb_emit_byte (mb, CEE_LDC_I4_0); + mono_marshal_emit_switch_domain (mb); + mono_mb_emit_byte (mb, CEE_POP); + + /* Restore thread domain data */ + + mono_mb_emit_ldloc (mb, loc_context); + mono_mb_emit_icall (mb, mono_context_set); + + /* if (loc_serialized_exc != null) ... */ + + mono_mb_emit_ldloc (mb, loc_serialized_exc); + pos_noex = mono_mb_emit_short_branch (mb, CEE_BRFALSE_S); + + mono_mb_emit_ldloc (mb, loc_serialized_exc); + mono_marshal_emit_xdomain_copy_value (mb, byte_array_class); + mono_mb_emit_managed_call (mb, method_rs_deserialize, NULL); + mono_mb_emit_op (mb, CEE_CASTCLASS, mono_defaults.exception_class); + mono_mb_emit_managed_call (mb, method_exc_fixexc, NULL); + mono_mb_emit_byte (mb, CEE_THROW); + mono_mb_patch_short_branch (mb, pos_noex); + + /* copy back non-serialized output parameters */ + + j = 0; + for (i = 0; i < sig->param_count; i++) { + if (!sig->params [i]->byref || marshal_types [i] != MONO_MARSHAL_COPY) continue; + mono_mb_emit_ldarg (mb, i + 1); + mono_mb_emit_ldloc (mb, copy_locals_base + (j++)); + mono_marshal_emit_xdomain_copy_value (mb, mono_class_from_mono_type (sig->params [i])); + mono_mb_emit_byte (mb, CEE_STIND_REF); + } + + /* Deserialize out parameters */ + + if (complex_out_count > 0) { + mono_mb_emit_ldloc (mb, loc_serialized_data); + mono_marshal_emit_xdomain_copy_value (mb, byte_array_class); + mono_mb_emit_managed_call (mb, method_rs_deserialize, NULL); + mono_mb_emit_stloc (mb, loc_array); + + /* Copy back output parameters and return type */ + + j = 0; + for (i = 0; i < sig->param_count; i++) { + if (marshal_types [i] != MONO_MARSHAL_SERIALIZE) continue; + if (sig->params[i]->byref) { + MonoClass *pclass = mono_class_from_mono_type (sig->params [i]); + mono_mb_emit_ldarg (mb, i + 1); + mono_mb_emit_ldloc (mb, loc_array); + mono_mb_emit_icon (mb, j); + mono_mb_emit_byte (mb, CEE_LDELEM_REF); + if (pclass->valuetype) { + mono_mb_emit_op (mb, CEE_UNBOX, pclass); + mono_mb_emit_op (mb, CEE_LDOBJ, pclass); + mono_mb_emit_op (mb, CEE_STOBJ, pclass); + } else { + if (pclass != mono_defaults.object_class) + mono_mb_emit_op (mb, CEE_CASTCLASS, pclass); + mono_mb_emit_byte (mb, CEE_STIND_REF); + } + } + j++; + } + + if (ret_marshal_type == MONO_MARSHAL_SERIALIZE) { + mono_mb_emit_ldloc (mb, loc_array); + mono_mb_emit_icon (mb, complex_count); + mono_mb_emit_byte (mb, CEE_LDELEM_REF); + if (ret_class->valuetype) { + mono_mb_emit_op (mb, CEE_UNBOX, ret_class); + mono_mb_emit_op (mb, CEE_LDOBJ, ret_class); + } + } + } else if (ret_marshal_type == MONO_MARSHAL_SERIALIZE) { + mono_mb_emit_ldloc (mb, loc_serialized_data); + mono_marshal_emit_xdomain_copy_value (mb, byte_array_class); + mono_mb_emit_managed_call (mb, method_rs_deserialize, NULL); + if (ret_class->valuetype) { + mono_mb_emit_op (mb, CEE_UNBOX, ret_class); + mono_mb_emit_op (mb, CEE_LDOBJ, ret_class); + } else if (ret_class != mono_defaults.object_class) { + mono_mb_emit_op (mb, CEE_CASTCLASS, ret_class); + } + } else { + mono_mb_emit_ldloc (mb, loc_serialized_data); + mono_mb_emit_byte (mb, CEE_DUP); + pos = mono_mb_emit_short_branch (mb, CEE_BRFALSE_S); + mono_marshal_emit_xdomain_copy_value (mb, byte_array_class); + + mono_mb_patch_short_branch (mb, pos); + mono_mb_emit_managed_call (mb, method_rs_deserialize, NULL); + mono_mb_emit_byte (mb, CEE_POP); + } + + if (copy_return) { + mono_mb_emit_ldloc (mb, loc_return); + if (ret_marshal_type == MONO_MARSHAL_COPY) + mono_marshal_emit_xdomain_copy_value (mb, ret_class); + } + + mono_mb_emit_byte (mb, CEE_RET); +#endif /* DISABLE_JIT */ + + res = mono_remoting_mb_create_and_cache (method, mb, sig, sig->param_count + 16); + mono_mb_free (mb); + + return res; +} + +MonoMethod * +mono_marshal_get_remoting_invoke_for_target (MonoMethod *method, MonoRemotingTarget target_type) +{ + if (target_type == MONO_REMOTING_TARGET_APPDOMAIN) { + return mono_marshal_get_xappdomain_invoke (method); + } else if (target_type == MONO_REMOTING_TARGET_COMINTEROP) { +#ifndef DISABLE_COM + return mono_cominterop_get_invoke (method); +#else + g_assert_not_reached (); +#endif + } else { + return mono_marshal_get_remoting_invoke (method); + } + /* Not erached */ + return NULL; +} + +G_GNUC_UNUSED static gpointer +mono_marshal_load_remoting_wrapper (MonoRealProxy *rp, MonoMethod *method) +{ + if (rp->target_domain_id != -1) + return mono_compile_method (mono_marshal_get_xappdomain_invoke (method)); + else + return mono_compile_method (mono_marshal_get_remoting_invoke (method)); +} + +MonoMethod * +mono_marshal_get_remoting_invoke_with_check (MonoMethod *method) +{ + MonoMethodSignature *sig; + MonoMethodBuilder *mb; + MonoMethod *res, *native; + int i, pos, pos_rem; + + g_assert (method); + + if (method->wrapper_type == MONO_WRAPPER_REMOTING_INVOKE_WITH_CHECK) + return method; + + /* we cant remote methods without this pointer */ + g_assert (mono_method_signature (method)->hasthis); + + if ((res = mono_marshal_remoting_find_in_cache (method, MONO_WRAPPER_REMOTING_INVOKE_WITH_CHECK))) + return res; + + sig = mono_signature_no_pinvoke (method); + + mb = mono_mb_new (method->klass, method->name, MONO_WRAPPER_REMOTING_INVOKE_WITH_CHECK); + +#ifndef DISABLE_JIT + for (i = 0; i <= sig->param_count; i++) + mono_mb_emit_ldarg (mb, i); + + mono_mb_emit_ldarg (mb, 0); + pos = mono_mb_emit_proxy_check (mb, CEE_BNE_UN); + + if (mono_marshal_supports_fast_xdomain (method)) { + mono_mb_emit_ldarg (mb, 0); + pos_rem = mono_mb_emit_xdomain_check (mb, CEE_BEQ); + + /* wrapper for cross app domain calls */ + native = mono_marshal_get_xappdomain_invoke (method); + mono_mb_emit_managed_call (mb, native, mono_method_signature (native)); + mono_mb_emit_byte (mb, CEE_RET); + + mono_mb_patch_branch (mb, pos_rem); + } + /* wrapper for normal remote calls */ + native = mono_marshal_get_remoting_invoke (method); + mono_mb_emit_managed_call (mb, native, mono_method_signature (native)); + mono_mb_emit_byte (mb, CEE_RET); + + /* not a proxy */ + mono_mb_patch_branch (mb, pos); + mono_mb_emit_managed_call (mb, method, mono_method_signature (method)); + mono_mb_emit_byte (mb, CEE_RET); +#endif + + res = mono_remoting_mb_create_and_cache (method, mb, sig, sig->param_count + 16); + mono_mb_free (mb); + + return res; +} + +/* + * mono_marshal_get_ldfld_remote_wrapper: + * @klass: The return type + * + * This method generates a wrapper for calling mono_load_remote_field_new. + * The return type is ignored for now, as mono_load_remote_field_new () always + * returns an object. In the future, to optimize some codepaths, we might + * call a different function that takes a pointer to a valuetype, instead. + */ +MonoMethod * +mono_marshal_get_ldfld_remote_wrapper (MonoClass *klass) +{ + MonoMethodSignature *sig, *csig; + MonoMethodBuilder *mb; + MonoMethod *res; + static MonoMethod* cached = NULL; + + mono_marshal_lock_internal (); + if (cached) { + mono_marshal_unlock_internal (); + return cached; + } + mono_marshal_unlock_internal (); + + mb = mono_mb_new_no_dup_name (mono_defaults.object_class, "__mono_load_remote_field_new_wrapper", MONO_WRAPPER_LDFLD_REMOTE); + + mb->method->save_lmf = 1; + + sig = mono_metadata_signature_alloc (mono_defaults.corlib, 3); + sig->params [0] = &mono_defaults.object_class->byval_arg; + sig->params [1] = &mono_defaults.int_class->byval_arg; + sig->params [2] = &mono_defaults.int_class->byval_arg; + sig->ret = &mono_defaults.object_class->byval_arg; + +#ifndef DISABLE_JIT + mono_mb_emit_ldarg (mb, 0); + mono_mb_emit_ldarg (mb, 1); + mono_mb_emit_ldarg (mb, 2); + + csig = mono_metadata_signature_alloc (mono_defaults.corlib, 3); + csig->params [0] = &mono_defaults.object_class->byval_arg; + csig->params [1] = &mono_defaults.int_class->byval_arg; + csig->params [2] = &mono_defaults.int_class->byval_arg; + csig->ret = &mono_defaults.object_class->byval_arg; + csig->pinvoke = 1; + + mono_mb_emit_native_call (mb, csig, mono_load_remote_field_new); + mono_marshal_emit_thread_interrupt_checkpoint (mb); + + mono_mb_emit_byte (mb, CEE_RET); +#endif + + mono_marshal_lock_internal (); + res = cached; + mono_marshal_unlock_internal (); + if (!res) { + MonoMethod *newm; + newm = mono_mb_create (mb, sig, 4, NULL); + mono_marshal_lock_internal (); + res = cached; + if (!res) { + res = newm; + cached = res; + mono_marshal_unlock_internal (); + } else { + mono_marshal_unlock_internal (); + mono_free_method (newm); + } + } + mono_mb_free (mb); + + return res; +} + +/* + * mono_marshal_get_ldfld_wrapper: + * @type: the type of the field + * + * This method generates a function which can be use to load a field with type + * @type from an object. The generated function has the following signature: + * <@type> ldfld_wrapper (MonoObject *this, MonoClass *class, MonoClassField *field, int offset) + */ +MonoMethod * +mono_marshal_get_ldfld_wrapper (MonoType *type) +{ + MonoMethodSignature *sig; + MonoMethodBuilder *mb; + MonoMethod *res; + MonoClass *klass; + GHashTable *cache; + WrapperInfo *info; + char *name; + int t, pos0, pos1 = 0; + + type = mono_type_get_underlying_type (type); + + t = type->type; + + if (!type->byref) { + if (type->type == MONO_TYPE_SZARRAY) { + klass = mono_defaults.array_class; + } else if (type->type == MONO_TYPE_VALUETYPE) { + klass = type->data.klass; + } else if (t == MONO_TYPE_OBJECT || t == MONO_TYPE_CLASS || t == MONO_TYPE_STRING) { + klass = mono_defaults.object_class; + } else if (t == MONO_TYPE_PTR || t == MONO_TYPE_FNPTR) { + klass = mono_defaults.int_class; + } else if (t == MONO_TYPE_GENERICINST) { + if (mono_type_generic_inst_is_valuetype (type)) + klass = mono_class_from_mono_type (type); + else + klass = mono_defaults.object_class; + } else { + klass = mono_class_from_mono_type (type); + } + } else { + klass = mono_defaults.int_class; + } + + cache = get_cache (&klass->image->ldfld_wrapper_cache, mono_aligned_addr_hash, NULL); + if ((res = mono_marshal_find_in_cache (cache, klass))) + return res; + + /* we add the %p pointer value of klass because class names are not unique */ + name = g_strdup_printf ("__ldfld_wrapper_%p_%s.%s", klass, klass->name_space, klass->name); + mb = mono_mb_new (mono_defaults.object_class, name, MONO_WRAPPER_LDFLD); + g_free (name); + + sig = mono_metadata_signature_alloc (mono_defaults.corlib, 4); + sig->params [0] = &mono_defaults.object_class->byval_arg; + sig->params [1] = &mono_defaults.int_class->byval_arg; + sig->params [2] = &mono_defaults.int_class->byval_arg; + sig->params [3] = &mono_defaults.int_class->byval_arg; + sig->ret = &klass->byval_arg; + +#ifndef DISABLE_JIT + mono_mb_emit_ldarg (mb, 0); + pos0 = mono_mb_emit_proxy_check (mb, CEE_BNE_UN); + + mono_mb_emit_ldarg (mb, 0); + mono_mb_emit_ldarg (mb, 1); + mono_mb_emit_ldarg (mb, 2); + + mono_mb_emit_managed_call (mb, mono_marshal_get_ldfld_remote_wrapper (klass), NULL); + + /* + csig = mono_metadata_signature_alloc (mono_defaults.corlib, 3); + csig->params [0] = &mono_defaults.object_class->byval_arg; + csig->params [1] = &mono_defaults.int_class->byval_arg; + csig->params [2] = &mono_defaults.int_class->byval_arg; + csig->ret = &klass->this_arg; + csig->pinvoke = 1; + + mono_mb_emit_native_call (mb, csig, mono_load_remote_field_new); + mono_marshal_emit_thread_interrupt_checkpoint (mb); + */ + + if (klass->valuetype) { + mono_mb_emit_op (mb, CEE_UNBOX, klass); + pos1 = mono_mb_emit_branch (mb, CEE_BR); + } else { + mono_mb_emit_byte (mb, CEE_RET); + } + + mono_mb_patch_branch (mb, pos0); + + mono_mb_emit_ldarg (mb, 0); + mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX); + mono_mb_emit_byte (mb, CEE_MONO_OBJADDR); + mono_mb_emit_ldarg (mb, 3); + mono_mb_emit_byte (mb, CEE_ADD); + + if (klass->valuetype) + mono_mb_patch_branch (mb, pos1); + + switch (t) { + case MONO_TYPE_I1: + case MONO_TYPE_U1: + case MONO_TYPE_BOOLEAN: + case MONO_TYPE_CHAR: + case MONO_TYPE_I2: + case MONO_TYPE_U2: + case MONO_TYPE_I4: + case MONO_TYPE_U4: + case MONO_TYPE_I8: + case MONO_TYPE_U8: + case MONO_TYPE_R4: + case MONO_TYPE_R8: + case MONO_TYPE_ARRAY: + case MONO_TYPE_SZARRAY: + case MONO_TYPE_OBJECT: + case MONO_TYPE_CLASS: + case MONO_TYPE_STRING: + case MONO_TYPE_I: + case MONO_TYPE_U: + case MONO_TYPE_PTR: + case MONO_TYPE_FNPTR: + mono_mb_emit_byte (mb, mono_type_to_ldind (type)); + break; + case MONO_TYPE_VALUETYPE: + g_assert (!klass->enumtype); + mono_mb_emit_op (mb, CEE_LDOBJ, klass); + break; + case MONO_TYPE_GENERICINST: + if (mono_type_generic_inst_is_valuetype (type)) { + mono_mb_emit_op (mb, CEE_LDOBJ, klass); + } else { + mono_mb_emit_byte (mb, CEE_LDIND_REF); + } + break; + case MONO_TYPE_VAR: + case MONO_TYPE_MVAR: + mono_mb_emit_op (mb, CEE_LDOBJ, klass); + break; + default: + g_warning ("type %x not implemented", type->type); + g_assert_not_reached (); + } + + mono_mb_emit_byte (mb, CEE_RET); +#endif /* DISABLE_JIT */ + + info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NONE); + info->d.proxy.klass = klass; + res = mono_mb_create_and_cache_full (cache, klass, + mb, sig, sig->param_count + 16, info, NULL); + mono_mb_free (mb); + + return res; +} + +/* + * mono_marshal_get_ldflda_wrapper: + * @type: the type of the field + * + * This method generates a function which can be used to load a field address + * from an object. The generated function has the following signature: + * gpointer ldflda_wrapper (MonoObject *this, MonoClass *class, MonoClassField *field, int offset); + */ +MonoMethod * +mono_marshal_get_ldflda_wrapper (MonoType *type) +{ + MonoMethodSignature *sig; + MonoMethodBuilder *mb; + MonoMethod *res; + MonoClass *klass; + GHashTable *cache; + WrapperInfo *info; + char *name; + int t, pos0, pos1, pos2, pos3; + + type = mono_type_get_underlying_type (type); + t = type->type; + + if (!type->byref) { + if (type->type == MONO_TYPE_SZARRAY) { + klass = mono_defaults.array_class; + } else if (type->type == MONO_TYPE_VALUETYPE) { + klass = type->data.klass; + } else if (t == MONO_TYPE_OBJECT || t == MONO_TYPE_CLASS || t == MONO_TYPE_STRING || + t == MONO_TYPE_CLASS) { + klass = mono_defaults.object_class; + } else if (t == MONO_TYPE_PTR || t == MONO_TYPE_FNPTR) { + klass = mono_defaults.int_class; + } else if (t == MONO_TYPE_GENERICINST) { + if (mono_type_generic_inst_is_valuetype (type)) + klass = mono_class_from_mono_type (type); + else + klass = mono_defaults.object_class; + } else { + klass = mono_class_from_mono_type (type); + } + } else { + klass = mono_defaults.int_class; + } + + cache = get_cache (&klass->image->ldflda_wrapper_cache, mono_aligned_addr_hash, NULL); + if ((res = mono_marshal_find_in_cache (cache, klass))) + return res; + + /* we add the %p pointer value of klass because class names are not unique */ + name = g_strdup_printf ("__ldflda_wrapper_%p_%s.%s", klass, klass->name_space, klass->name); + mb = mono_mb_new (mono_defaults.object_class, name, MONO_WRAPPER_LDFLDA); + g_free (name); + + sig = mono_metadata_signature_alloc (mono_defaults.corlib, 4); + sig->params [0] = &mono_defaults.object_class->byval_arg; + sig->params [1] = &mono_defaults.int_class->byval_arg; + sig->params [2] = &mono_defaults.int_class->byval_arg; + sig->params [3] = &mono_defaults.int_class->byval_arg; + sig->ret = &mono_defaults.int_class->byval_arg; + +#ifndef DISABLE_JIT + /* if typeof (this) != transparent_proxy goto pos0 */ + mono_mb_emit_ldarg (mb, 0); + pos0 = mono_mb_emit_proxy_check (mb, CEE_BNE_UN); + + /* if same_appdomain goto pos1 */ + mono_mb_emit_ldarg (mb, 0); + pos1 = mono_mb_emit_xdomain_check (mb, CEE_BEQ); + + mono_mb_emit_exception_full (mb, "System", "InvalidOperationException", "Attempt to load field address from object in another appdomain."); + + /* same app domain */ + mono_mb_patch_branch (mb, pos1); + + /* if typeof (this) != contextbound goto pos2 */ + mono_mb_emit_ldarg (mb, 0); + pos2 = mono_mb_emit_contextbound_check (mb, CEE_BEQ); + + /* if this->rp->context == mono_context_get goto pos3 */ + mono_mb_emit_ldarg (mb, 0); + mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoTransparentProxy, rp)); + mono_mb_emit_byte (mb, CEE_LDIND_REF); + mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoRealProxy, context)); + mono_mb_emit_byte (mb, CEE_LDIND_REF); + mono_mb_emit_icall (mb, mono_context_get); + pos3 = mono_mb_emit_branch (mb, CEE_BEQ); + + mono_mb_emit_exception_full (mb, "System", "InvalidOperationException", "Attempt to load field address from object in another context."); + + mono_mb_patch_branch (mb, pos2); + mono_mb_patch_branch (mb, pos3); + + /* return the address of the field from this->rp->unwrapped_server */ + mono_mb_emit_ldarg (mb, 0); + mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoTransparentProxy, rp)); + mono_mb_emit_byte (mb, CEE_LDIND_REF); + mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoRealProxy, unwrapped_server)); + mono_mb_emit_byte (mb, CEE_LDIND_REF); + mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX); + mono_mb_emit_byte (mb, CEE_MONO_OBJADDR); + mono_mb_emit_ldarg (mb, 3); + mono_mb_emit_byte (mb, CEE_ADD); + mono_mb_emit_byte (mb, CEE_RET); + + /* not a proxy: return the address of the field directly */ + mono_mb_patch_branch (mb, pos0); + + mono_mb_emit_ldarg (mb, 0); + mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX); + mono_mb_emit_byte (mb, CEE_MONO_OBJADDR); + mono_mb_emit_ldarg (mb, 3); + mono_mb_emit_byte (mb, CEE_ADD); + + mono_mb_emit_byte (mb, CEE_RET); +#endif + + info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NONE); + info->d.proxy.klass = klass; + res = mono_mb_create_and_cache_full (cache, klass, + mb, sig, sig->param_count + 16, + info, NULL); + mono_mb_free (mb); + + return res; +} + +/* + * mono_marshal_get_stfld_remote_wrapper: + * klass: The type of the field + * + * This function generates a wrapper for calling mono_store_remote_field_new + * with the appropriate signature. + * Similarly to mono_marshal_get_ldfld_remote_wrapper () this doesn't depend on the + * klass argument anymore. + */ +MonoMethod * +mono_marshal_get_stfld_remote_wrapper (MonoClass *klass) +{ + MonoMethodSignature *sig, *csig; + MonoMethodBuilder *mb; + MonoMethod *res; + static MonoMethod *cached = NULL; + + mono_marshal_lock_internal (); + if (cached) { + mono_marshal_unlock_internal (); + return cached; + } + mono_marshal_unlock_internal (); + + mb = mono_mb_new_no_dup_name (mono_defaults.object_class, "__mono_store_remote_field_new_wrapper", MONO_WRAPPER_STFLD_REMOTE); + + mb->method->save_lmf = 1; + + sig = mono_metadata_signature_alloc (mono_defaults.corlib, 4); + sig->params [0] = &mono_defaults.object_class->byval_arg; + sig->params [1] = &mono_defaults.int_class->byval_arg; + sig->params [2] = &mono_defaults.int_class->byval_arg; + sig->params [3] = &mono_defaults.object_class->byval_arg; + sig->ret = &mono_defaults.void_class->byval_arg; + +#ifndef DISABLE_JIT + mono_mb_emit_ldarg (mb, 0); + mono_mb_emit_ldarg (mb, 1); + mono_mb_emit_ldarg (mb, 2); + mono_mb_emit_ldarg (mb, 3); + + csig = mono_metadata_signature_alloc (mono_defaults.corlib, 4); + csig->params [0] = &mono_defaults.object_class->byval_arg; + csig->params [1] = &mono_defaults.int_class->byval_arg; + csig->params [2] = &mono_defaults.int_class->byval_arg; + csig->params [3] = &mono_defaults.object_class->byval_arg; + csig->ret = &mono_defaults.void_class->byval_arg; + csig->pinvoke = 1; + + mono_mb_emit_native_call (mb, csig, mono_store_remote_field_new); + mono_marshal_emit_thread_interrupt_checkpoint (mb); + + mono_mb_emit_byte (mb, CEE_RET); +#endif + + mono_marshal_lock_internal (); + res = cached; + mono_marshal_unlock_internal (); + if (!res) { + MonoMethod *newm; + newm = mono_mb_create (mb, sig, 6, NULL); + mono_marshal_lock_internal (); + res = cached; + if (!res) { + res = newm; + cached = res; + mono_marshal_unlock_internal (); + } else { + mono_marshal_unlock_internal (); + mono_free_method (newm); + } + } + mono_mb_free (mb); + + return res; +} + +/* + * mono_marshal_get_stfld_wrapper: + * @type: the type of the field + * + * This method generates a function which can be use to store a field with type + * @type. The generated function has the following signature: + * void stfld_wrapper (MonoObject *this, MonoClass *class, MonoClassField *field, int offset, <@type> val) + */ +MonoMethod * +mono_marshal_get_stfld_wrapper (MonoType *type) +{ + MonoMethodSignature *sig; + MonoMethodBuilder *mb; + MonoMethod *res; + MonoClass *klass; + GHashTable *cache; + WrapperInfo *info; + char *name; + int t, pos; + + type = mono_type_get_underlying_type (type); + t = type->type; + + if (!type->byref) { + if (type->type == MONO_TYPE_SZARRAY) { + klass = mono_defaults.array_class; + } else if (type->type == MONO_TYPE_VALUETYPE) { + klass = type->data.klass; + } else if (t == MONO_TYPE_OBJECT || t == MONO_TYPE_CLASS || t == MONO_TYPE_STRING) { + klass = mono_defaults.object_class; + } else if (t == MONO_TYPE_PTR || t == MONO_TYPE_FNPTR) { + klass = mono_defaults.int_class; + } else if (t == MONO_TYPE_GENERICINST) { + if (mono_type_generic_inst_is_valuetype (type)) + klass = mono_class_from_mono_type (type); + else + klass = mono_defaults.object_class; + } else { + klass = mono_class_from_mono_type (type); + } + } else { + klass = mono_defaults.int_class; + } + + cache = get_cache (&klass->image->stfld_wrapper_cache, mono_aligned_addr_hash, NULL); + if ((res = mono_marshal_find_in_cache (cache, klass))) + return res; + + /* we add the %p pointer value of klass because class names are not unique */ + name = g_strdup_printf ("__stfld_wrapper_%p_%s.%s", klass, klass->name_space, klass->name); + mb = mono_mb_new (mono_defaults.object_class, name, MONO_WRAPPER_STFLD); + g_free (name); + + sig = mono_metadata_signature_alloc (mono_defaults.corlib, 5); + sig->params [0] = &mono_defaults.object_class->byval_arg; + sig->params [1] = &mono_defaults.int_class->byval_arg; + sig->params [2] = &mono_defaults.int_class->byval_arg; + sig->params [3] = &mono_defaults.int_class->byval_arg; + sig->params [4] = &klass->byval_arg; + sig->ret = &mono_defaults.void_class->byval_arg; + +#ifndef DISABLE_JIT + mono_mb_emit_ldarg (mb, 0); + pos = mono_mb_emit_proxy_check (mb, CEE_BNE_UN); + + mono_mb_emit_ldarg (mb, 0); + mono_mb_emit_ldarg (mb, 1); + mono_mb_emit_ldarg (mb, 2); + mono_mb_emit_ldarg (mb, 4); + if (klass->valuetype) + mono_mb_emit_op (mb, CEE_BOX, klass); + + mono_mb_emit_managed_call (mb, mono_marshal_get_stfld_remote_wrapper (klass), NULL); + + mono_mb_emit_byte (mb, CEE_RET); + + mono_mb_patch_branch (mb, pos); + + mono_mb_emit_ldarg (mb, 0); + mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX); + mono_mb_emit_byte (mb, CEE_MONO_OBJADDR); + mono_mb_emit_ldarg (mb, 3); + mono_mb_emit_byte (mb, CEE_ADD); + mono_mb_emit_ldarg (mb, 4); + + switch (t) { + case MONO_TYPE_I1: + case MONO_TYPE_U1: + case MONO_TYPE_BOOLEAN: + case MONO_TYPE_CHAR: + case MONO_TYPE_I2: + case MONO_TYPE_U2: + case MONO_TYPE_I4: + case MONO_TYPE_U4: + case MONO_TYPE_I8: + case MONO_TYPE_U8: + case MONO_TYPE_R4: + case MONO_TYPE_R8: + case MONO_TYPE_ARRAY: + case MONO_TYPE_SZARRAY: + case MONO_TYPE_OBJECT: + case MONO_TYPE_CLASS: + case MONO_TYPE_STRING: + case MONO_TYPE_I: + case MONO_TYPE_U: + case MONO_TYPE_PTR: + case MONO_TYPE_FNPTR: + mono_mb_emit_byte (mb, mono_type_to_stind (type)); + break; + case MONO_TYPE_VALUETYPE: + g_assert (!klass->enumtype); + mono_mb_emit_op (mb, CEE_STOBJ, klass); + break; + case MONO_TYPE_GENERICINST: + case MONO_TYPE_VAR: + case MONO_TYPE_MVAR: + mono_mb_emit_op (mb, CEE_STOBJ, klass); + break; + default: + g_warning ("type %x not implemented", type->type); + g_assert_not_reached (); + } + + mono_mb_emit_byte (mb, CEE_RET); +#endif + + info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NONE); + info->d.proxy.klass = klass; + res = mono_mb_create_and_cache_full (cache, klass, + mb, sig, sig->param_count + 16, + info, NULL); + mono_mb_free (mb); + + return res; +} + +MonoMethod * +mono_marshal_get_proxy_cancast (MonoClass *klass) +{ + static MonoMethodSignature *isint_sig = NULL; + GHashTable *cache; + MonoMethod *res; + WrapperInfo *info; + int pos_failed, pos_end; + char *name, *klass_name; + MonoMethod *can_cast_to; + MonoMethodDesc *desc; + MonoMethodBuilder *mb; + + cache = get_cache (&klass->image->proxy_isinst_cache, mono_aligned_addr_hash, NULL); + if ((res = mono_marshal_find_in_cache (cache, klass))) + return res; + + if (!isint_sig) { + isint_sig = mono_metadata_signature_alloc (mono_defaults.corlib, 1); + isint_sig->params [0] = &mono_defaults.object_class->byval_arg; + isint_sig->ret = &mono_defaults.object_class->byval_arg; + isint_sig->pinvoke = 0; + } + + klass_name = mono_type_full_name (&klass->byval_arg); + name = g_strdup_printf ("__proxy_isinst_wrapper_%s", klass_name); + mb = mono_mb_new (mono_defaults.object_class, name, MONO_WRAPPER_PROXY_ISINST); + g_free (klass_name); + g_free (name); + + mb->method->save_lmf = 1; + +#ifndef DISABLE_JIT + /* get the real proxy from the transparent proxy*/ + mono_mb_emit_ldarg (mb, 0); + mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoTransparentProxy, rp)); + mono_mb_emit_byte (mb, CEE_LDIND_REF); + + /* get the reflection type from the type handle */ + mono_mb_emit_ptr (mb, &klass->byval_arg); + mono_mb_emit_icall (mb, type_from_handle); + + mono_mb_emit_ldarg (mb, 0); + + /* make the call to CanCastTo (type, ob) */ + desc = mono_method_desc_new ("IRemotingTypeInfo:CanCastTo", FALSE); + can_cast_to = mono_method_desc_search_in_class (desc, mono_defaults.iremotingtypeinfo_class); + g_assert (can_cast_to); + mono_method_desc_free (desc); + mono_mb_emit_op (mb, CEE_CALLVIRT, can_cast_to); + + pos_failed = mono_mb_emit_branch (mb, CEE_BRFALSE); + + /* Upgrade the proxy vtable by calling: mono_upgrade_remote_class_wrapper (type, ob)*/ + mono_mb_emit_ptr (mb, &klass->byval_arg); + mono_mb_emit_icall (mb, type_from_handle); + mono_mb_emit_ldarg (mb, 0); + + mono_mb_emit_icall (mb, mono_upgrade_remote_class_wrapper); + mono_marshal_emit_thread_interrupt_checkpoint (mb); + + mono_mb_emit_ldarg (mb, 0); + pos_end = mono_mb_emit_branch (mb, CEE_BR); + + /* fail */ + + mono_mb_patch_branch (mb, pos_failed); + mono_mb_emit_byte (mb, CEE_LDNULL); + + /* the end */ + + mono_mb_patch_branch (mb, pos_end); + mono_mb_emit_byte (mb, CEE_RET); +#endif + + info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NONE); + info->d.proxy.klass = klass; + res = mono_mb_create_and_cache_full (cache, klass, mb, isint_sig, isint_sig->param_count + 16, info, NULL); + mono_mb_free (mb); + + return res; +} + +void +mono_upgrade_remote_class_wrapper (MonoReflectionType *rtype, MonoTransparentProxy *tproxy) +{ + MonoClass *klass; + MonoDomain *domain = ((MonoObject*)tproxy)->vtable->domain; + klass = mono_class_from_mono_type (rtype->type); + mono_upgrade_remote_class (domain, (MonoObject*)tproxy, klass); +} + +#endif /* DISABLE_REMOTING */ + +/* mono_get_xdomain_marshal_type() + * Returns the kind of marshalling that a type needs for cross domain calls. + */ +static MonoXDomainMarshalType +mono_get_xdomain_marshal_type (MonoType *t) +{ + switch (t->type) { + case MONO_TYPE_VOID: + g_assert_not_reached (); + break; + case MONO_TYPE_U1: + case MONO_TYPE_I1: + case MONO_TYPE_BOOLEAN: + case MONO_TYPE_U2: + case MONO_TYPE_I2: + case MONO_TYPE_CHAR: + case MONO_TYPE_U4: + case MONO_TYPE_I4: + case MONO_TYPE_I8: + case MONO_TYPE_U8: + case MONO_TYPE_R4: + case MONO_TYPE_R8: + return MONO_MARSHAL_NONE; + case MONO_TYPE_STRING: + return MONO_MARSHAL_COPY; + case MONO_TYPE_ARRAY: + case MONO_TYPE_SZARRAY: { + MonoClass *elem_class = mono_class_from_mono_type (t)->element_class; + if (mono_get_xdomain_marshal_type (&(elem_class->byval_arg)) != MONO_MARSHAL_SERIALIZE) + return MONO_MARSHAL_COPY; + break; + } + } + + return MONO_MARSHAL_SERIALIZE; +} + +/* mono_marshal_xdomain_copy_value + * Makes a copy of "val" suitable for the current domain. + */ +MonoObject * +mono_marshal_xdomain_copy_value (MonoObject *val) +{ + MonoDomain *domain; + if (val == NULL) return NULL; + + domain = mono_domain_get (); + + switch (mono_object_class (val)->byval_arg.type) { + case MONO_TYPE_VOID: + g_assert_not_reached (); + break; + case MONO_TYPE_U1: + case MONO_TYPE_I1: + case MONO_TYPE_BOOLEAN: + case MONO_TYPE_U2: + case MONO_TYPE_I2: + case MONO_TYPE_CHAR: + case MONO_TYPE_U4: + case MONO_TYPE_I4: + case MONO_TYPE_I8: + case MONO_TYPE_U8: + case MONO_TYPE_R4: + case MONO_TYPE_R8: { + return mono_value_box (domain, mono_object_class (val), ((char*)val) + sizeof(MonoObject)); + } + case MONO_TYPE_STRING: { + MonoString *str = (MonoString *) val; + return (MonoObject *) mono_string_new_utf16 (domain, mono_string_chars (str), mono_string_length (str)); + } + case MONO_TYPE_ARRAY: + case MONO_TYPE_SZARRAY: { + MonoArray *acopy; + MonoXDomainMarshalType mt = mono_get_xdomain_marshal_type (&(mono_object_class (val)->element_class->byval_arg)); + if (mt == MONO_MARSHAL_SERIALIZE) return NULL; + acopy = mono_array_clone_in_domain (domain, (MonoArray *) val); + if (mt == MONO_MARSHAL_COPY) { + int i, len = mono_array_length (acopy); + for (i = 0; i < len; i++) { + MonoObject *item = mono_array_get (acopy, gpointer, i); + mono_array_setref (acopy, i, mono_marshal_xdomain_copy_value (item)); + } + } + return (MonoObject *) acopy; + } + } + + if (mono_object_class (val) == mono_defaults.stringbuilder_class) { + MonoStringBuilder *oldsb = (MonoStringBuilder *) val; + MonoStringBuilder *newsb = (MonoStringBuilder *) mono_object_new (domain, mono_defaults.stringbuilder_class); + MONO_OBJECT_SETREF (newsb, str, mono_string_new_utf16 (domain, mono_string_chars (oldsb->str), mono_string_length (oldsb->str))); + newsb->length = oldsb->length; + newsb->max_capacity = (gint32)0x7fffffff; + return (MonoObject *) newsb; + } + return NULL; +} diff --git a/mono/metadata/remoting.h b/mono/metadata/remoting.h new file mode 100644 index 00000000000..24f4c802fc4 --- /dev/null +++ b/mono/metadata/remoting.h @@ -0,0 +1,52 @@ +/* + * remoting.h: Remoting support + * + * (C) 2014 Xamarin, Inc. http://www.xamarin.com + * + */ + +#ifndef __MONO_REMOTING_H__ +#define __MONO_REMOTING_H__ + +#include "config.h" +#include +#include +#include + +void mono_remoting_init (void) MONO_INTERNAL; + +#ifndef DISABLE_REMOTING + +MonoMethod * +mono_marshal_get_remoting_invoke (MonoMethod *method) MONO_INTERNAL; + +MonoMethod * +mono_marshal_get_xappdomain_invoke (MonoMethod *method) MONO_INTERNAL; + +MonoMethod * +mono_marshal_get_remoting_invoke_for_target (MonoMethod *method, MonoRemotingTarget target_type) MONO_INTERNAL; + +MonoMethod * +mono_marshal_get_remoting_invoke_with_check (MonoMethod *method) MONO_INTERNAL; + +MonoMethod * +mono_marshal_get_stfld_wrapper (MonoType *type) MONO_INTERNAL; + +MonoMethod * +mono_marshal_get_ldfld_wrapper (MonoType *type) MONO_INTERNAL; + +MonoMethod * +mono_marshal_get_ldflda_wrapper (MonoType *type) MONO_INTERNAL; + +MonoMethod * +mono_marshal_get_ldfld_remote_wrapper (MonoClass *klass) MONO_INTERNAL; + +MonoMethod * +mono_marshal_get_stfld_remote_wrapper (MonoClass *klass) MONO_INTERNAL; + +MonoMethod * +mono_marshal_get_proxy_cancast (MonoClass *klass) MONO_INTERNAL; + +#endif + +#endif diff --git a/mono/metadata/sgen-alloc.c b/mono/metadata/sgen-alloc.c index 368388a5dab..9ce5b45c5bf 100644 --- a/mono/metadata/sgen-alloc.c +++ b/mono/metadata/sgen-alloc.c @@ -51,7 +51,6 @@ #define ALIGN_UP SGEN_ALIGN_UP #define ALLOC_ALIGN SGEN_ALLOC_ALIGN -#define ALLOC_ALIGN_BITS SGEN_ALLOC_ALIGN_BITS #define MAX_SMALL_OBJ_SIZE SGEN_MAX_SMALL_OBJ_SIZE #define ALIGN_TO(val,align) ((((guint64)val) + ((align) - 1)) & ~((align) - 1)) @@ -68,9 +67,9 @@ enum { static gboolean use_managed_allocator = TRUE; #ifdef HEAVY_STATISTICS -static long long stat_objects_alloced = 0; -static long long stat_bytes_alloced = 0; -static long long stat_bytes_alloced_los = 0; +static guint64 stat_objects_alloced = 0; +static guint64 stat_bytes_alloced = 0; +static guint64 stat_bytes_alloced_los = 0; #endif @@ -1214,9 +1213,9 @@ sgen_has_managed_allocator (void) void sgen_alloc_init_heavy_stats (void) { - mono_counters_register ("# objects allocated", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_objects_alloced); - mono_counters_register ("bytes allocated", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_bytes_alloced); - mono_counters_register ("bytes allocated in LOS", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_bytes_alloced_los); + mono_counters_register ("# objects allocated", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_objects_alloced); + mono_counters_register ("bytes allocated", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_bytes_alloced); + mono_counters_register ("bytes allocated in LOS", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_bytes_alloced_los); } #endif diff --git a/mono/metadata/sgen-archdep.h b/mono/metadata/sgen-archdep.h index 420dc96e47d..410ba6aab0a 100644 --- a/mono/metadata/sgen-archdep.h +++ b/mono/metadata/sgen-archdep.h @@ -87,6 +87,13 @@ ((a)[__i]) = (gpointer) UCONTEXT_REG_Rn((ctx), __i); \ } while (0) +/* MS_BLOCK_SIZE must be a multiple of the system pagesize, which for some + archs is 64k. */ +#if defined(TARGET_POWERPC64) && _CALL_ELF == 2 +#define ARCH_MIN_MS_BLOCK_SIZE (64*1024) +#define ARCH_MIN_MS_BLOCK_SIZE_SHIFT 16 +#endif + #elif defined(TARGET_ARM) #define REDZONE_SIZE 0 diff --git a/mono/metadata/sgen-cardtable.c b/mono/metadata/sgen-cardtable.c index 10524efe7b0..99cae37adbd 100644 --- a/mono/metadata/sgen-cardtable.c +++ b/mono/metadata/sgen-cardtable.c @@ -52,23 +52,23 @@ guint8 *sgen_cardtable; static gboolean need_mod_union; #ifdef HEAVY_STATISTICS -long long marked_cards; -long long scanned_cards; -long long scanned_objects; -long long remarked_cards; +guint64 marked_cards; +guint64 scanned_cards; +guint64 scanned_objects; +guint64 remarked_cards; -static long long los_marked_cards; -static long long large_objects; -static long long bloby_objects; -static long long los_array_cards; -static long long los_array_remsets; +static guint64 los_marked_cards; +static guint64 large_objects; +static guint64 bloby_objects; +static guint64 los_array_cards; +static guint64 los_array_remsets; #endif -static long long major_card_scan_time; -static long long los_card_scan_time; +static guint64 major_card_scan_time; +static guint64 los_card_scan_time; -static long long last_major_scan_time; -static long long last_los_scan_time; +static guint64 last_major_scan_time; +static guint64 last_los_scan_time; static void sgen_card_tables_collect_stats (gboolean begin); @@ -753,19 +753,19 @@ sgen_card_table_init (SgenRemeberedSet *remset) #endif #ifdef HEAVY_STATISTICS - mono_counters_register ("marked cards", MONO_COUNTER_GC | MONO_COUNTER_LONG, &marked_cards); - mono_counters_register ("scanned cards", MONO_COUNTER_GC | MONO_COUNTER_LONG, &scanned_cards); - mono_counters_register ("remarked cards", MONO_COUNTER_GC | MONO_COUNTER_LONG, &remarked_cards); - - mono_counters_register ("los marked cards", MONO_COUNTER_GC | MONO_COUNTER_LONG, &los_marked_cards); - mono_counters_register ("los array cards scanned ", MONO_COUNTER_GC | MONO_COUNTER_LONG, &los_array_cards); - mono_counters_register ("los array remsets", MONO_COUNTER_GC | MONO_COUNTER_LONG, &los_array_remsets); - mono_counters_register ("cardtable scanned objects", MONO_COUNTER_GC | MONO_COUNTER_LONG, &scanned_objects); - mono_counters_register ("cardtable large objects", MONO_COUNTER_GC | MONO_COUNTER_LONG, &large_objects); - mono_counters_register ("cardtable bloby objects", MONO_COUNTER_GC | MONO_COUNTER_LONG, &bloby_objects); + mono_counters_register ("marked cards", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &marked_cards); + mono_counters_register ("scanned cards", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &scanned_cards); + mono_counters_register ("remarked cards", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &remarked_cards); + + mono_counters_register ("los marked cards", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &los_marked_cards); + mono_counters_register ("los array cards scanned ", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &los_array_cards); + mono_counters_register ("los array remsets", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &los_array_remsets); + mono_counters_register ("cardtable scanned objects", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &scanned_objects); + mono_counters_register ("cardtable large objects", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &large_objects); + mono_counters_register ("cardtable bloby objects", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &bloby_objects); #endif - mono_counters_register ("cardtable major scan time", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &major_card_scan_time); - mono_counters_register ("cardtable los scan time", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &los_card_scan_time); + mono_counters_register ("cardtable major scan time", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &major_card_scan_time); + mono_counters_register ("cardtable los scan time", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &los_card_scan_time); remset->wbarrier_set_field = sgen_card_table_wbarrier_set_field; diff --git a/mono/metadata/sgen-conf.h b/mono/metadata/sgen-conf.h index b76ffd49829..b74830f8f6d 100644 --- a/mono/metadata/sgen-conf.h +++ b/mono/metadata/sgen-conf.h @@ -28,10 +28,8 @@ #if SIZEOF_VOID_P == 4 typedef guint32 mword; -#define MWORD_MAX_VALUE ((uint32_t) 0xffffffff) #else typedef guint64 mword; -#define MWORD_MAX_VALUE (G_MAXUINT64) #endif @@ -153,12 +151,9 @@ typedef guint64 mword; #define SGEN_SCAN_START_SIZE (4096*2) /* - * Objects bigger then this go into the large object space. This size - * has a few constraints. It must fit into the major heap, which in - * the case of the copying collector means that it must fit into a - * pinned chunk. It must also play well with the GC descriptors, some - * of which (DESC_TYPE_RUN_LENGTH, DESC_TYPE_SMALL_BITMAP) encode the - * object size. + * Objects bigger then this go into the large object space. This size has a few + * constraints. At least two of them must fit into a major heap block. It must also play + * well with the run length GC descriptor, which encodes the object size. */ #define SGEN_MAX_SMALL_OBJ_SIZE 8000 diff --git a/mono/metadata/sgen-copy-object.h b/mono/metadata/sgen-copy-object.h index 21331c18f06..c5589f672e8 100644 --- a/mono/metadata/sgen-copy-object.h +++ b/mono/metadata/sgen-copy-object.h @@ -21,16 +21,18 @@ #include "mono/utils/mono-compiler.h" -extern long long stat_copy_object_called_nursery; -extern long long stat_objects_copied_nursery; +extern guint64 stat_copy_object_called_nursery; +extern guint64 stat_objects_copied_nursery; -extern long long stat_nursery_copy_object_failed_from_space; -extern long long stat_nursery_copy_object_failed_forwarded; -extern long long stat_nursery_copy_object_failed_pinned; +extern guint64 stat_nursery_copy_object_failed_from_space; +extern guint64 stat_nursery_copy_object_failed_forwarded; +extern guint64 stat_nursery_copy_object_failed_pinned; -extern long long stat_slots_allocated_in_vain; +extern guint64 stat_slots_allocated_in_vain; /* + * Copies an object and enqueues it if a queue is given. + * * This function can be used even if the vtable of obj is not valid * anymore, which is the case in the parallel collector. */ @@ -77,15 +79,20 @@ copy_object_no_checks (void *obj, SgenGrayQueue *queue) MonoVTable *vt = ((MonoObject*)obj)->vtable; gboolean has_references = SGEN_VTABLE_HAS_REFERENCES (vt); mword objsize = SGEN_ALIGN_UP (sgen_par_object_get_size (vt, (MonoObject*)obj)); + /* FIXME: Does this not mark the newly allocated object? */ char *destination = COLLECTOR_SERIAL_ALLOC_FOR_PROMOTION (vt, obj, objsize, has_references); if (G_UNLIKELY (!destination)) { + /* FIXME: Is this path ever tested? */ collector_pin_object (obj, queue); sgen_set_pinned_from_failed_allocation (objsize); return obj; } - par_copy_object_no_checks (destination, vt, obj, objsize, has_references ? queue : NULL); + if (!has_references) + queue = NULL; + + par_copy_object_no_checks (destination, vt, obj, objsize, queue); /* FIXME: mark mod union cards if necessary */ /* set the forwarding pointer */ diff --git a/mono/metadata/sgen-debug.c b/mono/metadata/sgen-debug.c index 8989c9e930e..580f7c185e3 100644 --- a/mono/metadata/sgen-debug.c +++ b/mono/metadata/sgen-debug.c @@ -131,7 +131,7 @@ describe_pointer (char *ptr, gboolean need_setup) desc = ((GCVTable*)vtable)->desc; printf ("Descriptor: %lx\n", (long)desc); - type = desc & 0x7; + type = desc & DESC_TYPE_MASK; printf ("Descriptor type: %d (%s)\n", type, descriptor_types [type]); size = sgen_safe_object_get_size ((MonoObject*)ptr); diff --git a/mono/metadata/sgen-descriptor.c b/mono/metadata/sgen-descriptor.c index 6da8f7290d9..de452becccb 100644 --- a/mono/metadata/sgen-descriptor.c +++ b/mono/metadata/sgen-descriptor.c @@ -60,7 +60,8 @@ static int user_descriptors_next = 0; static void *all_ref_root_descrs [32]; #ifdef HEAVY_STATISTICS -static long long stat_scanned_count_per_descriptor [DESC_TYPE_MAX]; +static guint64 stat_scanned_count_per_descriptor [DESC_TYPE_MAX]; +static guint64 stat_copied_count_per_descriptor [DESC_TYPE_MAX]; #endif static int @@ -121,7 +122,7 @@ sgen_get_complex_descriptor (mword desc) void* mono_gc_make_descr_for_string (gsize *bitmap, int numbits) { - return (void*) DESC_TYPE_RUN_LENGTH; + return (void*)SGEN_DESC_STRING; } void* @@ -145,14 +146,23 @@ mono_gc_make_descr_for_object (gsize *bitmap, int numbits, size_t obj_size) if (first_set < 0) { SGEN_LOG (6, "Ptrfree descriptor %p, size: %zd", (void*)desc, stored_size); - if (stored_size <= MAX_RUNLEN_OBJECT_SIZE) - return (void*)(DESC_TYPE_RUN_LENGTH | stored_size); + if (stored_size <= MAX_RUNLEN_OBJECT_SIZE && stored_size <= SGEN_MAX_SMALL_OBJ_SIZE) + return (void*)(DESC_TYPE_SMALL_PTRFREE | stored_size); return (void*)DESC_TYPE_COMPLEX_PTRFREE; } g_assert (!(stored_size & 0x7)); - if (stored_size <= MAX_RUNLEN_OBJECT_SIZE) { + SGEN_ASSERT (5, stored_size == SGEN_ALIGN_UP (stored_size), "Size is not aligned"); + + /* we know the 2-word header is ptr-free */ + if (last_set < BITMAP_NUM_BITS + OBJECT_HEADER_WORDS && stored_size <= SGEN_MAX_SMALL_OBJ_SIZE) { + desc = DESC_TYPE_BITMAP | ((*bitmap >> OBJECT_HEADER_WORDS) << LOW_TYPE_BITS); + SGEN_LOG (6, "Largebitmap descriptor %p, size: %zd, last set: %d", (void*)desc, stored_size, last_set); + return (void*) desc; + } + + if (stored_size <= MAX_RUNLEN_OBJECT_SIZE && stored_size <= SGEN_MAX_SMALL_OBJ_SIZE) { /* check run-length encoding first: one byte offset, one byte number of pointers * on 64 bit archs, we can have 3 runs, just one on 32. * It may be better to use nibbles. @@ -164,19 +174,6 @@ mono_gc_make_descr_for_object (gsize *bitmap, int numbits, size_t obj_size) } } - /* we know the 2-word header is ptr-free */ - if (last_set < SMALL_BITMAP_SIZE + OBJECT_HEADER_WORDS && stored_size < (1 << SMALL_BITMAP_SHIFT)) { - desc = DESC_TYPE_SMALL_BITMAP | stored_size | ((*bitmap >> OBJECT_HEADER_WORDS) << SMALL_BITMAP_SHIFT); - SGEN_LOG (6, "Smallbitmap descriptor %p, size: %zd, last set: %d", (void*)desc, stored_size, last_set); - return (void*) desc; - } - - /* we know the 2-word header is ptr-free */ - if (last_set < LARGE_BITMAP_SIZE + OBJECT_HEADER_WORDS) { - desc = DESC_TYPE_LARGE_BITMAP | ((*bitmap >> OBJECT_HEADER_WORDS) << LOW_TYPE_BITS); - SGEN_LOG (6, "Largebitmap descriptor %p, size: %zd, last set: %d", (void*)desc, stored_size, last_set); - return (void*) desc; - } /* it's a complex object ... */ desc = DESC_TYPE_COMPLEX | (alloc_complex_descriptor (bitmap, last_set + 1) << LOW_TYPE_BITS); return (void*) desc; @@ -214,7 +211,7 @@ mono_gc_make_descr_for_array (int vector, gsize *elem_bitmap, int numbits, size_ } /* FIXME: try run-len first */ /* Note: we can't skip the object header here, because it's not present */ - if (last_set < SMALL_BITMAP_SIZE) { + if (last_set < VECTOR_BITMAP_SIZE) { return (void*)(desc | VECTOR_SUBTYPE_BITMAP | (*elem_bitmap << 16)); } } @@ -231,7 +228,7 @@ mono_gc_get_bitmap_for_descr (void *descr, int *numbits) mword d = (mword)descr; gsize *bitmap; - switch (d & 0x7) { + switch (d & DESC_TYPE_MASK) { case DESC_TYPE_RUN_LENGTH: { int first_set = (d >> 16) & 0xff; int num_set = (d >> 24) & 0xff; @@ -247,15 +244,7 @@ mono_gc_get_bitmap_for_descr (void *descr, int *numbits) return bitmap; } - case DESC_TYPE_SMALL_BITMAP: - bitmap = g_new0 (gsize, 1); - - bitmap [0] = (d >> SMALL_BITMAP_SHIFT) << OBJECT_HEADER_WORDS; - - *numbits = GC_BITS_PER_WORD; - return bitmap; - - case DESC_TYPE_LARGE_BITMAP: { + case DESC_TYPE_BITMAP: { gsize bmap = (d >> LOW_TYPE_BITS) << OBJECT_HEADER_WORDS; bitmap = g_new0 (gsize, 1); @@ -356,23 +345,39 @@ sgen_get_user_descriptor_func (mword desc) void sgen_descriptor_count_scanned_object (mword desc) { - int type = desc & 7; + int type = desc & DESC_TYPE_MASK; SGEN_ASSERT (0, type, "Descriptor type can't be zero"); ++stat_scanned_count_per_descriptor [type - 1]; } + +void +sgen_descriptor_count_copied_object (mword desc) +{ + int type = desc & DESC_TYPE_MASK; + SGEN_ASSERT (0, type, "Descriptor type can't be zero"); + ++stat_copied_count_per_descriptor [type - 1]; +} #endif void sgen_init_descriptors (void) { #ifdef HEAVY_STATISTICS - mono_counters_register ("# scanned RUN_LENGTH", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_scanned_count_per_descriptor [DESC_TYPE_RUN_LENGTH - 1]); - mono_counters_register ("# scanned SMALL_BITMAP", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_scanned_count_per_descriptor [DESC_TYPE_SMALL_BITMAP - 1]); - mono_counters_register ("# scanned COMPLEX", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_scanned_count_per_descriptor [DESC_TYPE_COMPLEX - 1]); - mono_counters_register ("# scanned VECTOR", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_scanned_count_per_descriptor [DESC_TYPE_VECTOR - 1]); - mono_counters_register ("# scanned LARGE_BITMAP", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_scanned_count_per_descriptor [DESC_TYPE_LARGE_BITMAP - 1]); - mono_counters_register ("# scanned COMPLEX_ARR", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_scanned_count_per_descriptor [DESC_TYPE_COMPLEX_ARR - 1]); - mono_counters_register ("# scanned COMPLEX_PTRFREE", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_scanned_count_per_descriptor [DESC_TYPE_COMPLEX_PTRFREE - 1]); + mono_counters_register ("# scanned RUN_LENGTH", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_scanned_count_per_descriptor [DESC_TYPE_RUN_LENGTH - 1]); + mono_counters_register ("# scanned SMALL_PTRFREE", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_scanned_count_per_descriptor [DESC_TYPE_SMALL_PTRFREE - 1]); + mono_counters_register ("# scanned COMPLEX", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_scanned_count_per_descriptor [DESC_TYPE_COMPLEX - 1]); + mono_counters_register ("# scanned VECTOR", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_scanned_count_per_descriptor [DESC_TYPE_VECTOR - 1]); + mono_counters_register ("# scanned BITMAP", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_scanned_count_per_descriptor [DESC_TYPE_BITMAP - 1]); + mono_counters_register ("# scanned COMPLEX_ARR", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_scanned_count_per_descriptor [DESC_TYPE_COMPLEX_ARR - 1]); + mono_counters_register ("# scanned COMPLEX_PTRFREE", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_scanned_count_per_descriptor [DESC_TYPE_COMPLEX_PTRFREE - 1]); + + mono_counters_register ("# copied RUN_LENGTH", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_copied_count_per_descriptor [DESC_TYPE_RUN_LENGTH - 1]); + mono_counters_register ("# copied SMALL_PTRFREE", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_copied_count_per_descriptor [DESC_TYPE_SMALL_PTRFREE - 1]); + mono_counters_register ("# copied COMPLEX", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_copied_count_per_descriptor [DESC_TYPE_COMPLEX - 1]); + mono_counters_register ("# copied VECTOR", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_copied_count_per_descriptor [DESC_TYPE_VECTOR - 1]); + mono_counters_register ("# copied BITMAP", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_copied_count_per_descriptor [DESC_TYPE_BITMAP - 1]); + mono_counters_register ("# copied COMPLEX_ARR", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_copied_count_per_descriptor [DESC_TYPE_COMPLEX_ARR - 1]); + mono_counters_register ("# copied COMPLEX_PTRFREE", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_copied_count_per_descriptor [DESC_TYPE_COMPLEX_PTRFREE - 1]); #endif } diff --git a/mono/metadata/sgen-descriptor.h b/mono/metadata/sgen-descriptor.h index c06354dd958..de01e1c6a94 100644 --- a/mono/metadata/sgen-descriptor.h +++ b/mono/metadata/sgen-descriptor.h @@ -36,26 +36,39 @@ */ #define OBJECT_HEADER_WORDS (sizeof(MonoObject)/sizeof(gpointer)) #define LOW_TYPE_BITS 3 +#define DESC_TYPE_MASK ((1 << LOW_TYPE_BITS) - 1) #define MAX_RUNLEN_OBJECT_SIZE 0xFFFF -#define SMALL_BITMAP_SHIFT 16 -#define SMALL_BITMAP_SIZE (GC_BITS_PER_WORD - SMALL_BITMAP_SHIFT) #define VECTOR_INFO_SHIFT 14 #define VECTOR_KIND_SHIFT 13 #define VECTOR_ELSIZE_SHIFT 3 -#define LARGE_BITMAP_SIZE (GC_BITS_PER_WORD - LOW_TYPE_BITS) +#define VECTOR_BITMAP_SHIFT 16 +#define VECTOR_BITMAP_SIZE (GC_BITS_PER_WORD - VECTOR_BITMAP_SHIFT) +#define BITMAP_NUM_BITS (GC_BITS_PER_WORD - LOW_TYPE_BITS) #define MAX_ELEMENT_SIZE 0x3ff #define VECTOR_SUBTYPE_PTRFREE (DESC_TYPE_V_PTRFREE << VECTOR_INFO_SHIFT) #define VECTOR_SUBTYPE_REFS (DESC_TYPE_V_REFS << VECTOR_INFO_SHIFT) -#define VECTOR_SUBTYPE_RUN_LEN (DESC_TYPE_V_RUN_LEN << VECTOR_INFO_SHIFT) #define VECTOR_SUBTYPE_BITMAP (DESC_TYPE_V_BITMAP << VECTOR_INFO_SHIFT) #define VECTOR_KIND_SZARRAY (DESC_TYPE_V_SZARRAY << VECTOR_KIND_SHIFT) #define VECTOR_KIND_ARRAY (DESC_TYPE_V_ARRAY << VECTOR_KIND_SHIFT) -/* objects are aligned to 8 bytes boundaries +/* + * Objects are aligned to 8 bytes boundaries. + * * A descriptor is a pointer in MonoVTable, so 32 or 64 bits of size. * The low 3 bits define the type of the descriptor. The other bits * depend on the type. + * + * It's important to be able to quickly identify two properties of classes from their + * descriptors: whether they are small enough to live in the regular major heap (size <= + * SGEN_MAX_SMALL_OBJ_SIZE), and whether they contain references. + * + * To that end we have three descriptor types that only apply to small classes: RUN_LENGTH, + * BITMAP, and SMALL_PTRFREE. We also have the type COMPLEX_PTRFREE, which applies to + * classes that are either not small or of unknown size (those being strings and arrays). + * The lowest two bits of the SMALL_PTRFREE and COMPLEX_PTRFREE tags are the same, so we can + * quickly check for references. + * * As a general rule the 13 remaining low bits define the size, either * of the whole object or of the elements in the arrays. While for objects * the size is already in bytes, for arrays we need to shift, because @@ -69,37 +82,41 @@ * will be allocated in the large object heap. * If we want 4-bytes alignment, we need to put vector and small bitmap * inside complex. + * + * We don't use 0 so that 0 isn't a valid GC descriptor. No deep reason for this other than + * to be able to identify a non-inited descriptor for debugging. */ enum { - /* - * We don't use 0 so that 0 isn't a valid GC descriptor. No - * deep reason for this other than to be able to identify a - * non-inited descriptor for debugging. - * - * If an object contains no references, its GC descriptor is - * always DESC_TYPE_RUN_LENGTH, without a size, no exceptions. - * This is so that we can quickly check for that in - * copy_object_no_checks(), without having to fetch the - * object's class. - */ DESC_TYPE_RUN_LENGTH = 1, /* 16 bits aligned byte size | 1-3 (offset, numptr) bytes tuples */ - DESC_TYPE_SMALL_BITMAP = 2, /* 16 bits aligned byte size | 16-48 bit bitmap */ - DESC_TYPE_COMPLEX = 3, /* index for bitmap into complex_descriptors */ - DESC_TYPE_VECTOR = 4, /* 10 bits element size | 1 bit kind | 2 bits desc | element desc */ - DESC_TYPE_LARGE_BITMAP = 5, /* | 29-61 bitmap bits */ + DESC_TYPE_BITMAP = 2, /* | 29-61 bitmap bits */ + DESC_TYPE_SMALL_PTRFREE = 3, + DESC_TYPE_MAX_SMALL_OBJ = 3, + DESC_TYPE_COMPLEX = 4, /* index for bitmap into complex_descriptors */ + DESC_TYPE_VECTOR = 5, /* 10 bits element size | 1 bit kind | 2 bits desc | element desc */ DESC_TYPE_COMPLEX_ARR = 6, /* index for bitmap into complex_descriptors */ - DESC_TYPE_COMPLEX_PTRFREE = 7, /*Nothing, used to encode large ptr objects. */ + DESC_TYPE_COMPLEX_PTRFREE = 7, /* Nothing, used to encode large ptr objects and strings. */ DESC_TYPE_MAX = 7, - /* values for array kind */ + + DESC_TYPE_PTRFREE_MASK = 3, + DESC_TYPE_PTRFREE_BITS = 3 +}; + +/* values for array kind */ +enum { DESC_TYPE_V_SZARRAY = 0, /*vector with no bounds data */ DESC_TYPE_V_ARRAY = 1, /* array with bounds data */ - /* subtypes for arrays and vectors */ +}; + +/* subtypes for arrays and vectors */ +enum { DESC_TYPE_V_PTRFREE = 0,/* there are no refs: keep first so it has a zero value */ DESC_TYPE_V_REFS, /* all the array elements are refs */ DESC_TYPE_V_RUN_LEN, /* elements are run-length encoded as DESC_TYPE_RUN_LENGTH */ DESC_TYPE_V_BITMAP /* elements are as the bitmap in DESC_TYPE_SMALL_BITMAP */ }; +#define SGEN_DESC_STRING (DESC_TYPE_COMPLEX_PTRFREE | (1 << LOW_TYPE_BITS)) + /* Root bitmap descriptors are simpler: the lower three bits describe the type * and we either have 30/62 bitmap bits or nibble-based run-length, * or a complex descriptor, or a user defined marker function. @@ -122,22 +139,20 @@ void sgen_init_descriptors (void) MONO_INTERNAL; #ifdef HEAVY_STATISTICS void sgen_descriptor_count_scanned_object (mword desc) MONO_INTERNAL; +void sgen_descriptor_count_copied_object (mword desc) MONO_INTERNAL; #endif static inline gboolean sgen_gc_descr_has_references (mword desc) { - /*Both string and fixed size objects are encoded using a zero run RUN_LEN*/ - if ((desc & 0xffff0007) == DESC_TYPE_RUN_LENGTH) + /* This covers SMALL_PTRFREE and COMPLEX_PTRFREE */ + if ((desc & DESC_TYPE_PTRFREE_MASK) == DESC_TYPE_PTRFREE_BITS) return FALSE; /*The array is ptr-free*/ if ((desc & 0xC007) == (DESC_TYPE_VECTOR | VECTOR_SUBTYPE_PTRFREE)) return FALSE; - if ((desc & 0x7) == DESC_TYPE_COMPLEX_PTRFREE) - return FALSE; - return TRUE; } @@ -146,18 +161,10 @@ sgen_gc_descr_has_references (mword desc) #define SGEN_OBJECT_HAS_REFERENCES(o) (SGEN_VTABLE_HAS_REFERENCES (SGEN_LOAD_VTABLE ((o)))) /* helper macros to scan and traverse objects, macros because we resue them in many functions */ -#define OBJ_RUN_LEN_SIZE(size,desc,obj) do { \ - (size) = ((desc) & 0xfff8); \ - } while (0) - -#define OBJ_BITMAP_SIZE(size,desc,obj) do { \ - (size) = ((desc) & 0xfff8); \ - } while (0) - #ifdef __GNUC__ -#define PREFETCH(addr) __builtin_prefetch ((addr)) +#define PREFETCH_READ(addr) __builtin_prefetch ((addr), 0, 1) #else -#define PREFETCH(addr) +#define PREFETCH_READ(addr) #endif #if defined(__GNUC__) && SIZEOF_VOID_P==4 @@ -181,52 +188,38 @@ sgen_gc_descr_has_references (mword desc) } \ } while (0) -#if defined(__GNUC__) -#define OBJ_BITMAP_FOREACH_PTR(desc,obj) do { \ - /* there are pointers */ \ - void **_objptr = (void**)(obj); \ - gsize _bmap = (desc) >> 16; \ - _objptr += OBJECT_HEADER_WORDS; \ - do { \ - int _index = GNUC_BUILTIN_CTZ (_bmap); \ - _objptr += _index; \ - _bmap >>= (_index + 1); \ - HANDLE_PTR (_objptr, (obj)); \ - _objptr ++; \ - } while (_bmap); \ - } while (0) -#else -#define OBJ_BITMAP_FOREACH_PTR(desc,obj) do { \ - /* there are pointers */ \ - void **_objptr = (void**)(obj); \ - gsize _bmap = (desc) >> 16; \ - _objptr += OBJECT_HEADER_WORDS; \ - while (_bmap) { \ - if ((_bmap & 1)) { \ - HANDLE_PTR (_objptr, (obj)); \ - } \ - _bmap >>= 1; \ - ++_objptr; \ - } \ - } while (0) -#endif - /* a bitmap desc means that there are pointer references or we'd have * choosen run-length, instead: add an assert to check. */ -#define OBJ_LARGE_BITMAP_FOREACH_PTR(desc,obj) do { \ +#ifdef __GNUC__ +#define OBJ_BITMAP_FOREACH_PTR(desc,obj) do { \ + /* there are pointers */ \ + void **_objptr = (void**)(obj); \ + gsize _bmap = (desc) >> LOW_TYPE_BITS; \ + _objptr += OBJECT_HEADER_WORDS; \ + do { \ + int _index = GNUC_BUILTIN_CTZ (_bmap); \ + _objptr += _index; \ + _bmap >>= (_index + 1); \ + HANDLE_PTR (_objptr, (obj)); \ + ++_objptr; \ + } while (_bmap); \ + } while (0) +#else +#define OBJ_BITMAP_FOREACH_PTR(desc,obj) do { \ /* there are pointers */ \ void **_objptr = (void**)(obj); \ gsize _bmap = (desc) >> LOW_TYPE_BITS; \ _objptr += OBJECT_HEADER_WORDS; \ - while (_bmap) { \ + do { \ if ((_bmap & 1)) { \ HANDLE_PTR (_objptr, (obj)); \ } \ _bmap >>= 1; \ ++_objptr; \ - } \ + } while (_bmap) \ } while (0) +#endif #define OBJ_COMPLEX_FOREACH_PTR(vt,obj) do { \ /* there are pointers */ \ diff --git a/mono/metadata/sgen-fin-weak-hash.c b/mono/metadata/sgen-fin-weak-hash.c index 99639432683..686e0c60909 100644 --- a/mono/metadata/sgen-fin-weak-hash.c +++ b/mono/metadata/sgen-fin-weak-hash.c @@ -422,12 +422,12 @@ process_stage_entries (int num_entries, volatile gint32 *next_entry, StageEntry } #ifdef HEAVY_STATISTICS -static long long stat_overflow_abort = 0; -static long long stat_wait_for_processing = 0; -static long long stat_increment_other_thread = 0; -static long long stat_index_decremented = 0; -static long long stat_entry_invalidated = 0; -static long long stat_success = 0; +static guint64 stat_overflow_abort = 0; +static guint64 stat_wait_for_processing = 0; +static guint64 stat_increment_other_thread = 0; +static guint64 stat_index_decremented = 0; +static guint64 stat_entry_invalidated = 0; +static guint64 stat_success = 0; #endif static int @@ -905,12 +905,12 @@ void sgen_init_fin_weak_hash (void) { #ifdef HEAVY_STATISTICS - mono_counters_register ("FinWeak Successes", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_success); - mono_counters_register ("FinWeak Overflow aborts", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_overflow_abort); - mono_counters_register ("FinWeak Wait for processing", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_wait_for_processing); - mono_counters_register ("FinWeak Increment other thread", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_increment_other_thread); - mono_counters_register ("FinWeak Index decremented", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_index_decremented); - mono_counters_register ("FinWeak Entry invalidated", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_entry_invalidated); + mono_counters_register ("FinWeak Successes", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_success); + mono_counters_register ("FinWeak Overflow aborts", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_overflow_abort); + mono_counters_register ("FinWeak Wait for processing", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_wait_for_processing); + mono_counters_register ("FinWeak Increment other thread", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_increment_other_thread); + mono_counters_register ("FinWeak Index decremented", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_index_decremented); + mono_counters_register ("FinWeak Entry invalidated", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_entry_invalidated); #endif } diff --git a/mono/metadata/sgen-gc.c b/mono/metadata/sgen-gc.c index 2ea2bf033f5..897b11af57d 100644 --- a/mono/metadata/sgen-gc.c +++ b/mono/metadata/sgen-gc.c @@ -293,23 +293,23 @@ static gboolean do_dump_nursery_content = FALSE; static gboolean enable_nursery_canaries = FALSE; #ifdef HEAVY_STATISTICS -long long stat_objects_alloced_degraded = 0; -long long stat_bytes_alloced_degraded = 0; +guint64 stat_objects_alloced_degraded = 0; +guint64 stat_bytes_alloced_degraded = 0; -long long stat_copy_object_called_nursery = 0; -long long stat_objects_copied_nursery = 0; -long long stat_copy_object_called_major = 0; -long long stat_objects_copied_major = 0; +guint64 stat_copy_object_called_nursery = 0; +guint64 stat_objects_copied_nursery = 0; +guint64 stat_copy_object_called_major = 0; +guint64 stat_objects_copied_major = 0; -long long stat_scan_object_called_nursery = 0; -long long stat_scan_object_called_major = 0; +guint64 stat_scan_object_called_nursery = 0; +guint64 stat_scan_object_called_major = 0; -long long stat_slots_allocated_in_vain; +guint64 stat_slots_allocated_in_vain; -long long stat_nursery_copy_object_failed_from_space = 0; -long long stat_nursery_copy_object_failed_forwarded = 0; -long long stat_nursery_copy_object_failed_pinned = 0; -long long stat_nursery_copy_object_failed_to_space = 0; +guint64 stat_nursery_copy_object_failed_from_space = 0; +guint64 stat_nursery_copy_object_failed_forwarded = 0; +guint64 stat_nursery_copy_object_failed_pinned = 0; +guint64 stat_nursery_copy_object_failed_to_space = 0; static int stat_wbarrier_add_to_global_remset = 0; static int stat_wbarrier_set_field = 0; @@ -322,32 +322,32 @@ static int stat_wbarrier_value_copy = 0; static int stat_wbarrier_object_copy = 0; #endif -static long long stat_pinned_objects = 0; - -static long long time_minor_pre_collection_fragment_clear = 0; -static long long time_minor_pinning = 0; -static long long time_minor_scan_remsets = 0; -static long long time_minor_scan_pinned = 0; -static long long time_minor_scan_registered_roots = 0; -static long long time_minor_scan_thread_data = 0; -static long long time_minor_finish_gray_stack = 0; -static long long time_minor_fragment_creation = 0; - -static long long time_major_pre_collection_fragment_clear = 0; -static long long time_major_pinning = 0; -static long long time_major_scan_pinned = 0; -static long long time_major_scan_registered_roots = 0; -static long long time_major_scan_thread_data = 0; -static long long time_major_scan_alloc_pinned = 0; -static long long time_major_scan_finalized = 0; -static long long time_major_scan_big_objects = 0; -static long long time_major_finish_gray_stack = 0; -static long long time_major_free_bigobjs = 0; -static long long time_major_los_sweep = 0; -static long long time_major_sweep = 0; -static long long time_major_fragment_creation = 0; - -static long long time_max = 0; +static guint64 stat_pinned_objects = 0; + +static guint64 time_minor_pre_collection_fragment_clear = 0; +static guint64 time_minor_pinning = 0; +static guint64 time_minor_scan_remsets = 0; +static guint64 time_minor_scan_pinned = 0; +static guint64 time_minor_scan_registered_roots = 0; +static guint64 time_minor_scan_thread_data = 0; +static guint64 time_minor_finish_gray_stack = 0; +static guint64 time_minor_fragment_creation = 0; + +static guint64 time_major_pre_collection_fragment_clear = 0; +static guint64 time_major_pinning = 0; +static guint64 time_major_scan_pinned = 0; +static guint64 time_major_scan_registered_roots = 0; +static guint64 time_major_scan_thread_data = 0; +static guint64 time_major_scan_alloc_pinned = 0; +static guint64 time_major_scan_finalized = 0; +static guint64 time_major_scan_big_objects = 0; +static guint64 time_major_finish_gray_stack = 0; +static guint64 time_major_free_bigobjs = 0; +static guint64 time_major_los_sweep = 0; +static guint64 time_major_sweep = 0; +static guint64 time_major_fragment_creation = 0; + +static guint64 time_max = 0; static SGEN_TV_DECLARE (time_major_conc_collection_start); static SGEN_TV_DECLARE (time_major_conc_collection_end); @@ -371,7 +371,6 @@ mono_gc_flush_info (void) #define TV_DECLARE SGEN_TV_DECLARE #define TV_GETTIME SGEN_TV_GETTIME #define TV_ELAPSED SGEN_TV_ELAPSED -#define TV_ELAPSED_MS SGEN_TV_ELAPSED_MS SGEN_TV_DECLARE (sgen_init_timestamp); @@ -382,7 +381,6 @@ NurseryClearPolicy nursery_clear_policy = CLEAR_AT_TLAB_CREATION; #define object_is_forwarded SGEN_OBJECT_IS_FORWARDED #define object_is_pinned SGEN_OBJECT_IS_PINNED #define pin_object SGEN_PIN_OBJECT -#define unpin_object SGEN_UNPIN_OBJECT #define ptr_in_nursery sgen_ptr_in_nursery @@ -429,10 +427,6 @@ static volatile mword lowest_heap_address = ~(mword)0; static volatile mword highest_heap_address = 0; LOCK_DECLARE (sgen_interruption_mutex); -static LOCK_DECLARE (pin_queue_mutex); - -#define LOCK_PIN_QUEUE mono_mutex_lock (&pin_queue_mutex) -#define UNLOCK_PIN_QUEUE mono_mutex_unlock (&pin_queue_mutex) typedef struct _FinalizeReadyEntry FinalizeReadyEntry; struct _FinalizeReadyEntry { @@ -520,7 +514,6 @@ guint32 tlab_size = (1024 * 4); static MonoGCCallbacks gc_callbacks; #define ALLOC_ALIGN SGEN_ALLOC_ALIGN -#define ALLOC_ALIGN_BITS SGEN_ALLOC_ALIGN_BITS #define ALIGN_UP SGEN_ALIGN_UP @@ -829,6 +822,7 @@ mono_gc_clear_domain (MonoDomain * domain) sgen_restart_world (0, NULL); binary_protocol_domain_unload_end (domain); + binary_protocol_flush_buffers (FALSE); UNLOCK_GC; } @@ -895,6 +889,9 @@ sgen_drain_gray_stack (int max_objs, ScanCopyContext ctx) ScanObjectFunc scan_func = ctx.scan_func; GrayQueue *queue = ctx.queue; + if (current_collection_generation == GENERATION_OLD && major_collector.drain_gray_stack) + return major_collector.drain_gray_stack (ctx); + do { int i; for (i = 0; i != max_objs; ++i) { @@ -1237,7 +1234,7 @@ conservatively_pin_objects_from (void **start, void **end, void *start_nursery, if (addr >= (mword)start_nursery && addr < (mword)end_nursery) { SGEN_LOG (6, "Pinning address %p from %p", (void*)addr, start); sgen_pin_stage_ptr ((void*)addr); - binary_protocol_pin_stage (start, (void*)addr, thread_info); + binary_protocol_pin_stage (start, (void*)addr); count++; } if (G_UNLIKELY (do_pin_stats)) { @@ -1325,7 +1322,6 @@ precisely_scan_objects_from (void** start_root, void** end_root, char* n_start, if ((desc & 1) && *start_root) { copy_func (start_root, queue); SGEN_LOG (9, "Overwrote root at %p with %p", start_root, *start_root); - sgen_drain_gray_stack (-1, ctx); } desc >>= 1; start_root++; @@ -1343,7 +1339,6 @@ precisely_scan_objects_from (void** start_root, void** end_root, char* n_start, if ((bmap & 1) && *objptr) { copy_func (objptr, queue); SGEN_LOG (9, "Overwrote root at %p with %p", objptr, *objptr); - sgen_drain_gray_stack (-1, ctx); } bmap >>= 1; ++objptr; @@ -1936,32 +1931,32 @@ init_stats (void) if (inited) return; - mono_counters_register ("Collection max time", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME | MONO_COUNTER_MONOTONIC, &time_max); - - mono_counters_register ("Minor fragment clear", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &time_minor_pre_collection_fragment_clear); - mono_counters_register ("Minor pinning", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &time_minor_pinning); - mono_counters_register ("Minor scan remembered set", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &time_minor_scan_remsets); - mono_counters_register ("Minor scan pinned", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &time_minor_scan_pinned); - mono_counters_register ("Minor scan registered roots", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &time_minor_scan_registered_roots); - mono_counters_register ("Minor scan thread data", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &time_minor_scan_thread_data); - mono_counters_register ("Minor finish gray stack", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &time_minor_finish_gray_stack); - mono_counters_register ("Minor fragment creation", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &time_minor_fragment_creation); - - mono_counters_register ("Major fragment clear", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &time_major_pre_collection_fragment_clear); - mono_counters_register ("Major pinning", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &time_major_pinning); - mono_counters_register ("Major scan pinned", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &time_major_scan_pinned); - mono_counters_register ("Major scan registered roots", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &time_major_scan_registered_roots); - mono_counters_register ("Major scan thread data", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &time_major_scan_thread_data); - mono_counters_register ("Major scan alloc_pinned", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &time_major_scan_alloc_pinned); - mono_counters_register ("Major scan finalized", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &time_major_scan_finalized); - mono_counters_register ("Major scan big objects", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &time_major_scan_big_objects); - mono_counters_register ("Major finish gray stack", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &time_major_finish_gray_stack); - mono_counters_register ("Major free big objects", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &time_major_free_bigobjs); - mono_counters_register ("Major LOS sweep", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &time_major_los_sweep); - mono_counters_register ("Major sweep", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &time_major_sweep); - mono_counters_register ("Major fragment creation", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &time_major_fragment_creation); - - mono_counters_register ("Number of pinned objects", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_pinned_objects); + mono_counters_register ("Collection max time", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME | MONO_COUNTER_MONOTONIC, &time_max); + + mono_counters_register ("Minor fragment clear", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_minor_pre_collection_fragment_clear); + mono_counters_register ("Minor pinning", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_minor_pinning); + mono_counters_register ("Minor scan remembered set", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_minor_scan_remsets); + mono_counters_register ("Minor scan pinned", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_minor_scan_pinned); + mono_counters_register ("Minor scan registered roots", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_minor_scan_registered_roots); + mono_counters_register ("Minor scan thread data", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_minor_scan_thread_data); + mono_counters_register ("Minor finish gray stack", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_minor_finish_gray_stack); + mono_counters_register ("Minor fragment creation", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_minor_fragment_creation); + + mono_counters_register ("Major fragment clear", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_pre_collection_fragment_clear); + mono_counters_register ("Major pinning", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_pinning); + mono_counters_register ("Major scan pinned", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_scan_pinned); + mono_counters_register ("Major scan registered roots", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_scan_registered_roots); + mono_counters_register ("Major scan thread data", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_scan_thread_data); + mono_counters_register ("Major scan alloc_pinned", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_scan_alloc_pinned); + mono_counters_register ("Major scan finalized", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_scan_finalized); + mono_counters_register ("Major scan big objects", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_scan_big_objects); + mono_counters_register ("Major finish gray stack", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_finish_gray_stack); + mono_counters_register ("Major free big objects", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_free_bigobjs); + mono_counters_register ("Major LOS sweep", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_los_sweep); + mono_counters_register ("Major sweep", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_sweep); + mono_counters_register ("Major fragment creation", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_major_fragment_creation); + + mono_counters_register ("Number of pinned objects", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_pinned_objects); #ifdef HEAVY_STATISTICS mono_counters_register ("WBarrier remember pointer", MONO_COUNTER_GC | MONO_COUNTER_INT, &stat_wbarrier_add_to_global_remset); @@ -1974,23 +1969,23 @@ init_stats (void) mono_counters_register ("WBarrier value copy", MONO_COUNTER_GC | MONO_COUNTER_INT, &stat_wbarrier_value_copy); mono_counters_register ("WBarrier object copy", MONO_COUNTER_GC | MONO_COUNTER_INT, &stat_wbarrier_object_copy); - mono_counters_register ("# objects allocated degraded", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_objects_alloced_degraded); - mono_counters_register ("bytes allocated degraded", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_bytes_alloced_degraded); + mono_counters_register ("# objects allocated degraded", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_objects_alloced_degraded); + mono_counters_register ("bytes allocated degraded", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_bytes_alloced_degraded); - mono_counters_register ("# copy_object() called (nursery)", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_copy_object_called_nursery); - mono_counters_register ("# objects copied (nursery)", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_objects_copied_nursery); - mono_counters_register ("# copy_object() called (major)", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_copy_object_called_major); - mono_counters_register ("# objects copied (major)", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_objects_copied_major); + mono_counters_register ("# copy_object() called (nursery)", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_copy_object_called_nursery); + mono_counters_register ("# objects copied (nursery)", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_objects_copied_nursery); + mono_counters_register ("# copy_object() called (major)", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_copy_object_called_major); + mono_counters_register ("# objects copied (major)", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_objects_copied_major); - mono_counters_register ("# scan_object() called (nursery)", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_scan_object_called_nursery); - mono_counters_register ("# scan_object() called (major)", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_scan_object_called_major); + mono_counters_register ("# scan_object() called (nursery)", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_scan_object_called_nursery); + mono_counters_register ("# scan_object() called (major)", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_scan_object_called_major); - mono_counters_register ("Slots allocated in vain", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_slots_allocated_in_vain); + mono_counters_register ("Slots allocated in vain", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_slots_allocated_in_vain); - mono_counters_register ("# nursery copy_object() failed from space", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_nursery_copy_object_failed_from_space); - mono_counters_register ("# nursery copy_object() failed forwarded", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_nursery_copy_object_failed_forwarded); - mono_counters_register ("# nursery copy_object() failed pinned", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_nursery_copy_object_failed_pinned); - mono_counters_register ("# nursery copy_object() failed to space", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_nursery_copy_object_failed_to_space); + mono_counters_register ("# nursery copy_object() failed from space", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_nursery_copy_object_failed_from_space); + mono_counters_register ("# nursery copy_object() failed forwarded", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_nursery_copy_object_failed_forwarded); + mono_counters_register ("# nursery copy_object() failed pinned", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_nursery_copy_object_failed_pinned); + mono_counters_register ("# nursery copy_object() failed to space", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_nursery_copy_object_failed_to_space); sgen_nursery_allocator_init_heavy_stats (); sgen_alloc_init_heavy_stats (); @@ -2456,7 +2451,7 @@ collect_nursery (SgenGrayQueue *unpin_queue, gboolean finish_up_concurrent_mark) objects_pinned = 0; MONO_GC_END (GENERATION_NURSERY); - binary_protocol_collection_end (gc_stats.minor_gc_count - 1, GENERATION_NURSERY); + binary_protocol_collection_end (gc_stats.minor_gc_count - 1, GENERATION_NURSERY, 0, 0); if (check_nursery_objects_pinned && !sgen_minor_collector.is_split) sgen_check_nursery_objects_pinned (unpin_queue != NULL); @@ -2802,6 +2797,7 @@ wait_for_workers_to_finish (void) static void major_finish_collection (const char *reason, size_t old_next_pin_slot, gboolean scan_mod_union, gboolean scan_whole_nursery) { + ScannedObjectCounts counts; LOSObject *bigobj, *prevbo; TV_DECLARE (atv); TV_DECLARE (btv); @@ -2962,7 +2958,8 @@ major_finish_collection (const char *reason, size_t old_next_pin_slot, gboolean sgen_memgov_major_collection_end (); current_collection_generation = -1; - major_collector.finish_major_collection (); + memset (&counts, 0, sizeof (ScannedObjectCounts)); + major_collector.finish_major_collection (&counts); g_assert (sgen_section_gray_queue_is_empty (sgen_workers_get_distribute_section_gray_queue ())); @@ -2977,7 +2974,7 @@ major_finish_collection (const char *reason, size_t old_next_pin_slot, gboolean //consistency_check (); MONO_GC_END (GENERATION_OLD); - binary_protocol_collection_end (gc_stats.major_gc_count - 1, GENERATION_OLD); + binary_protocol_collection_end (gc_stats.major_gc_count - 1, GENERATION_OLD, counts.num_scanned_objects, counts.num_unique_scanned_objects); } static gboolean @@ -3045,6 +3042,9 @@ major_start_concurrent_collection (const char *reason) current_collection_generation = -1; } +/* + * Returns whether the major collection has finished. + */ static gboolean major_should_finish_concurrent_collection (void) { @@ -3061,7 +3061,7 @@ major_update_concurrent_collection (void) TV_GETTIME (total_start); MONO_GC_CONCURRENT_UPDATE_FINISH_BEGIN (GENERATION_OLD, major_collector.get_and_reset_num_major_objects_marked ()); - binary_protocol_concurrent_update_finish (); + binary_protocol_concurrent_update (); major_collector.update_cardtable_mod_union (); sgen_los_update_cardtable_mod_union (); @@ -3084,7 +3084,7 @@ major_finish_concurrent_collection (void) TV_GETTIME (total_start); MONO_GC_CONCURRENT_UPDATE_FINISH_BEGIN (GENERATION_OLD, major_collector.get_and_reset_num_major_objects_marked ()); - binary_protocol_concurrent_update_finish (); + binary_protocol_concurrent_finish (); /* * The major collector can add global remsets which are processed in the finishing @@ -4670,7 +4670,6 @@ mono_gc_base_init (void) mono_threads_init (&cb, sizeof (SgenThreadInfo)); LOCK_INIT (sgen_interruption_mutex); - LOCK_INIT (pin_queue_mutex); if ((env = g_getenv (MONO_GC_PARAMS_NAME))) { opts = g_strsplit (env, ",", -1); diff --git a/mono/metadata/sgen-gc.h b/mono/metadata/sgen-gc.h index 32e878d0fe8..0e328097c7f 100644 --- a/mono/metadata/sgen-gc.h +++ b/mono/metadata/sgen-gc.h @@ -67,7 +67,6 @@ NurseryClearPolicy sgen_get_nursery_clear_policy (void) MONO_INTERNAL; #define SGEN_TV_DECLARE(name) gint64 name #define SGEN_TV_GETTIME(tv) tv = mono_100ns_ticks () #define SGEN_TV_ELAPSED(start,end) (int)((end-start)) -#define SGEN_TV_ELAPSED_MS(start,end) ((SGEN_TV_ELAPSED((start),(end)) + 5000) / 10000) #if !defined(__MACH__) && !MONO_MACH_ARCH_SUPPORTED && defined(HAVE_PTHREAD_KILL) #define SGEN_POSIX_STW 1 @@ -160,7 +159,6 @@ struct _GCMemSection { mono_mutex_lock (&gc_mutex); \ MONO_GC_LOCKED (); \ } while (0) -#define TRYLOCK_GC (mono_mutex_trylock (&gc_mutex) == 0) #define UNLOCK_GC do { sgen_gc_unlock (); } while (0) extern LOCK_DECLARE (sgen_interruption_mutex); @@ -190,10 +188,10 @@ extern LOCK_DECLARE (sgen_interruption_mutex); #endif #ifdef HEAVY_STATISTICS -extern long long stat_objects_alloced_degraded; -extern long long stat_bytes_alloced_degraded; -extern long long stat_copy_object_called_major; -extern long long stat_objects_copied_major; +extern guint64 stat_objects_alloced_degraded; +extern guint64 stat_bytes_alloced_degraded; +extern guint64 stat_copy_object_called_major; +extern guint64 stat_objects_copied_major; #endif #define SGEN_ASSERT(level, a, ...) do { \ @@ -213,11 +211,6 @@ extern long long stat_objects_copied_major; mono_gc_printf (gc_debug_file, format, ##__VA_ARGS__); \ } } while (0) -#define SGEN_LOG_DO(level, fun) do { \ - if (G_UNLIKELY ((level) <= SGEN_MAX_DEBUG_LEVEL && (level) <= gc_debug_level)) { \ - fun; \ -} } while (0) - extern int gc_debug_level; extern FILE* gc_debug_file; @@ -310,27 +303,37 @@ typedef struct { mword desc; } GCVTable; -/* these bits are set in the object vtable: we could merge them since an object can be - * either pinned or forwarded but not both. - * We store them in the vtable slot because the bits are used in the sync block for - * other purposes: if we merge them and alloc the sync blocks aligned to 8 bytes, we can change +/* + * We use the lowest three bits in the vtable pointer of objects to tag whether they're + * forwarded, pinned, and/or cemented. These are the valid states: + * + * | State | bits | + * |------------------+------+ + * | default | 000 | + * | forwarded | 001 | + * | pinned | 010 | + * | pinned, cemented | 110 | + * + * We store them in the vtable slot because the bits are used in the sync block for other + * purposes: if we merge them and alloc the sync blocks aligned to 8 bytes, we can change * this and use bit 3 in the syncblock (with the lower two bits both set for forwarded, that * would be an invalid combination for the monitor and hash code). - * The values are already shifted. - * The forwarding address is stored in the sync block. */ -#define SGEN_VTABLE_BITS_MASK 0x3 - #include "sgen-tagged-pointer.h" +#define SGEN_VTABLE_BITS_MASK SGEN_TAGGED_POINTER_MASK + #define SGEN_POINTER_IS_TAGGED_FORWARDED(p) SGEN_POINTER_IS_TAGGED_1((p)) -#define SGEN_POINTER_TAG_FORWARDED(p) SGEN_POINTER_TAG_1((p)) +#define SGEN_POINTER_TAG_FORWARDED(p) SGEN_POINTER_TAG_1((p)) #define SGEN_POINTER_IS_TAGGED_PINNED(p) SGEN_POINTER_IS_TAGGED_2((p)) -#define SGEN_POINTER_TAG_PINNED(p) SGEN_POINTER_TAG_2((p)) +#define SGEN_POINTER_TAG_PINNED(p) SGEN_POINTER_TAG_2((p)) -#define SGEN_POINTER_UNTAG_VTABLE(p) SGEN_POINTER_UNTAG_12((p)) +#define SGEN_POINTER_IS_TAGGED_CEMENTED(p) SGEN_POINTER_IS_TAGGED_4((p)) +#define SGEN_POINTER_TAG_CEMENTED(p) SGEN_POINTER_TAG_4((p)) + +#define SGEN_POINTER_UNTAG_VTABLE(p) SGEN_POINTER_UNTAG_ALL((p)) /* returns NULL if not forwarded, or the forwarded address */ #define SGEN_VTABLE_IS_FORWARDED(vtable) (SGEN_POINTER_IS_TAGGED_FORWARDED ((vtable)) ? SGEN_POINTER_UNTAG_VTABLE ((vtable)) : NULL) @@ -339,6 +342,8 @@ typedef struct { #define SGEN_VTABLE_IS_PINNED(vtable) SGEN_POINTER_IS_TAGGED_PINNED ((vtable)) #define SGEN_OBJECT_IS_PINNED(obj) (SGEN_VTABLE_IS_PINNED (((mword*)(obj))[0])) +#define SGEN_OBJECT_IS_CEMENTED(obj) (SGEN_POINTER_IS_TAGGED_CEMENTED (((mword*)(obj))[0])) + /* set the forwarded address fw_addr for object obj */ #define SGEN_FORWARD_OBJECT(obj,fw_addr) do { \ *(void**)(obj) = SGEN_POINTER_TAG_FORWARDED ((fw_addr)); \ @@ -346,15 +351,19 @@ typedef struct { #define SGEN_PIN_OBJECT(obj) do { \ *(void**)(obj) = SGEN_POINTER_TAG_PINNED (*(void**)(obj)); \ } while (0) +#define SGEN_CEMENT_OBJECT(obj) do { \ + *(void**)(obj) = SGEN_POINTER_TAG_CEMENTED (*(void**)(obj)); \ + } while (0) +/* Unpins and uncements */ #define SGEN_UNPIN_OBJECT(obj) do { \ - *(void**)(obj) = SGEN_POINTER_UNTAG_2 (*(void**)(obj)); \ + *(void**)(obj) = SGEN_POINTER_UNTAG_VTABLE (*(void**)(obj)); \ } while (0) /* * Since we set bits in the vtable, use the macro to load it from the pointer to * an object that is potentially pinned. */ -#define SGEN_LOAD_VTABLE(addr) SGEN_POINTER_UNTAG_12 (*(void**)(addr)) +#define SGEN_LOAD_VTABLE(addr) SGEN_POINTER_UNTAG_ALL (*(void**)(addr)) /* List of what each bit on of the vtable gc bits means. @@ -644,6 +653,12 @@ typedef enum { ITERATE_OBJECTS_SWEEP_ALL = ITERATE_OBJECTS_SWEEP | ITERATE_OBJECTS_NON_PINNED | ITERATE_OBJECTS_PINNED } IterateObjectsFlags; +typedef struct +{ + size_t num_scanned_objects; + size_t num_unique_scanned_objects; +} ScannedObjectCounts; + typedef struct _SgenMajorCollector SgenMajorCollector; struct _SgenMajorCollector { size_t section_size; @@ -689,7 +704,8 @@ struct _SgenMajorCollector { void (*start_nursery_collection) (void); void (*finish_nursery_collection) (void); void (*start_major_collection) (void); - void (*finish_major_collection) (void); + void (*finish_major_collection) (ScannedObjectCounts *counts); + gboolean (*drain_gray_stack) (ScanCopyContext ctx); void (*have_computed_minor_collection_allowance) (void); gboolean (*ptr_is_in_non_pinned_space) (char *ptr, char **start); gboolean (*obj_is_from_pinned_alloc) (char *obj); @@ -775,7 +791,7 @@ static inline mword sgen_obj_get_descriptor (char *obj) { MonoVTable *vtable = ((MonoObject*)obj)->vtable; - SGEN_ASSERT (0, !SGEN_POINTER_IS_TAGGED_1_OR_2 (vtable), "Object can't be tagged"); + SGEN_ASSERT (9, !SGEN_POINTER_IS_TAGGED_ANY (vtable), "Object can't be tagged"); return sgen_vtable_get_descriptor (vtable); } @@ -795,13 +811,14 @@ static inline mword sgen_par_object_get_size (MonoVTable *vtable, MonoObject* o) { mword descr = (mword)vtable->gc_descr; - mword type = descr & 0x7; + mword type = descr & DESC_TYPE_MASK; - if (type == DESC_TYPE_RUN_LENGTH || type == DESC_TYPE_SMALL_BITMAP) { + if (type == DESC_TYPE_RUN_LENGTH || type == DESC_TYPE_SMALL_PTRFREE) { mword size = descr & 0xfff8; - if (size == 0) /* This is used to encode a string */ - return offsetof (MonoString, chars) + 2 * mono_string_length_fast ((MonoString*) o) + 2; + SGEN_ASSERT (9, size >= sizeof (MonoObject), "Run length object size to small"); return size; + } else if (descr == SGEN_DESC_STRING) { + return offsetof (MonoString, chars) + 2 * mono_string_length_fast ((MonoString*) o) + 2; } else if (type == DESC_TYPE_VECTOR) { int element_size = ((descr) >> VECTOR_ELSIZE_SHIFT) & MAX_ELEMENT_SIZE; MonoArray *array = (MonoArray*)o; diff --git a/mono/metadata/sgen-gray.c b/mono/metadata/sgen-gray.c index 3a1da29784f..6407ef8928d 100644 --- a/mono/metadata/sgen-gray.c +++ b/mono/metadata/sgen-gray.c @@ -26,12 +26,12 @@ #include "sgen-protocol.h" #ifdef HEAVY_STATISTICS -unsigned long long stat_gray_queue_section_alloc; -unsigned long long stat_gray_queue_section_free; -unsigned long long stat_gray_queue_enqueue_fast_path; -unsigned long long stat_gray_queue_dequeue_fast_path; -unsigned long long stat_gray_queue_enqueue_slow_path; -unsigned long long stat_gray_queue_dequeue_slow_path; +guint64 stat_gray_queue_section_alloc; +guint64 stat_gray_queue_section_free; +guint64 stat_gray_queue_enqueue_fast_path; +guint64 stat_gray_queue_dequeue_fast_path; +guint64 stat_gray_queue_enqueue_slow_path; +guint64 stat_gray_queue_dequeue_slow_path; #endif #define GRAY_QUEUE_LENGTH_LIMIT 64 @@ -99,7 +99,7 @@ sgen_gray_object_free_queue_section (GrayQueueSection *section) void sgen_gray_object_enqueue (SgenGrayQueue *queue, char *obj, mword desc) { - GrayQueueEntry entry = { obj, desc }; + GrayQueueEntry entry = SGEN_GRAY_QUEUE_ENTRY (obj, desc); HEAVY_STAT (stat_gray_queue_enqueue_slow_path ++); diff --git a/mono/metadata/sgen-gray.h b/mono/metadata/sgen-gray.h index 37ba2d8e650..c51822c908d 100644 --- a/mono/metadata/sgen-gray.h +++ b/mono/metadata/sgen-gray.h @@ -20,7 +20,7 @@ #ifndef __MONO_SGEN_GRAY_H__ #define __MONO_SGEN_GRAY_H__ -#include "sgen-protocol.h" +#include "metadata/sgen-protocol.h" /* * This gray queue has to be as optimized as possible, because it is in the core of @@ -74,6 +74,8 @@ struct _GrayQueueEntry { mword desc; }; +#define SGEN_GRAY_QUEUE_ENTRY(obj,desc) { (obj), (desc) } + /* * This is a stack now instead of a queue, so the most recently added items are removed * first, improving cache locality, and keeping the stack size manageable. @@ -124,12 +126,12 @@ struct _SgenSectionGrayQueue { #define GRAY_FIRST_CURSOR_POSITION(s) ((s)->entries) #ifdef HEAVY_STATISTICS -extern unsigned long long stat_gray_queue_section_alloc; -extern unsigned long long stat_gray_queue_section_free; -extern unsigned long long stat_gray_queue_enqueue_fast_path; -extern unsigned long long stat_gray_queue_dequeue_fast_path; -extern unsigned long long stat_gray_queue_enqueue_slow_path; -extern unsigned long long stat_gray_queue_dequeue_slow_path; +extern guint64 stat_gray_queue_section_alloc; +extern guint64 stat_gray_queue_section_free; +extern guint64 stat_gray_queue_enqueue_fast_path; +extern guint64 stat_gray_queue_dequeue_fast_path; +extern guint64 stat_gray_queue_enqueue_slow_path; +extern guint64 stat_gray_queue_dequeue_slow_path; #endif void sgen_init_gray_queues (void) MONO_INTERNAL; @@ -155,6 +157,8 @@ gboolean sgen_section_gray_queue_is_empty (SgenSectionGrayQueue *queue) MONO_INT GrayQueueSection* sgen_section_gray_queue_dequeue (SgenSectionGrayQueue *queue) MONO_INTERNAL; void sgen_section_gray_queue_enqueue (SgenSectionGrayQueue *queue, GrayQueueSection *section) MONO_INTERNAL; +gboolean sgen_gray_object_fill_prefetch (SgenGrayQueue *queue); + static inline gboolean sgen_gray_object_queue_is_empty (SgenGrayQueue *queue) { @@ -170,7 +174,7 @@ GRAY_OBJECT_ENQUEUE (SgenGrayQueue *queue, char* obj, mword desc) if (G_UNLIKELY (!queue->first || queue->cursor == GRAY_LAST_CURSOR_POSITION (queue->first))) { sgen_gray_object_enqueue (queue, obj, desc); } else { - GrayQueueEntry entry = { obj, desc }; + GrayQueueEntry entry = SGEN_GRAY_QUEUE_ENTRY (obj, desc); HEAVY_STAT (stat_gray_queue_enqueue_fast_path ++); @@ -187,7 +191,7 @@ GRAY_OBJECT_DEQUEUE (SgenGrayQueue *queue, char** obj, mword *desc) { GrayQueueEntry entry; #if SGEN_MAX_DEBUG_LEVEL >= 9 - entry = sgen_gray_object_enqueue (queue); + entry = sgen_gray_object_dequeue (queue); *obj = entry.obj; *desc = entry.desc; #else @@ -195,9 +199,6 @@ GRAY_OBJECT_DEQUEUE (SgenGrayQueue *queue, char** obj, mword *desc) HEAVY_STAT (stat_gray_queue_dequeue_fast_path ++); *obj = NULL; -#ifdef SGEN_HEAVY_BINARY_PROTOCOL - binary_protocol_gray_dequeue (queue, queue->cursor, *obj); -#endif } else if (G_UNLIKELY (queue->cursor == GRAY_FIRST_CURSOR_POSITION (queue->first))) { entry = sgen_gray_object_dequeue (queue); *obj = entry.obj; diff --git a/mono/metadata/sgen-hash-table.c b/mono/metadata/sgen-hash-table.c index cebba4fae11..176a5634ade 100644 --- a/mono/metadata/sgen-hash-table.c +++ b/mono/metadata/sgen-hash-table.c @@ -30,9 +30,9 @@ #include #ifdef HEAVY_STATISTICS -static long long stat_lookups; -static long long stat_lookup_iterations; -static long long stat_lookup_max_iterations; +static guint64 stat_lookups; +static guint64 stat_lookup_iterations; +static guint64 stat_lookup_max_iterations; #endif static void @@ -82,7 +82,7 @@ lookup (SgenHashTable *hash_table, gpointer key, guint *_hash) guint hash; GEqualFunc equal = hash_table->equal_func; #ifdef HEAVY_STATISTICS - long long iterations = 0; + guint64 iterations = 0; ++stat_lookups; #endif @@ -241,9 +241,9 @@ void sgen_init_hash_table (void) { #ifdef HEAVY_STATISTICS - mono_counters_register ("Hash table lookups", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_lookups); - mono_counters_register ("Hash table lookup iterations", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_lookup_iterations); - mono_counters_register ("Hash table lookup max iterations", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_lookup_max_iterations); + mono_counters_register ("Hash table lookups", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_lookups); + mono_counters_register ("Hash table lookup iterations", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_lookup_iterations); + mono_counters_register ("Hash table lookup max iterations", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_lookup_max_iterations); #endif } diff --git a/mono/metadata/sgen-los.c b/mono/metadata/sgen-los.c index 8e823b05537..dc104a0a8cd 100644 --- a/mono/metadata/sgen-los.c +++ b/mono/metadata/sgen-los.c @@ -38,6 +38,7 @@ #include "metadata/sgen-cardtable.h" #include "metadata/sgen-memory-governor.h" #include "utils/mono-mmap.h" +#include "utils/mono-compiler.h" #define LOS_SECTION_SIZE (1024 * 1024) diff --git a/mono/metadata/sgen-major-copy-object.h b/mono/metadata/sgen-major-copy-object.h index e912be704c2..a4b10ff85df 100644 --- a/mono/metadata/sgen-major-copy-object.h +++ b/mono/metadata/sgen-major-copy-object.h @@ -29,7 +29,5 @@ } while (0) #define COLLECTOR_SERIAL_ALLOC_FOR_PROMOTION sgen_minor_collector.alloc_for_promotion -#define COLLECTOR_PARALLEL_ALLOC_FOR_PROMOTION sgen_minor_collector.par_alloc_for_promotion - #include "sgen-copy-object.h" diff --git a/mono/metadata/sgen-major-scan-object.h b/mono/metadata/sgen-major-scan-object.h deleted file mode 100644 index 14b11317096..00000000000 --- a/mono/metadata/sgen-major-scan-object.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - * sgen-major-scan-object.h: Object scanning in the major collectors. - * - * Copyright 2001-2003 Ximian, Inc - * Copyright 2003-2010 Novell, Inc. - * Copyright (C) 2012 Xamarin Inc - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License 2.0 as published by the Free Software Foundation; - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License 2.0 along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -extern long long stat_scan_object_called_major; - -#ifdef FIXED_HEAP -#define PREFETCH_DYNAMIC_HEAP(addr) -#else -#define PREFETCH_DYNAMIC_HEAP(addr) PREFETCH ((addr)) -#endif - -#ifdef SCAN_FOR_CONCURRENT_MARK -#define FOLLOW_OBJECT(addr) (!sgen_ptr_in_nursery ((addr))) -#define ALWAYS_ADD_TO_GLOBAL_REMSET 1 -#define CONCURRENT_NAME(x) x ## _concurrent -#else -#define FOLLOW_OBJECT(addr) 1 -#define ALWAYS_ADD_TO_GLOBAL_REMSET 0 -#define CONCURRENT_NAME(x) x -#endif - -/* - * FIXME: We use the same scanning function in the concurrent collector whether we scan - * during the starting/finishing collection pause (with the world stopped) or from the - * concurrent worker thread. - * - * As long as the world is stopped, we should just follow pointers into the nursery and - * evict if possible. In that case we also don't need the ALWAYS_ADD_TO_GLOBAL_REMSET case, - * which only seems to make sense for when the world is stopped, in which case we only need - * it because we don't follow into the nursery. - */ - -#undef HANDLE_PTR -#define HANDLE_PTR(ptr,obj) do { \ - void *__old = *(ptr); \ - SGEN_OBJECT_LAYOUT_STATISTICS_MARK_BITMAP ((obj), (ptr)); \ - if (__old && FOLLOW_OBJECT (__old)) { \ - void *__copy; \ - PREFETCH_DYNAMIC_HEAP (__old); \ - CONCURRENT_NAME (major_copy_or_mark_object) ((ptr), __old, queue); \ - __copy = *(ptr); \ - SGEN_COND_LOG (9, __old != __copy, "Overwrote field at %p with %p (was: %p)", (ptr), *(ptr), __old); \ - if (G_UNLIKELY (sgen_ptr_in_nursery (__copy) && !sgen_ptr_in_nursery ((ptr)))) \ - sgen_add_to_global_remset ((ptr), __copy); \ - } else { \ - if (ALWAYS_ADD_TO_GLOBAL_REMSET && G_UNLIKELY (sgen_ptr_in_nursery (__old) && !sgen_ptr_in_nursery ((ptr)))) \ - sgen_add_to_global_remset ((ptr), __old); \ - } \ - } while (0) - -static void -CONCURRENT_NAME (major_scan_object) (char *start, mword desc, SgenGrayQueue *queue) -{ - SGEN_OBJECT_LAYOUT_STATISTICS_DECLARE_BITMAP; - -#ifdef HEAVY_STATISTICS - sgen_descriptor_count_scanned_object (desc); -#endif - -#define SCAN_OBJECT_PROTOCOL -#include "sgen-scan-object.h" - - SGEN_OBJECT_LAYOUT_STATISTICS_COMMIT_BITMAP; - HEAVY_STAT (++stat_scan_object_called_major); -} - -#ifdef SCAN_FOR_CONCURRENT_MARK -#ifdef SGEN_PARALLEL_MARK -#error concurrent and parallel mark not supported yet -#else -static void -CONCURRENT_NAME (major_scan_vtype) (char *start, mword desc, SgenGrayQueue *queue BINARY_PROTOCOL_ARG (size_t size)) -{ - SGEN_OBJECT_LAYOUT_STATISTICS_DECLARE_BITMAP; - - /* The descriptors include info about the MonoObject header as well */ - start -= sizeof (MonoObject); - -#define SCAN_OBJECT_NOVTABLE -#define SCAN_OBJECT_PROTOCOL -#include "sgen-scan-object.h" - - SGEN_OBJECT_LAYOUT_STATISTICS_COMMIT_BITMAP; -} -#endif -#endif - -#undef PREFETCH_DYNAMIC_HEAP -#undef FOLLOW_OBJECT -#undef ALWAYS_ADD_TO_GLOBAL_REMSET -#undef CONCURRENT_NAME diff --git a/mono/metadata/sgen-marksweep-drain-gray-stack.h b/mono/metadata/sgen-marksweep-drain-gray-stack.h new file mode 100644 index 00000000000..da962a81b8f --- /dev/null +++ b/mono/metadata/sgen-marksweep-drain-gray-stack.h @@ -0,0 +1,248 @@ +/* + * sgen-marksweep-drain-gray-stack.h: The copy/mark and gray stack + * draining functions of the M&S major collector. + * + * Copyright (C) 2014 Xamarin Inc + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License 2.0 as published by the Free Software Foundation; + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License 2.0 along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +/* + * COPY_OR_MARK_FUNCTION_NAME must be defined to be the function name of the copy/mark + * function. + * + * SCAN_OBJECT_FUNCTION_NAME must be defined to be the function name of the object scanning + * function. + * + * DRAIN_GRAY_STACK_FUNCTION_NAME must be defined to be the function name of the gray stack + * draining function. + * + * Define COPY_OR_MARK_WITH_EVACUATION to support evacuation. + */ + +/* Returns whether the object is still in the nursery. */ +static inline MONO_ALWAYS_INLINE gboolean +COPY_OR_MARK_FUNCTION_NAME (void **ptr, void *obj, SgenGrayQueue *queue) +{ + MSBlockInfo *block; + +#ifdef HEAVY_STATISTICS + ++stat_optimized_copy; + { + char *forwarded; + mword desc; + if ((forwarded = SGEN_OBJECT_IS_FORWARDED (obj))) + desc = sgen_obj_get_descriptor_safe (forwarded); + else + desc = sgen_obj_get_descriptor_safe (obj); + + sgen_descriptor_count_copied_object (desc); + } +#endif + + SGEN_ASSERT (9, obj, "null object from pointer %p", ptr); + SGEN_ASSERT (9, current_collection_generation == GENERATION_OLD, "old gen parallel allocator called from a %d collection", current_collection_generation); + + if (sgen_ptr_in_nursery (obj)) { + int word, bit; + char *forwarded, *old_obj; + mword vtable_word = *(mword*)obj; + + HEAVY_STAT (++stat_optimized_copy_nursery); + +#if SGEN_MAX_DEBUG_LEVEL >= 9 + if (sgen_nursery_is_to_space (obj)) + SGEN_ASSERT (9, !SGEN_VTABLE_IS_PINNED (vtable_word) && !SGEN_VTABLE_IS_FORWARDED (vtable_word), "To-space object can't be pinned or forwarded."); +#endif + + if (SGEN_VTABLE_IS_PINNED (vtable_word)) { + SGEN_ASSERT (9, !SGEN_VTABLE_IS_FORWARDED (vtable_word), "Cannot be both pinned and forwarded."); + HEAVY_STAT (++stat_optimized_copy_nursery_pinned); + return TRUE; + } + if ((forwarded = SGEN_VTABLE_IS_FORWARDED (vtable_word))) { + HEAVY_STAT (++stat_optimized_copy_nursery_forwarded); + *ptr = forwarded; + return sgen_ptr_in_nursery (forwarded); + } + + /* An object in the nursery To Space has already been copied and grayed. Nothing to do. */ + if (sgen_nursery_is_to_space (obj)) + return TRUE; + +#ifdef COPY_OR_MARK_WITH_EVACUATION + do_copy_object: +#endif + old_obj = obj; + obj = copy_object_no_checks (obj, queue); + if (G_UNLIKELY (old_obj == obj)) { + /* + * If we fail to evacuate an object we just stop doing it for a + * given block size as all other will surely fail too. + */ + /* FIXME: test this case somehow. */ + if (!sgen_ptr_in_nursery (obj)) { + int size_index; + block = MS_BLOCK_FOR_OBJ (obj); + size_index = block->obj_size_index; + evacuate_block_obj_sizes [size_index] = FALSE; + MS_MARK_OBJECT_AND_ENQUEUE (obj, sgen_obj_get_descriptor (obj), block, queue); + return FALSE; + } + return TRUE; + } + HEAVY_STAT (++stat_objects_copied_major); + *ptr = obj; + + if (sgen_ptr_in_nursery (obj)) + return TRUE; + + /* + * FIXME: See comment for copy_object_no_checks(). If + * we have that, we can let the allocation function + * give us the block info, too, and we won't have to + * re-fetch it. + * + * FIXME (2): We should rework this to avoid all those nursery checks. + */ + /* + * For the split nursery allocator the object might + * still be in the nursery despite having being + * promoted, in which case we can't mark it. + */ + block = MS_BLOCK_FOR_OBJ (obj); + MS_CALC_MARK_BIT (word, bit, obj); + SGEN_ASSERT (9, !MS_MARK_BIT (block, word, bit), "object %p already marked", obj); + MS_SET_MARK_BIT (block, word, bit); + binary_protocol_mark (obj, (gpointer)LOAD_VTABLE (obj), sgen_safe_object_get_size ((MonoObject*)obj)); + + return FALSE; + } else { + mword vtable_word = *(mword*)obj; + mword desc = sgen_vtable_get_descriptor ((MonoVTable*)vtable_word); + int type = desc & DESC_TYPE_MASK; + + HEAVY_STAT (++stat_optimized_copy_major); + +#ifdef COPY_OR_MARK_WITH_EVACUATION + { + char *forwarded; + if ((forwarded = SGEN_VTABLE_IS_FORWARDED (vtable_word))) { + HEAVY_STAT (++stat_optimized_copy_major_forwarded); + *ptr = forwarded; + SGEN_ASSERT (9, !sgen_ptr_in_nursery (forwarded), "Cannot be forwarded to nursery."); + return FALSE; + } + } +#endif + + if (type <= DESC_TYPE_MAX_SMALL_OBJ || SGEN_ALIGN_UP (sgen_safe_object_get_size ((MonoObject*)obj)) <= SGEN_MAX_SMALL_OBJ_SIZE) { +#ifdef HEAVY_STATISTICS + if (type <= DESC_TYPE_MAX_SMALL_OBJ) + ++stat_optimized_copy_major_small_fast; + else + ++stat_optimized_copy_major_small_slow; +#endif + + block = MS_BLOCK_FOR_OBJ (obj); + +#ifdef COPY_OR_MARK_WITH_EVACUATION + { + int size_index = block->obj_size_index; + + if (evacuate_block_obj_sizes [size_index] && !block->has_pinned) { + HEAVY_STAT (++stat_optimized_copy_major_small_evacuate); + if (block->is_to_space) + return FALSE; + goto do_copy_object; + } + } +#endif + + MS_MARK_OBJECT_AND_ENQUEUE (obj, desc, block, queue); + } else { + HEAVY_STAT (++stat_optimized_copy_major_large); + + if (sgen_los_object_is_pinned (obj)) + return FALSE; + binary_protocol_pin (obj, (gpointer)SGEN_LOAD_VTABLE (obj), sgen_safe_object_get_size ((MonoObject*)obj)); + + sgen_los_pin_object (obj); + if (SGEN_OBJECT_HAS_REFERENCES (obj)) + GRAY_OBJECT_ENQUEUE (queue, obj, sgen_obj_get_descriptor (obj)); + } + return FALSE; + } + return FALSE; +} + +static void +SCAN_OBJECT_FUNCTION_NAME (char *obj, mword desc, SgenGrayQueue *queue) +{ + char *start = obj; + +#ifdef HEAVY_STATISTICS + ++stat_optimized_major_scan; + if (!sgen_gc_descr_has_references (desc)) + ++stat_optimized_major_scan_no_refs; + sgen_descriptor_count_scanned_object (desc); +#endif +#ifdef SGEN_HEAVY_BINARY_PROTOCOL + add_scanned_object (start); +#endif + + /* Now scan the object. */ + +#undef HANDLE_PTR +#define HANDLE_PTR(ptr,obj) do { \ + void *__old = *(ptr); \ + binary_protocol_scan_process_reference ((obj), (ptr), __old); \ + if (__old) { \ + gboolean __still_in_nursery = COPY_OR_MARK_FUNCTION_NAME ((ptr), __old, queue); \ + if (G_UNLIKELY (__still_in_nursery && !sgen_ptr_in_nursery ((ptr)) && !SGEN_OBJECT_IS_CEMENTED (*(ptr)))) { \ + void *__copy = *(ptr); \ + sgen_add_to_global_remset ((ptr), __copy); \ + } \ + } \ + } while (0) + +#define SCAN_OBJECT_PROTOCOL +#include "sgen-scan-object.h" +} + +static gboolean +DRAIN_GRAY_STACK_FUNCTION_NAME (ScanCopyContext ctx) +{ + SgenGrayQueue *queue = ctx.queue; + + SGEN_ASSERT (0, ctx.scan_func == major_scan_object_with_evacuation, "Wrong scan function"); + + for (;;) { + char *obj; + mword desc; + + HEAVY_STAT (++stat_drain_loops); + + GRAY_OBJECT_DEQUEUE (queue, &obj, &desc); + if (!obj) + return TRUE; + + SCAN_OBJECT_FUNCTION_NAME (obj, desc, ctx.queue); + } +} + +#undef COPY_OR_MARK_FUNCTION_NAME +#undef COPY_OR_MARK_WITH_EVACUATION +#undef SCAN_OBJECT_FUNCTION_NAME +#undef DRAIN_GRAY_STACK_FUNCTION_NAME diff --git a/mono/metadata/sgen-marksweep-scan-object-concurrent.h b/mono/metadata/sgen-marksweep-scan-object-concurrent.h new file mode 100644 index 00000000000..7902104fb79 --- /dev/null +++ b/mono/metadata/sgen-marksweep-scan-object-concurrent.h @@ -0,0 +1,93 @@ +/* + * sgen-major-scan-object.h: Object scanning in the major collectors. + * + * Copyright 2001-2003 Ximian, Inc + * Copyright 2003-2010 Novell, Inc. + * Copyright (C) 2012 Xamarin Inc + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License 2.0 as published by the Free Software Foundation; + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License 2.0 along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +extern guint64 stat_scan_object_called_major; + +/* + * FIXME: We use the same scanning function in the concurrent collector whether we scan + * during the starting/finishing collection pause (with the world stopped) or from the + * concurrent worker thread. + * + * As long as the world is stopped, we should just follow pointers into the nursery and + * evict if possible. In that case we also don't need the ALWAYS_ADD_TO_GLOBAL_REMSET case, + * which only seems to make sense for when the world is stopped, in which case we only need + * it because we don't follow into the nursery. + */ + +#undef HANDLE_PTR +#define HANDLE_PTR(ptr,obj) do { \ + void *__old = *(ptr); \ + SGEN_OBJECT_LAYOUT_STATISTICS_MARK_BITMAP ((obj), (ptr)); \ + binary_protocol_scan_process_reference ((obj), (ptr), __old); \ + if (__old && !sgen_ptr_in_nursery (__old)) { \ + void *__copy; \ + PREFETCH_READ (__old); \ + major_copy_or_mark_object_with_evacuation_concurrent ((ptr), __old, queue); \ + __copy = *(ptr); \ + SGEN_COND_LOG (9, __old != __copy, "Overwrote field at %p with %p (was: %p)", (ptr), *(ptr), __old); \ + if (G_UNLIKELY (sgen_ptr_in_nursery (__copy) && !sgen_ptr_in_nursery ((ptr)) && !SGEN_OBJECT_IS_CEMENTED (__copy))) \ + sgen_add_to_global_remset ((ptr), __copy); \ + } else { \ + if (G_UNLIKELY (sgen_ptr_in_nursery (__old) && !sgen_ptr_in_nursery ((ptr)))) \ + sgen_add_to_global_remset ((ptr), __old); \ + } \ + } while (0) + +/* FIXME: Unify this with optimized code in sgen-marksweep.c. */ + +static void +major_scan_object_no_mark_concurrent (char *start, mword desc, SgenGrayQueue *queue) +{ + SGEN_OBJECT_LAYOUT_STATISTICS_DECLARE_BITMAP; + +#ifdef HEAVY_STATISTICS + sgen_descriptor_count_scanned_object (desc); +#endif +#ifdef SGEN_HEAVY_BINARY_PROTOCOL + add_scanned_object (start); +#endif + +#define SCAN_OBJECT_PROTOCOL +#include "sgen-scan-object.h" + + SGEN_OBJECT_LAYOUT_STATISTICS_COMMIT_BITMAP; + HEAVY_STAT (++stat_scan_object_called_major); +} + +static void +major_scan_vtype_concurrent (char *start, mword desc, SgenGrayQueue *queue BINARY_PROTOCOL_ARG (size_t size)) +{ + SGEN_OBJECT_LAYOUT_STATISTICS_DECLARE_BITMAP; + +#ifdef HEAVY_STATISTICS + /* FIXME: We're half scanning this object. How do we account for that? */ + //add_scanned_object (start); +#endif + + /* The descriptors include info about the MonoObject header as well */ + start -= sizeof (MonoObject); + +#define SCAN_OBJECT_NOVTABLE +#define SCAN_OBJECT_PROTOCOL +#include "sgen-scan-object.h" + + SGEN_OBJECT_LAYOUT_STATISTICS_COMMIT_BITMAP; +} diff --git a/mono/metadata/sgen-marksweep.c b/mono/metadata/sgen-marksweep.c index 8baa393c001..88664226b9a 100644 --- a/mono/metadata/sgen-marksweep.c +++ b/mono/metadata/sgen-marksweep.c @@ -46,8 +46,13 @@ #define SGEN_HAVE_CONCURRENT_MARK -#define MS_BLOCK_SIZE (16*1024) -#define MS_BLOCK_SIZE_SHIFT 14 +#if defined(ARCH_MIN_MS_BLOCK_SIZE) && defined(ARCH_MIN_MS_BLOCK_SIZE_SHIFT) +#define MS_BLOCK_SIZE ARCH_MIN_MS_BLOCK_SIZE +#define MS_BLOCK_SIZE_SHIFT ARCH_MIN_MS_BLOCK_SIZE_SHIFT +#else +#define MS_BLOCK_SIZE_SHIFT 14 /* INT FASTENABLE */ +#define MS_BLOCK_SIZE (1 << MS_BLOCK_SIZE_SHIFT) +#endif #define MAJOR_SECTION_SIZE MS_BLOCK_SIZE #define CARDS_PER_BLOCK (MS_BLOCK_SIZE / CARD_SIZE_IN_BYTES) @@ -62,16 +67,12 @@ * of a block is the MSBlockHeader, then opional padding, then come * the objects, so this must be >= sizeof (MSBlockHeader). */ -#define MS_BLOCK_SKIP 16 +#define MS_BLOCK_SKIP ((sizeof (MSBlockHeader) + 15) & ~15) #define MS_BLOCK_FREE (MS_BLOCK_SIZE - MS_BLOCK_SKIP) #define MS_NUM_MARK_WORDS ((MS_BLOCK_SIZE / SGEN_ALLOC_ALIGN + sizeof (mword) * 8 - 1) / (sizeof (mword) * 8)) -#if SGEN_MAX_SMALL_OBJ_SIZE > MS_BLOCK_FREE / 2 -#error MAX_SMALL_OBJ_SIZE must be at most MS_BLOCK_FREE / 2 -#endif - typedef struct _MSBlockInfo MSBlockInfo; struct _MSBlockInfo { int obj_size; @@ -81,7 +82,6 @@ struct _MSBlockInfo { unsigned int has_pinned : 1; /* means cannot evacuate */ unsigned int is_to_space : 1; unsigned int swept : 1; - char *block; void **free_list; MSBlockInfo *next_free; size_t pin_queue_first_entry; @@ -92,17 +92,17 @@ struct _MSBlockInfo { mword mark_words [MS_NUM_MARK_WORDS]; }; -#define MS_BLOCK_FOR_BLOCK_INFO(b) ((b)->block) +#define MS_BLOCK_FOR_BLOCK_INFO(b) ((char*)(b)) #define MS_BLOCK_OBJ(b,i) (MS_BLOCK_FOR_BLOCK_INFO(b) + MS_BLOCK_SKIP + (b)->obj_size * (i)) #define MS_BLOCK_OBJ_FOR_SIZE(b,i,obj_size) (MS_BLOCK_FOR_BLOCK_INFO(b) + MS_BLOCK_SKIP + (obj_size) * (i)) #define MS_BLOCK_DATA_FOR_OBJ(o) ((char*)((mword)(o) & ~(mword)(MS_BLOCK_SIZE - 1))) typedef struct { - MSBlockInfo *info; + MSBlockInfo info; } MSBlockHeader; -#define MS_BLOCK_FOR_OBJ(o) (((MSBlockHeader*)MS_BLOCK_DATA_FOR_OBJ ((o)))->info) +#define MS_BLOCK_FOR_OBJ(o) (&((MSBlockHeader*)MS_BLOCK_DATA_FOR_OBJ ((o)))->info) /* object index will always be small */ #define MS_BLOCK_OBJ_INDEX(o,b) ((int)(((char*)(o) - (MS_BLOCK_FOR_BLOCK_INFO(b) + MS_BLOCK_SKIP)) / (b)->obj_size)) @@ -121,25 +121,10 @@ typedef struct { #define MS_MARK_BIT(bl,w,b) ((bl)->mark_words [(w)] & (ONE_P << (b))) #define MS_SET_MARK_BIT(bl,w,b) ((bl)->mark_words [(w)] |= (ONE_P << (b))) -#define MS_PAR_SET_MARK_BIT(was_marked,bl,w,b) do { \ - mword __old = (bl)->mark_words [(w)]; \ - mword __bitmask = ONE_P << (b); \ - if (__old & __bitmask) { \ - was_marked = TRUE; \ - break; \ - } \ - if (SGEN_CAS_PTR ((gpointer*)&(bl)->mark_words [(w)], \ - (gpointer)(__old | __bitmask), \ - (gpointer)__old) == \ - (gpointer)__old) { \ - was_marked = FALSE; \ - break; \ - } \ - } while (1) #define MS_OBJ_ALLOCED(o,b) (*(void**)(o) && (*(char**)(o) < MS_BLOCK_FOR_BLOCK_INFO (b) || *(char**)(o) >= MS_BLOCK_FOR_BLOCK_INFO (b) + MS_BLOCK_SIZE)) -#define MS_BLOCK_OBJ_SIZE_FACTOR (sqrt (2.0)) +#define MS_BLOCK_OBJ_SIZE_FACTOR (pow (2.0, 1.0 / 3)) /* * This way we can lookup block object size indexes for sizes up to @@ -192,25 +177,41 @@ static size_t num_major_sections = 0; /* one free block list for each block object size */ static MSBlockInfo **free_block_lists [MS_BLOCK_TYPE_MAX]; -static long long stat_major_blocks_alloced = 0; -static long long stat_major_blocks_freed = 0; -static long long stat_major_blocks_lazy_swept = 0; -static long long stat_major_objects_evacuated = 0; +static guint64 stat_major_blocks_alloced = 0; +static guint64 stat_major_blocks_freed = 0; +static guint64 stat_major_blocks_lazy_swept = 0; +static guint64 stat_major_objects_evacuated = 0; #if SIZEOF_VOID_P != 8 -static long long stat_major_blocks_freed_ideal = 0; -static long long stat_major_blocks_freed_less_ideal = 0; -static long long stat_major_blocks_freed_individual = 0; -static long long stat_major_blocks_alloced_less_ideal = 0; +static guint64 stat_major_blocks_freed_ideal = 0; +static guint64 stat_major_blocks_freed_less_ideal = 0; +static guint64 stat_major_blocks_freed_individual = 0; +static guint64 stat_major_blocks_alloced_less_ideal = 0; #endif #ifdef SGEN_COUNT_NUMBER_OF_MAJOR_OBJECTS_MARKED -static long long num_major_objects_marked = 0; +static guint64 num_major_objects_marked = 0; #define INC_NUM_MAJOR_OBJECTS_MARKED() (++num_major_objects_marked) #else #define INC_NUM_MAJOR_OBJECTS_MARKED() #endif +#ifdef SGEN_HEAVY_BINARY_PROTOCOL +static mono_mutex_t scanned_objects_list_lock; +static SgenPointerQueue scanned_objects_list; + +static void +add_scanned_object (void *ptr) +{ + if (!binary_protocol_is_enabled ()) + return; + + mono_mutex_lock (&scanned_objects_list_lock); + sgen_pointer_queue_add (&scanned_objects_list, ptr); + mono_mutex_unlock (&scanned_objects_list_lock); +} +#endif + static void sweep_block (MSBlockInfo *block, gboolean during_major_collection); @@ -415,7 +416,6 @@ ms_alloc_block (int size_index, gboolean pinned, gboolean has_references) int size = block_obj_sizes [size_index]; int count = MS_BLOCK_FREE / size; MSBlockInfo *info; - MSBlockHeader *header; MSBlockInfo **free_blocks = FREE_BLOCKS (pinned, has_references); char *obj_start; int i; @@ -423,7 +423,7 @@ ms_alloc_block (int size_index, gboolean pinned, gboolean has_references) if (!sgen_memgov_try_alloc_space (MS_BLOCK_SIZE, SPACE_MAJOR)) return FALSE; - info = sgen_alloc_internal (INTERNAL_MEM_MS_BLOCK_INFO); + info = (MSBlockInfo*)ms_get_empty_block (); SGEN_ASSERT (9, count >= 2, "block with %d objects, it must hold at least 2", count); @@ -440,10 +440,6 @@ ms_alloc_block (int size_index, gboolean pinned, gboolean has_references) */ info->is_to_space = (sgen_get_current_collection_generation () == GENERATION_OLD); info->swept = 1; - info->block = ms_get_empty_block (); - - header = (MSBlockHeader*) info->block; - header->info = info; #ifdef SGEN_HAVE_CONCURRENT_MARK info->cardtable_mod_union = NULL; #endif @@ -615,8 +611,6 @@ major_alloc_degraded (MonoVTable *vtable, size_t size) return obj; } -#define MAJOR_OBJ_IS_IN_TO_SPACE(obj) FALSE - /* * obj is some object. If it's not in the major heap (i.e. if it's in * the nursery or LOS), return FALSE. Otherwise return whether it's @@ -836,9 +830,9 @@ major_dump_heap (FILE *heap_dump_file) #define MS_MARK_OBJECT_AND_ENQUEUE_CHECKED(obj,desc,block,queue) do { \ int __word, __bit; \ MS_CALC_MARK_BIT (__word, __bit, (obj)); \ - if (!MS_MARK_BIT ((block), __word, __bit) && MS_OBJ_ALLOCED ((obj), (block))) { \ + if (!MS_MARK_BIT ((block), __word, __bit) && MS_OBJ_ALLOCED ((obj), (block))) { \ MS_SET_MARK_BIT ((block), __word, __bit); \ - if ((block)->has_references) \ + if (sgen_gc_descr_has_references (desc)) \ GRAY_OBJECT_ENQUEUE ((queue), (obj), (desc)); \ binary_protocol_mark ((obj), (gpointer)LOAD_VTABLE ((obj)), sgen_safe_object_get_size ((MonoObject*)(obj))); \ INC_NUM_MAJOR_OBJECTS_MARKED (); \ @@ -847,23 +841,10 @@ major_dump_heap (FILE *heap_dump_file) #define MS_MARK_OBJECT_AND_ENQUEUE(obj,desc,block,queue) do { \ int __word, __bit; \ MS_CALC_MARK_BIT (__word, __bit, (obj)); \ - SGEN_ASSERT (9, MS_OBJ_ALLOCED ((obj), (block)), "object %p not allocated", obj); \ + SGEN_ASSERT (9, MS_OBJ_ALLOCED ((obj), (block)), "object %p not allocated", obj); \ if (!MS_MARK_BIT ((block), __word, __bit)) { \ MS_SET_MARK_BIT ((block), __word, __bit); \ - if ((block)->has_references) \ - GRAY_OBJECT_ENQUEUE ((queue), (obj), (desc)); \ - binary_protocol_mark ((obj), (gpointer)LOAD_VTABLE ((obj)), sgen_safe_object_get_size ((MonoObject*)(obj))); \ - INC_NUM_MAJOR_OBJECTS_MARKED (); \ - } \ - } while (0) -#define MS_PAR_MARK_OBJECT_AND_ENQUEUE(obj,desc,block,queue) do { \ - int __word, __bit; \ - gboolean __was_marked; \ - SGEN_ASSERT (9, MS_OBJ_ALLOCED ((obj), (block)), "object %p not allocated", obj); \ - MS_CALC_MARK_BIT (__word, __bit, (obj)); \ - MS_PAR_SET_MARK_BIT (__was_marked, (block), __word, __bit); \ - if (!__was_marked) { \ - if ((block)->has_references) \ + if (sgen_gc_descr_has_references (desc)) \ GRAY_OBJECT_ENQUEUE ((queue), (obj), (desc)); \ binary_protocol_mark ((obj), (gpointer)LOAD_VTABLE ((obj)), sgen_safe_object_get_size ((MonoObject*)(obj))); \ INC_NUM_MAJOR_OBJECTS_MARKED (); \ @@ -889,7 +870,7 @@ pin_major_object (char *obj, SgenGrayQueue *queue) #ifdef SGEN_HAVE_CONCURRENT_MARK static void -major_copy_or_mark_object_concurrent (void **ptr, void *obj, SgenGrayQueue *queue) +major_copy_or_mark_object_with_evacuation_concurrent (void **ptr, void *obj, SgenGrayQueue *queue) { SGEN_ASSERT (9, sgen_concurrent_collection_in_progress (), "Why are we scanning concurrently when there's no concurrent collection on?"); SGEN_ASSERT (9, !sgen_workers_are_working () || sgen_is_worker_thread (mono_native_thread_id_get ()), "We must not scan from two threads at the same time!"); @@ -924,160 +905,86 @@ major_copy_or_mark_object_concurrent (void **ptr, void *obj, SgenGrayQueue *queu } #endif -static void -major_copy_or_mark_object (void **ptr, void *obj, SgenGrayQueue *queue) +static long long +major_get_and_reset_num_major_objects_marked (void) { - MSBlockInfo *block; - - HEAVY_STAT (++stat_copy_object_called_major); - - SGEN_ASSERT (9, !sgen_concurrent_collection_in_progress (), "Why are we scanning non-concurrently when there's a concurrent collection on?"); - - SGEN_ASSERT (9, obj, "null object from pointer %p", ptr); - SGEN_ASSERT (9, current_collection_generation == GENERATION_OLD, "old gen parallel allocator called from a %d collection", current_collection_generation); - - if (sgen_ptr_in_nursery (obj)) { - int word, bit; - char *forwarded, *old_obj; +#ifdef SGEN_COUNT_NUMBER_OF_MAJOR_OBJECTS_MARKED + long long num = num_major_objects_marked; + num_major_objects_marked = 0; + return num; +#else + return 0; +#endif +} - if ((forwarded = SGEN_OBJECT_IS_FORWARDED (obj))) { - SGEN_UPDATE_REFERENCE (ptr, forwarded); - return; - } - if (SGEN_OBJECT_IS_PINNED (obj)) - return; +#ifdef HEAVY_STATISTICS +static guint64 stat_optimized_copy; +static guint64 stat_optimized_copy_nursery; +static guint64 stat_optimized_copy_nursery_forwarded; +static guint64 stat_optimized_copy_nursery_pinned; +static guint64 stat_optimized_copy_major; +static guint64 stat_optimized_copy_major_small_fast; +static guint64 stat_optimized_copy_major_small_slow; +static guint64 stat_optimized_copy_major_large; +static guint64 stat_optimized_copy_major_forwarded; +static guint64 stat_optimized_copy_major_small_evacuate; +static guint64 stat_optimized_major_scan; +static guint64 stat_optimized_major_scan_no_refs; + +static guint64 stat_drain_prefetch_fills; +static guint64 stat_drain_prefetch_fill_failures; +static guint64 stat_drain_loops; +#endif - /* An object in the nursery To Space has already been copied and grayed. Nothing to do. */ - if (sgen_nursery_is_to_space (obj)) - return; +static void major_scan_object_with_evacuation (char *start, mword desc, SgenGrayQueue *queue); - HEAVY_STAT (++stat_objects_copied_major); - - do_copy_object: - old_obj = obj; - obj = copy_object_no_checks (obj, queue); - if (G_UNLIKELY (old_obj == obj)) { - /*If we fail to evacuate an object we just stop doing it for a given block size as all other will surely fail too.*/ - if (!sgen_ptr_in_nursery (obj)) { - int size_index; - block = MS_BLOCK_FOR_OBJ (obj); - size_index = block->obj_size_index; - evacuate_block_obj_sizes [size_index] = FALSE; - MS_MARK_OBJECT_AND_ENQUEUE (obj, sgen_obj_get_descriptor (obj), block, queue); - } - return; - } - SGEN_UPDATE_REFERENCE (ptr, obj); +#define COPY_OR_MARK_FUNCTION_NAME major_copy_or_mark_object_no_evacuation +#define SCAN_OBJECT_FUNCTION_NAME major_scan_object_no_evacuation +#define DRAIN_GRAY_STACK_FUNCTION_NAME drain_gray_stack_no_evacuation +#include "sgen-marksweep-drain-gray-stack.h" - /* - * FIXME: See comment for copy_object_no_checks(). If - * we have that, we can let the allocation function - * give us the block info, too, and we won't have to - * re-fetch it. - * - * FIXME (2): We should rework this to avoid all those nursery checks. - */ - /* - * For the split nursery allocator the object might - * still be in the nursery despite having being - * promoted, in which case we can't mark it. - */ - if (!sgen_ptr_in_nursery (obj)) { - block = MS_BLOCK_FOR_OBJ (obj); - MS_CALC_MARK_BIT (word, bit, obj); - SGEN_ASSERT (9, !MS_MARK_BIT (block, word, bit), "object %p already marked", obj); - MS_SET_MARK_BIT (block, word, bit); - binary_protocol_mark (obj, (gpointer)LOAD_VTABLE (obj), sgen_safe_object_get_size ((MonoObject*)obj)); - } - } else { - char *forwarded; - mword objsize; +#define COPY_OR_MARK_WITH_EVACUATION +#define COPY_OR_MARK_FUNCTION_NAME major_copy_or_mark_object_with_evacuation +#define SCAN_OBJECT_FUNCTION_NAME major_scan_object_with_evacuation +#define DRAIN_GRAY_STACK_FUNCTION_NAME drain_gray_stack_with_evacuation +#include "sgen-marksweep-drain-gray-stack.h" - /* - * If we have don't have a fixed heap we cannot know - * whether an object is in the LOS or in the small - * object major heap without checking its size. To do - * that, however, we need to know that we actually - * have a valid object, not a forwarding pointer, so - * we have to do this check first. - */ - if ((forwarded = SGEN_OBJECT_IS_FORWARDED (obj))) { - SGEN_UPDATE_REFERENCE (ptr, forwarded); - return; +static gboolean +drain_gray_stack (ScanCopyContext ctx) +{ + gboolean evacuation = FALSE; + int i; + for (i = 0; i < num_block_obj_sizes; ++i) { + if (evacuate_block_obj_sizes [i]) { + evacuation = TRUE; + break; } + } - objsize = SGEN_ALIGN_UP (sgen_safe_object_get_size ((MonoObject*)obj)); - - if (objsize <= SGEN_MAX_SMALL_OBJ_SIZE) { - int size_index; - gboolean evacuate; - - block = MS_BLOCK_FOR_OBJ (obj); - size_index = block->obj_size_index; - evacuate = evacuate_block_obj_sizes [size_index]; - - if (evacuate && !block->has_pinned) { - g_assert (!SGEN_OBJECT_IS_PINNED (obj)); - if (block->is_to_space) - return; - HEAVY_STAT (++stat_major_objects_evacuated); - goto do_copy_object; - } else { - MS_MARK_OBJECT_AND_ENQUEUE (obj, sgen_obj_get_descriptor (obj), block, queue); - } - } else { - if (sgen_los_object_is_pinned (obj)) - return; - binary_protocol_pin (obj, (gpointer)SGEN_LOAD_VTABLE (obj), sgen_safe_object_get_size ((MonoObject*)obj)); + if (evacuation) + return drain_gray_stack_with_evacuation (ctx); + else + return drain_gray_stack_no_evacuation (ctx); +} -#ifdef ENABLE_DTRACE - if (G_UNLIKELY (MONO_GC_OBJ_PINNED_ENABLED ())) { - MonoVTable *vt = (MonoVTable*)SGEN_LOAD_VTABLE (obj); - MONO_GC_OBJ_PINNED ((mword)obj, sgen_safe_object_get_size (obj), vt->klass->name_space, vt->klass->name, GENERATION_OLD); - } +#ifdef SGEN_HAVE_CONCURRENT_MARK +#include "sgen-marksweep-scan-object-concurrent.h" #endif - sgen_los_pin_object (obj); - if (SGEN_OBJECT_HAS_REFERENCES (obj)) - GRAY_OBJECT_ENQUEUE (queue, obj, sgen_obj_get_descriptor (obj)); - } - } -} - static void major_copy_or_mark_object_canonical (void **ptr, SgenGrayQueue *queue) { - major_copy_or_mark_object (ptr, *ptr, queue); + major_copy_or_mark_object_with_evacuation (ptr, *ptr, queue); } #ifdef SGEN_HAVE_CONCURRENT_MARK static void major_copy_or_mark_object_concurrent_canonical (void **ptr, SgenGrayQueue *queue) { - major_copy_or_mark_object_concurrent (ptr, *ptr, queue); + major_copy_or_mark_object_with_evacuation_concurrent (ptr, *ptr, queue); } #endif -static long long -major_get_and_reset_num_major_objects_marked (void) -{ -#ifdef SGEN_COUNT_NUMBER_OF_MAJOR_OBJECTS_MARKED - long long num = num_major_objects_marked; - num_major_objects_marked = 0; - return num; -#else - return 0; -#endif -} - -#include "sgen-major-scan-object.h" - -#ifdef SGEN_HAVE_CONCURRENT_MARK -#define SCAN_FOR_CONCURRENT_MARK -#include "sgen-major-scan-object.h" -#undef SCAN_FOR_CONCURRENT_MARK -#endif - static void mark_pinned_objects_in_block (MSBlockInfo *block, SgenGrayQueue *queue) { @@ -1295,8 +1202,7 @@ ms_sweep (void) DELETE_BLOCK_IN_FOREACH (); binary_protocol_empty (MS_BLOCK_OBJ (block, 0), (char*)MS_BLOCK_OBJ (block, count) - (char*)MS_BLOCK_OBJ (block, 0)); - ms_free_block (block->block); - sgen_free_internal (block, INTERNAL_MEM_MS_BLOCK_INFO); + ms_free_block (block); --num_major_sections; } @@ -1460,8 +1366,18 @@ major_start_major_collection (void) } static void -major_finish_major_collection (void) +major_finish_major_collection (ScannedObjectCounts *counts) { +#ifdef SGEN_HEAVY_BINARY_PROTOCOL + if (binary_protocol_is_enabled ()) { + counts->num_scanned_objects = scanned_objects_list.next_slot; + + sgen_pointer_queue_sort_uniq (&scanned_objects_list); + counts->num_unique_scanned_objects = scanned_objects_list.next_slot; + + sgen_pointer_queue_clear (&scanned_objects_list); + } +#endif } #if SIZEOF_VOID_P != 8 @@ -1731,10 +1647,10 @@ major_iterate_live_block_ranges (sgen_cardtable_block_callback callback) } #ifdef HEAVY_STATISTICS -extern long long marked_cards; -extern long long scanned_cards; -extern long long scanned_objects; -extern long long remarked_cards; +extern guint64 marked_cards; +extern guint64 scanned_cards; +extern guint64 scanned_objects; +extern guint64 remarked_cards; #endif #define CARD_WORDS_PER_BLOCK (CARDS_PER_BLOCK / SIZEOF_VOID_P) @@ -1844,6 +1760,8 @@ major_scan_card_table (gboolean mod_union, SgenGrayQueue *queue) end = block_start + MS_BLOCK_SIZE; base = sgen_card_table_align_pointer (obj); + cards += MS_BLOCK_SKIP >> CARD_BITS; + while (obj < end) { size_t card_offset; @@ -1898,6 +1816,8 @@ major_scan_card_table (gboolean mod_union, SgenGrayQueue *queue) } card_data_end = card_data + CARDS_PER_BLOCK; + card_data += MS_BLOCK_SKIP >> CARD_BITS; + for (card_data = initial_skip_card (card_data); card_data < card_data_end; ++card_data) { //card_data = skip_card (card_data + 1, card_data_end)) { size_t index; size_t idx = card_data - card_base; @@ -2048,15 +1968,15 @@ sgen_marksweep_init_internal (SgenMajorCollector *collector, gboolean is_concurr for (i = 0; i < MS_NUM_FAST_BLOCK_OBJ_SIZE_INDEXES * 8; ++i) g_assert (MS_BLOCK_OBJ_SIZE_INDEX (i) == ms_find_block_obj_size_index (i)); - mono_counters_register ("# major blocks allocated", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_major_blocks_alloced); - mono_counters_register ("# major blocks freed", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_major_blocks_freed); - mono_counters_register ("# major blocks lazy swept", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_major_blocks_lazy_swept); - mono_counters_register ("# major objects evacuated", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_major_objects_evacuated); + mono_counters_register ("# major blocks allocated", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_major_blocks_alloced); + mono_counters_register ("# major blocks freed", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_major_blocks_freed); + mono_counters_register ("# major blocks lazy swept", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_major_blocks_lazy_swept); + mono_counters_register ("# major objects evacuated", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_major_objects_evacuated); #if SIZEOF_VOID_P != 8 - mono_counters_register ("# major blocks freed ideally", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_major_blocks_freed_ideal); - mono_counters_register ("# major blocks freed less ideally", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_major_blocks_freed_less_ideal); - mono_counters_register ("# major blocks freed individually", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_major_blocks_freed_individual); - mono_counters_register ("# major blocks allocated less ideally", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_major_blocks_alloced_less_ideal); + mono_counters_register ("# major blocks freed ideally", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_major_blocks_freed_ideal); + mono_counters_register ("# major blocks freed less ideally", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_major_blocks_freed_less_ideal); + mono_counters_register ("# major blocks freed individually", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_major_blocks_freed_individual); + mono_counters_register ("# major blocks allocated less ideally", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_major_blocks_alloced_less_ideal); #endif collector->section_size = MAJOR_SECTION_SIZE; @@ -2119,15 +2039,44 @@ sgen_marksweep_init_internal (SgenMajorCollector *collector, gboolean is_concurr collector->count_cards = major_count_cards; collector->major_ops.copy_or_mark_object = major_copy_or_mark_object_canonical; - collector->major_ops.scan_object = major_scan_object; + collector->major_ops.scan_object = major_scan_object_with_evacuation; #ifdef SGEN_HAVE_CONCURRENT_MARK if (is_concurrent) { collector->major_concurrent_ops.copy_or_mark_object = major_copy_or_mark_object_concurrent_canonical; - collector->major_concurrent_ops.scan_object = major_scan_object_concurrent; + collector->major_concurrent_ops.scan_object = major_scan_object_no_mark_concurrent; collector->major_concurrent_ops.scan_vtype = major_scan_vtype_concurrent; } #endif +#if !defined (FIXED_HEAP) && !defined (SGEN_PARALLEL_MARK) + /* FIXME: this will not work with evacuation or the split nursery. */ + if (!is_concurrent) + collector->drain_gray_stack = drain_gray_stack; + +#ifdef HEAVY_STATISTICS + mono_counters_register ("Optimized copy", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_optimized_copy); + mono_counters_register ("Optimized copy nursery", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_optimized_copy_nursery); + mono_counters_register ("Optimized copy nursery forwarded", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_optimized_copy_nursery_forwarded); + mono_counters_register ("Optimized copy nursery pinned", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_optimized_copy_nursery_pinned); + mono_counters_register ("Optimized copy major", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_optimized_copy_major); + mono_counters_register ("Optimized copy major small fast", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_optimized_copy_major_small_fast); + mono_counters_register ("Optimized copy major small slow", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_optimized_copy_major_small_slow); + mono_counters_register ("Optimized copy major large", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_optimized_copy_major_large); + mono_counters_register ("Optimized major scan", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_optimized_major_scan); + mono_counters_register ("Optimized major scan no refs", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_optimized_major_scan_no_refs); + + mono_counters_register ("Gray stack drain loops", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_drain_loops); + mono_counters_register ("Gray stack prefetch fills", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_drain_prefetch_fills); + mono_counters_register ("Gray stack prefetch failures", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_drain_prefetch_fill_failures); +#endif +#endif + +#ifdef SGEN_HEAVY_BINARY_PROTOCOL + mono_mutex_init (&scanned_objects_list_lock); +#endif + + SGEN_ASSERT (0, SGEN_MAX_SMALL_OBJ_SIZE <= MS_BLOCK_FREE / 2, "MAX_SMALL_OBJ_SIZE must be at most MS_BLOCK_FREE / 2"); + /*cardtable requires major pages to be 8 cards aligned*/ g_assert ((MS_BLOCK_SIZE % (8 * CARD_SIZE_IN_BYTES)) == 0); } diff --git a/mono/metadata/sgen-minor-copy-object.h b/mono/metadata/sgen-minor-copy-object.h index efbb8c19fe4..f1061ee2c47 100644 --- a/mono/metadata/sgen-minor-copy-object.h +++ b/mono/metadata/sgen-minor-copy-object.h @@ -22,7 +22,7 @@ #define collector_pin_object(obj, queue) sgen_pin_object (obj, queue); #define COLLECTOR_SERIAL_ALLOC_FOR_PROMOTION alloc_for_promotion -extern long long stat_nursery_copy_object_failed_to_space; /* from sgen-gc.c */ +extern guint64 stat_nursery_copy_object_failed_to_space; /* from sgen-gc.c */ #include "mono/utils/mono-compiler.h" @@ -136,7 +136,7 @@ SERIAL_COPY_OBJECT_FROM_OBJ (void **obj_slot, SgenGrayQueue *queue) HEAVY_STAT (++stat_nursery_copy_object_failed_forwarded); SGEN_UPDATE_REFERENCE (obj_slot, forwarded); #ifndef SGEN_SIMPLE_NURSERY - if (G_UNLIKELY (sgen_ptr_in_nursery (forwarded) && !sgen_ptr_in_nursery (obj_slot))) + if (G_UNLIKELY (sgen_ptr_in_nursery (forwarded) && !sgen_ptr_in_nursery (obj_slot) && !SGEN_OBJECT_IS_CEMENTED (forwarded))) sgen_add_to_global_remset (obj_slot, forwarded); #endif return; @@ -145,7 +145,7 @@ SERIAL_COPY_OBJECT_FROM_OBJ (void **obj_slot, SgenGrayQueue *queue) SGEN_ASSERT (9, ((MonoVTable*)SGEN_LOAD_VTABLE(obj))->gc_descr, "pinned object %p has no gc descriptor", obj); SGEN_LOG (9, " (pinned, no change)"); HEAVY_STAT (++stat_nursery_copy_object_failed_pinned); - if (!sgen_ptr_in_nursery (obj_slot)) + if (!sgen_ptr_in_nursery (obj_slot) && !SGEN_OBJECT_IS_CEMENTED (obj)) sgen_add_to_global_remset (obj_slot, obj); return; } @@ -189,7 +189,7 @@ SERIAL_COPY_OBJECT_FROM_OBJ (void **obj_slot, SgenGrayQueue *queue) * remsets will be overwritten. Scanning objects at * most once would be the icing on the cake. */ - if (!sgen_ptr_in_nursery (obj_slot)) + if (!sgen_ptr_in_nursery (obj_slot) && !SGEN_OBJECT_IS_CEMENTED (obj)) sgen_add_to_global_remset (obj_slot, obj); return; @@ -201,12 +201,12 @@ SERIAL_COPY_OBJECT_FROM_OBJ (void **obj_slot, SgenGrayQueue *queue) copy = copy_object_no_checks (obj, queue); SGEN_UPDATE_REFERENCE (obj_slot, copy); #ifndef SGEN_SIMPLE_NURSERY - if (G_UNLIKELY (sgen_ptr_in_nursery (copy) && !sgen_ptr_in_nursery (obj_slot))) + if (G_UNLIKELY (sgen_ptr_in_nursery (copy) && !sgen_ptr_in_nursery (obj_slot) && !SGEN_OBJECT_IS_CEMENTED (copy))) sgen_add_to_global_remset (obj_slot, copy); #else /* copy_object_no_checks () can return obj on OOM */ if (G_UNLIKELY (obj == copy)) { - if (G_UNLIKELY (sgen_ptr_in_nursery (copy) && !sgen_ptr_in_nursery (obj_slot))) + if (G_UNLIKELY (sgen_ptr_in_nursery (copy) && !sgen_ptr_in_nursery (obj_slot) && !SGEN_OBJECT_IS_CEMENTED (copy))) sgen_add_to_global_remset (obj_slot, copy); } #endif diff --git a/mono/metadata/sgen-minor-scan-object.h b/mono/metadata/sgen-minor-scan-object.h index 3cff269a7da..cd660cc9de2 100644 --- a/mono/metadata/sgen-minor-scan-object.h +++ b/mono/metadata/sgen-minor-scan-object.h @@ -19,7 +19,7 @@ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -extern long long stat_scan_object_called_nursery; +extern guint64 stat_scan_object_called_nursery; #if defined(SGEN_SIMPLE_NURSERY) #define SERIAL_SCAN_OBJECT simple_nursery_serial_scan_object @@ -38,6 +38,7 @@ extern long long stat_scan_object_called_nursery; #define HANDLE_PTR(ptr,obj) do { \ void *__old = *(ptr); \ SGEN_OBJECT_LAYOUT_STATISTICS_MARK_BITMAP ((obj), (ptr)); \ + binary_protocol_scan_process_reference ((obj), (ptr), __old); \ if (__old) { \ SERIAL_COPY_OBJECT_FROM_OBJ ((ptr), queue); \ SGEN_COND_LOG (9, __old != *(ptr), "Overwrote field at %p with %p (was: %p)", (ptr), *(ptr), __old); \ @@ -53,6 +54,8 @@ SERIAL_SCAN_OBJECT (char *start, mword desc, SgenGrayQueue *queue) sgen_descriptor_count_scanned_object (desc); #endif + SGEN_ASSERT (9, sgen_get_current_collection_generation () == GENERATION_NURSERY, "Must not use minor scan during major collection."); + #define SCAN_OBJECT_PROTOCOL #include "sgen-scan-object.h" @@ -65,6 +68,8 @@ SERIAL_SCAN_VTYPE (char *start, mword desc, SgenGrayQueue *queue BINARY_PROTOCOL { SGEN_OBJECT_LAYOUT_STATISTICS_DECLARE_BITMAP; + SGEN_ASSERT (9, sgen_get_current_collection_generation () == GENERATION_NURSERY, "Must not use minor scan during major collection."); + /* The descriptors include info about the MonoObject header as well */ start -= sizeof (MonoObject); diff --git a/mono/metadata/sgen-pinning.c b/mono/metadata/sgen-pinning.c index 66d5c7d9b83..dac7f8e48b8 100644 --- a/mono/metadata/sgen-pinning.c +++ b/mono/metadata/sgen-pinning.c @@ -293,6 +293,9 @@ sgen_cement_lookup_or_register (char *obj) ++hash [i].count; if (hash [i].count == SGEN_CEMENT_THRESHOLD) { + SGEN_ASSERT (9, SGEN_OBJECT_IS_PINNED (obj), "Can only cement pinned objects"); + SGEN_CEMENT_OBJECT (obj); + if (G_UNLIKELY (MONO_GC_OBJ_CEMENTED_ENABLED())) { MonoVTable *vt G_GNUC_UNUSED = (MonoVTable*)SGEN_LOAD_VTABLE (obj); MONO_GC_OBJ_CEMENTED ((mword)obj, sgen_safe_object_get_size ((MonoObject*)obj), @@ -318,6 +321,8 @@ pin_from_hash (CementHashEntry *hash, gboolean has_been_reset) sgen_pin_stage_ptr (hash [i].obj); /* FIXME: do pin stats if enabled */ + + SGEN_CEMENT_OBJECT (hash [i].obj); } } diff --git a/mono/metadata/sgen-pointer-queue.c b/mono/metadata/sgen-pointer-queue.c index 7ace7dfa4b6..e201e12751b 100644 --- a/mono/metadata/sgen-pointer-queue.c +++ b/mono/metadata/sgen-pointer-queue.c @@ -17,6 +17,7 @@ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include "utils/mono-compiler.h" #include "metadata/sgen-gc.h" #include "metadata/sgen-pointer-queue.h" diff --git a/mono/metadata/sgen-protocol.c b/mono/metadata/sgen-protocol.c index 7e6d16ded78..92e4fd18994 100644 --- a/mono/metadata/sgen-protocol.c +++ b/mono/metadata/sgen-protocol.c @@ -29,9 +29,15 @@ #include "utils/mono-mmap.h" #include "utils/mono-threads.h" -/* If not null, dump binary protocol to this file */ -/* FIXME: Don't use FILE - use system calls, otherwise we might deadlock. */ -static FILE *binary_protocol_file = NULL; +#include +#ifdef HAVE_UNISTD_H +#include +#endif + +/* FIXME Implement binary protocol IO on systems that don't have unistd */ +#ifdef HAVE_UNISTD_H +/* If valid, dump binary protocol to this file */ +static int binary_protocol_file = -1; /* We set this to -1 to indicate an exclusive lock */ static volatile int binary_protocol_use_count = 0; @@ -83,27 +89,48 @@ binary_protocol_open_file (void) else filename = filename_or_prefix; - binary_protocol_file = fopen (filename, "w"); + do { + binary_protocol_file = open (filename, O_CREAT|O_WRONLY|O_TRUNC, 0644); + if (binary_protocol_file == -1 && errno != EINTR) + break; /* Failed */ + } while (binary_protocol_file == -1); if (file_size_limit > 0) free_filename (filename); } +#endif void binary_protocol_init (const char *filename, long long limit) { +#ifdef HAVE_UNISTD_H filename_or_prefix = sgen_alloc_internal_dynamic (strlen (filename) + 1, INTERNAL_MEM_BINARY_PROTOCOL, TRUE); strcpy (filename_or_prefix, filename); file_size_limit = limit; binary_protocol_open_file (); +#endif } gboolean binary_protocol_is_enabled (void) { - return binary_protocol_file != NULL; +#ifdef HAVE_UNISTD_H + return binary_protocol_file != -1; +#else + return FALSE; +#endif +} + +#ifdef HAVE_UNISTD_H + +static void +close_binary_protocol_file (void) +{ + while (close (binary_protocol_file) == -1 && errno == EINTR) + ; + binary_protocol_file = -1; } static gboolean @@ -156,8 +183,21 @@ unlock_recursive (void) static void binary_protocol_flush_buffer (BinaryProtocolBuffer *buffer) { + ssize_t ret; + size_t to_write = buffer->index; + size_t written = 0; g_assert (buffer->index > 0); - fwrite (buffer->buffer, 1, buffer->index, binary_protocol_file); + + while (written < to_write) { + ret = write (binary_protocol_file, buffer->buffer + written, to_write - written); + if (ret >= 0) + written += ret; + else if (errno == EINTR) + continue; + else + close_binary_protocol_file (); + } + current_file_size += buffer->index; sgen_free_os_memory (buffer, sizeof (BinaryProtocolBuffer), SGEN_ALLOC_INTERNAL); @@ -169,8 +209,7 @@ binary_protocol_check_file_overflow (void) if (file_size_limit <= 0 || current_file_size < file_size_limit) return; - fclose (binary_protocol_file); - binary_protocol_file = NULL; + close_binary_protocol_file (); if (current_file_index > 0) { char *filename = filename_for_index (current_file_index - 1); @@ -183,15 +222,17 @@ binary_protocol_check_file_overflow (void) binary_protocol_open_file (); } +#endif void binary_protocol_flush_buffers (gboolean force) { +#ifdef HAVE_UNISTD_H int num_buffers = 0, i; BinaryProtocolBuffer *buf; BinaryProtocolBuffer **bufs; - if (!binary_protocol_file) + if (binary_protocol_file == -1) return; if (!force && !try_lock_exclusive ()) @@ -215,15 +256,14 @@ binary_protocol_flush_buffers (gboolean force) if (!force) unlock_exclusive (); - - fflush (binary_protocol_file); +#endif } +#ifdef HAVE_UNISTD_H static BinaryProtocolBuffer* binary_protocol_get_buffer (int length) { BinaryProtocolBuffer *buffer, *new_buffer; - retry: buffer = binary_protocol_buffers; if (buffer && buffer->index + length <= BINARY_PROTOCOL_BUFFER_SIZE) @@ -240,15 +280,16 @@ binary_protocol_get_buffer (int length) return new_buffer; } - +#endif static void protocol_entry (unsigned char type, gpointer data, int size) { +#ifdef HAVE_UNISTD_H int index; BinaryProtocolBuffer *buffer; - if (!binary_protocol_file) + if (binary_protocol_file == -1) return; if (sgen_is_worker_thread (mono_native_thread_id_get ())) @@ -276,6 +317,7 @@ protocol_entry (unsigned char type, gpointer data, int size) g_assert (index <= BINARY_PROTOCOL_BUFFER_SIZE); unlock_recursive (); +#endif } void @@ -289,17 +331,17 @@ binary_protocol_collection_force (int generation) void binary_protocol_collection_begin (int index, int generation) { - SGenProtocolCollection entry = { index, generation }; + SGenProtocolCollectionBegin entry = { index, generation }; binary_protocol_flush_buffers (FALSE); - protocol_entry (SGEN_PROTOCOL_COLLECTION_BEGIN, &entry, sizeof (SGenProtocolCollection)); + protocol_entry (SGEN_PROTOCOL_COLLECTION_BEGIN, &entry, sizeof (SGenProtocolCollectionBegin)); } void -binary_protocol_collection_end (int index, int generation) +binary_protocol_collection_end (int index, int generation, long long num_objects_scanned, long long num_unique_objects_scanned) { - SGenProtocolCollection entry = { index, generation }; + SGenProtocolCollectionEnd entry = { index, generation, num_objects_scanned, num_unique_objects_scanned }; binary_protocol_flush_buffers (FALSE); - protocol_entry (SGEN_PROTOCOL_COLLECTION_END, &entry, sizeof (SGenProtocolCollection)); + protocol_entry (SGEN_PROTOCOL_COLLECTION_END, &entry, sizeof (SGenProtocolCollectionEnd)); } void @@ -309,9 +351,15 @@ binary_protocol_concurrent_start (void) } void -binary_protocol_concurrent_update_finish (void) +binary_protocol_concurrent_update (void) +{ + protocol_entry (SGEN_PROTOCOL_CONCURRENT_UPDATE, NULL, 0); +} + +void +binary_protocol_concurrent_finish (void) { - protocol_entry (SGEN_PROTOCOL_CONCURRENT_UPDATE_FINISH, NULL, 0); + protocol_entry (SGEN_PROTOCOL_CONCURRENT_FINISH, NULL, 0); } void @@ -439,9 +487,9 @@ binary_protocol_copy (gpointer from, gpointer to, gpointer vtable, int size) } void -binary_protocol_pin_stage (gpointer addr_ptr, gpointer addr, gpointer thread) +binary_protocol_pin_stage (gpointer addr_ptr, gpointer addr) { - SGenProtocolPinStage entry = { addr_ptr, addr, thread }; + SGenProtocolPinStage entry = { addr_ptr, addr }; protocol_entry (SGEN_PROTOCOL_PIN_STAGE, &entry, sizeof (SGenProtocolPinStage)); } @@ -473,6 +521,13 @@ binary_protocol_scan_vtype_begin (gpointer obj, int size) protocol_entry (SGEN_PROTOCOL_SCAN_VTYPE_BEGIN, &entry, sizeof (SGenProtocolScanVTypeBegin)); } +void +binary_protocol_scan_process_reference (gpointer obj, gpointer ptr, gpointer value) +{ + SGenProtocolScanProcessReference entry = { obj, ptr, value }; + protocol_entry (SGEN_PROTOCOL_SCAN_PROCESS_REFERENCE, &entry, sizeof (SGenProtocolScanProcessReference)); +} + void binary_protocol_wbarrier (gpointer ptr, gpointer value, gpointer value_vtable) { diff --git a/mono/metadata/sgen-protocol.h b/mono/metadata/sgen-protocol.h index 1b4b24a3d54..fbf3df6412f 100644 --- a/mono/metadata/sgen-protocol.h +++ b/mono/metadata/sgen-protocol.h @@ -30,7 +30,8 @@ enum { SGEN_PROTOCOL_COLLECTION_BEGIN, SGEN_PROTOCOL_COLLECTION_END, SGEN_PROTOCOL_CONCURRENT_START, - SGEN_PROTOCOL_CONCURRENT_UPDATE_FINISH, + SGEN_PROTOCOL_CONCURRENT_UPDATE, + SGEN_PROTOCOL_CONCURRENT_FINISH, SGEN_PROTOCOL_WORLD_STOPPING, SGEN_PROTOCOL_WORLD_STOPPED, SGEN_PROTOCOL_WORLD_RESTARTING, @@ -42,6 +43,7 @@ enum { SGEN_PROTOCOL_MARK, SGEN_PROTOCOL_SCAN_BEGIN, SGEN_PROTOCOL_SCAN_VTYPE_BEGIN, + SGEN_PROTOCOL_SCAN_PROCESS_REFERENCE, SGEN_PROTOCOL_WBARRIER, SGEN_PROTOCOL_GLOBAL_REMSET, SGEN_PROTOCOL_PTR_UPDATE, @@ -72,7 +74,13 @@ typedef struct { typedef struct { int index, generation; -} SGenProtocolCollection; +} SGenProtocolCollectionBegin; + +typedef struct { + int index, generation; + long long num_scanned_objects; + long long num_unique_scanned_objects; +} SGenProtocolCollectionEnd; typedef struct { long long timestamp; @@ -116,7 +124,6 @@ typedef struct { typedef struct { gpointer addr_ptr; gpointer addr; - gpointer thread; } SGenProtocolPinStage; typedef struct { @@ -142,6 +149,12 @@ typedef struct { int size; } SGenProtocolScanVTypeBegin; +typedef struct { + gpointer obj; + gpointer ptr; + gpointer value; +} SGenProtocolScanProcessReference; + typedef struct { gpointer ptr; gpointer value; @@ -248,9 +261,10 @@ void binary_protocol_flush_buffers (gboolean force) MONO_INTERNAL; void binary_protocol_collection_force (int generation) MONO_INTERNAL; void binary_protocol_collection_begin (int index, int generation) MONO_INTERNAL; -void binary_protocol_collection_end (int index, int generation) MONO_INTERNAL; +void binary_protocol_collection_end (int index, int generation, long long num_objects_scanned, long long num_unique_objects_scanned) MONO_INTERNAL; void binary_protocol_concurrent_start (void) MONO_INTERNAL; -void binary_protocol_concurrent_update_finish (void) MONO_INTERNAL; +void binary_protocol_concurrent_update (void) MONO_INTERNAL; +void binary_protocol_concurrent_finish (void) MONO_INTERNAL; void binary_protocol_world_stopping (long long timestamp) MONO_INTERNAL; void binary_protocol_world_stopped (long long timestamp, long long total_major_cards, long long marked_major_cards, long long total_los_cards, long long marked_los_cards) MONO_INTERNAL; @@ -279,11 +293,12 @@ void binary_protocol_alloc (gpointer obj, gpointer vtable, int size) MONO_INTERN void binary_protocol_alloc_pinned (gpointer obj, gpointer vtable, int size) MONO_INTERNAL; void binary_protocol_alloc_degraded (gpointer obj, gpointer vtable, int size) MONO_INTERNAL; void binary_protocol_copy (gpointer from, gpointer to, gpointer vtable, int size) MONO_INTERNAL; -void binary_protocol_pin_stage (gpointer addr_ptr, gpointer addr, gpointer thread) MONO_INTERNAL; +void binary_protocol_pin_stage (gpointer addr_ptr, gpointer addr) MONO_INTERNAL; void binary_protocol_pin (gpointer obj, gpointer vtable, int size) MONO_INTERNAL; void binary_protocol_mark (gpointer obj, gpointer vtable, int size) MONO_INTERNAL; void binary_protocol_scan_begin (gpointer obj, gpointer vtable, int size) MONO_INTERNAL; void binary_protocol_scan_vtype_begin (gpointer start, int size) MONO_INTERNAL; +void binary_protocol_scan_process_reference (gpointer obj, gpointer ptr, gpointer value) MONO_INTERNAL; void binary_protocol_wbarrier (gpointer ptr, gpointer value, gpointer value_vtable) MONO_INTERNAL; void binary_protocol_global_remset (gpointer ptr, gpointer value, gpointer value_vtable) MONO_INTERNAL; void binary_protocol_ptr_update (gpointer ptr, gpointer old_value, gpointer new_value, gpointer vtable, int size) MONO_INTERNAL; @@ -304,11 +319,12 @@ void binary_protocol_gray_dequeue (gpointer queue, gpointer cursor, gpointer val #define binary_protocol_alloc_pinned(obj, vtable, size) #define binary_protocol_alloc_degraded(obj, vtable, size) #define binary_protocol_copy(from, to, vtable, size) -#define binary_protocol_pin_stage(addr_ptr, addr, thread) +#define binary_protocol_pin_stage(addr_ptr, addr) #define binary_protocol_pin(obj, vtable, size) #define binary_protocol_mark(obj, vtable, size) #define binary_protocol_scan_begin(obj, vtable, size) #define binary_protocol_scan_vtype_begin(obj, size) +#define binary_protocol_scan_process_reference(obj, ptr, value) #define binary_protocol_wbarrier(ptr, value, value_vtable) #define binary_protocol_global_remset(ptr, value, value_vtable) #define binary_protocol_ptr_update(ptr, old_value, new_value, vtable, size) diff --git a/mono/metadata/sgen-scan-object.h b/mono/metadata/sgen-scan-object.h index ad569dda359..30c43fb2854 100644 --- a/mono/metadata/sgen-scan-object.h +++ b/mono/metadata/sgen-scan-object.h @@ -53,19 +53,12 @@ binary_protocol_scan_vtype_begin (start + sizeof (MonoObject), size); #endif #endif - switch (desc & 0x7) { + switch (desc & DESC_TYPE_MASK) { case DESC_TYPE_RUN_LENGTH: #define SCAN OBJ_RUN_LEN_FOREACH_PTR (desc, start) #ifndef SCAN_OBJECT_NOSCAN SCAN; #endif -#undef SCAN - break; - case DESC_TYPE_SMALL_BITMAP: -#define SCAN OBJ_BITMAP_FOREACH_PTR (desc, start) -#ifndef SCAN_OBJECT_NOSCAN - SCAN; -#endif #undef SCAN break; case DESC_TYPE_VECTOR: @@ -75,8 +68,8 @@ #endif #undef SCAN break; - case DESC_TYPE_LARGE_BITMAP: -#define SCAN OBJ_LARGE_BITMAP_FOREACH_PTR (desc, start) + case DESC_TYPE_BITMAP: +#define SCAN OBJ_BITMAP_FOREACH_PTR (desc, start) #ifndef SCAN_OBJECT_NOSCAN SCAN; #endif @@ -100,6 +93,7 @@ #undef SCAN break; #endif + case DESC_TYPE_SMALL_PTRFREE: case DESC_TYPE_COMPLEX_PTRFREE: /*Nothing to do*/ break; diff --git a/mono/metadata/sgen-stw.c b/mono/metadata/sgen-stw.c index 4d3bd9345f9..eb6a50d9726 100644 --- a/mono/metadata/sgen-stw.c +++ b/mono/metadata/sgen-stw.c @@ -38,7 +38,6 @@ #define TV_DECLARE SGEN_TV_DECLARE #define TV_GETTIME SGEN_TV_GETTIME #define TV_ELAPSED SGEN_TV_ELAPSED -#define TV_ELAPSED_MS SGEN_TV_ELAPSED_MS inline static void* align_pointer (void *ptr) @@ -202,8 +201,8 @@ count_cards (long long *major_total, long long *major_marked, long long *los_tot static TV_DECLARE (stop_world_time); static unsigned long max_pause_usec = 0; -static long long time_stop_world; -static long long time_restart_world; +static guint64 time_stop_world; +static guint64 time_restart_world; /* LOCKING: assumes the GC lock is held */ int @@ -328,8 +327,8 @@ sgen_restart_world (int generation, GGTimingInfo *timing) void sgen_init_stw (void) { - mono_counters_register ("World stop", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &time_stop_world); - mono_counters_register ("World restart", MONO_COUNTER_GC | MONO_COUNTER_LONG | MONO_COUNTER_TIME, &time_restart_world); + mono_counters_register ("World stop", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_stop_world); + mono_counters_register ("World restart", MONO_COUNTER_GC | MONO_COUNTER_ULONG | MONO_COUNTER_TIME, &time_restart_world); } #endif diff --git a/mono/metadata/sgen-tagged-pointer.h b/mono/metadata/sgen-tagged-pointer.h index fc065f7f96b..3d63e94bfcd 100644 --- a/mono/metadata/sgen-tagged-pointer.h +++ b/mono/metadata/sgen-tagged-pointer.h @@ -20,6 +20,8 @@ #ifndef __MONO_SGEN_TAGGED_POINTER_H__ #define __MONO_SGEN_TAGGED_POINTER_H__ +#define SGEN_TAGGED_POINTER_MASK 7 + #define SGEN_POINTER_IS_TAGGED_1(p) ((mword)(p) & 1) #define SGEN_POINTER_TAG_1(p) ((void*)((mword)(p) | 1)) #define SGEN_POINTER_UNTAG_1(p) ((void*)((mword)(p) & ~1)) @@ -28,7 +30,16 @@ #define SGEN_POINTER_TAG_2(p) ((void*)((mword)(p) | 2)) #define SGEN_POINTER_UNTAG_2(p) ((void*)((mword)(p) & ~2)) -#define SGEN_POINTER_IS_TAGGED_1_OR_2(p) ((mword)(p) & 3) -#define SGEN_POINTER_UNTAG_12(p) ((void*)((mword)(p) & ~3)) +#define SGEN_POINTER_TAG_12(p) ((mword)(p) & 3) +#define SGEN_POINTER_SET_TAG_12(p,t) ((void*)(((mword)(p) & ~3) | (t))) + +#define SGEN_POINTER_IS_TAGGED_4(p) ((mword)(p) & 4) +#define SGEN_POINTER_TAG_4(p) ((void*)((mword)(p) | 4)) +#define SGEN_POINTER_UNTAG_4(p) ((void*)((mword)(p) & ~4)) + +#define SGEN_POINTER_UNTAG_24(p) ((void*)((mword)(p) & ~6)) + +#define SGEN_POINTER_IS_TAGGED_ANY(p) ((mword)(p) & SGEN_TAGGED_POINTER_MASK) +#define SGEN_POINTER_UNTAG_ALL(p) ((void*)((mword)(p) & ~SGEN_TAGGED_POINTER_MASK)) #endif diff --git a/mono/metadata/sgen-workers.c b/mono/metadata/sgen-workers.c index 7d33e778c5b..9144fc27c28 100644 --- a/mono/metadata/sgen-workers.c +++ b/mono/metadata/sgen-workers.c @@ -73,10 +73,10 @@ static LOCK_DECLARE (workers_job_queue_mutex); static int workers_num_jobs_enqueued = 0; static volatile int workers_num_jobs_finished = 0; -static long long stat_workers_stolen_from_self_lock; -static long long stat_workers_stolen_from_self_no_lock; -static long long stat_workers_stolen_from_others; -static long long stat_workers_num_waited; +static guint64 stat_workers_stolen_from_self_lock; +static guint64 stat_workers_stolen_from_self_no_lock; +static guint64 stat_workers_stolen_from_others; +static guint64 stat_workers_num_waited; static gboolean set_state (State old_state, State new_state) @@ -600,10 +600,10 @@ sgen_workers_init (int num_workers) sgen_register_fixed_internal_mem_type (INTERNAL_MEM_JOB_QUEUE_ENTRY, sizeof (JobQueueEntry)); - mono_counters_register ("Stolen from self lock", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_workers_stolen_from_self_lock); - mono_counters_register ("Stolen from self no lock", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_workers_stolen_from_self_no_lock); - mono_counters_register ("Stolen from others", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_workers_stolen_from_others); - mono_counters_register ("# workers waited", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_workers_num_waited); + mono_counters_register ("Stolen from self lock", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_workers_stolen_from_self_lock); + mono_counters_register ("Stolen from self no lock", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_workers_stolen_from_self_no_lock); + mono_counters_register ("Stolen from others", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_workers_stolen_from_others); + mono_counters_register ("# workers waited", MONO_COUNTER_GC | MONO_COUNTER_ULONG, &stat_workers_num_waited); } /* only the GC thread is allowed to start and join workers */ diff --git a/mono/metadata/threads.c b/mono/metadata/threads.c index de4917ce08d..36a847d10b5 100644 --- a/mono/metadata/threads.c +++ b/mono/metadata/threads.c @@ -44,11 +44,17 @@ #include +#if defined(PLATFORM_ANDROID) && !defined(TARGET_ARM64) +#define USE_TKILL_ON_ANDROID 1 +#endif + #ifdef PLATFORM_ANDROID #include +#ifdef USE_TKILL_ON_ANDROID extern int tkill (pid_t tid, int signal); #endif +#endif /*#define THREAD_DEBUG(a) do { a; } while (0)*/ #define THREAD_DEBUG(a) @@ -4476,7 +4482,7 @@ mono_thread_kill (MonoInternalThread *thread, int signal) # ifdef PTHREAD_POINTER_ID return pthread_kill ((gpointer)(gsize)(thread->tid), mono_thread_get_abort_signal ()); # else -# ifdef PLATFORM_ANDROID +# ifdef USE_TKILL_ON_ANDROID if (thread->android_tid != 0) { int ret; int old_errno = errno; diff --git a/mono/metadata/verify.c b/mono/metadata/verify.c index 95bde8efbc5..28f23dd1133 100644 --- a/mono/metadata/verify.c +++ b/mono/metadata/verify.c @@ -934,6 +934,7 @@ mono_method_is_valid_in_context (VerifyContext *ctx, MonoMethod *method) static MonoClassField* verifier_load_field (VerifyContext *ctx, int token, MonoClass **out_klass, const char *opcode) { + MonoError error; MonoClassField *field; MonoClass *klass = NULL; @@ -946,12 +947,12 @@ verifier_load_field (VerifyContext *ctx, int token, MonoClass **out_klass, const return NULL; } - field = mono_field_from_token (ctx->image, token, &klass, ctx->generic_context); + field = mono_field_from_token_checked (ctx->image, token, &klass, ctx->generic_context, &error); + mono_error_cleanup (&error); /*FIXME don't swallow the error */ } - if (!field || !field->parent || !klass || mono_loader_get_last_error ()) { + if (!field || !field->parent || !klass) { ADD_VERIFY_ERROR2 (ctx, g_strdup_printf ("Cannot load field from token 0x%08x for %s at 0x%04x", token, opcode, ctx->ip_offset), MONO_EXCEPTION_BAD_IMAGE); - mono_loader_clear_error (); return NULL; } @@ -3126,6 +3127,7 @@ do_ret (VerifyContext *ctx) static void do_invoke_method (VerifyContext *ctx, int method_token, gboolean virtual) { + MonoError error; int param_count, i; MonoMethodSignature *sig; ILStackDesc *value; @@ -3155,12 +3157,15 @@ do_invoke_method (VerifyContext *ctx, int method_token, gboolean virtual) } } - if (!(sig = mono_method_get_signature_full (method, ctx->image, method_token, ctx->generic_context))) - sig = mono_method_get_signature (method, ctx->image, method_token); + if (!(sig = mono_method_get_signature_checked (method, ctx->image, method_token, ctx->generic_context, &error))) { + mono_error_cleanup (&error); + sig = mono_method_get_signature_checked (method, ctx->image, method_token, NULL, &error); + } if (!sig) { char *name = mono_type_get_full_name (method->klass); - ADD_VERIFY_ERROR (ctx, g_strdup_printf ("Could not resolve signature of %s:%s at 0x%04x", name, method->name, ctx->ip_offset)); + ADD_VERIFY_ERROR (ctx, g_strdup_printf ("Could not resolve signature of %s:%s at 0x%04x due to: %s", name, method->name, ctx->ip_offset, mono_error_get_message (&error))); + mono_error_cleanup (&error); g_free (name); return; } diff --git a/mono/mini/aot-compiler.c b/mono/mini/aot-compiler.c index 938f8fc9a68..283489f8d26 100644 --- a/mono/mini/aot-compiler.c +++ b/mono/mini/aot-compiler.c @@ -71,18 +71,6 @@ #define TV_GETTIME(tv) tv = mono_100ns_ticks () #define TV_ELAPSED(start,end) (((end) - (start)) / 10) -#ifdef TARGET_WIN32 -#define SHARED_EXT ".dll" -#elif defined(__ppc__) && defined(TARGET_MACH) -#define SHARED_EXT ".dylib" -#elif defined(TARGET_MACH) && defined(TARGET_X86) && !defined(__native_client_codegen__) -#define SHARED_EXT ".dylib" -#elif defined(TARGET_MACH) && defined(TARGET_AMD64) && !defined(__native_client_codegen__) -#define SHARED_EXT ".dylib" -#else -#define SHARED_EXT ".so" -#endif - #define ALIGN_TO(val,align) ((((guint64)val) + ((align) - 1)) & ~((align) - 1)) #define ALIGN_PTR_TO(ptr,align) (gpointer)((((gssize)(ptr)) + (align - 1)) & (~(align - 1))) #define ROUND_DOWN(VALUE,SIZE) ((VALUE) & ~((SIZE) - 1)) @@ -1935,14 +1923,14 @@ arch_emit_imt_thunk (MonoAotCompile *acfg, int offset, int *tramp_size) code = buf; /* Load the mscorlib got address */ - ppc_ldptr (code, ppc_r11, sizeof (gpointer), ppc_r30); + ppc_ldptr (code, ppc_r12, sizeof (gpointer), ppc_r30); /* Load the parameter from the GOT */ ppc_load (code, ppc_r0, offset * sizeof (gpointer)); - ppc_ldptr_indexed (code, ppc_r11, ppc_r11, ppc_r0); + ppc_ldptr_indexed (code, ppc_r12, ppc_r12, ppc_r0); /* Load and check key */ labels [1] = code; - ppc_ldptr (code, ppc_r0, 0, ppc_r11); + ppc_ldptr (code, ppc_r0, 0, ppc_r12); ppc_cmp (code, 0, sizeof (gpointer) == 8 ? 1 : 0, ppc_r0, MONO_ARCH_IMT_REG); labels [2] = code; ppc_bc (code, PPC_BR_TRUE, PPC_BR_EQ, 0); @@ -1953,18 +1941,18 @@ arch_emit_imt_thunk (MonoAotCompile *acfg, int offset, int *tramp_size) ppc_bc (code, PPC_BR_TRUE, PPC_BR_EQ, 0); /* Loop footer */ - ppc_addi (code, ppc_r11, ppc_r11, 2 * sizeof (gpointer)); + ppc_addi (code, ppc_r12, ppc_r12, 2 * sizeof (gpointer)); labels [4] = code; ppc_b (code, 0); mono_ppc_patch (labels [4], labels [1]); /* Match */ mono_ppc_patch (labels [2], code); - ppc_ldptr (code, ppc_r11, sizeof (gpointer), ppc_r11); - /* r11 now contains the value of the vtable slot */ + ppc_ldptr (code, ppc_r12, sizeof (gpointer), ppc_r12); + /* r12 now contains the value of the vtable slot */ /* this is not a function descriptor on ppc64 */ - ppc_ldptr (code, ppc_r11, 0, ppc_r11); - ppc_mtctr (code, ppc_r11); + ppc_ldptr (code, ppc_r12, 0, ppc_r12); + ppc_mtctr (code, ppc_r12); ppc_bcctr (code, PPC_BR_ALWAYS, 0); /* Fail */ @@ -5389,6 +5377,15 @@ emit_exception_debug_info (MonoAotCompile *acfg, MonoCompile *cfg) encode_value (table->num_holes, p, &p); } + if (jinfo->has_arch_eh_info) { + /* + * In AOT mode, the code length is calculated from the address of the previous method, + * which could include alignment padding, so calculating the start of the epilog as + * code_len - epilog_size is correct any more. Save the real code len as a workaround. + */ + encode_value (jinfo->code_size, p, &p); + } + /* Exception table */ if (cfg->compile_llvm) { /* @@ -8626,7 +8623,7 @@ compile_asm (MonoAotCompile *acfg) if (acfg->aot_opts.outfile) outfile_name = g_strdup_printf ("%s", acfg->aot_opts.outfile); else - outfile_name = g_strdup_printf ("%s%s", acfg->image->name, SHARED_EXT); + outfile_name = g_strdup_printf ("%s%s", acfg->image->name, MONO_SOLIB_EXT); tmp_outfile_name = g_strdup_printf ("%s.tmp", outfile_name); @@ -8646,7 +8643,7 @@ compile_asm (MonoAotCompile *acfg) g_free (command); - /*com = g_strdup_printf ("strip --strip-unneeded %s%s", acfg->image->name, SHARED_EXT); + /*com = g_strdup_printf ("strip --strip-unneeded %s%s", acfg->image->name, MONO_SOLIB_EXT); printf ("Stripping the binary: %s\n", com); system (com); g_free (com);*/ @@ -8997,7 +8994,7 @@ mono_compile_assembly (MonoAssembly *ass, guint32 opts, const char *aot_options) if (acfg->aot_opts.outfile) outfile_name = g_strdup_printf ("%s", acfg->aot_opts.outfile); else - outfile_name = g_strdup_printf ("%s%s", acfg->image->name, SHARED_EXT); + outfile_name = g_strdup_printf ("%s%s", acfg->image->name, MONO_SOLIB_EXT); /* * Can't use g_file_open_tmp () as it will be deleted at exit, and diff --git a/mono/mini/aot-runtime.c b/mono/mini/aot-runtime.c index 856819c3936..7158952a2ec 100644 --- a/mono/mini/aot-runtime.c +++ b/mono/mini/aot-runtime.c @@ -67,16 +67,6 @@ #define ENABLE_AOT_CACHE #endif -#ifdef TARGET_WIN32 -#define SHARED_EXT ".dll" -#elif ((defined(__ppc__) || defined(__powerpc__) || defined(__ppc64__)) || defined(__MACH__)) && !defined(__linux__) -#define SHARED_EXT ".dylib" -#elif defined(__APPLE__) && defined(TARGET_X86) && !defined(__native_client_codegen__) -#define SHARED_EXT ".dylib" -#else -#define SHARED_EXT ".so" -#endif - #define ALIGN_TO(val,align) ((((guint64)val) + ((align) - 1)) & ~((align) - 1)) #define ALIGN_PTR_TO(ptr,align) (gpointer)((((gssize)(ptr)) + (align - 1)) & (~(align - 1))) #define ROUND_DOWN(VALUE,SIZE) ((VALUE) & ~((SIZE) - 1)) @@ -1445,7 +1435,7 @@ aot_cache_load_module (MonoAssembly *assembly, char **aot_name) */ hash = get_aot_config_hash (assembly); - tmp2 = g_strdup_printf ("%s-%s%s", assembly->image->assembly_name, hash, SHARED_EXT); + tmp2 = g_strdup_printf ("%s-%s%s", assembly->image->assembly_name, hash, MONO_SOLIB_EXT); fname = g_build_filename (cache_dir, tmp2, NULL); *aot_name = fname; g_free (tmp2); @@ -1773,13 +1763,21 @@ load_aot_module (MonoAssembly *assembly, gpointer user_data) sofile = aot_cache_load_module (assembly, &aot_name); if (!sofile) { char *err; - aot_name = g_strdup_printf ("%s%s", assembly->image->name, SHARED_EXT); + aot_name = g_strdup_printf ("%s%s", assembly->image->name, MONO_SOLIB_EXT); sofile = mono_dl_open (aot_name, MONO_DL_LAZY, &err); if (!sofile) { mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT module '%s' not found: %s\n", aot_name, err); g_free (err); + + aot_name = g_strdup_printf ("%s/mono/aot-cache/%s/%s%s", mono_assembly_getrootdir(), ARCHITECTURE, g_path_get_basename (assembly->image->name), MONO_SOLIB_EXT); + sofile = mono_dl_open (aot_name, MONO_DL_LAZY, &err); + if (!sofile) { + mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_AOT, "AOT module '%s' not found: %s\n", aot_name, err); + g_free (err); + } + } } } @@ -2586,18 +2584,22 @@ decode_exception_debug_info (MonoAotModule *amodule, MonoDomain *domain, } else { num_holes = try_holes_info_size = 0; } - /* Exception table */ - if (has_clauses) - num_clauses = decode_value (p, &p); - else - num_clauses = 0; + if (has_arch_eh_jit_info) { flags |= JIT_INFO_HAS_ARCH_EH_INFO; arch_eh_jit_info_size = sizeof (MonoArchEHJitInfo); + /* Overwrite the original code_len which includes alignment padding */ + code_len = decode_value (p, &p); } else { arch_eh_jit_info_size = 0; } + /* Exception table */ + if (has_clauses) + num_clauses = decode_value (p, &p); + else + num_clauses = 0; + if (from_llvm) { MonoJitExceptionInfo *clauses; GSList **nesting; diff --git a/mono/mini/cpu-ppc64.md b/mono/mini/cpu-ppc64.md index 1f5234a7670..dc6ac728ab4 100644 --- a/mono/mini/cpu-ppc64.md +++ b/mono/mini/cpu-ppc64.md @@ -381,7 +381,7 @@ vcall2_membase: src1:b len:16 clob:c jump_table: dest:i len:20 -atomic_add_i4: src1:b src2:i dest:i len:20 -atomic_add_i8: src1:b src2:i dest:i len:20 +atomic_add_i4: src1:b src2:i dest:i len:28 +atomic_add_i8: src1:b src2:i dest:i len:28 atomic_cas_i4: src1:b src2:i src3:i dest:i len:38 atomic_cas_i8: src1:b src2:i src3:i dest:i len:38 diff --git a/mono/mini/debug-mini.c b/mono/mini/debug-mini.c index 742b6e93d9d..1565a8684f8 100644 --- a/mono/mini/debug-mini.c +++ b/mono/mini/debug-mini.c @@ -16,7 +16,6 @@ #include #include -#define _IN_THE_MONO_DEBUGGER #include #include diff --git a/mono/mini/debugger-agent.c b/mono/mini/debugger-agent.c index e5ca36c2692..240f8419a45 100644 --- a/mono/mini/debugger-agent.c +++ b/mono/mini/debugger-agent.c @@ -290,7 +290,7 @@ typedef struct { #define HEADER_LENGTH 11 #define MAJOR_VERSION 2 -#define MINOR_VERSION 37 +#define MINOR_VERSION 38 typedef enum { CMD_SET_VM = 1, @@ -515,7 +515,8 @@ typedef enum { typedef enum { CMD_STACK_FRAME_GET_VALUES = 1, CMD_STACK_FRAME_GET_THIS = 2, - CMD_STACK_FRAME_SET_VALUES = 3 + CMD_STACK_FRAME_SET_VALUES = 3, + CMD_STACK_FRAME_GET_DOMAIN = 4, } CmdStackFrame; typedef enum { @@ -816,6 +817,12 @@ static void register_socket_transport (void); #endif +static inline gboolean +is_debugger_thread (void) +{ + return GetCurrentThreadId () == debugger_thread_id; +} + static int parse_address (char *address, char **host, int *port) { @@ -989,6 +996,9 @@ mono_debugger_agent_init (void) mono_native_tls_alloc (&debugger_tls_id, NULL); + /* Needed by the hash_table_new_type () call below */ + mono_gc_base_init (); + thread_to_tls = mono_g_hash_table_new_type (NULL, NULL, MONO_HASH_KEY_GC); MONO_GC_REGISTER_ROOT_FIXED (thread_to_tls); @@ -3971,6 +3981,10 @@ appdomain_start_unload (MonoProfiler *prof, MonoDomain *domain) { DebuggerTlsData *tls; + /* This might be called during shutdown on the debugger thread from the CMD_VM_EXIT code */ + if (is_debugger_thread ()) + return; + /* * Remember the currently unloading appdomain as it is needed to generate * proper ids for unloading assemblies. @@ -3985,6 +3999,9 @@ appdomain_unload (MonoProfiler *prof, MonoDomain *domain) { DebuggerTlsData *tls; + if (is_debugger_thread ()) + return; + tls = mono_native_tls_get_value (debugger_tls_id); g_assert (tls); tls->domain_unloading = NULL; @@ -8954,6 +8971,11 @@ frame_commands (int command, guint8 *p, guint8 *end, Buffer *buf) mono_metadata_free_mh (header); break; } + case CMD_STACK_FRAME_GET_DOMAIN: { + if (CHECK_PROTOCOL_VERSION (2, 38)) + buffer_add_domainid (buf, frame->domain); + break; + } default: return ERR_NOT_IMPLEMENTED; } @@ -9322,7 +9344,8 @@ static const char* type_cmds_str[] = { static const char* stack_frame_cmds_str[] = { "GET_VALUES", "GET_THIS", - "SET_VALUES" + "SET_VALUES", + "GET_DOMAIN", }; static const char* array_cmds_str[] = { diff --git a/mono/mini/dwarfwriter.c b/mono/mini/dwarfwriter.c index 67585763b69..d79b0cae348 100644 --- a/mono/mini/dwarfwriter.c +++ b/mono/mini/dwarfwriter.c @@ -1422,10 +1422,12 @@ token_handler (MonoDisHelper *dh, MonoMethod *method, guint32 token) case CEE_LDSFLD: case CEE_STFLD: case CEE_STSFLD: - if (method->wrapper_type) + if (method->wrapper_type) { field = data; - else - field = mono_field_from_token (method->klass->image, token, &klass, NULL); + } else { + field = mono_field_from_token_checked (method->klass->image, token, &klass, NULL, &error); + g_assert (mono_error_ok (&error)); /* FIXME error handling */ + } desc = mono_field_full_name (field); res = g_strdup_printf ("<%s>", desc); g_free (desc); diff --git a/mono/mini/exceptions-ppc.c b/mono/mini/exceptions-ppc.c index 8ba3bf083d8..2697bc0895b 100644 --- a/mono/mini/exceptions-ppc.c +++ b/mono/mini/exceptions-ppc.c @@ -381,18 +381,18 @@ mono_arch_get_throw_exception_generic (int size, MonoTrampInfo **info, int corli if (aot) { code = mono_arch_emit_load_aotconst (start, code, &ji, MONO_PATCH_INFO_IMAGE, mono_defaults.corlib); - ppc_mr (code, ppc_r3, ppc_r11); + ppc_mr (code, ppc_r3, ppc_r12); code = mono_arch_emit_load_aotconst (start, code, &ji, MONO_PATCH_INFO_JIT_ICALL_ADDR, "mono_exception_from_token"); #ifdef PPC_USES_FUNCTION_DESCRIPTOR - ppc_ldptr (code, ppc_r2, sizeof (gpointer), ppc_r11); - ppc_ldptr (code, ppc_r11, 0, ppc_r11); + ppc_ldptr (code, ppc_r2, sizeof (gpointer), ppc_r12); + ppc_ldptr (code, ppc_r12, 0, ppc_r12); #endif - ppc_mtctr (code, ppc_r11); + ppc_mtctr (code, ppc_r12); ppc_bcctrl (code, PPC_BR_ALWAYS, 0); } else { ppc_load (code, ppc_r3, (gulong)mono_defaults.corlib); - ppc_load_func (code, ppc_r0, mono_exception_from_token); - ppc_mtctr (code, ppc_r0); + ppc_load_func (code, PPC_CALL_REG, mono_exception_from_token); + ppc_mtctr (code, PPC_CALL_REG); ppc_bcctrl (code, PPC_BR_ALWAYS, 0); } } @@ -420,14 +420,14 @@ mono_arch_get_throw_exception_generic (int size, MonoTrampInfo **info, int corli code = mono_arch_emit_load_got_addr (start, code, NULL, &ji); code = mono_arch_emit_load_aotconst (start, code, &ji, MONO_PATCH_INFO_JIT_ICALL_ADDR, "mono_ppc_throw_exception"); #ifdef PPC_USES_FUNCTION_DESCRIPTOR - ppc_ldptr (code, ppc_r2, sizeof (gpointer), ppc_r11); - ppc_ldptr (code, ppc_r11, 0, ppc_r11); + ppc_ldptr (code, ppc_r2, sizeof (gpointer), ppc_r12); + ppc_ldptr (code, ppc_r12, 0, ppc_r12); #endif - ppc_mtctr (code, ppc_r11); + ppc_mtctr (code, ppc_r12); ppc_bcctrl (code, PPC_BR_ALWAYS, 0); } else { - ppc_load_func (code, ppc_r0, mono_ppc_throw_exception); - ppc_mtctr (code, ppc_r0); + ppc_load_func (code, PPC_CALL_REG, mono_ppc_throw_exception); + ppc_mtctr (code, PPC_CALL_REG); ppc_bcctrl (code, PPC_BR_ALWAYS, 0); } /* we should never reach this breakpoint */ diff --git a/mono/mini/exceptions-s390x.c b/mono/mini/exceptions-s390x.c index bc05005d01d..8ff629876f5 100644 --- a/mono/mini/exceptions-s390x.c +++ b/mono/mini/exceptions-s390x.c @@ -33,8 +33,6 @@ #define S390_THROWSTACK_ACCREGS (S390_THROWSTACK_FLTREGS+(16*sizeof(gdouble))) #define S390_THROWSTACK_SIZE (S390_THROWSTACK_ACCREGS+(16*sizeof(gint32))) -#define S390_REG_SAVE_R13 (S390_REG_SAVE_OFFSET+(7*sizeof(gulong))) - #define SZ_THROW 384 #define setup_context(ctx) diff --git a/mono/mini/exceptions-x86.c b/mono/mini/exceptions-x86.c index 5b91a476dac..d21a7413ad1 100755 --- a/mono/mini/exceptions-x86.c +++ b/mono/mini/exceptions-x86.c @@ -826,14 +826,12 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls, return TRUE; } - + if ((ji = mini_jit_info_table_find (domain, (gpointer)(*lmf)->eip, NULL))) { + frame->ji = ji; } else { - if (!((guint32)((*lmf)->previous_lmf) & 1)) - /* Top LMF entry */ + if (!(*lmf)->method) return FALSE; - g_assert_not_reached (); - /* Trampoline lmf frame */ frame->method = (*lmf)->method; } @@ -846,7 +844,6 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls, /* Adjust IP */ new_ctx->eip --; - frame->ji = ji; frame->type = FRAME_TYPE_MANAGED_TO_NATIVE; /* Check if we are in a trampoline LMF frame */ diff --git a/mono/mini/ir-emit.h b/mono/mini/ir-emit.h index 937ba3bd462..aac45186598 100644 --- a/mono/mini/ir-emit.h +++ b/mono/mini/ir-emit.h @@ -302,8 +302,6 @@ alloc_dreg (MonoCompile *cfg, MonoStackType stack_type) #define NEW_JIT_ICALL_ADDRCONST(cfg,dest,name) NEW_AOTCONST ((cfg), (dest), MONO_PATCH_INFO_JIT_ICALL_ADDR, (name)) -#define GET_VARINFO_INST(cfg,num) ((cfg)->varinfo [(num)]->inst) - #define NEW_VARLOAD(cfg,dest,var,vartype) do { \ MONO_INST_NEW ((cfg), (dest), OP_MOVE); \ (dest)->opcode = mono_type_to_regmove ((cfg), (vartype)); \ diff --git a/mono/mini/method-to-ir.c b/mono/mini/method-to-ir.c index a7e2e878590..3e1a3554c83 100755 --- a/mono/mini/method-to-ir.c +++ b/mono/mini/method-to-ir.c @@ -124,6 +124,13 @@ LOAD_ERROR; \ } while (0) +#define CHECK_CFG_ERROR do {\ + if (!mono_error_ok (&cfg->error)) { \ + mono_cfg_set_exception (cfg, MONO_EXCEPTION_MONO_ERROR); \ + goto mono_error_exit; \ + } \ + } while (0) + /* Determine whenever 'ins' represents a load of the 'this' argument */ #define MONO_CHECK_THIS(ins) (mono_method_signature (cfg->method)->hasthis && ((ins)->opcode == OP_MOVE) && ((ins)->sreg1 == cfg->args [0]->dreg)) @@ -6614,6 +6621,7 @@ initialize_array_data (MonoMethod *method, gboolean aot, unsigned char *ip, Mono * call void class [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array, valuetype [mscorlib]System.RuntimeFieldHandle) */ if (ip [0] == CEE_DUP && ip [1] == CEE_LDTOKEN && ip [5] == 0x4 && ip [6] == CEE_CALL) { + MonoError error; guint32 token = read32 (ip + 7); guint32 field_token = read32 (ip + 2); guint32 field_index = field_token & 0xffffff; @@ -6622,11 +6630,13 @@ initialize_array_data (MonoMethod *method, gboolean aot, unsigned char *ip, Mono int size = 0; MonoMethod *cmethod; MonoClass *dummy_class; - MonoClassField *field = mono_field_from_token (method->klass->image, field_token, &dummy_class, NULL); + MonoClassField *field = mono_field_from_token_checked (method->klass->image, field_token, &dummy_class, NULL, &error); int dummy_align; - if (!field) + if (!field) { + mono_error_cleanup (&error); /* FIXME don't swallow the error */ return NULL; + } *out_field_token = field_token; @@ -7554,11 +7564,8 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b skip_dead_blocks = !dont_verify; if (skip_dead_blocks) { - original_bb = bb = mono_basic_block_split (method, &error); - if (!mono_error_ok (&error)) { - mono_error_cleanup (&error); - UNVERIFIED; - } + original_bb = bb = mono_basic_block_split (method, &cfg->error); + CHECK_CFG_ERROR; g_assert (bb); } @@ -8178,7 +8185,8 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b } else if (constrained_call) { fsig = mono_method_signature (cmethod); } else { - fsig = mono_method_get_signature_full (cmethod, image, token, generic_context); + fsig = mono_method_get_signature_checked (cmethod, image, token, generic_context, &cfg->error); + CHECK_CFG_ERROR; } } @@ -9710,9 +9718,8 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b cmethod = mini_get_method (cfg, method, token, NULL, generic_context); if (!cmethod || mono_loader_get_last_error ()) LOAD_ERROR; - fsig = mono_method_get_signature (cmethod, image, token); - if (!fsig) - LOAD_ERROR; + fsig = mono_method_get_signature_checked (cmethod, image, token, NULL, &cfg->error); + CHECK_CFG_ERROR; mono_save_token_info (cfg, image, token, cmethod); @@ -10168,10 +10175,9 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b klass = field->parent; } else { - field = mono_field_from_token (image, token, &klass, generic_context); + field = mono_field_from_token_checked (image, token, &klass, generic_context, &cfg->error); + CHECK_CFG_ERROR; } - if (!field) - LOAD_ERROR; if (!dont_verify && !cfg->skip_visibility && !mono_method_can_access_field (method, field)) FIELD_ACCESS_FAILURE (method, field); mono_class_init (klass); @@ -10981,10 +10987,8 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b MONO_INST_NEW (cfg, ins, *ip); --sp; CHECK_OPSIZE (5); - klass = mono_class_get_and_inflate_typespec_checked (image, read32 (ip + 1), generic_context, &error); - mono_error_cleanup (&error); /* FIXME don't swallow the error */ + klass = mini_get_class (method, read32 (ip + 1), generic_context); CHECK_TYPELOAD (klass); - mono_class_init (klass); context_used = mini_class_check_context_used (cfg, klass); @@ -11022,10 +11026,8 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b MONO_INST_NEW (cfg, ins, *ip); --sp; CHECK_OPSIZE (5); - klass = mono_class_get_and_inflate_typespec_checked (image, read32 (ip + 1), generic_context, &error); - mono_error_cleanup (&error); /* FIXME don't swallow the error */ + klass = mini_get_class (method, read32 (ip + 1), generic_context); CHECK_TYPELOAD (klass); - mono_class_init (klass); context_used = mini_class_check_context_used (cfg, klass); @@ -12189,17 +12191,14 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b CHECK_OPSIZE (6); token = read32 (ip + 2); if (mono_metadata_token_table (token) == MONO_TABLE_TYPESPEC && !image_is_dynamic (method->klass->image) && !generic_context) { - MonoType *type = mono_type_create_from_typespec_checked (image, token, &error); - mono_error_cleanup (&error); /* FIXME don't swallow the error */ - if (!type) - UNVERIFIED; + MonoType *type = mono_type_create_from_typespec_checked (image, token, &cfg->error); + CHECK_CFG_ERROR; val = mono_type_size (type, &ialign); } else { - MonoClass *klass = mono_class_get_and_inflate_typespec_checked (image, token, generic_context, &error); - mono_error_cleanup (&error); /* FIXME don't swallow the error */ + MonoClass *klass = mini_get_class (method, token, generic_context); CHECK_TYPELOAD (klass); - mono_class_init (klass); + val = mono_type_size (&klass->byval_arg, &ialign); if (mini_is_gsharedvt_klass (cfg, klass)) @@ -12382,6 +12381,10 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b mono_print_code (cfg, "AFTER METHOD-TO-IR"); goto cleanup; + +mono_error_exit: + g_assert (!mono_error_ok (&cfg->error)); + goto cleanup; exception_exit: g_assert (cfg->exception_type != MONO_EXCEPTION_NONE); diff --git a/mono/mini/mini-amd64.c b/mono/mini/mini-amd64.c index 248a1bebb82..58e6ebecb8d 100755 --- a/mono/mini/mini-amd64.c +++ b/mono/mini/mini-amd64.c @@ -7693,14 +7693,11 @@ get_delegate_invoke_impl (gboolean has_target, guint32 param_count, guint32 *cod g_assert ((code - start) < 64); } - nacl_global_codeman_validate(&start, 64, &code); - - mono_debug_add_delegate_trampoline (start, code - start); + nacl_global_codeman_validate (&start, 64, &code); if (code_len) *code_len = code - start; - if (mono_jit_map_is_enabled ()) { char *buff; if (has_target) diff --git a/mono/mini/mini-amd64.h b/mono/mini/mini-amd64.h index dc43eb731a2..f5c5282a5e5 100755 --- a/mono/mini/mini-amd64.h +++ b/mono/mini/mini-amd64.h @@ -161,9 +161,6 @@ struct sigcontext { * reproduceable results for benchmarks */ #define MONO_ARCH_CODE_ALIGNMENT 32 -#define MONO_ARCH_RETREG1 X86_EAX -#define MONO_ARCH_RETREG2 X86_EDX - /*This is the max size of the locals area of a given frame. I think 1MB is a safe default for now*/ #define MONO_ARCH_MAX_FRAME_SIZE 0x100000 diff --git a/mono/mini/mini-arm.c b/mono/mini/mini-arm.c index 456a8b34250..343cb49b8dc 100644 --- a/mono/mini/mini-arm.c +++ b/mono/mini/mini-arm.c @@ -177,30 +177,7 @@ int mono_exc_esp_offset = 0; #define LDR_PC_VAL ((ARMCOND_AL << ARMCOND_SHIFT) | (1 << 26) | (0 << 22) | (1 << 20) | (15 << 12)) #define IS_LDR_PC(val) (((val) & LDR_MASK) == LDR_PC_VAL) -#define ADD_LR_PC_4 ((ARMCOND_AL << ARMCOND_SHIFT) | (1 << 25) | (1 << 23) | (ARMREG_PC << 16) | (ARMREG_LR << 12) | 4) -#define MOV_LR_PC ((ARMCOND_AL << ARMCOND_SHIFT) | (1 << 24) | (0xa << 20) | (ARMREG_LR << 12) | ARMREG_PC) //#define DEBUG_IMT 0 - -/* A variant of ARM_LDR_IMM which can handle large offsets */ -#define ARM_LDR_IMM_GENERAL(code, dreg, basereg, offset, scratch_reg) do { \ - if (arm_is_imm12 ((offset))) { \ - ARM_LDR_IMM (code, (dreg), (basereg), (offset)); \ - } else { \ - g_assert ((scratch_reg) != (basereg)); \ - code = mono_arm_emit_load_imm (code, (scratch_reg), (offset)); \ - ARM_LDR_REG_REG (code, (dreg), (basereg), (scratch_reg)); \ - } \ - } while (0) - -#define ARM_STR_IMM_GENERAL(code, dreg, basereg, offset, scratch_reg) do { \ - if (arm_is_imm12 ((offset))) { \ - ARM_STR_IMM (code, (dreg), (basereg), (offset)); \ - } else { \ - g_assert ((scratch_reg) != (basereg)); \ - code = mono_arm_emit_load_imm (code, (scratch_reg), (offset)); \ - ARM_STR_REG_REG (code, (dreg), (basereg), (scratch_reg)); \ - } \ - } while (0) #ifndef DISABLE_JIT static void mono_arch_compute_omit_fp (MonoCompile *cfg); @@ -1116,8 +1093,6 @@ mono_arch_get_allocatable_int_vars (MonoCompile *cfg) return vars; } -#define USE_EXTRA_TEMPS 0 - GList * mono_arch_get_global_int_regs (MonoCompile *cfg) { diff --git a/mono/mini/mini-arm.h b/mono/mini/mini-arm.h index f22514b61ef..e9f99014610 100644 --- a/mono/mini/mini-arm.h +++ b/mono/mini/mini-arm.h @@ -242,7 +242,6 @@ typedef struct MonoCompileArch { #define MONO_ARCH_EMULATE_DIV 1 #define MONO_ARCH_EMULATE_CONV_R8_UN 1 #define MONO_ARCH_EMULATE_MUL_OVF 1 -//#define MONO_ARCH_BIGMUL_INTRINS 1 #define ARM_FIRST_ARG_REG 0 #define ARM_LAST_ARG_REG 3 @@ -258,9 +257,6 @@ typedef struct MonoCompileArch { #define MONO_ARCH_HAVE_CREATE_DELEGATE_TRAMPOLINE #define MONO_ARCH_HAVE_GENERALIZED_IMT_THUNK 1 -#define ARM_NUM_REG_ARGS (ARM_LAST_ARG_REG-ARM_FIRST_ARG_REG+1) -#define ARM_NUM_REG_FPARGS 0 - #define MONO_ARCH_HAVE_FULL_AOT_TRAMPOLINES 1 #define MONO_ARCH_HAVE_DECOMPOSE_LONG_OPTS 1 diff --git a/mono/mini/mini-gc.c b/mono/mini/mini-gc.c index 6c616a5f6f2..fddca9c6c34 100644 --- a/mono/mini/mini-gc.c +++ b/mono/mini/mini-gc.c @@ -12,8 +12,8 @@ #include "mini-gc.h" #include -//#if 0 -#if defined(MONO_ARCH_GC_MAPS_SUPPORTED) +#if 0 +//#if defined(MONO_ARCH_GC_MAPS_SUPPORTED) #include #include @@ -436,6 +436,13 @@ static int callee_saved_regs [] = { ARMREG_V1, ARMREG_V2, ARMREG_V3, ARMREG_V4, static int callee_saved_regs [] = { }; #elif defined(TARGET_S390X) static int callee_saved_regs [] = { s390_r6, s390_r7, s390_r8, s390_r9, s390_r10, s390_r11, s390_r12, s390_r13, s390_r14 }; +#elif defined(TARGET_POWERPC64) && _CALL_ELF == 2 +static int callee_saved_regs [] = { + ppc_r13, ppc_r14, ppc_r15, ppc_r16, + ppc_r17, ppc_r18, ppc_r19, ppc_r20, + ppc_r21, ppc_r22, ppc_r23, ppc_r24, + ppc_r25, ppc_r26, ppc_r27, ppc_r28, + ppc_r29, ppc_r30, ppc_r31 }; #elif defined(TARGET_POWERPC) static int callee_saved_regs [] = { ppc_r6, ppc_r7, ppc_r8, ppc_r9, ppc_r10, ppc_r11, ppc_r12, ppc_r13, ppc_r14 }; #endif diff --git a/mono/mini/mini-ia64.h b/mono/mini/mini-ia64.h index 15bb596d414..928ccfbb535 100644 --- a/mono/mini/mini-ia64.h +++ b/mono/mini/mini-ia64.h @@ -41,9 +41,6 @@ #define MONO_ARCH_CODE_ALIGNMENT 16 -#define MONO_ARCH_RETREG1 IA64_R8 -#define MONO_ARCH_FRETREG1 8 - #define MONO_ARCH_SIGNAL_STACK_SIZE SIGSTKSZ struct MonoLMF { @@ -106,7 +103,6 @@ unw_dyn_region_info_t* mono_ia64_create_unwind_region (Ia64CodegenState *code); #define MONO_ARCH_EMULATE_LCONV_TO_R8_UN 1 #define MONO_ARCH_EMULATE_FREM 1 #define MONO_ARCH_EMULATE_MUL_DIV 1 -#define MONO_ARCH_EMULATE_LONG_MUL_OPTS 1 #define MONO_ARCH_NEED_DIV_CHECK 1 #define MONO_ARCH_HAVE_IS_INT_OVERFLOW 1 diff --git a/mono/mini/mini-mips.c b/mono/mini/mini-mips.c index 336f245f53c..277b4744a07 100644 --- a/mono/mini/mini-mips.c +++ b/mono/mini/mini-mips.c @@ -3305,8 +3305,8 @@ emit_reserve_param_area (MonoCompile *cfg, guint8 *code) if (ppc_is_imm16 (-size)) { ppc_stwu (code, ppc_r0, -size, ppc_sp); } else { - ppc_load (code, ppc_r11, -size); - ppc_stwux (code, ppc_r0, ppc_sp, ppc_r11); + ppc_load (code, ppc_r12, -size); + ppc_stwux (code, ppc_r0, ppc_sp, ppc_r12); } #endif return code; @@ -3327,8 +3327,8 @@ emit_unreserve_param_area (MonoCompile *cfg, guint8 *code) if (ppc_is_imm16 (size)) { ppc_stwu (code, ppc_r0, size, ppc_sp); } else { - ppc_load (code, ppc_r11, size); - ppc_stwux (code, ppc_r0, ppc_sp, ppc_r11); + ppc_load (code, ppc_r12, size); + ppc_stwux (code, ppc_r0, ppc_sp, ppc_r12); } #endif return code; @@ -3722,8 +3722,8 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) case OP_DIV_IMM: g_assert_not_reached (); #if 0 - ppc_load (code, ppc_r11, ins->inst_imm); - ppc_divwod (code, ins->dreg, ins->sreg1, ppc_r11); + ppc_load (code, ppc_r12, ins->inst_imm); + ppc_divwod (code, ins->dreg, ins->sreg1, ppc_r12); ppc_mfspr (code, ppc_r0, ppc_xer); ppc_andisd (code, ppc_r0, ppc_r0, (1<<14)); /* FIXME: use OverflowException for 0x80000000/-1 */ diff --git a/mono/mini/mini-mips.h b/mono/mini/mini-mips.h index d8d769130c4..1d84ef867b0 100644 --- a/mono/mini/mini-mips.h +++ b/mono/mini/mini-mips.h @@ -231,7 +231,6 @@ typedef struct MonoCompileArch { #define MONO_ARCH_EMULATE_LCONV_TO_R4 1 #define MONO_ARCH_EMULATE_LCONV_TO_R8_UN 1 #define MONO_ARCH_EMULATE_FREM 1 -#define MONO_ARCH_BIGMUL_INTRINS 1 #endif #if SIZEOF_REGISTER == 8 @@ -330,8 +329,6 @@ typedef struct { #undef DEBUG_EXCEPTIONS -#define MONO_ZERO_REG mips_zero - #define MONO_EMIT_NEW_MIPS_COND_EXC(cfg,cond,sr1,sr2,name) do { \ MonoInst *inst; \ MONO_INST_NEW ((cfg), (inst), cond); \ diff --git a/mono/mini/mini-posix.c b/mono/mini/mini-posix.c index 1889eeaeaea..473e4c4a1fe 100644 --- a/mono/mini/mini-posix.c +++ b/mono/mini/mini-posix.c @@ -395,6 +395,9 @@ MONO_SIG_HANDLER_FUNC (static, sigprof_signal_handler) if (mono_thread_info_get_small_id () == -1) return; //an non-attached thread got the signal + if (!mono_domain_get () || !mono_native_tls_get_value (mono_jit_tls_id)) + return; //thread in the process of dettaching + hp_save_index = mono_hazard_pointer_save_for_signal_handler (); /* If we can't consume a profiling request it means we're the initiator. */ @@ -721,7 +724,11 @@ mono_runtime_setup_stat_profiler (void) pid_t mono_runtime_syscall_fork () { -#if defined(SYS_fork) +#if defined(PLATFORM_ANDROID) + /* SYS_fork is defined to be __NR_fork which is not defined in some ndk versions */ + g_assert_not_reached (); + return 0; +#elif defined(SYS_fork) return (pid_t) syscall (SYS_fork); #else g_assert_not_reached (); diff --git a/mono/mini/mini-ppc.c b/mono/mini/mini-ppc.c index 7117bb1cefa..907fe766c9c 100644 --- a/mono/mini/mini-ppc.c +++ b/mono/mini/mini-ppc.c @@ -104,11 +104,11 @@ offsets_from_pthread_key (guint32 key, int *offset2) /* FIXME: ensure the sc call preserves all but r3 */ #define emit_darwing4_tls(code,dreg,key) do {\ int off1 = 0x48 + key * sizeof (gpointer); \ - if ((dreg) != ppc_r3) ppc_mr ((code), ppc_r11, ppc_r3); \ + if ((dreg) != ppc_r3) ppc_mr ((code), ppc_r12, ppc_r3); \ ppc_li ((code), ppc_r0, 0x7FF2); \ ppc_sc ((code)); \ ppc_lwz ((code), (dreg), off1, ppc_r3); \ - if ((dreg) != ppc_r3) ppc_mr ((code), ppc_r3, ppc_r11); \ + if ((dreg) != ppc_r3) ppc_mr ((code), ppc_r3, ppc_r12); \ } while (0); #ifdef PPC_THREAD_PTR_REG @@ -119,8 +119,8 @@ offsets_from_pthread_key (guint32 key, int *offset2) ppc_ldptr ((code), (dreg), off1, PPC_THREAD_PTR_REG); \ } else { \ int off3 = (off2 + 1) > 1; \ - ppc_addis ((code), ppc_r11, PPC_THREAD_PTR_REG, off3); \ - ppc_ldptr ((code), (dreg), off1, ppc_r11); \ + ppc_addis ((code), ppc_r12, PPC_THREAD_PTR_REG, off3); \ + ppc_ldptr ((code), (dreg), off1, ppc_r12); \ } \ } while (0); #else @@ -191,29 +191,29 @@ emit_memcpy (guint8 *code, int size, int dreg, int doffset, int sreg, int soffse ppc_load (code, ppc_r0, shifted); ppc_mtctr (code, ppc_r0); - //g_assert (sreg == ppc_r11); - ppc_addi (code, ppc_r12, dreg, (doffset - sizeof (gpointer))); - ppc_addi (code, ppc_r11, sreg, (soffset - sizeof (gpointer))); + //g_assert (sreg == ppc_r12); + ppc_addi (code, ppc_r11, dreg, (doffset - sizeof (gpointer))); + ppc_addi (code, ppc_r12, sreg, (soffset - sizeof (gpointer))); copy_loop_start = code; - ppc_ldptr_update (code, ppc_r0, (unsigned int)sizeof (gpointer), ppc_r11); - ppc_stptr_update (code, ppc_r0, (unsigned int)sizeof (gpointer), ppc_r12); + ppc_ldptr_update (code, ppc_r0, (unsigned int)sizeof (gpointer), ppc_r12); + ppc_stptr_update (code, ppc_r0, (unsigned int)sizeof (gpointer), ppc_r11); copy_loop_jump = code; ppc_bc (code, PPC_BR_DEC_CTR_NONZERO, 0, 0); ppc_patch (copy_loop_jump, copy_loop_start); size -= shifted * sizeof (gpointer); doffset = soffset = 0; - dreg = ppc_r12; + dreg = ppc_r11; } #ifdef __mono_ppc64__ /* the hardware has multiple load/store units and the move is long enough to use more then one regiester, then use load/load/store/store to execute 2 instructions per cycle. */ - if ((cpu_hw_caps & PPC_MULTIPLE_LS_UNITS) && (dreg != ppc_r12) && (sreg != ppc_r12)) { + if ((cpu_hw_caps & PPC_MULTIPLE_LS_UNITS) && (dreg != ppc_r11) && (sreg != ppc_r11)) { while (size >= 16) { ppc_ldptr (code, ppc_r0, soffset, sreg); - ppc_ldptr (code, ppc_r12, soffset+8, sreg); + ppc_ldptr (code, ppc_r11, soffset+8, sreg); ppc_stptr (code, ppc_r0, doffset, dreg); - ppc_stptr (code, ppc_r12, doffset+8, dreg); + ppc_stptr (code, ppc_r11, doffset+8, dreg); size -= 16; soffset += 16; doffset += 16; @@ -227,12 +227,12 @@ emit_memcpy (guint8 *code, int size, int dreg, int doffset, int sreg, int soffse doffset += 8; } #else - if ((cpu_hw_caps & PPC_MULTIPLE_LS_UNITS) && (dreg != ppc_r12) && (sreg != ppc_r12)) { + if ((cpu_hw_caps & PPC_MULTIPLE_LS_UNITS) && (dreg != ppc_r11) && (sreg != ppc_r11)) { while (size >= 8) { ppc_lwz (code, ppc_r0, soffset, sreg); - ppc_lwz (code, ppc_r12, soffset+4, sreg); + ppc_lwz (code, ppc_r11, soffset+4, sreg); ppc_stw (code, ppc_r0, doffset, dreg); - ppc_stw (code, ppc_r12, doffset+4, dreg); + ppc_stw (code, ppc_r11, doffset+4, dreg); size -= 8; soffset += 8; doffset += 8; @@ -744,7 +744,7 @@ mono_arch_get_global_int_regs (MonoCompile *cfg) for (i = 14; i < top; ++i) { /* * Reserve r29 for holding the vtable address for virtual calls in AOT mode, - * since the trampolines can clobber r11. + * since the trampolines can clobber r12. */ if (!(cfg->compile_aot && i == 29)) regs = g_list_prepend (regs, GUINT_TO_POINTER (i)); @@ -1789,8 +1789,8 @@ mono_arch_instrument_prolog (MonoCompile *cfg, void *func, void *p, gboolean ena ppc_load_ptr (code, ppc_r3, cfg->method); ppc_li (code, ppc_r4, 0); /* NULL ebp for now */ - ppc_load_func (code, ppc_r0, func); - ppc_mtlr (code, ppc_r0); + ppc_load_func (code, PPC_CALL_REG, func); + ppc_mtlr (code, PPC_CALL_REG); ppc_blrl (code); return code; } @@ -1887,8 +1887,8 @@ mono_arch_instrument_epilog_full (MonoCompile *cfg, void *func, void *p, gboolea } ppc_load_ptr (code, ppc_r3, cfg->method); - ppc_load_func (code, ppc_r0, func); - ppc_mtlr (code, ppc_r0); + ppc_load_func (code, PPC_CALL_REG, func); + ppc_mtlr (code, PPC_CALL_REG); ppc_blrl (code); switch (save_mode) { @@ -2822,14 +2822,14 @@ handle_thunk (int absolute, guchar *code, const guchar *target) { static void patch_ins (guint8 *code, guint32 ins) { - *(guint32*)code = GUINT32_TO_BE (ins); + *(guint32*)code = ins; mono_arch_flush_icache (code, 4); } void ppc_patch_full (guchar *code, const guchar *target, gboolean is_fd) { - guint32 ins = GUINT32_FROM_BE (*(guint32*)code); + guint32 ins = *(guint32*)code; guint32 prim = ins >> 26; guint32 ovf; @@ -2912,7 +2912,13 @@ ppc_patch_full (guchar *code, const guchar *target, gboolean is_fd) else code -= 24; } else { - if (ppc_is_load_op (seq [5]) || ppc_opcode (seq [5]) == 31) /* ld || lwz || mr */ + if (ppc_is_load_op (seq [5]) +#ifdef PPC_USES_FUNCTION_DESCRIPTOR + /* With function descs we need to do more careful + matches. */ + || ppc_opcode (seq [5]) == 31 /* ld || lwz || mr */ +#endif + ) branch_ins = seq + 8; else branch_ins = seq + 6; @@ -2927,7 +2933,7 @@ ppc_patch_full (guchar *code, const guchar *target, gboolean is_fd) if (!is_fd) { guint8 *buf = (guint8*)&seq [5]; - ppc_mr (buf, ppc_r0, ppc_r11); + ppc_mr (buf, PPC_CALL_REG, ppc_r12); ppc_nop (buf); } } else { @@ -2936,8 +2942,12 @@ ppc_patch_full (guchar *code, const guchar *target, gboolean is_fd) } /* FIXME: make this thread safe */ - /* FIXME: we're assuming we're using r11 here */ - ppc_load_ptr_sequence (code, ppc_r11, target); +#ifdef PPC_USES_FUNCTION_DESCRIPTOR + /* FIXME: we're assuming we're using r12 here */ + ppc_load_ptr_sequence (code, ppc_r12, target); +#else + ppc_load_ptr_sequence (code, PPC_CALL_REG, target); +#endif mono_arch_flush_icache ((guint8*)seq, 28); #else guint32 *seq; @@ -2952,8 +2962,8 @@ ppc_patch_full (guchar *code, const guchar *target, gboolean is_fd) g_assert ((seq [2] >> 26) == 31); g_assert (seq [3] == 0x4e800021 || seq [3] == 0x4e800020 || seq [3] == 0x4e800420); /* FIXME: make this thread safe */ - ppc_lis (code, ppc_r0, (guint32)(target) >> 16); - ppc_ori (code, ppc_r0, ppc_r0, (guint32)(target) & 0xffff); + ppc_lis (code, PPC_CALL_REG, (guint32)(target) >> 16); + ppc_ori (code, PPC_CALL_REG, PPC_CALL_REG, (guint32)(target) & 0xffff); mono_arch_flush_icache (code - 8, 8); #endif } else { @@ -3010,8 +3020,8 @@ emit_reserve_param_area (MonoCompile *cfg, guint8 *code) if (ppc_is_imm16 (-size)) { ppc_stptr_update (code, ppc_r0, -size, ppc_sp); } else { - ppc_load (code, ppc_r11, -size); - ppc_stptr_update_indexed (code, ppc_r0, ppc_sp, ppc_r11); + ppc_load (code, ppc_r12, -size); + ppc_stptr_update_indexed (code, ppc_r0, ppc_sp, ppc_r12); } return code; @@ -3032,8 +3042,8 @@ emit_unreserve_param_area (MonoCompile *cfg, guint8 *code) if (ppc_is_imm16 (size)) { ppc_stptr_update (code, ppc_r0, size, ppc_sp); } else { - ppc_load (code, ppc_r11, size); - ppc_stptr_update_indexed (code, ppc_r0, ppc_sp, ppc_r11); + ppc_load (code, ppc_r12, size); + ppc_stptr_update_indexed (code, ppc_r0, ppc_sp, ppc_r12); } return code; @@ -3110,8 +3120,8 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) * a breakpoint is hit will step to the next IL offset. */ if (ins->flags & MONO_INST_SINGLE_STEP_LOC) { - ppc_load (code, ppc_r11, (gsize)ss_trigger_page); - ppc_ldptr (code, ppc_r11, 0, ppc_r11); + ppc_load (code, ppc_r12, (gsize)ss_trigger_page); + ppc_ldptr (code, ppc_r12, 0, ppc_r12); } mono_add_seq_point (cfg, bb, ins, code - cfg->native_code); @@ -3145,8 +3155,8 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) ppc_stb (code, ins->sreg1, ins->inst_offset, ins->inst_destbasereg); } else { if (ppc_is_imm32 (ins->inst_offset)) { - ppc_addis (code, ppc_r12, ins->inst_destbasereg, ppc_ha(ins->inst_offset)); - ppc_stb (code, ins->sreg1, ins->inst_offset, ppc_r12); + ppc_addis (code, ppc_r11, ins->inst_destbasereg, ppc_ha(ins->inst_offset)); + ppc_stb (code, ins->sreg1, ins->inst_offset, ppc_r11); } else { ppc_load (code, ppc_r0, ins->inst_offset); ppc_stbx (code, ins->sreg1, ins->inst_destbasereg, ppc_r0); @@ -3158,8 +3168,8 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) ppc_sth (code, ins->sreg1, ins->inst_offset, ins->inst_destbasereg); } else { if (ppc_is_imm32 (ins->inst_offset)) { - ppc_addis (code, ppc_r12, ins->inst_destbasereg, ppc_ha(ins->inst_offset)); - ppc_sth (code, ins->sreg1, ins->inst_offset, ppc_r12); + ppc_addis (code, ppc_r11, ins->inst_destbasereg, ppc_ha(ins->inst_offset)); + ppc_sth (code, ins->sreg1, ins->inst_offset, ppc_r11); } else { ppc_load (code, ppc_r0, ins->inst_offset); ppc_sthx (code, ins->sreg1, ins->inst_destbasereg, ppc_r0); @@ -3171,8 +3181,8 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) ppc_stptr (code, ins->sreg1, ins->inst_offset, ins->inst_destbasereg); } else { if (ppc_is_imm32 (ins->inst_offset)) { - ppc_addis (code, ppc_r12, ins->inst_destbasereg, ppc_ha(ins->inst_offset)); - ppc_stptr (code, ins->sreg1, ins->inst_offset, ppc_r12); + ppc_addis (code, ppc_r11, ins->inst_destbasereg, ppc_ha(ins->inst_offset)); + ppc_stptr (code, ins->sreg1, ins->inst_offset, ppc_r11); } else { ppc_load (code, ppc_r0, ins->inst_offset); ppc_stptr_indexed (code, ins->sreg1, ins->inst_destbasereg, ppc_r0); @@ -3374,8 +3384,8 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_INTERNAL_METHOD, (gpointer)"mono_break"); if ((FORCE_INDIR_CALL || cfg->method->dynamic) && !cfg->compile_aot) { - ppc_load_func (code, ppc_r0, 0); - ppc_mtlr (code, ppc_r0); + ppc_load_func (code, PPC_CALL_REG, 0); + ppc_mtlr (code, PPC_CALL_REG); ppc_blrl (code); } else { ppc_bl (code, 0); @@ -3728,7 +3738,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) */ g_assert (!cfg->method->save_lmf); /* - * Note: we can use ppc_r11 here because it is dead anyway: + * Note: we can use ppc_r12 here because it is dead anyway: * we're leaving the method. */ if (1 || cfg->flags & MONO_CFG_HAS_CALLS) { @@ -3736,26 +3746,26 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) if (ppc_is_imm16 (ret_offset)) { ppc_ldptr (code, ppc_r0, ret_offset, cfg->frame_reg); } else { - ppc_load (code, ppc_r11, ret_offset); - ppc_ldptr_indexed (code, ppc_r0, cfg->frame_reg, ppc_r11); + ppc_load (code, ppc_r12, ret_offset); + ppc_ldptr_indexed (code, ppc_r0, cfg->frame_reg, ppc_r12); } ppc_mtlr (code, ppc_r0); } if (ppc_is_imm16 (cfg->stack_usage)) { - ppc_addi (code, ppc_r11, cfg->frame_reg, cfg->stack_usage); + ppc_addi (code, ppc_r12, cfg->frame_reg, cfg->stack_usage); } else { /* cfg->stack_usage is an int, so we can use * an addis/addi sequence here even in 64-bit. */ - ppc_addis (code, ppc_r11, cfg->frame_reg, ppc_ha(cfg->stack_usage)); - ppc_addi (code, ppc_r11, ppc_r11, cfg->stack_usage); + ppc_addis (code, ppc_r12, cfg->frame_reg, ppc_ha(cfg->stack_usage)); + ppc_addi (code, ppc_r12, ppc_r12, cfg->stack_usage); } if (!cfg->method->save_lmf) { pos = 0; for (i = 31; i >= 13; --i) { if (cfg->used_int_regs & (1 << i)) { pos += sizeof (gpointer); - ppc_ldptr (code, i, -pos, ppc_r11); + ppc_ldptr (code, i, -pos, ppc_r12); } } } else { @@ -3764,27 +3774,27 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) /* Copy arguments on the stack to our argument area */ if (call->stack_usage) { - code = emit_memcpy (code, call->stack_usage, ppc_r11, PPC_STACK_PARAM_OFFSET, ppc_sp, PPC_STACK_PARAM_OFFSET); - /* r11 was clobbered */ + code = emit_memcpy (code, call->stack_usage, ppc_r12, PPC_STACK_PARAM_OFFSET, ppc_sp, PPC_STACK_PARAM_OFFSET); + /* r12 was clobbered */ g_assert (cfg->frame_reg == ppc_sp); if (ppc_is_imm16 (cfg->stack_usage)) { - ppc_addi (code, ppc_r11, cfg->frame_reg, cfg->stack_usage); + ppc_addi (code, ppc_r12, cfg->frame_reg, cfg->stack_usage); } else { /* cfg->stack_usage is an int, so we can use * an addis/addi sequence here even in 64-bit. */ - ppc_addis (code, ppc_r11, cfg->frame_reg, ppc_ha(cfg->stack_usage)); - ppc_addi (code, ppc_r11, ppc_r11, cfg->stack_usage); + ppc_addis (code, ppc_r12, cfg->frame_reg, ppc_ha(cfg->stack_usage)); + ppc_addi (code, ppc_r12, ppc_r12, cfg->stack_usage); } } - ppc_mr (code, ppc_sp, ppc_r11); + ppc_mr (code, ppc_sp, ppc_r12); mono_add_patch_info (cfg, (guint8*) code - cfg->native_code, MONO_PATCH_INFO_METHOD_JUMP, call->method); if (cfg->compile_aot) { /* arch_emit_got_access () patches this */ ppc_load32 (code, ppc_r0, 0); #ifdef PPC_USES_FUNCTION_DESCRIPTOR - ppc_ldptr_indexed (code, ppc_r11, ppc_r30, ppc_r0); - ppc_ldptr (code, ppc_r0, 0, ppc_r11); + ppc_ldptr_indexed (code, ppc_r12, ppc_r30, ppc_r0); + ppc_ldptr (code, ppc_r0, 0, ppc_r12); #else ppc_ldptr_indexed (code, ppc_r0, ppc_r30, ppc_r0); #endif @@ -3822,8 +3832,8 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) else mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_ABS, call->fptr); if ((FORCE_INDIR_CALL || cfg->method->dynamic) && !cfg->compile_aot) { - ppc_load_func (code, ppc_r0, 0); - ppc_mtlr (code, ppc_r0); + ppc_load_func (code, PPC_CALL_REG, 0); + ppc_mtlr (code, PPC_CALL_REG); ppc_blrl (code); } else { ppc_bl (code, 0); @@ -3856,7 +3866,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) case OP_VCALL2_MEMBASE: case OP_VOIDCALL_MEMBASE: case OP_CALL_MEMBASE: - if (cfg->compile_aot && ins->sreg1 == ppc_r11) { + if (cfg->compile_aot && ins->sreg1 == ppc_r12) { /* The trampolines clobber this */ ppc_mr (code, ppc_r29, ins->sreg1); ppc_ldptr (code, ppc_r0, ins->inst_offset, ppc_r29); @@ -3874,9 +3884,9 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) int alloca_waste = PPC_STACK_PARAM_OFFSET + cfg->param_area + 31; int area_offset = alloca_waste; area_offset &= ~31; - ppc_addi (code, ppc_r11, ins->sreg1, alloca_waste + 31); + ppc_addi (code, ppc_r12, ins->sreg1, alloca_waste + 31); /* FIXME: should be calculated from MONO_ARCH_FRAME_ALIGNMENT */ - ppc_clear_right_imm (code, ppc_r11, ppc_r11, 4); + ppc_clear_right_imm (code, ppc_r12, ppc_r12, 4); /* use ctr to store the number of words to 0 if needed */ if (ins->flags & MONO_INST_INIT) { /* we zero 4 bytes at a time: @@ -3889,8 +3899,8 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) ppc_mtctr (code, ppc_r0); } ppc_ldptr (code, ppc_r0, 0, ppc_sp); - ppc_neg (code, ppc_r11, ppc_r11); - ppc_stptr_update_indexed (code, ppc_r0, ppc_sp, ppc_r11); + ppc_neg (code, ppc_r12, ppc_r12); + ppc_stptr_update_indexed (code, ppc_r0, ppc_sp, ppc_r12); /* FIXME: make this loop work in 8 byte increments on PPC64 */ @@ -3900,9 +3910,9 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) * run at least once */ ppc_addi (code, ins->dreg, ppc_sp, (area_offset - 8)); - ppc_li (code, ppc_r11, 0); + ppc_li (code, ppc_r12, 0); zero_loop_start = code; - ppc_stwu (code, ppc_r11, 4, ins->dreg); + ppc_stwu (code, ppc_r12, 4, ins->dreg); zero_loop_jump = code; ppc_bc (code, PPC_BR_DEC_CTR_NONZERO, 0, 0); ppc_patch (zero_loop_jump, zero_loop_start); @@ -3916,8 +3926,8 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_INTERNAL_METHOD, (gpointer)"mono_arch_throw_exception"); if ((FORCE_INDIR_CALL || cfg->method->dynamic) && !cfg->compile_aot) { - ppc_load_func (code, ppc_r0, 0); - ppc_mtlr (code, ppc_r0); + ppc_load_func (code, PPC_CALL_REG, 0); + ppc_mtlr (code, PPC_CALL_REG); ppc_blrl (code); } else { ppc_bl (code, 0); @@ -3930,8 +3940,8 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_INTERNAL_METHOD, (gpointer)"mono_arch_rethrow_exception"); if ((FORCE_INDIR_CALL || cfg->method->dynamic) && !cfg->compile_aot) { - ppc_load_func (code, ppc_r0, 0); - ppc_mtlr (code, ppc_r0); + ppc_load_func (code, PPC_CALL_REG, 0); + ppc_mtlr (code, PPC_CALL_REG); ppc_blrl (code); } else { ppc_bl (code, 0); @@ -3946,8 +3956,8 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) if (ppc_is_imm16 (spvar->inst_offset)) { ppc_stptr (code, ppc_r0, spvar->inst_offset, spvar->inst_basereg); } else { - ppc_load (code, ppc_r11, spvar->inst_offset); - ppc_stptr_indexed (code, ppc_r0, ppc_r11, spvar->inst_basereg); + ppc_load (code, ppc_r12, spvar->inst_offset); + ppc_stptr_indexed (code, ppc_r0, ppc_r12, spvar->inst_basereg); } break; } @@ -3960,8 +3970,8 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) if (ppc_is_imm16 (spvar->inst_offset)) { ppc_ldptr (code, ppc_r0, spvar->inst_offset, spvar->inst_basereg); } else { - ppc_load (code, ppc_r11, spvar->inst_offset); - ppc_ldptr_indexed (code, ppc_r0, spvar->inst_basereg, ppc_r11); + ppc_load (code, ppc_r12, spvar->inst_offset); + ppc_ldptr_indexed (code, ppc_r0, spvar->inst_basereg, ppc_r12); } ppc_mtlr (code, ppc_r0); ppc_blr (code); @@ -4067,11 +4077,11 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) /* FIXME: Optimize this */ ppc_bl (code, 1); - ppc_mflr (code, ppc_r11); + ppc_mflr (code, ppc_r12); ppc_b (code, 3); *(double*)code = *(double*)ins->inst_p0; code += 8; - ppc_lfd (code, ins->dreg, 8, ppc_r11); + ppc_lfd (code, ins->dreg, 8, ppc_r12); break; case OP_R4CONST: g_assert_not_reached (); @@ -4081,8 +4091,8 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) ppc_stfd (code, ins->sreg1, ins->inst_offset, ins->inst_destbasereg); } else { if (ppc_is_imm32 (ins->inst_offset)) { - ppc_addis (code, ppc_r12, ins->inst_destbasereg, ppc_ha(ins->inst_offset)); - ppc_stfd (code, ins->sreg1, ins->inst_offset, ppc_r12); + ppc_addis (code, ppc_r11, ins->inst_destbasereg, ppc_ha(ins->inst_offset)); + ppc_stfd (code, ins->sreg1, ins->inst_offset, ppc_r11); } else { ppc_load (code, ppc_r0, ins->inst_offset); ppc_stfdx (code, ins->sreg1, ins->inst_destbasereg, ppc_r0); @@ -4094,8 +4104,8 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) ppc_lfd (code, ins->dreg, ins->inst_offset, ins->inst_basereg); } else { if (ppc_is_imm32 (ins->inst_offset)) { - ppc_addis (code, ppc_r12, ins->inst_destbasereg, ppc_ha(ins->inst_offset)); - ppc_lfd (code, ins->dreg, ins->inst_offset, ppc_r12); + ppc_addis (code, ppc_r11, ins->inst_destbasereg, ppc_ha(ins->inst_offset)); + ppc_lfd (code, ins->dreg, ins->inst_offset, ppc_r11); } else { ppc_load (code, ppc_r0, ins->inst_offset); ppc_lfdx (code, ins->dreg, ins->inst_destbasereg, ppc_r0); @@ -4108,8 +4118,8 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) ppc_stfs (code, ins->sreg1, ins->inst_offset, ins->inst_destbasereg); } else { if (ppc_is_imm32 (ins->inst_offset)) { - ppc_addis (code, ppc_r12, ins->inst_destbasereg, ppc_ha(ins->inst_offset)); - ppc_stfs (code, ins->sreg1, ins->inst_offset, ppc_r12); + ppc_addis (code, ppc_r11, ins->inst_destbasereg, ppc_ha(ins->inst_offset)); + ppc_stfs (code, ins->sreg1, ins->inst_offset, ppc_r11); } else { ppc_load (code, ppc_r0, ins->inst_offset); ppc_stfsx (code, ins->sreg1, ins->inst_destbasereg, ppc_r0); @@ -4121,8 +4131,8 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) ppc_lfs (code, ins->dreg, ins->inst_offset, ins->inst_basereg); } else { if (ppc_is_imm32 (ins->inst_offset)) { - ppc_addis (code, ppc_r12, ins->inst_destbasereg, ppc_ha(ins->inst_offset)); - ppc_lfs (code, ins->dreg, ins->inst_offset, ppc_r12); + ppc_addis (code, ppc_r11, ins->inst_destbasereg, ppc_ha(ins->inst_offset)); + ppc_lfs (code, ins->dreg, ins->inst_offset, ppc_r11); } else { ppc_load (code, ppc_r0, ins->inst_offset); ppc_lfsx (code, ins->dreg, ins->inst_destbasereg, ppc_r0); @@ -4512,6 +4522,16 @@ mono_arch_register_lowlevel_calls (void) } #ifdef __mono_ppc64__ +#ifdef _LITTLE_ENDIAN +#define patch_load_sequence(ip,val) do {\ + guint16 *__load = (guint16*)(ip); \ + g_assert (sizeof (val) == sizeof (gsize)); \ + __load [0] = (((guint64)(gsize)(val)) >> 48) & 0xffff; \ + __load [2] = (((guint64)(gsize)(val)) >> 32) & 0xffff; \ + __load [6] = (((guint64)(gsize)(val)) >> 16) & 0xffff; \ + __load [8] = ((guint64)(gsize)(val)) & 0xffff; \ + } while (0) +#elif defined _BIG_ENDIAN #define patch_load_sequence(ip,val) do {\ guint16 *__load = (guint16*)(ip); \ g_assert (sizeof (val) == sizeof (gsize)); \ @@ -4521,6 +4541,9 @@ mono_arch_register_lowlevel_calls (void) __load [9] = ((guint64)(gsize)(val)) & 0xffff; \ } while (0) #else +#error huh? No endianess defined by compiler +#endif +#else #define patch_load_sequence(ip,val) do {\ guint16 *__lis_ori = (guint16*)(ip); \ __lis_ori [1] = (((gulong)(val)) >> 16) & 0xffff; \ @@ -4731,12 +4754,12 @@ mono_arch_emit_prolog (MonoCompile *cfg) code = save_registers (cfg, code, alloc_size - pos, ppc_sp, method->save_lmf, cfg->used_int_regs, cfa_offset); } else { if (pos) - ppc_addi (code, ppc_r11, ppc_sp, -pos); + ppc_addi (code, ppc_r12, ppc_sp, -pos); ppc_load (code, ppc_r0, -alloc_size); ppc_str_update_indexed (code, ppc_sp, ppc_sp, ppc_r0); cfa_offset = alloc_size; mono_emit_unwind_op_def_cfa_offset (cfg, code, alloc_size); - code = save_registers (cfg, code, 0, ppc_r11, method->save_lmf, cfg->used_int_regs, cfa_offset); + code = save_registers (cfg, code, 0, ppc_r12, method->save_lmf, cfg->used_int_regs, cfa_offset); } } if (cfg->frame_reg != ppc_sp) { @@ -4782,8 +4805,8 @@ mono_arch_emit_prolog (MonoCompile *cfg) if (ppc_is_imm16 (inst->inst_offset)) { ppc_stptr (code, ainfo->reg, inst->inst_offset, inst->inst_basereg); } else { - ppc_load (code, ppc_r11, inst->inst_offset); - ppc_stptr_indexed (code, ainfo->reg, ppc_r11, inst->inst_basereg); + ppc_load (code, ppc_r12, inst->inst_offset); + ppc_stptr_indexed (code, ainfo->reg, ppc_r12, inst->inst_basereg); } } @@ -4800,8 +4823,8 @@ mono_arch_emit_prolog (MonoCompile *cfg) else if (ainfo->regtype == RegTypeFP) ppc_fmr (code, inst->dreg, ainfo->reg); else if (ainfo->regtype == RegTypeBase) { - ppc_ldr (code, ppc_r11, 0, ppc_sp); - ppc_ldptr (code, inst->dreg, ainfo->offset, ppc_r11); + ppc_ldr (code, ppc_r12, 0, ppc_sp); + ppc_ldptr (code, inst->dreg, ainfo->offset, ppc_r12); } else g_assert_not_reached (); @@ -4816,11 +4839,11 @@ mono_arch_emit_prolog (MonoCompile *cfg) ppc_stb (code, ainfo->reg, inst->inst_offset, inst->inst_basereg); } else { if (ppc_is_imm32 (inst->inst_offset)) { - ppc_addis (code, ppc_r11, inst->inst_basereg, ppc_ha(inst->inst_offset)); - ppc_stb (code, ainfo->reg, inst->inst_offset, ppc_r11); + ppc_addis (code, ppc_r12, inst->inst_basereg, ppc_ha(inst->inst_offset)); + ppc_stb (code, ainfo->reg, inst->inst_offset, ppc_r12); } else { - ppc_load (code, ppc_r11, inst->inst_offset); - ppc_stbx (code, ainfo->reg, inst->inst_basereg, ppc_r11); + ppc_load (code, ppc_r12, inst->inst_offset); + ppc_stbx (code, ainfo->reg, inst->inst_basereg, ppc_r12); } } break; @@ -4829,11 +4852,11 @@ mono_arch_emit_prolog (MonoCompile *cfg) ppc_sth (code, ainfo->reg, inst->inst_offset, inst->inst_basereg); } else { if (ppc_is_imm32 (inst->inst_offset)) { - ppc_addis (code, ppc_r11, inst->inst_basereg, ppc_ha(inst->inst_offset)); - ppc_sth (code, ainfo->reg, inst->inst_offset, ppc_r11); + ppc_addis (code, ppc_r12, inst->inst_basereg, ppc_ha(inst->inst_offset)); + ppc_sth (code, ainfo->reg, inst->inst_offset, ppc_r12); } else { - ppc_load (code, ppc_r11, inst->inst_offset); - ppc_sthx (code, ainfo->reg, inst->inst_basereg, ppc_r11); + ppc_load (code, ppc_r12, inst->inst_offset); + ppc_sthx (code, ainfo->reg, inst->inst_basereg, ppc_r12); } } break; @@ -4843,11 +4866,11 @@ mono_arch_emit_prolog (MonoCompile *cfg) ppc_stw (code, ainfo->reg, inst->inst_offset, inst->inst_basereg); } else { if (ppc_is_imm32 (inst->inst_offset)) { - ppc_addis (code, ppc_r11, inst->inst_basereg, ppc_ha(inst->inst_offset)); - ppc_stw (code, ainfo->reg, inst->inst_offset, ppc_r11); + ppc_addis (code, ppc_r12, inst->inst_basereg, ppc_ha(inst->inst_offset)); + ppc_stw (code, ainfo->reg, inst->inst_offset, ppc_r12); } else { - ppc_load (code, ppc_r11, inst->inst_offset); - ppc_stwx (code, ainfo->reg, inst->inst_basereg, ppc_r11); + ppc_load (code, ppc_r12, inst->inst_offset); + ppc_stwx (code, ainfo->reg, inst->inst_basereg, ppc_r12); } } break; @@ -4855,8 +4878,8 @@ mono_arch_emit_prolog (MonoCompile *cfg) if (ppc_is_imm16 (inst->inst_offset)) { ppc_str (code, ainfo->reg, inst->inst_offset, inst->inst_basereg); } else { - ppc_load (code, ppc_r11, inst->inst_offset); - ppc_str_indexed (code, ainfo->reg, ppc_r11, inst->inst_basereg); + ppc_load (code, ppc_r12, inst->inst_offset); + ppc_str_indexed (code, ainfo->reg, ppc_r12, inst->inst_basereg); } break; #else @@ -4865,10 +4888,10 @@ mono_arch_emit_prolog (MonoCompile *cfg) ppc_stw (code, ainfo->reg, inst->inst_offset, inst->inst_basereg); ppc_stw (code, ainfo->reg + 1, inst->inst_offset + 4, inst->inst_basereg); } else { - ppc_addis (code, ppc_r11, inst->inst_basereg, ppc_ha(inst->inst_offset)); - ppc_addi (code, ppc_r11, ppc_r11, inst->inst_offset); - ppc_stw (code, ainfo->reg, 0, ppc_r11); - ppc_stw (code, ainfo->reg + 1, 4, ppc_r11); + ppc_addis (code, ppc_r12, inst->inst_basereg, ppc_ha(inst->inst_offset)); + ppc_addi (code, ppc_r12, ppc_r12, inst->inst_offset); + ppc_stw (code, ainfo->reg, 0, ppc_r12); + ppc_stw (code, ainfo->reg + 1, 4, ppc_r12); } break; #endif @@ -4877,31 +4900,31 @@ mono_arch_emit_prolog (MonoCompile *cfg) ppc_stptr (code, ainfo->reg, inst->inst_offset, inst->inst_basereg); } else { if (ppc_is_imm32 (inst->inst_offset)) { - ppc_addis (code, ppc_r11, inst->inst_basereg, ppc_ha(inst->inst_offset)); - ppc_stptr (code, ainfo->reg, inst->inst_offset, ppc_r11); + ppc_addis (code, ppc_r12, inst->inst_basereg, ppc_ha(inst->inst_offset)); + ppc_stptr (code, ainfo->reg, inst->inst_offset, ppc_r12); } else { - ppc_load (code, ppc_r11, inst->inst_offset); - ppc_stptr_indexed (code, ainfo->reg, inst->inst_basereg, ppc_r11); + ppc_load (code, ppc_r12, inst->inst_offset); + ppc_stptr_indexed (code, ainfo->reg, inst->inst_basereg, ppc_r12); } } break; } } else if (ainfo->regtype == RegTypeBase) { g_assert (ppc_is_imm16 (ainfo->offset)); - /* load the previous stack pointer in r11 */ - ppc_ldr (code, ppc_r11, 0, ppc_sp); - ppc_ldptr (code, ppc_r0, ainfo->offset, ppc_r11); + /* load the previous stack pointer in r12 */ + ppc_ldr (code, ppc_r12, 0, ppc_sp); + ppc_ldptr (code, ppc_r0, ainfo->offset, ppc_r12); switch (ainfo->size) { case 1: if (ppc_is_imm16 (inst->inst_offset)) { ppc_stb (code, ppc_r0, inst->inst_offset, inst->inst_basereg); } else { if (ppc_is_imm32 (inst->inst_offset)) { - ppc_addis (code, ppc_r11, inst->inst_basereg, ppc_ha(inst->inst_offset)); - ppc_stb (code, ppc_r0, inst->inst_offset, ppc_r11); + ppc_addis (code, ppc_r12, inst->inst_basereg, ppc_ha(inst->inst_offset)); + ppc_stb (code, ppc_r0, inst->inst_offset, ppc_r12); } else { - ppc_load (code, ppc_r11, inst->inst_offset); - ppc_stbx (code, ppc_r0, inst->inst_basereg, ppc_r11); + ppc_load (code, ppc_r12, inst->inst_offset); + ppc_stbx (code, ppc_r0, inst->inst_basereg, ppc_r12); } } break; @@ -4910,11 +4933,11 @@ mono_arch_emit_prolog (MonoCompile *cfg) ppc_sth (code, ppc_r0, inst->inst_offset, inst->inst_basereg); } else { if (ppc_is_imm32 (inst->inst_offset)) { - ppc_addis (code, ppc_r11, inst->inst_basereg, ppc_ha(inst->inst_offset)); - ppc_sth (code, ppc_r0, inst->inst_offset, ppc_r11); + ppc_addis (code, ppc_r12, inst->inst_basereg, ppc_ha(inst->inst_offset)); + ppc_sth (code, ppc_r0, inst->inst_offset, ppc_r12); } else { - ppc_load (code, ppc_r11, inst->inst_offset); - ppc_sthx (code, ppc_r0, inst->inst_basereg, ppc_r11); + ppc_load (code, ppc_r12, inst->inst_offset); + ppc_sthx (code, ppc_r0, inst->inst_basereg, ppc_r12); } } break; @@ -4924,11 +4947,11 @@ mono_arch_emit_prolog (MonoCompile *cfg) ppc_stw (code, ppc_r0, inst->inst_offset, inst->inst_basereg); } else { if (ppc_is_imm32 (inst->inst_offset)) { - ppc_addis (code, ppc_r11, inst->inst_basereg, ppc_ha(inst->inst_offset)); - ppc_stw (code, ppc_r0, inst->inst_offset, ppc_r11); + ppc_addis (code, ppc_r12, inst->inst_basereg, ppc_ha(inst->inst_offset)); + ppc_stw (code, ppc_r0, inst->inst_offset, ppc_r12); } else { - ppc_load (code, ppc_r11, inst->inst_offset); - ppc_stwx (code, ppc_r0, inst->inst_basereg, ppc_r11); + ppc_load (code, ppc_r12, inst->inst_offset); + ppc_stwx (code, ppc_r0, inst->inst_basereg, ppc_r12); } } break; @@ -4936,8 +4959,8 @@ mono_arch_emit_prolog (MonoCompile *cfg) if (ppc_is_imm16 (inst->inst_offset)) { ppc_str (code, ppc_r0, inst->inst_offset, inst->inst_basereg); } else { - ppc_load (code, ppc_r11, inst->inst_offset); - ppc_str_indexed (code, ppc_r0, ppc_r11, inst->inst_basereg); + ppc_load (code, ppc_r12, inst->inst_offset); + ppc_str_indexed (code, ppc_r0, ppc_r12, inst->inst_basereg); } break; #else @@ -4945,15 +4968,15 @@ mono_arch_emit_prolog (MonoCompile *cfg) g_assert (ppc_is_imm16 (ainfo->offset + 4)); if (ppc_is_imm16 (inst->inst_offset + 4)) { ppc_stw (code, ppc_r0, inst->inst_offset, inst->inst_basereg); - ppc_lwz (code, ppc_r0, ainfo->offset + 4, ppc_r11); + ppc_lwz (code, ppc_r0, ainfo->offset + 4, ppc_r12); ppc_stw (code, ppc_r0, inst->inst_offset + 4, inst->inst_basereg); } else { - /* use r12 to load the 2nd half of the long before we clobber r11. */ - ppc_lwz (code, ppc_r12, ainfo->offset + 4, ppc_r11); - ppc_addis (code, ppc_r11, inst->inst_basereg, ppc_ha(inst->inst_offset)); - ppc_addi (code, ppc_r11, ppc_r11, inst->inst_offset); - ppc_stw (code, ppc_r0, 0, ppc_r11); - ppc_stw (code, ppc_r12, 4, ppc_r11); + /* use r11 to load the 2nd half of the long before we clobber r12. */ + ppc_lwz (code, ppc_r11, ainfo->offset + 4, ppc_r12); + ppc_addis (code, ppc_r12, inst->inst_basereg, ppc_ha(inst->inst_offset)); + ppc_addi (code, ppc_r12, ppc_r12, inst->inst_offset); + ppc_stw (code, ppc_r0, 0, ppc_r12); + ppc_stw (code, ppc_r11, 4, ppc_r12); } break; #endif @@ -4962,11 +4985,11 @@ mono_arch_emit_prolog (MonoCompile *cfg) ppc_stptr (code, ppc_r0, inst->inst_offset, inst->inst_basereg); } else { if (ppc_is_imm32 (inst->inst_offset)) { - ppc_addis (code, ppc_r11, inst->inst_basereg, ppc_ha(inst->inst_offset)); - ppc_stptr (code, ppc_r0, inst->inst_offset, ppc_r11); + ppc_addis (code, ppc_r12, inst->inst_basereg, ppc_ha(inst->inst_offset)); + ppc_stptr (code, ppc_r0, inst->inst_offset, ppc_r12); } else { - ppc_load (code, ppc_r11, inst->inst_offset); - ppc_stptr_indexed (code, ppc_r0, inst->inst_basereg, ppc_r11); + ppc_load (code, ppc_r12, inst->inst_offset); + ppc_stptr_indexed (code, ppc_r0, inst->inst_basereg, ppc_r12); } } break; @@ -5025,39 +5048,39 @@ mono_arch_emit_prolog (MonoCompile *cfg) /* FIXME: we need to do the shifting here, too */ if (ainfo->bytes) NOT_IMPLEMENTED; - /* load the previous stack pointer in r11 (r0 gets overwritten by the memcpy) */ - ppc_ldr (code, ppc_r11, 0, ppc_sp); + /* load the previous stack pointer in r12 (r0 gets overwritten by the memcpy) */ + ppc_ldr (code, ppc_r12, 0, ppc_sp); if ((size & MONO_PPC_32_64_CASE (3, 7)) != 0) { code = emit_memcpy (code, size - soffset, inst->inst_basereg, doffset, - ppc_r11, ainfo->offset + soffset); + ppc_r12, ainfo->offset + soffset); } else { code = emit_memcpy (code, ainfo->vtsize * sizeof (gpointer), inst->inst_basereg, doffset, - ppc_r11, ainfo->offset + soffset); + ppc_r12, ainfo->offset + soffset); } } } else if (ainfo->regtype == RegTypeStructByAddr) { /* if it was originally a RegTypeBase */ if (ainfo->offset) { - /* load the previous stack pointer in r11 */ - ppc_ldr (code, ppc_r11, 0, ppc_sp); - ppc_ldptr (code, ppc_r11, ainfo->offset, ppc_r11); + /* load the previous stack pointer in r12 */ + ppc_ldr (code, ppc_r12, 0, ppc_sp); + ppc_ldptr (code, ppc_r12, ainfo->offset, ppc_r12); } else { - ppc_mr (code, ppc_r11, ainfo->reg); + ppc_mr (code, ppc_r12, ainfo->reg); } if (cfg->tailcall_valuetype_addrs) { MonoInst *addr = cfg->tailcall_valuetype_addrs [tailcall_struct_index]; g_assert (ppc_is_imm16 (addr->inst_offset)); - ppc_stptr (code, ppc_r11, addr->inst_offset, addr->inst_basereg); + ppc_stptr (code, ppc_r12, addr->inst_offset, addr->inst_basereg); tailcall_struct_index++; } g_assert (ppc_is_imm16 (inst->inst_offset)); - code = emit_memcpy (code, ainfo->vtsize, inst->inst_basereg, inst->inst_offset, ppc_r11, 0); + code = emit_memcpy (code, ainfo->vtsize, inst->inst_basereg, inst->inst_offset, ppc_r12, 0); /*g_print ("copy in %s: %d bytes from %d to offset: %d\n", method->name, ainfo->vtsize, ainfo->reg, inst->inst_offset);*/ } else g_assert_not_reached (); @@ -5078,8 +5101,8 @@ mono_arch_emit_prolog (MonoCompile *cfg) mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_INTERNAL_METHOD, (gpointer)"mono_get_lmf_addr"); if ((FORCE_INDIR_CALL || cfg->method->dynamic) && !cfg->compile_aot) { - ppc_load_func (code, ppc_r0, 0); - ppc_mtlr (code, ppc_r0); + ppc_load_func (code, PPC_CALL_REG, 0); + ppc_mtlr (code, PPC_CALL_REG); ppc_blrl (code); } else { ppc_bl (code, 0); @@ -5089,25 +5112,25 @@ mono_arch_emit_prolog (MonoCompile *cfg) /* lmf_offset is the offset from the previous stack pointer, * alloc_size is the total stack space allocated, so the offset * of MonoLMF from the current stack ptr is alloc_size - lmf_offset. - * The pointer to the struct is put in ppc_r11 (new_lmf). + * The pointer to the struct is put in ppc_r12 (new_lmf). * The callee-saved registers are already in the MonoLMF structure */ - ppc_addi (code, ppc_r11, ppc_sp, alloc_size - lmf_offset); + ppc_addi (code, ppc_r12, ppc_sp, alloc_size - lmf_offset); /* ppc_r3 is the result from mono_get_lmf_addr () */ - ppc_stptr (code, ppc_r3, G_STRUCT_OFFSET(MonoLMF, lmf_addr), ppc_r11); + ppc_stptr (code, ppc_r3, G_STRUCT_OFFSET(MonoLMF, lmf_addr), ppc_r12); /* new_lmf->previous_lmf = *lmf_addr */ ppc_ldptr (code, ppc_r0, G_STRUCT_OFFSET(MonoLMF, previous_lmf), ppc_r3); - ppc_stptr (code, ppc_r0, G_STRUCT_OFFSET(MonoLMF, previous_lmf), ppc_r11); - /* *(lmf_addr) = r11 */ - ppc_stptr (code, ppc_r11, G_STRUCT_OFFSET(MonoLMF, previous_lmf), ppc_r3); + ppc_stptr (code, ppc_r0, G_STRUCT_OFFSET(MonoLMF, previous_lmf), ppc_r12); + /* *(lmf_addr) = r12 */ + ppc_stptr (code, ppc_r12, G_STRUCT_OFFSET(MonoLMF, previous_lmf), ppc_r3); /* save method info */ if (cfg->compile_aot) // FIXME: ppc_load (code, ppc_r0, 0); else ppc_load_ptr (code, ppc_r0, method); - ppc_stptr (code, ppc_r0, G_STRUCT_OFFSET(MonoLMF, method), ppc_r11); - ppc_stptr (code, ppc_sp, G_STRUCT_OFFSET(MonoLMF, ebp), ppc_r11); + ppc_stptr (code, ppc_r0, G_STRUCT_OFFSET(MonoLMF, method), ppc_r12); + ppc_stptr (code, ppc_sp, G_STRUCT_OFFSET(MonoLMF, ebp), ppc_r12); /* save the current IP */ if (cfg->compile_aot) { ppc_bl (code, 1); @@ -5120,7 +5143,7 @@ mono_arch_emit_prolog (MonoCompile *cfg) ppc_load_sequence (code, ppc_r0, (gulong)0x01010101L); #endif } - ppc_stptr (code, ppc_r0, G_STRUCT_OFFSET(MonoLMF, eip), ppc_r11); + ppc_stptr (code, ppc_r0, G_STRUCT_OFFSET(MonoLMF, eip), ppc_r12); } if (tracing) @@ -5172,21 +5195,21 @@ mono_arch_emit_epilog (MonoCompile *cfg) lmf_offset = pos; /* save the frame reg in r8 */ ppc_mr (code, ppc_r8, cfg->frame_reg); - ppc_addi (code, ppc_r11, cfg->frame_reg, cfg->stack_usage - lmf_offset); + ppc_addi (code, ppc_r12, cfg->frame_reg, cfg->stack_usage - lmf_offset); /* r5 = previous_lmf */ - ppc_ldptr (code, ppc_r5, G_STRUCT_OFFSET(MonoLMF, previous_lmf), ppc_r11); + ppc_ldptr (code, ppc_r5, G_STRUCT_OFFSET(MonoLMF, previous_lmf), ppc_r12); /* r6 = lmf_addr */ - ppc_ldptr (code, ppc_r6, G_STRUCT_OFFSET(MonoLMF, lmf_addr), ppc_r11); + ppc_ldptr (code, ppc_r6, G_STRUCT_OFFSET(MonoLMF, lmf_addr), ppc_r12); /* *(lmf_addr) = previous_lmf */ ppc_stptr (code, ppc_r5, G_STRUCT_OFFSET(MonoLMF, previous_lmf), ppc_r6); /* FIXME: speedup: there is no actual need to restore the registers if * we didn't actually change them (idea from Zoltan). */ /* restore iregs */ - ppc_ldr_multiple (code, ppc_r13, G_STRUCT_OFFSET(MonoLMF, iregs), ppc_r11); + ppc_ldr_multiple (code, ppc_r13, G_STRUCT_OFFSET(MonoLMF, iregs), ppc_r12); /* restore fregs */ /*for (i = 14; i < 32; i++) { - ppc_lfd (code, i, G_STRUCT_OFFSET(MonoLMF, fregs) + ((i-14) * sizeof (gdouble)), ppc_r11); + ppc_lfd (code, i, G_STRUCT_OFFSET(MonoLMF, fregs) + ((i-14) * sizeof (gdouble)), ppc_r12); }*/ g_assert (ppc_is_imm16 (cfg->stack_usage + PPC_RET_ADDR_OFFSET)); /* use the saved copy of the frame reg in r8 */ @@ -5201,8 +5224,8 @@ mono_arch_emit_epilog (MonoCompile *cfg) if (ppc_is_imm16 (return_offset)) { ppc_ldr (code, ppc_r0, return_offset, cfg->frame_reg); } else { - ppc_load (code, ppc_r11, return_offset); - ppc_ldr_indexed (code, ppc_r0, cfg->frame_reg, ppc_r11); + ppc_load (code, ppc_r12, return_offset); + ppc_ldr_indexed (code, ppc_r0, cfg->frame_reg, ppc_r12); } ppc_mtlr (code, ppc_r0); } @@ -5213,7 +5236,7 @@ mono_arch_emit_epilog (MonoCompile *cfg) offset -= sizeof (mgreg_t); } if (cfg->frame_reg != ppc_sp) - ppc_mr (code, ppc_r11, cfg->frame_reg); + ppc_mr (code, ppc_r12, cfg->frame_reg); /* note r31 (possibly the frame register) is restored last */ for (i = 13; i <= 31; i++) { if (cfg->used_int_regs & (1 << i)) { @@ -5222,22 +5245,22 @@ mono_arch_emit_epilog (MonoCompile *cfg) } } if (cfg->frame_reg != ppc_sp) - ppc_addi (code, ppc_sp, ppc_r11, cfg->stack_usage); + ppc_addi (code, ppc_sp, ppc_r12, cfg->stack_usage); else ppc_addi (code, ppc_sp, ppc_sp, cfg->stack_usage); } else { - ppc_load32 (code, ppc_r11, cfg->stack_usage); + ppc_load32 (code, ppc_r12, cfg->stack_usage); if (cfg->used_int_regs) { - ppc_add (code, ppc_r11, cfg->frame_reg, ppc_r11); + ppc_add (code, ppc_r12, cfg->frame_reg, ppc_r12); for (i = 31; i >= 13; --i) { if (cfg->used_int_regs & (1 << i)) { pos += sizeof (mgreg_t); - ppc_ldr (code, i, -pos, ppc_r11); + ppc_ldr (code, i, -pos, ppc_r12); } } - ppc_mr (code, ppc_sp, ppc_r11); + ppc_mr (code, ppc_sp, ppc_r12); } else { - ppc_add (code, ppc_sp, cfg->frame_reg, ppc_r11); + ppc_add (code, ppc_sp, cfg->frame_reg, ppc_r12); } } @@ -5388,8 +5411,8 @@ mono_arch_emit_exceptions (MonoCompile *cfg) patch_info->data.name = "mono_arch_throw_corlib_exception"; patch_info->ip.i = code - cfg->native_code; if (FORCE_INDIR_CALL || cfg->method->dynamic) { - ppc_load_func (code, ppc_r0, 0); - ppc_mtctr (code, ppc_r0); + ppc_load_func (code, PPC_CALL_REG, 0); + ppc_mtctr (code, PPC_CALL_REG); ppc_bcctr (code, PPC_BR_ALWAYS, 0); } else { ppc_bl (code, 0); @@ -5624,15 +5647,15 @@ mono_arch_build_imt_thunk (MonoVTable *vtable, MonoDomain *domain, MonoIMTCheckI start = code; /* - * We need to save and restore r11 because it might be + * We need to save and restore r12 because it might be * used by the caller as the vtable register, so * clobbering it will trip up the magic trampoline. * - * FIXME: Get rid of this by making sure that r11 is + * FIXME: Get rid of this by making sure that r12 is * not used as the vtable register in interface calls. */ - ppc_stptr (code, ppc_r11, PPC_RET_ADDR_OFFSET, ppc_sp); - ppc_load (code, ppc_r11, (gsize)(& (vtable->vtable [0]))); + ppc_stptr (code, ppc_r12, PPC_RET_ADDR_OFFSET, ppc_sp); + ppc_load (code, ppc_r12, (gsize)(& (vtable->vtable [0]))); for (i = 0; i < count; ++i) { MonoIMTCheckItem *item = imt_entries [i]; @@ -5648,8 +5671,8 @@ mono_arch_build_imt_thunk (MonoVTable *vtable, MonoDomain *domain, MonoIMTCheckI if (item->has_target_code) { ppc_load_ptr (code, ppc_r0, item->value.target_code); } else { - ppc_ldptr (code, ppc_r0, (sizeof (gpointer) * item->value.vtable_slot), ppc_r11); - ppc_ldptr (code, ppc_r11, PPC_RET_ADDR_OFFSET, ppc_sp); + ppc_ldptr (code, ppc_r0, (sizeof (gpointer) * item->value.vtable_slot), ppc_r12); + ppc_ldptr (code, ppc_r12, PPC_RET_ADDR_OFFSET, ppc_sp); } ppc_mtctr (code, ppc_r0); ppc_bcctr (code, PPC_BR_ALWAYS, 0); @@ -5681,8 +5704,8 @@ mono_arch_build_imt_thunk (MonoVTable *vtable, MonoDomain *domain, MonoIMTCheckI item->jmp_code = code; ppc_bc (code, PPC_BR_FALSE, PPC_BR_EQ, 0); #endif - ppc_ldptr (code, ppc_r0, (sizeof (gpointer) * item->value.vtable_slot), ppc_r11); - ppc_ldptr (code, ppc_r11, PPC_RET_ADDR_OFFSET, ppc_sp); + ppc_ldptr (code, ppc_r0, (sizeof (gpointer) * item->value.vtable_slot), ppc_r12); + ppc_ldptr (code, ppc_r12, PPC_RET_ADDR_OFFSET, ppc_sp); ppc_mtctr (code, ppc_r0); ppc_bcctr (code, PPC_BR_ALWAYS, 0); #if ENABLE_WRONG_METHOD_CHECK @@ -5807,17 +5830,17 @@ mono_arch_emit_load_got_addr (guint8 *start, guint8 *code, MonoCompile *cfg, Mon * Emit code to load the contents of the GOT slot identified by TRAMP_TYPE and * TARGET from the mscorlib GOT in full-aot code. * On PPC, the GOT address is assumed to be in r30, and the result is placed into - * r11. + * r12. */ guint8* mono_arch_emit_load_aotconst (guint8 *start, guint8 *code, MonoJumpInfo **ji, int tramp_type, gconstpointer target) { /* Load the mscorlib got address */ - ppc_ldptr (code, ppc_r11, sizeof (gpointer), ppc_r30); + ppc_ldptr (code, ppc_r12, sizeof (gpointer), ppc_r30); *ji = mono_patch_info_list_prepend (*ji, code - start, tramp_type, target); /* arch_emit_got_access () patches this */ ppc_load32 (code, ppc_r0, 0); - ppc_ldptr_indexed (code, ppc_r11, ppc_r11, ppc_r0); + ppc_ldptr_indexed (code, ppc_r12, ppc_r12, ppc_r0); return code; } @@ -5840,8 +5863,8 @@ mono_arch_set_breakpoint (MonoJitInfo *ji, guint8 *ip) guint8 *code = ip; guint8 *orig_code = code; - ppc_load_sequence (code, ppc_r11, (gsize)bp_trigger_page); - ppc_ldptr (code, ppc_r11, 0, ppc_r11); + ppc_load_sequence (code, ppc_r12, (gsize)bp_trigger_page); + ppc_ldptr (code, ppc_r12, 0, ppc_r12); g_assert (code - orig_code == BREAKPOINT_SIZE); diff --git a/mono/mini/mini-ppc.h b/mono/mini/mini-ppc.h index 4b39b7ac223..2a9af123de4 100644 --- a/mono/mini/mini-ppc.h +++ b/mono/mini/mini-ppc.h @@ -68,7 +68,13 @@ typedef struct MonoCompileArch { #ifdef __mono_ppc64__ #define MONO_ARCH_NO_EMULATE_LONG_SHIFT_OPS #define MONO_ARCH_NO_EMULATE_LONG_MUL_OPTS + +/* ELFv2 ABI doesn't use function descriptors. */ +#if _CALL_ELF == 2 +#undef PPC_USES_FUNCTION_DESCRIPTOR +#else #define PPC_USES_FUNCTION_DESCRIPTOR +#endif #ifndef __mono_ilp32__ #define MONO_ARCH_HAVE_TLS_GET 1 @@ -93,11 +99,10 @@ typedef struct MonoCompileArch { #define MONO_ARCH_EMULATE_LCONV_TO_R8_UN 1 #define MONO_ARCH_EMULATE_FREM 1 -#define MONO_ARCH_BIGMUL_INTRINS 1 #define MONO_ARCH_GC_MAPS_SUPPORTED 1 /* Parameters used by the register allocator */ -#define MONO_ARCH_CALLEE_REGS ((0xff << ppc_r3) | (1 << ppc_r11) | (1 << ppc_r12)) +#define MONO_ARCH_CALLEE_REGS ((0xff << ppc_r3) | (1 << ppc_r12) | (1 << ppc_r11)) #define MONO_ARCH_CALLEE_SAVED_REGS (0xfffff << ppc_r13) /* ppc_13 - ppc_31 */ #if defined(__APPLE__) || defined(__mono_ppc64__) @@ -147,7 +152,6 @@ typedef struct MonoCompileArch { #define PPC_MINIMAL_PARAM_AREA_SIZE 64 #define PPC_LAST_FPARG_REG ppc_f13 #define PPC_PASS_STRUCTS_BY_VALUE 1 -#define PPC_SMALL_RET_STRUCT_IN_REG 0 #define PPC_THREAD_PTR_REG ppc_r13 #else #define PPC_RET_ADDR_OFFSET 4 @@ -156,7 +160,6 @@ typedef struct MonoCompileArch { #define PPC_MINIMAL_PARAM_AREA_SIZE 0 #define PPC_LAST_FPARG_REG ppc_f8 #define PPC_PASS_STRUCTS_BY_VALUE 0 -#define PPC_SMALL_RET_STRUCT_IN_REG 1 #define PPC_THREAD_PTR_REG ppc_r2 #endif #define PPC_FIRST_ARG_REG ppc_r3 @@ -164,15 +167,17 @@ typedef struct MonoCompileArch { #define PPC_FIRST_FPARG_REG ppc_f1 #endif +#define PPC_CALL_REG ppc_r12 + #if defined(HAVE_WORKING_SIGALTSTACK) && !defined(__APPLE__) #define MONO_ARCH_SIGSEGV_ON_ALTSTACK 1 #define MONO_ARCH_SIGNAL_STACK_SIZE (12 * 1024) #endif /* HAVE_WORKING_SIGALTSTACK */ #define MONO_ARCH_HAVE_CREATE_DELEGATE_TRAMPOLINE -#define MONO_ARCH_IMT_REG ppc_r12 +#define MONO_ARCH_IMT_REG ppc_r11 -#define MONO_ARCH_VTABLE_REG ppc_r12 +#define MONO_ARCH_VTABLE_REG ppc_r11 #define MONO_ARCH_RGCTX_REG MONO_ARCH_IMT_REG #define MONO_ARCH_NO_IOV_CHECK 1 @@ -194,7 +199,6 @@ typedef struct MonoCompileArch { #define MONO_ARCH_HAVE_OP_TAIL_CALL 1 #define PPC_NUM_REG_ARGS (PPC_LAST_ARG_REG-PPC_FIRST_ARG_REG+1) -#define PPC_NUM_REG_FPARGS (PPC_LAST_FPARG_REG-PPC_FIRST_FPARG_REG+1) #ifdef MONO_CROSS_COMPILE diff --git a/mono/mini/mini-s390x.h b/mono/mini/mini-s390x.h index b40425c6478..7de88fdf1e2 100644 --- a/mono/mini/mini-s390x.h +++ b/mono/mini/mini-s390x.h @@ -68,11 +68,6 @@ typedef struct #define S390_LAST_ARG_REG s390_r6 #define S390_FIRST_FPARG_REG s390_f0 #define S390_LAST_FPARG_REG s390_f6 -#define S390_PASS_STRUCTS_BY_VALUE 1 -#define S390_SMALL_RET_STRUCT_IN_REG 1 - -#define S390_NUM_REG_ARGS (S390_LAST_ARG_REG-S390_FIRST_ARG_REG+1) -#define S390_NUM_REG_FPARGS ((S390_LAST_FPARG_REG-S390_FIRST_FPARG_REG)/2) /*===============================================*/ /* Definitions used by mini-codegen.c */ @@ -115,8 +110,6 @@ typedef struct #define MONO_ARCH_FRAME_ALIGNMENT 8 #define MONO_ARCH_CODE_ALIGNMENT 32 -#define MONO_ARCH_RETREG1 s390_r2 - /*-----------------------------------------------*/ /* Macros used to generate instructions */ /*-----------------------------------------------*/ diff --git a/mono/mini/mini-sparc.h b/mono/mini/mini-sparc.h index ab8e452b70e..2c9d8772f68 100644 --- a/mono/mini/mini-sparc.h +++ b/mono/mini/mini-sparc.h @@ -57,8 +57,6 @@ #define MONO_ARCH_CODE_ALIGNMENT 32 -#define MONO_ARCH_RETREG1 sparc_i0 - #ifdef SPARCV9 #define MONO_SPARC_STACK_BIAS 2047 #else diff --git a/mono/mini/mini-unwind.h b/mono/mini/mini-unwind.h index a2c9f49805d..1085cbe0e3f 100644 --- a/mono/mini/mini-unwind.h +++ b/mono/mini/mini-unwind.h @@ -82,11 +82,11 @@ typedef struct { */ /* Set cfa to reg+offset */ -#define mono_emit_unwind_op_def_cfa(cfg,ip,reg,offset) do { mono_emit_unwind_op (cfg, (ip) - (cfg)->native_code, DW_CFA_def_cfa, (reg), (offset)); (cfg)->cfa_reg = (reg); (cfg)->cfa_offset = (offset); } while (0) +#define mono_emit_unwind_op_def_cfa(cfg,ip,reg,offset) do { mono_emit_unwind_op (cfg, (ip) - (cfg)->native_code, DW_CFA_def_cfa, (reg), (offset)); (cfg)->cur_cfa_reg = (reg); (cfg)->cur_cfa_offset = (offset); } while (0) /* Set cfa to reg+existing offset */ -#define mono_emit_unwind_op_def_cfa_reg(cfg,ip,reg) do { mono_emit_unwind_op (cfg, (ip) - (cfg)->native_code, DW_CFA_def_cfa_register, (reg), (0)); (cfg)->cfa_reg = (reg); } while (0) +#define mono_emit_unwind_op_def_cfa_reg(cfg,ip,reg) do { mono_emit_unwind_op (cfg, (ip) - (cfg)->native_code, DW_CFA_def_cfa_register, (reg), (0)); (cfg)->cur_cfa_reg = (reg); } while (0) /* Set cfa to existing reg+offset */ -#define mono_emit_unwind_op_def_cfa_offset(cfg,ip,offset) do { mono_emit_unwind_op (cfg, (ip) - (cfg)->native_code, DW_CFA_def_cfa_offset, (0), (offset)); (cfg)->cfa_offset = (offset); } while (0) +#define mono_emit_unwind_op_def_cfa_offset(cfg,ip,offset) do { mono_emit_unwind_op (cfg, (ip) - (cfg)->native_code, DW_CFA_def_cfa_offset, (0), (offset)); (cfg)->cur_cfa_offset = (offset); } while (0) /* Reg is the same as it was on enter to the function */ #define mono_emit_unwind_op_same_value(cfg,ip,reg) mono_emit_unwind_op (cfg, (ip) - (cfg)->native_code, DW_CFA_same_value, (reg), 0) /* Reg is saved at cfa+offset */ diff --git a/mono/mini/mini-x86.c b/mono/mini/mini-x86.c index 5e5d1f9df51..e4415df43fa 100644 --- a/mono/mini/mini-x86.c +++ b/mono/mini/mini-x86.c @@ -6104,8 +6104,7 @@ get_delegate_invoke_impl (gboolean has_target, guint32 param_count, guint32 *cod g_assert ((code - start) < code_reserve); } - nacl_global_codeman_validate(&start, code_reserve, &code); - mono_debug_add_delegate_trampoline (start, code - start); + nacl_global_codeman_validate (&start, code_reserve, &code); if (code_len) *code_len = code - start; diff --git a/mono/mini/mini-x86.h b/mono/mini/mini-x86.h index f6ddc930427..2d9df6a3495 100644 --- a/mono/mini/mini-x86.h +++ b/mono/mini/mini-x86.h @@ -134,9 +134,6 @@ struct sigcontext { * reproduceable results for benchmarks */ #define MONO_ARCH_CODE_ALIGNMENT 32 -#define MONO_ARCH_RETREG1 X86_EAX -#define MONO_ARCH_RETREG2 X86_EDX - /*This is the max size of the locals area of a given frame. I think 1MB is a safe default for now*/ #define MONO_ARCH_MAX_FRAME_SIZE 0x100000 @@ -201,7 +198,6 @@ typedef struct { /* Enables OP_LSHL, OP_LSHL_IMM, OP_LSHR, OP_LSHR_IMM, OP_LSHR_UN, OP_LSHR_UN_IMM */ #define MONO_ARCH_NO_EMULATE_LONG_SHIFT_OPS -#define MONO_ARCH_BIGMUL_INTRINS 1 #define MONO_ARCH_NEED_DIV_CHECK 1 #define MONO_ARCH_HAVE_IS_INT_OVERFLOW 1 #define MONO_ARCH_HAVE_INVALIDATE_METHOD 1 diff --git a/mono/mini/mini.c b/mono/mini/mini.c index 604a4142aa8..f876ce3ea5c 100755 --- a/mono/mini/mini.c +++ b/mono/mini/mini.c @@ -53,6 +53,7 @@ #include #include #include +#include #include #include #include @@ -712,10 +713,11 @@ G_GNUC_UNUSED gboolean mono_debug_count (void) { static int count = 0; - count ++; static gboolean inited; static const char *value; + count ++; + if (!inited) { value = g_getenv ("COUNT"); inited = TRUE; @@ -3972,6 +3974,8 @@ mono_codegen (MonoCompile *cfg) cfg->code_len = code - cfg->native_code; cfg->prolog_end = cfg->code_len; + cfg->cfa_reg = cfg->cur_cfa_reg; + cfg->cfa_offset = cfg->cur_cfa_offset; mono_debug_open_method (cfg); @@ -3986,6 +3990,7 @@ mono_codegen (MonoCompile *cfg) if (bb == cfg->bb_exit) { cfg->epilog_begin = cfg->code_len; mono_arch_emit_epilog (cfg); + cfg->epilog_end = cfg->code_len; } } @@ -4494,7 +4499,7 @@ create_jit_info (MonoCompile *cfg, MonoMethod *method_to_compile) info = mono_jit_info_get_arch_eh_info (jinfo); g_assert (info); - info->epilog_size = cfg->code_size - cfg->epilog_begin; + info->epilog_size = cfg->code_len - cfg->epilog_begin; } jinfo->unwind_info = unwind_desc; g_free (unwind_info); @@ -4858,6 +4863,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl if (cfg->gen_seq_points) cfg->seq_points = g_ptr_array_new (); + mono_error_init (&cfg->error); if (cfg->compile_aot && !try_generic_shared && (method->is_generic || method->klass->generic_container || method_is_gshared)) { cfg->exception_type = MONO_EXCEPTION_GENERIC_SHARING_FAILED; @@ -5279,7 +5285,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl */ //#define DEBUGSSA "logic_run" -#define DEBUGSSA_CLASS "Tests" +//#define DEBUGSSA_CLASS "Tests" #ifdef DEBUGSSA if (!cfg->disable_ssa) { @@ -5948,6 +5954,10 @@ mono_jit_compile_method_inner (MonoMethod *method, MonoDomain *target_domain, in case MONO_EXCEPTION_OUT_OF_MEMORY: ex = mono_domain_get ()->out_of_memory_ex; break; + case MONO_EXCEPTION_MONO_ERROR: + g_assert (!mono_error_ok (&cfg->error)); + ex = mono_error_convert_to_exception (&cfg->error); + break; default: g_assert_not_reached (); } @@ -6935,10 +6945,9 @@ mini_get_debug_options (void) static gpointer mini_create_ftnptr (MonoDomain *domain, gpointer addr) { -#if !defined(__ia64__) && !defined(__ppc64__) && !defined(__powerpc64__) +#if !defined(__ia64__) && (!defined(__ppc64__) && !defined(__powerpc64__) || _CALL_ELF == 2) return addr; #else - gpointer* desc = NULL; if ((desc = g_hash_table_lookup (domain->ftnptrs_hash, addr))) @@ -6964,7 +6973,7 @@ mini_create_ftnptr (MonoDomain *domain, gpointer addr) static gpointer mini_get_addr_from_ftnptr (gpointer descr) { -#if defined(__ia64__) || defined(__ppc64__) || defined(__powerpc64__) +#if defined(__ia64__) || ((defined(__ppc64__) || defined(__powerpc64__)) && _CALL_ELF != 2) return *(gpointer*)descr; #else return descr; diff --git a/mono/mini/mini.h b/mono/mini/mini.h index 18d94252110..2169a79423f 100755 --- a/mono/mini/mini.h +++ b/mono/mini/mini.h @@ -103,7 +103,7 @@ #endif /* Version number of the AOT file format */ -#define MONO_AOT_FILE_VERSION 103 +#define MONO_AOT_FILE_VERSION 104 //TODO: This is x86/amd64 specific. #define mono_simd_shuffle_mask(a,b,c,d) ((a) | ((b) << 2) | ((c) << 4) | ((d) << 6)) @@ -113,10 +113,6 @@ #define printf g_print #endif -#if !defined(HAVE_KW_THREAD) || !defined(MONO_ARCH_ENABLE_MONO_LMF_VAR) -#define MONO_JIT_TLS_DATA_HAS_LMF -#endif - #define MONO_TYPE_IS_PRIMITIVE(t) ((!(t)->byref && ((((t)->type >= MONO_TYPE_BOOLEAN && (t)->type <= MONO_TYPE_R8) || ((t)->type >= MONO_TYPE_I && (t)->type <= MONO_TYPE_U))))) /* Constants used to encode different types of methods in AOT */ @@ -337,15 +333,9 @@ typedef MonoStackFrameInfo StackFrameInfo; #define mono_bitset_foreach_bit(set,b,n) \ for (b = 0; b < n; b++)\ if (mono_bitset_test_fast(set,b)) -#define mono_bitset_foreach_bit_rev(set,b,n) \ - for (b = n - 1; b >= 0; b--)\ - if (mono_bitset_test_fast(set,b)) #else #define mono_bitset_foreach_bit(set,b,n) \ for (b = mono_bitset_find_start (set); b < n && b >= 0; b = mono_bitset_find_first (set, b)) -#define mono_bitset_foreach_bit_rev(set,b,n) \ - for (b = mono_bitset_find_last (set, n - 1); b >= 0; b = b ? mono_bitset_find_last (set, b) : -1) - #endif /* @@ -382,11 +372,6 @@ enum { (dest)->inst.cil_code = (cfg)->ip; \ } while (0) -#define MONO_INST_NEW_CALL_ARG(cfg,dest,op) do { \ - (dest) = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoCallArgParm)); \ - (dest)->ins.opcode = (op); \ - } while (0) - #define MONO_ADD_INS(b,inst) do { \ if ((b)->last_ins) { \ (b)->last_ins->next = (inst); \ @@ -1431,6 +1416,7 @@ typedef struct { guint code_len; guint prolog_end; guint epilog_begin; + guint epilog_end; regmask_t used_int_regs; guint32 opt; guint32 prof_options; @@ -1612,6 +1598,9 @@ typedef struct { /* The offsets of the locals area relative to the frame pointer */ gint locals_min_stack_offset, locals_max_stack_offset; + /* The current CFA rule */ + int cur_cfa_reg, cur_cfa_offset; + /* The final CFA rule at the end of the prolog */ int cfa_reg, cfa_offset; @@ -1625,6 +1614,9 @@ typedef struct { guint8 *gc_map; guint32 gc_map_size; + /* Error handling */ + MonoError error; + /* Stats */ int stat_allocate_var; int stat_locals_stack_size; @@ -2745,8 +2737,6 @@ enum { SIMD_VERSION_INDEX_END = 6 }; -#define MASK(x) (1 << x) - enum { SIMD_COMP_EQ, SIMD_COMP_LT, diff --git a/mono/mini/ssa.c b/mono/mini/ssa.c index 160db5fec57..8f804b85c93 100644 --- a/mono/mini/ssa.c +++ b/mono/mini/ssa.c @@ -20,7 +20,6 @@ #include #endif -#define USE_ORIGINAL_VARS #define CREATE_PRUNED_SSA //#define DEBUG_SSA 1 diff --git a/mono/mini/tramp-arm.c b/mono/mini/tramp-arm.c index 40c3baae06c..735176dc568 100644 --- a/mono/mini/tramp-arm.c +++ b/mono/mini/tramp-arm.c @@ -499,7 +499,7 @@ mono_arch_create_specific_trampoline (gpointer arg1, MonoTrampolineType tramp_ty guint8 *code, *buf, *tramp; gpointer *constants; #ifndef USE_JUMP_TABLES - guint32 short_branch; + guint32 short_branch = FALSE; #endif guint32 size = SPEC_TRAMP_SIZE; diff --git a/mono/mini/tramp-ppc.c b/mono/mini/tramp-ppc.c index 6fac1a1bcb0..1b2cc1dfb91 100644 --- a/mono/mini/tramp-ppc.c +++ b/mono/mini/tramp-ppc.c @@ -295,44 +295,44 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf if (aot) { code = mono_arch_emit_load_aotconst (buf, code, &ji, MONO_PATCH_INFO_JIT_ICALL_ADDR, "mono_get_lmf_addr"); #ifdef PPC_USES_FUNCTION_DESCRIPTOR - ppc_ldptr (code, ppc_r2, sizeof (gpointer), ppc_r11); - ppc_ldptr (code, ppc_r11, 0, ppc_r11); + ppc_ldptr (code, ppc_r2, sizeof (gpointer), ppc_r12); + ppc_ldptr (code, ppc_r12, 0, ppc_r12); #endif - ppc_mtlr (code, ppc_r11); + ppc_mtlr (code, ppc_r12); ppc_blrl (code); } else { - ppc_load_func (code, ppc_r0, mono_get_lmf_addr); - ppc_mtlr (code, ppc_r0); + ppc_load_func (code, PPC_CALL_REG, mono_get_lmf_addr); + ppc_mtlr (code, PPC_CALL_REG); ppc_blrl (code); } /* we build the MonoLMF structure on the stack - see mini-ppc.h - * The pointer to the struct is put in ppc_r11. + * The pointer to the struct is put in ppc_r12. */ - ppc_addi (code, ppc_r11, ppc_sp, STACK - sizeof (MonoLMF)); - ppc_stptr (code, ppc_r3, G_STRUCT_OFFSET(MonoLMF, lmf_addr), ppc_r11); + ppc_addi (code, ppc_r12, ppc_sp, STACK - sizeof (MonoLMF)); + ppc_stptr (code, ppc_r3, G_STRUCT_OFFSET(MonoLMF, lmf_addr), ppc_r12); /* new_lmf->previous_lmf = *lmf_addr */ ppc_ldptr (code, ppc_r0, G_STRUCT_OFFSET(MonoLMF, previous_lmf), ppc_r3); - ppc_stptr (code, ppc_r0, G_STRUCT_OFFSET(MonoLMF, previous_lmf), ppc_r11); - /* *(lmf_addr) = r11 */ - ppc_stptr (code, ppc_r11, G_STRUCT_OFFSET(MonoLMF, previous_lmf), ppc_r3); + ppc_stptr (code, ppc_r0, G_STRUCT_OFFSET(MonoLMF, previous_lmf), ppc_r12); + /* *(lmf_addr) = r12 */ + ppc_stptr (code, ppc_r12, G_STRUCT_OFFSET(MonoLMF, previous_lmf), ppc_r3); /* save method info (it's stored on the stack, so get it first). */ if ((tramp_type == MONO_TRAMPOLINE_JIT) || (tramp_type == MONO_TRAMPOLINE_JUMP)) { ppc_ldr (code, ppc_r0, GREGS_OFFSET, ppc_r1); - ppc_stptr (code, ppc_r0, G_STRUCT_OFFSET(MonoLMF, method), ppc_r11); + ppc_stptr (code, ppc_r0, G_STRUCT_OFFSET(MonoLMF, method), ppc_r12); } else { ppc_load (code, ppc_r0, 0); - ppc_stptr (code, ppc_r0, G_STRUCT_OFFSET(MonoLMF, method), ppc_r11); + ppc_stptr (code, ppc_r0, G_STRUCT_OFFSET(MonoLMF, method), ppc_r12); } /* store the frame pointer of the calling method */ ppc_addi (code, ppc_r0, ppc_sp, STACK); - ppc_stptr (code, ppc_r0, G_STRUCT_OFFSET(MonoLMF, ebp), ppc_r11); + ppc_stptr (code, ppc_r0, G_STRUCT_OFFSET(MonoLMF, ebp), ppc_r12); /* save the IP (caller ip) */ if (tramp_type == MONO_TRAMPOLINE_JUMP) { ppc_li (code, ppc_r0, 0); } else { ppc_ldr (code, ppc_r0, STACK + PPC_RET_ADDR_OFFSET, ppc_r1); } - ppc_stptr (code, ppc_r0, G_STRUCT_OFFSET(MonoLMF, eip), ppc_r11); + ppc_stptr (code, ppc_r0, G_STRUCT_OFFSET(MonoLMF, eip), ppc_r12); /* * Now we're ready to call trampoline (mgreg_t *regs, guint8 *code, gpointer value, guint8 *tramp) @@ -356,15 +356,15 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf if (aot) { code = mono_arch_emit_load_aotconst (buf, code, &ji, MONO_PATCH_INFO_JIT_ICALL_ADDR, g_strdup_printf ("trampoline_func_%d", tramp_type)); #ifdef PPC_USES_FUNCTION_DESCRIPTOR - ppc_ldptr (code, ppc_r2, sizeof (gpointer), ppc_r11); - ppc_ldptr (code, ppc_r11, 0, ppc_r11); + ppc_ldptr (code, ppc_r2, sizeof (gpointer), ppc_r12); + ppc_ldptr (code, ppc_r12, 0, ppc_r12); #endif - ppc_mtlr (code, ppc_r11); + ppc_mtlr (code, ppc_r12); ppc_blrl (code); } else { tramp_handler = mono_get_trampoline_func (tramp_type); - ppc_load_func (code, ppc_r0, tramp_handler); - ppc_mtlr (code, ppc_r0); + ppc_load_func (code, PPC_CALL_REG, tramp_handler); + ppc_mtlr (code, PPC_CALL_REG); ppc_blrl (code); } @@ -384,20 +384,20 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf * Now we restore the MonoLMF (see emit_epilogue in mini-ppc.c) * and the rest of the registers, so the method called will see * the same state as before we executed. - * The pointer to MonoLMF is in ppc_r11. + * The pointer to MonoLMF is in ppc_r12. */ - ppc_addi (code, ppc_r11, ppc_r1, STACK - sizeof (MonoLMF)); + ppc_addi (code, ppc_r12, ppc_r1, STACK - sizeof (MonoLMF)); /* r5 = previous_lmf */ - ppc_ldptr (code, ppc_r5, G_STRUCT_OFFSET(MonoLMF, previous_lmf), ppc_r11); + ppc_ldptr (code, ppc_r5, G_STRUCT_OFFSET(MonoLMF, previous_lmf), ppc_r12); /* r6 = lmf_addr */ - ppc_ldptr (code, ppc_r6, G_STRUCT_OFFSET(MonoLMF, lmf_addr), ppc_r11); + ppc_ldptr (code, ppc_r6, G_STRUCT_OFFSET(MonoLMF, lmf_addr), ppc_r12); /* *(lmf_addr) = previous_lmf */ ppc_stptr (code, ppc_r5, G_STRUCT_OFFSET(MonoLMF, previous_lmf), ppc_r6); /* restore iregs */ - ppc_ldr_multiple (code, ppc_r13, G_STRUCT_OFFSET(MonoLMF, iregs), ppc_r11); + ppc_ldr_multiple (code, ppc_r13, G_STRUCT_OFFSET(MonoLMF, iregs), ppc_r12); /* restore fregs */ for (i = 14; i < 32; i++) - ppc_lfd (code, i, G_STRUCT_OFFSET(MonoLMF, fregs) + ((i-14) * sizeof (gdouble)), ppc_r11); + ppc_lfd (code, i, G_STRUCT_OFFSET(MonoLMF, fregs) + ((i-14) * sizeof (gdouble)), ppc_r12); /* restore the volatile registers, we skip r1, of course */ offset = STACK - sizeof (MonoLMF) - (14 * sizeof (double)); @@ -419,8 +419,8 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf */ /* Restore stack pointer and LR and jump to the code */ ppc_ldr (code, ppc_r1, 0, ppc_r1); - ppc_ldr (code, ppc_r11, PPC_RET_ADDR_OFFSET, ppc_r1); - ppc_mtlr (code, ppc_r11); + ppc_ldr (code, ppc_r12, PPC_RET_ADDR_OFFSET, ppc_r1); + ppc_mtlr (code, ppc_r12); if (MONO_TRAMPOLINE_TYPE_MUST_RETURN (tramp_type)) ppc_blr (code); else @@ -591,9 +591,9 @@ mono_arch_create_rgctx_lazy_fetch_trampoline (guint32 slot, MonoTrampInfo **info code = mono_arch_emit_load_aotconst (buf, code, &ji, MONO_PATCH_INFO_JIT_ICALL_ADDR, g_strdup_printf ("specific_trampoline_lazy_fetch_%u", slot)); /* Branch to the trampoline */ #ifdef PPC_USES_FUNCTION_DESCRIPTOR - ppc_ldptr (code, ppc_r11, 0, ppc_r11); + ppc_ldptr (code, ppc_r12, 0, ppc_r12); #endif - ppc_mtctr (code, ppc_r11); + ppc_mtctr (code, ppc_r12); ppc_bcctr (code, PPC_BR_ALWAYS, 0); } else { tramp = mono_arch_create_specific_trampoline (GUINT_TO_POINTER (slot), @@ -653,9 +653,9 @@ mono_arch_create_generic_class_init_trampoline (MonoTrampInfo **info, gboolean a code = mono_arch_emit_load_aotconst (buf, code, &ji, MONO_PATCH_INFO_JIT_ICALL_ADDR, "specific_trampoline_generic_class_init"); /* Branch to the trampoline */ #ifdef PPC_USES_FUNCTION_DESCRIPTOR - ppc_ldptr (code, ppc_r11, 0, ppc_r11); + ppc_ldptr (code, ppc_r12, 0, ppc_r12); #endif - ppc_mtctr (code, ppc_r11); + ppc_mtctr (code, ppc_r12); ppc_bcctr (code, PPC_BR_ALWAYS, 0); } else { tramp = mono_arch_create_specific_trampoline (NULL, MONO_TRAMPOLINE_GENERIC_CLASS_INIT, diff --git a/mono/profiler/proflog.c b/mono/profiler/proflog.c index 882a17f678e..8ce18359101 100644 --- a/mono/profiler/proflog.c +++ b/mono/profiler/proflog.c @@ -2459,6 +2459,10 @@ new_filename (const char* filename) } #ifndef DISABLE_HELPER_THREAD + +//this is exposed by the JIT, but it's not meant to be a supported API for now. +extern void mono_threads_attach_tools_thread (void); + static void* helper_thread (void* arg) { @@ -2468,6 +2472,7 @@ helper_thread (void* arg) char buf [64]; MonoThread *thread = NULL; + mono_threads_attach_tools_thread (); //fprintf (stderr, "Server listening\n"); command_socket = -1; while (1) { diff --git a/mono/tests/monitor-resurrection.cs b/mono/tests/monitor-resurrection.cs index 7ddd59c71b8..2ce4a3c4d78 100644 --- a/mono/tests/monitor-resurrection.cs +++ b/mono/tests/monitor-resurrection.cs @@ -14,20 +14,23 @@ public class Foo { public static void CreateFoo (int level) { - if (level == 0) - Foo.reference = new Foo (); - else + if (level == 0) { + reference = new Foo (); + + /* Allocate a MonoThreadsSync for the object */ + Monitor.Enter (reference); + Monitor.Exit (reference); + reference = null; + } else { CreateFoo (level - 1); + } } public static int Main() { /* Allocate an object down the stack so it doesn't get pinned */ CreateFoo (100); - /* Allocate a MonoThreadsSync for the object */ - Monitor.Enter (reference); - Monitor.Exit (reference); - reference = null; + Console.WriteLine ("."); /* resurrect obj */ GC.Collect (); diff --git a/mono/utils/mach-support.c b/mono/utils/mach-support.c index 5adc0c99ee8..19e745f630c 100644 --- a/mono/utils/mach-support.c +++ b/mono/utils/mach-support.c @@ -16,9 +16,6 @@ #include #include -#include -#include -#include #include #include "mach-support.h" diff --git a/mono/utils/mono-compiler.h b/mono/utils/mono-compiler.h index d3c41ba44df..bad994cc293 100644 --- a/mono/utils/mono-compiler.h +++ b/mono/utils/mono-compiler.h @@ -219,6 +219,20 @@ #include typedef SSIZE_T ssize_t; +/* + * SSIZE_MAX is not defined in MSVC, so define it here. + * + * These values come from MinGW64, and are public domain. + * + */ +#ifndef SSIZE_MAX +#ifdef _WIN64 +#define SSIZE_MAX _I64_MAX +#else +#define SSIZE_MAX INT_MAX +#endif +#endif + #endif /* _MSC_VER */ #if !defined(_MSC_VER) && !defined(PLATFORM_SOLARIS) && !defined(_WIN32) && !defined(__CYGWIN__) && !defined(MONOTOUCH) && HAVE_VISIBILITY_HIDDEN diff --git a/mono/utils/mono-dl.c b/mono/utils/mono-dl.c index 04e9165b7c0..c13c68a0421 100644 --- a/mono/utils/mono-dl.c +++ b/mono/utils/mono-dl.c @@ -64,12 +64,7 @@ static const char suffixes [][4] = { #endif /* RTLD_LAZY */ #define SO_HANDLE_TYPE void* -#ifdef PLATFORM_ANDROID -/* Bionic doesn't support NULL filenames */ -# define LL_SO_OPEN(file,flags) ((file) ? dlopen ((file), (flags)) : NULL) -#else -# define LL_SO_OPEN(file,flags) dlopen ((file), (flags)) -#endif +#define LL_SO_OPEN(file,flags) dlopen ((file), (flags)) #define LL_SO_CLOSE(module) dlclose ((module)->handle) #define LL_SO_SYMBOL(module, name) dlsym ((module)->handle, (name)) #define LL_SO_TRFLAGS(flags) convert_flags ((flags)) @@ -337,7 +332,16 @@ mono_dl_open (const char *name, int flags, char **error_msg) return NULL; } module->main_module = name == NULL? TRUE: FALSE; + +#ifdef PLATFORM_ANDROID + /* Bionic doesn't support NULL filenames */ + if (!name) + lib = NULL; + else + lib = LL_SO_OPEN (name, lflags); +#else lib = LL_SO_OPEN (name, lflags); +#endif if (!lib) { GSList *node; for (node = fallback_handlers; node != NULL; node = node->next){ diff --git a/mono/utils/mono-dl.h b/mono/utils/mono-dl.h index 869495cb5c5..205916b6d4b 100644 --- a/mono/utils/mono-dl.h +++ b/mono/utils/mono-dl.h @@ -4,6 +4,18 @@ #include "mono/utils/mono-compiler.h" #include "mono/utils/mono-dl-fallback.h" +#ifdef TARGET_WIN32 +#define MONO_SOLIB_EXT ".dll" +#elif defined(__ppc__) && defined(TARGET_MACH) +#define MONO_SOLIB_EXT ".dylib" +#elif defined(TARGET_MACH) && defined(TARGET_X86) && !defined(__native_client_codegen__) +#define MONO_SOLIB_EXT ".dylib" +#elif defined(TARGET_MACH) && defined(TARGET_AMD64) && !defined(__native_client_codegen__) +#define MONO_SOLIB_EXT ".dylib" +#else +#define MONO_SOLIB_EXT ".so" +#endif + typedef struct _MonoDl MonoDl; MonoDl* mono_dl_open (const char *name, int flags, char **error_msg) MONO_LLVM_INTERNAL; diff --git a/mono/utils/mono-io-portability.c b/mono/utils/mono-io-portability.c index 979bb6037fd..4304851c11d 100644 --- a/mono/utils/mono-io-portability.c +++ b/mono/utils/mono-io-portability.c @@ -6,12 +6,6 @@ #endif #include #include -#include -#include -#include -#include -#include -#include #include #ifndef DISABLE_PORTABILITY diff --git a/mono/utils/mono-linked-list-set.h b/mono/utils/mono-linked-list-set.h index efb14f0352b..89c7f1181c7 100644 --- a/mono/utils/mono-linked-list-set.h +++ b/mono/utils/mono-linked-list-set.h @@ -66,7 +66,15 @@ Requires the world to be stoped MonoLinkedListSetNode *__cur; \ for (__cur = (list)->head; __cur; __cur = mono_lls_pointer_unmask (__cur->next)) \ if (!mono_lls_pointer_get_mark (__cur->next)) { \ - (element) = (type)__cur; \ + (element) = (type)__cur; + + +#define MONO_LLS_FOREACH_FILTERED(list, element, filter_func, type) {\ + MonoLinkedListSetNode *__cur; \ + for (__cur = (list)->head; __cur; __cur = mono_lls_pointer_unmask (__cur->next)) \ + if (!mono_lls_pointer_get_mark (__cur->next)) { \ + (element) = (type)__cur; \ + if (!filter_func (element)) continue; #define MONO_LLS_END_FOREACH }} @@ -91,6 +99,18 @@ Provides snapshot iteration if (!mono_lls_pointer_get_mark (__next)) { \ (element) = (type)__cur; +#define MONO_LLS_FOREACH_FILTERED_SAFE(list, element, filter_func, type) {\ + MonoThreadHazardPointers *__hp = mono_hazard_pointer_get (); \ + MonoLinkedListSetNode *__cur, *__next; \ + for (__cur = mono_lls_pointer_unmask (get_hazardous_pointer ((gpointer volatile*)&(list)->head, __hp, 1)); \ + __cur; \ + __cur = mono_lls_info_step (__next, __hp)) { \ + __next = get_hazardous_pointer_with_mask ((gpointer volatile*)&__cur->next, __hp, 0); \ + if (!mono_lls_pointer_get_mark (__next)) { \ + (element) = (type)__cur; \ + if (!filter_func (element)) continue; + + #define MONO_LLS_END_FOREACH_SAFE \ } \ } \ diff --git a/mono/utils/mono-mmap.c b/mono/utils/mono-mmap.c index 6caf9628380..ed11c9f1b28 100644 --- a/mono/utils/mono-mmap.c +++ b/mono/utils/mono-mmap.c @@ -645,7 +645,7 @@ mono_shared_area (void) header->stats_start = sizeof (SAreaHeader); header->stats_end = sizeof (SAreaHeader); - atexit (mono_shared_area_remove); + mono_atexit (mono_shared_area_remove); return res; } diff --git a/mono/utils/mono-proclib.c b/mono/utils/mono-proclib.c index 1303b5b4d44..81399007ad6 100644 --- a/mono/utils/mono-proclib.c +++ b/mono/utils/mono-proclib.c @@ -498,6 +498,8 @@ mono_process_get_data_with_error (gpointer pid, MonoProcessData data, MonoProces return get_process_stat_item (rpid, 18, FALSE, error) / get_user_hz (); case MONO_PROCESS_PPID: return get_process_stat_time (rpid, 0, FALSE, error); + case MONO_PROCESS_PAGED_BYTES: + return get_pid_status_item (rpid, "VmSwap", error, 1024); /* Nothing yet */ case MONO_PROCESS_END: @@ -664,3 +666,13 @@ mono_cpu_get_data (int cpu_id, MonoCpuData data, MonoProcessError *error) return value; } +int +mono_atexit (void (*func)(void)) +{ +#ifdef PLATFORM_ANDROID + /* Some versions of android libc doesn't define atexit () */ + return 0; +#else + return atexit (func); +#endif +} diff --git a/mono/utils/mono-proclib.h b/mono/utils/mono-proclib.h index e0d84ec0233..6a8f6bf81f7 100644 --- a/mono/utils/mono-proclib.h +++ b/mono/utils/mono-proclib.h @@ -20,8 +20,9 @@ typedef enum { MONO_PROCESS_VIRTUAL_BYTES, MONO_PROCESS_VIRTUAL_BYTES_PEAK, MONO_PROCESS_FAULTS, - MONO_PROCESS_ELAPSED, + MONO_PROCESS_ELAPSED, /* 10 */ MONO_PROCESS_PPID, + MONO_PROCESS_PAGED_BYTES, MONO_PROCESS_END } MonoProcessData; @@ -52,5 +53,7 @@ int mono_process_current_pid (void) MONO_INTERNAL; int mono_cpu_count (void) MONO_INTERNAL; gint64 mono_cpu_get_data (int cpu_id, MonoCpuData data, MonoProcessError *error) MONO_INTERNAL; +int mono_atexit (void (*func)(void)) MONO_INTERNAL; + #endif /* __MONO_PROC_LIB_H__ */ diff --git a/mono/utils/mono-threads-mach.c b/mono/utils/mono-threads-mach.c index 6270c57f1d6..c0b28a12d8e 100644 --- a/mono/utils/mono-threads-mach.c +++ b/mono/utils/mono-threads-mach.c @@ -20,9 +20,6 @@ #include #include #include -#include -#include -#include void mono_threads_init_platform (void) diff --git a/mono/utils/mono-threads-posix.c b/mono/utils/mono-threads-posix.c index 377d522d250..a32f5a9ff9c 100644 --- a/mono/utils/mono-threads-posix.c +++ b/mono/utils/mono-threads-posix.c @@ -19,7 +19,11 @@ #include -#if defined(PLATFORM_ANDROID) +#if defined(PLATFORM_ANDROID) && !defined(TARGET_ARM64) +#define USE_TKILL_ON_ANDROID 1 +#endif + +#ifdef USE_TKILL_ON_ANDROID extern int tkill (pid_t tid, int signal); #endif @@ -267,7 +271,7 @@ mono_threads_core_clear_interruption (void) int mono_threads_pthread_kill (MonoThreadInfo *info, int signum) { -#if defined (PLATFORM_ANDROID) +#ifdef USE_TKILL_ON_ANDROID int result, old_errno = errno; result = tkill (info->native_handle, signum); if (result < 0) { @@ -369,7 +373,7 @@ mono_threads_init_platform (void) * FIXME: Use this on all platforms. * SIGUSR1 is used by dalvik/art. */ - no_interrupt_signo = SIGUSR2; + no_interrupt_signo = SIGWINCH; g_assert (abort_signo != no_interrupt_signo); mono_posix_add_signal_handler (no_interrupt_signo, suspend_signal_handler, SA_RESTART); #endif diff --git a/mono/utils/mono-threads.c b/mono/utils/mono-threads.c index 92b84e31266..8ae4a3f15d9 100644 --- a/mono/utils/mono-threads.c +++ b/mono/utils/mono-threads.c @@ -287,6 +287,31 @@ mono_thread_info_list_head (void) return &thread_list; } +/** + * mono_threads_attach_tools_thread + * + * Attach the current thread as a tool thread. DON'T USE THIS FUNCTION WITHOUT READING ALL DISCLAIMERS. + * + * A tools thread is a very special kind of thread that needs access to core runtime facilities but should + * not be counted as a regular thread for high order facilities such as executing managed code or accessing + * the managed heap. + * + * This is intended only to tools such as a profiler than needs to be able to use our lock-free support when + * doing things like resolving backtraces in their background processing thread. + */ +void +mono_threads_attach_tools_thread (void) +{ + int dummy = 0; + MonoThreadInfo *info; + + /* Must only be called once */ + g_assert (!mono_native_tls_get_value (thread_info_key)); + + info = mono_thread_info_attach (&dummy); + info->tools_thread = TRUE; +} + MonoThreadInfo* mono_thread_info_attach (void *baseptr) { diff --git a/mono/utils/mono-threads.h b/mono/utils/mono-threads.h index f2fd1fe94bb..409c405f7f2 100644 --- a/mono/utils/mono-threads.h +++ b/mono/utils/mono-threads.h @@ -113,6 +113,9 @@ typedef struct { /*Tells if this thread was created by the runtime or not.*/ gboolean runtime_thread; + /* Tells if this thread should be ignored or not by runtime services such as GC and profiling */ + gboolean tools_thread; + /* suspend machinery, fields protected by suspend_semaphore */ MonoSemType suspend_semaphore; int suspend_count; @@ -200,16 +203,22 @@ typedef struct { gboolean (*thread_state_init_from_handle) (MonoThreadUnwindState *tctx, MonoThreadInfo *info); } MonoThreadInfoRuntimeCallbacks; +static inline gboolean +mono_threads_filter_tools_threads (THREAD_INFO_TYPE *info) +{ + return !((MonoThreadInfo*)info)->tools_thread; +} + /* Requires the world to be stoped */ -#define FOREACH_THREAD(thread) MONO_LLS_FOREACH (mono_thread_info_list_head (), thread, THREAD_INFO_TYPE*) +#define FOREACH_THREAD(thread) MONO_LLS_FOREACH_FILTERED (mono_thread_info_list_head (), thread, mono_threads_filter_tools_threads, THREAD_INFO_TYPE*) #define END_FOREACH_THREAD MONO_LLS_END_FOREACH /* Snapshot iteration. */ -#define FOREACH_THREAD_SAFE(thread) MONO_LLS_FOREACH_SAFE (mono_thread_info_list_head (), thread, THREAD_INFO_TYPE*) +#define FOREACH_THREAD_SAFE(thread) MONO_LLS_FOREACH_FILTERED_SAFE (mono_thread_info_list_head (), thread, mono_threads_filter_tools_threads, THREAD_INFO_TYPE*) #define END_FOREACH_THREAD_SAFE MONO_LLS_END_FOREACH_SAFE #define mono_thread_info_get_tid(info) ((MonoNativeThreadId)((MonoThreadInfo*)info)->node.key) @@ -349,7 +358,10 @@ mono_threads_add_async_job (THREAD_INFO_TYPE *info, MonoAsyncJob job) MONO_INTER MonoAsyncJob mono_threads_consume_async_jobs (void) MONO_INTERNAL; - + +void +mono_threads_attach_tools_thread (void); + #if !defined(HOST_WIN32) diff --git a/mono/utils/strtod.c b/mono/utils/strtod.c index f20acdc2498..1ba4b726906 100644 --- a/mono/utils/strtod.c +++ b/mono/utils/strtod.c @@ -173,6 +173,12 @@ * #define NO_ERRNO if strtod should not assign errno = ERANGE when * the result overflows to +-Infinity or underflows to 0. */ +#if defined __BIG_ENDIAN__ || defined _BIG_ENDIAN +# define IEEE_MC68k +#elif defined __LITTLE_ENDIAN__ || defined _LITTLE_ENDIAN +# define IEEE_8087 +#else + #if defined(TARGET_X86) || defined(mips) && defined(MIPSEL) || defined (__arm__) || defined(__aarch64__) # define IEEE_8087 @@ -194,9 +200,12 @@ # define IEEE_MC68k #else +#warning byte order unknown, assuming big endian #define IEEE_MC68k #endif +#endif + #define Long gint32 #define ULong guint32 diff --git a/msvc/eglib.vcxproj b/msvc/eglib.vcxproj index cbafcdd6315..3d1db4be7f3 100644 --- a/msvc/eglib.vcxproj +++ b/msvc/eglib.vcxproj @@ -1,6 +1,14 @@  + + Debug + Win32 + + + Debug + x64 + Debug Win32 @@ -9,6 +17,14 @@ Debug x64 + + Release + Win32 + + + Release + x64 + Release Win32 @@ -29,51 +45,107 @@ Unicode v110 + + StaticLibrary + Unicode + v110 + StaticLibrary Unicode v110 + + StaticLibrary + Unicode + v110 + StaticLibrary Unicode v110 + + StaticLibrary + Unicode + v110 + StaticLibrary Unicode v110 + + StaticLibrary + Unicode + v110 + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 $(Platform)\lib\ $(Platform)\obj\$(ProjectName)\$(Configuration)\ + $(Platform)\lib\ + $(Platform)\obj\$(ProjectName)\$(Configuration)\ $(Platform)\lib\ $(Platform)\obj\$(ProjectName)\$(Configuration)\ + $(Platform)\lib\ + $(Platform)\obj\$(ProjectName)\$(Configuration)\ $(Platform)\lib\ $(Platform)\obj\$(ProjectName)\$(Configuration)\ + $(Platform)\lib\ + $(Platform)\obj\$(ProjectName)\$(Configuration)\ $(Platform)\lib\ $(Platform)\obj\$(ProjectName)\$(Configuration)\ + $(Platform)\lib\ + $(Platform)\obj\$(ProjectName)\$(Configuration)\ - copy ..\eglib\winconfig.h ..\eglib\config.h + winsetup.bat + + + Disabled + ../eglib/src;../eglib;%(AdditionalIncludeDirectories) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level4 + EditAndContinue + + + + + winsetup.bat Disabled @@ -89,7 +161,21 @@ - copy ..\eglib\winconfig.h ..\eglib\config.h + winsetup.bat + + + MinSpace + ../eglib/src;../eglib;%(AdditionalIncludeDirectories) + MultiThreadedDLL + + + Level4 + ProgramDatabase + + + + + winsetup.bat MinSpace @@ -103,7 +189,26 @@ - copy ..\eglib\winconfig.h ..\eglib\config.h + winsetup.bat + + + X64 + + + Disabled + ../eglib/src;../eglib;%(AdditionalIncludeDirectories) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level4 + ProgramDatabase + + + + + winsetup.bat X64 @@ -122,7 +227,24 @@ - copy ..\eglib\winconfig.h ..\eglib\config.h + winsetup.bat + + + X64 + + + MinSpace + ../eglib/src;../eglib;%(AdditionalIncludeDirectories) + MultiThreadedDLL + + + Level4 + ProgramDatabase + + + + + winsetup.bat X64 @@ -182,4 +304,4 @@ - \ No newline at end of file + diff --git a/msvc/genmdesc.vcxproj b/msvc/genmdesc.vcxproj index 34efcacfd5c..c247eb42993 100644 --- a/msvc/genmdesc.vcxproj +++ b/msvc/genmdesc.vcxproj @@ -1,6 +1,14 @@  + + Debug + Win32 + + + Debug + x64 + Debug Win32 @@ -9,6 +17,14 @@ Debug x64 + + Release + Win32 + + + Release + x64 + Release Win32 @@ -30,50 +46,94 @@ Unicode v110 + + Application + false + Unicode + v110 + Application false Unicode v110 + + Application + false + Unicode + v110 + Application false Unicode v110 + + Application + false + Unicode + v110 + Application false Unicode v110 + + Application + false + Unicode + v110 + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 $(Platform)\bin\ $(Platform)\obj\$(ProjectName)\ + $(Platform)\bin\ + $(Platform)\obj\$(ProjectName)\ $(Platform)\bin\ $(Platform)\obj\$(ProjectName)\ + $(Platform)\bin\ + $(Platform)\obj\$(ProjectName)\ $(Platform)\bin\ $(Platform)\obj\$(ProjectName)\ + $(Platform)\bin\ + $(Platform)\obj\$(ProjectName)\ $(Platform)\bin\ $(Platform)\obj\$(ProjectName)\ + $(Platform)\bin\ + $(Platform)\obj\$(ProjectName)\ @@ -118,6 +178,49 @@ runmdesc.bat "$(TargetPath)" $(Platform) + + + + + + + .\./VSDependancies/genmdesc___Win32_Debug/genmdesc.tlb + + + + + Disabled + ..\libgc\include;..\;..\mono\;..\eglib\src;%(AdditionalIncludeDirectories) + _DEBUG;_CRT_SECURE_NO_DEPRECATE;_CONSOLE;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + true + EditAndContinue + CompileAsC + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + false + + + eglib.lib;libmonoutils.lib;%(AdditionalDependencies) + true + $(Platform)\lib;%(AdditionalLibraryDirectories) + true + Console + MachineX86 + + + runmdesc.bat "$(TargetPath)" $(Platform) + + @@ -132,7 +235,51 @@ Disabled ..\libgc\include;..\;..\mono\;..\eglib\src;%(AdditionalIncludeDirectories) - _DEBUG;__x86_64__;TARGET_AMD64;WIN64;_WIN64;WIN32;_WIN32;__WIN32__;_WINDOWS;WINDOWS;HOST_WIN32;TARGET_WIN32;_CRT_SECURE_NO_DEPRECATE;_CONSOLE;HAVE_CONFIG_H;WINVER=0x0502;_WIN32_WINNT=0x0502;_WIN32_IE=0x0501;WIN32_THREADS;FD_SETSIZE=1024;%(PreprocessorDefinitions) + _DEBUG;__x86_64__;TARGET_AMD64;WIN64;_WIN64;WIN32;_WIN32;__WIN32__;_WINDOWS;WINDOWS;HOST_WIN32;TARGET_WIN32;_CRT_SECURE_NO_DEPRECATE;_CONSOLE;HAVE_CONFIG_H;WINVER=0x0502;_WIN32_WINNT=0x0502;_WIN32_IE=0x0501;WIN32_THREADS;FD_SETSIZE=1024;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + + + Level3 + true + ProgramDatabase + CompileAsC + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + false + + + eglib.lib;libmonoutils.lib;%(AdditionalDependencies) + true + $(Platform)\lib;%(AdditionalLibraryDirectories) + true + Console + MachineX64 + + + runmdesc.bat "$(TargetPath)" $(Platform) + + + + + + + + + X64 + .\./VSDependancies/genmdesc___Win32_Debug/genmdesc.tlb + + + + + Disabled + ..\libgc\include;..\;..\mono\;..\eglib\src;%(AdditionalIncludeDirectories) + _DEBUG;__x86_64__;TARGET_AMD64;WIN64;_WIN64;WIN32;_WIN32;__WIN32__;_WINDOWS;WINDOWS;HOST_WIN32;TARGET_WIN32;_CRT_SECURE_NO_DEPRECATE;_CONSOLE;HAVE_CONFIG_H;WINVER=0x0502;_WIN32_WINNT=0x0502;_WIN32_IE=0x0501;WIN32_THREADS;FD_SETSIZE=1024;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL @@ -204,6 +351,48 @@ runmdesc.bat "$(TargetPath)" $(Platform) + + + + + + + .\Release/genmdesc.tlb + + + + + MinSpace + OnlyExplicitInline + ..\libgc\include;..\;..\mono\;..\eglib\src;%(AdditionalIncludeDirectories) + NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CONSOLE;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + false + + + eglib.lib;libmonoutils.lib;%(AdditionalDependencies) + true + $(Platform)\lib;%(AdditionalLibraryDirectories) + Console + MachineX86 + true + + + runmdesc.bat "$(TargetPath)" $(Platform) + + @@ -219,7 +408,51 @@ MinSpace OnlyExplicitInline ..\libgc\include;..\;..\mono\;..\eglib\src;%(AdditionalIncludeDirectories) - NDEBUG;__x86_64__;TARGET_AMD64;WIN64;_WIN64;WIN32;_WIN32;__WIN32__;_WINDOWS;WINDOWS;HOST_WIN32;TARGET_WIN32;_CRT_SECURE_NO_DEPRECATE;_CONSOLE;HAVE_CONFIG_H;WINVER=0x0502;_WIN32_WINNT=0x0502;_WIN32_IE=0x0501;WIN32_THREADS;FD_SETSIZE=1024;%(PreprocessorDefinitions) + NDEBUG;__x86_64__;TARGET_AMD64;WIN64;_WIN64;WIN32;_WIN32;__WIN32__;_WINDOWS;WINDOWS;HOST_WIN32;TARGET_WIN32;_CRT_SECURE_NO_DEPRECATE;_CONSOLE;HAVE_CONFIG_H;WINVER=0x0502;_WIN32_WINNT=0x0502;_WIN32_IE=0x0501;WIN32_THREADS;FD_SETSIZE=1024;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + + + Level3 + true + CompileAsC + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + false + + + eglib.lib;libmonoutils.lib;%(AdditionalDependencies) + true + $(Platform)\lib;%(AdditionalLibraryDirectories) + Console + MachineX64 + true + + + runmdesc.bat "$(TargetPath)" $(Platform) + + + + + + + + + X64 + .\Release/genmdesc.tlb + + + + + MinSpace + OnlyExplicitInline + ..\libgc\include;..\;..\mono\;..\eglib\src;%(AdditionalIncludeDirectories) + NDEBUG;__x86_64__;TARGET_AMD64;WIN64;_WIN64;WIN32;_WIN32;__WIN32__;_WINDOWS;WINDOWS;HOST_WIN32;TARGET_WIN32;_CRT_SECURE_NO_DEPRECATE;_CONSOLE;HAVE_CONFIG_H;WINVER=0x0502;_WIN32_WINNT=0x0502;_WIN32_IE=0x0501;WIN32_THREADS;FD_SETSIZE=1024;%(PreprocessorDefinitions) true MultiThreadedDLL true @@ -255,19 +488,37 @@ true + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + true %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) true + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + true %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + %(AdditionalIncludeDirectories) @@ -275,19 +526,37 @@ true + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + true %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) true + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + true %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + %(AdditionalIncludeDirectories) @@ -295,19 +564,37 @@ true + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + true %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) true + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + true %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + %(AdditionalIncludeDirectories) @@ -315,19 +602,37 @@ true + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + true %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) true + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + + true %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + + diff --git a/msvc/libgc.vcxproj b/msvc/libgc.vcxproj index db5bfab6d46..4871cc2e3c2 100644 --- a/msvc/libgc.vcxproj +++ b/msvc/libgc.vcxproj @@ -1,6 +1,14 @@  + + Debug + Win32 + + + Debug + x64 + Debug Win32 @@ -9,6 +17,14 @@ Debug x64 + + Release + Win32 + + + Release + x64 + Release Win32 @@ -29,53 +45,113 @@ Unicode v110 + + StaticLibrary + Unicode + v110 + StaticLibrary Unicode v110 + + StaticLibrary + Unicode + v110 + StaticLibrary Unicode v110 + + StaticLibrary + Unicode + v110 + StaticLibrary Unicode v110 + + StaticLibrary + Unicode + v110 + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 $(Platform)\lib\ $(Platform)\obj\$(ProjectName)\$(Configuration)\ + $(Platform)\lib\ + $(Platform)\obj\$(ProjectName)\$(Configuration)\ $(Platform)\lib\ $(Platform)\obj\$(ProjectName)\$(Configuration)\ + $(Platform)\lib\ + $(Platform)\obj\$(ProjectName)\$(Configuration)\ $(Platform)\lib\ $(Platform)\obj\$(ProjectName)\$(Configuration)\ + $(Platform)\lib\ + $(Platform)\obj\$(ProjectName)\$(Configuration)\ $(Platform)\lib\ $(Platform)\obj\$(ProjectName)\$(Configuration)\ + $(Platform)\lib\ + $(Platform)\obj\$(ProjectName)\$(Configuration)\ Disabled ..\libgc\include;%(AdditionalIncludeDirectories) - _DEBUG;__i386__;TARGET_X86;i386;WIN32;_WIN32;__WIN32__;_WINDOWS;WINDOWS;HOST_WIN32;TARGET_WIN32;_CRT_SECURE_NO_DEPRECATE;__STDC__;PACKAGE_NAME="libgc-mono";PACKAGE_TARNAME="libgc-mono";PACKAGE_VERSION="6.6";PACKAGE_STRING="libgc-mono 6.6";PACKAGE_BUGREPORT="Hans_Boehm%40hp.com";GC_WIN32_THREADS=1;NO_GETENV=1;GC_INSIDE_DLL=1;GC_NOT_DLL=1;STDC_HEADERS=1;HAVE_SYS_TYPES_H=1;HAVE_SYS_STAT_H=1;HAVE_STDLIB_H=1;HAVE_STRING_H=1;HAVE_MEMORY_H=1;HAVE_STRINGS_H=1;HAVE_INTTYPES_H=1;HAVE_STDINT_H=1;HAVE_UNISTD_H=1;SILENT=1;NO_SIGNALS=1;NO_EXECUTE_PERMISSION=1;JAVA_FINALIZATION=1;GC_GCJ_SUPPORT=1;ATOMIC_UNCOLLECTABLE=1;_IN_LIBGC=1;WINVER=0x0502;_WIN32_WINNT=0x0502;_WIN32_IE=0x0501;WIN32_THREADS;FD_SETSIZE=1024;%(PreprocessorDefinitions) + _DEBUG;__i386__;TARGET_X86;i386;WIN32;_WIN32;__WIN32__;_WINDOWS;WINDOWS;HOST_WIN32;TARGET_WIN32;_CRT_SECURE_NO_DEPRECATE;__STDC__;PACKAGE_NAME="libgc-mono";PACKAGE_TARNAME="libgc-mono";PACKAGE_VERSION="6.6";PACKAGE_STRING="libgc-mono 6.6";PACKAGE_BUGREPORT="Hans_Boehm%40hp.com";GC_WIN32_THREADS=1;NO_GETENV=1;GC_INSIDE_DLL=1;GC_NOT_DLL=1;STDC_HEADERS=1;HAVE_SYS_TYPES_H=1;HAVE_SYS_STAT_H=1;HAVE_STDLIB_H=1;HAVE_STRING_H=1;HAVE_MEMORY_H=1;HAVE_STRINGS_H=1;HAVE_INTTYPES_H=1;HAVE_STDINT_H=1;HAVE_UNISTD_H=1;SILENT=1;NO_SIGNALS=1;NO_EXECUTE_PERMISSION=1;JAVA_FINALIZATION=1;GC_GCJ_SUPPORT=1;ATOMIC_UNCOLLECTABLE=1;_IN_LIBGC=1;WINVER=0x0502;_WIN32_WINNT=0x0502;_WIN32_IE=0x0501;WIN32_THREADS;FD_SETSIZE=1024;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + true + + + $(OutDir)vc80.pdb + ProgramDatabase + CompileAsC + 4311;4312;4996;4005;%(DisableSpecificWarnings) + + + $(OutDir)libgc.lib + + + + + Disabled + ..\libgc\include;%(AdditionalIncludeDirectories) + _DEBUG;__i386__;TARGET_X86;i386;WIN32;_WIN32;__WIN32__;_WINDOWS;WINDOWS;HOST_WIN32;TARGET_WIN32;_CRT_SECURE_NO_DEPRECATE;__STDC__;PACKAGE_NAME="libgc-mono";PACKAGE_TARNAME="libgc-mono";PACKAGE_VERSION="6.6";PACKAGE_STRING="libgc-mono 6.6";PACKAGE_BUGREPORT="Hans_Boehm%40hp.com";GC_WIN32_THREADS=1;NO_GETENV=1;GC_INSIDE_DLL=1;GC_NOT_DLL=1;STDC_HEADERS=1;HAVE_SYS_TYPES_H=1;HAVE_SYS_STAT_H=1;HAVE_STDLIB_H=1;HAVE_STRING_H=1;HAVE_MEMORY_H=1;HAVE_STRINGS_H=1;HAVE_INTTYPES_H=1;HAVE_STDINT_H=1;HAVE_UNISTD_H=1;SILENT=1;NO_SIGNALS=1;NO_EXECUTE_PERMISSION=1;JAVA_FINALIZATION=1;GC_GCJ_SUPPORT=1;ATOMIC_UNCOLLECTABLE=1;_IN_LIBGC=1;WINVER=0x0502;_WIN32_WINNT=0x0502;_WIN32_IE=0x0501;WIN32_THREADS;FD_SETSIZE=1024;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL @@ -95,7 +171,24 @@ MinSpace ..\libgc\include;%(AdditionalIncludeDirectories) - NDEBUG;__i386__;TARGET_X86;i386;i386;WIN32;_WIN32;__WIN32__;_WINDOWS;WINDOWS;HOST_WIN32;TARGET_WIN32;_CRT_SECURE_NO_DEPRECATE;__STDC__;PACKAGE_NAME="libgc-mono";PACKAGE_TARNAME="libgc-mono";PACKAGE_VERSION="6.6";PACKAGE_STRING="libgc-mono 6.6";PACKAGE_BUGREPORT="Hans_Boehm%40hp.com";GC_WIN32_THREADS=1;NO_GETENV=1;GC_INSIDE_DLL=1;GC_NOT_DLL=1;STDC_HEADERS=1;HAVE_SYS_TYPES_H=1;HAVE_SYS_STAT_H=1;HAVE_STDLIB_H=1;HAVE_STRING_H=1;HAVE_MEMORY_H=1;HAVE_STRINGS_H=1;HAVE_INTTYPES_H=1;HAVE_STDINT_H=1;HAVE_UNISTD_H=1;SILENT=1;NO_SIGNALS=1;NO_EXECUTE_PERMISSION=1;JAVA_FINALIZATION=1;GC_GCJ_SUPPORT=1;ATOMIC_UNCOLLECTABLE=1;_IN_LIBGC=1;WINVER=0x0502;_WIN32_WINNT=0x0502;_WIN32_IE=0x0501;WIN32_THREADS;FD_SETSIZE=1024;%(PreprocessorDefinitions) + NDEBUG;__i386__;TARGET_X86;i386;i386;WIN32;_WIN32;__WIN32__;_WINDOWS;WINDOWS;HOST_WIN32;TARGET_WIN32;_CRT_SECURE_NO_DEPRECATE;__STDC__;PACKAGE_NAME="libgc-mono";PACKAGE_TARNAME="libgc-mono";PACKAGE_VERSION="6.6";PACKAGE_STRING="libgc-mono 6.6";PACKAGE_BUGREPORT="Hans_Boehm%40hp.com";GC_WIN32_THREADS=1;NO_GETENV=1;GC_INSIDE_DLL=1;GC_NOT_DLL=1;STDC_HEADERS=1;HAVE_SYS_TYPES_H=1;HAVE_SYS_STAT_H=1;HAVE_STDLIB_H=1;HAVE_STRING_H=1;HAVE_MEMORY_H=1;HAVE_STRINGS_H=1;HAVE_INTTYPES_H=1;HAVE_STDINT_H=1;HAVE_UNISTD_H=1;SILENT=1;NO_SIGNALS=1;NO_EXECUTE_PERMISSION=1;JAVA_FINALIZATION=1;GC_GCJ_SUPPORT=1;ATOMIC_UNCOLLECTABLE=1;_IN_LIBGC=1;WINVER=0x0502;_WIN32_WINNT=0x0502;_WIN32_IE=0x0501;WIN32_THREADS;FD_SETSIZE=1024;%(PreprocessorDefinitions) + MultiThreadedDLL + true + + + $(OutDir)vc80.pdb + ProgramDatabase + CompileAsC + + + $(OutDir)libgc.lib + + + + + MinSpace + ..\libgc\include;%(AdditionalIncludeDirectories) + NDEBUG;__i386__;TARGET_X86;i386;i386;WIN32;_WIN32;__WIN32__;_WINDOWS;WINDOWS;HOST_WIN32;TARGET_WIN32;_CRT_SECURE_NO_DEPRECATE;__STDC__;PACKAGE_NAME="libgc-mono";PACKAGE_TARNAME="libgc-mono";PACKAGE_VERSION="6.6";PACKAGE_STRING="libgc-mono 6.6";PACKAGE_BUGREPORT="Hans_Boehm%40hp.com";GC_WIN32_THREADS=1;NO_GETENV=1;GC_INSIDE_DLL=1;GC_NOT_DLL=1;STDC_HEADERS=1;HAVE_SYS_TYPES_H=1;HAVE_SYS_STAT_H=1;HAVE_STDLIB_H=1;HAVE_STRING_H=1;HAVE_MEMORY_H=1;HAVE_STRINGS_H=1;HAVE_INTTYPES_H=1;HAVE_STDINT_H=1;HAVE_UNISTD_H=1;SILENT=1;NO_SIGNALS=1;NO_EXECUTE_PERMISSION=1;JAVA_FINALIZATION=1;GC_GCJ_SUPPORT=1;ATOMIC_UNCOLLECTABLE=1;_IN_LIBGC=1;WINVER=0x0502;_WIN32_WINNT=0x0502;_WIN32_IE=0x0501;WIN32_THREADS;FD_SETSIZE=1024;%(PreprocessorDefinitions) MultiThreadedDLL true @@ -115,7 +208,30 @@ Disabled ..\libgc\include;%(AdditionalIncludeDirectories) - _DEBUG;__x86_64__;WIN64;_WIN64;WIN32;_WIN32;__WIN32__;_WINDOWS;WINDOWS;HOST_WIN32;TARGET_WIN32;_CRT_SECURE_NO_DEPRECATE;__STDC__;PACKAGE_NAME="libgc-mono";PACKAGE_TARNAME="libgc-mono";PACKAGE_VERSION="6.6";PACKAGE_STRING="libgc-mono 6.6";PACKAGE_BUGREPORT="Hans_Boehm%40hp.com";GC_WIN32_THREADS=1;NO_GETENV=1;GC_INSIDE_DLL=1;GC_NOT_DLL=1;STDC_HEADERS=1;HAVE_SYS_TYPES_H=1;HAVE_SYS_STAT_H=1;HAVE_STDLIB_H=1;HAVE_STRING_H=1;HAVE_MEMORY_H=1;HAVE_STRINGS_H=1;HAVE_INTTYPES_H=1;HAVE_STDINT_H=1;HAVE_UNISTD_H=1;SILENT=1;NO_SIGNALS=1;NO_EXECUTE_PERMISSION=1;JAVA_FINALIZATION=1;GC_GCJ_SUPPORT=1;ATOMIC_UNCOLLECTABLE=1;_IN_LIBGC=1;WINVER=0x0502;_WIN32_WINNT=0x0502;_WIN32_IE=0x0501;WIN32_THREADS;FD_SETSIZE=1024 + _DEBUG;__x86_64__;WIN64;_WIN64;WIN32;_WIN32;__WIN32__;_WINDOWS;WINDOWS;HOST_WIN32;TARGET_WIN32;_CRT_SECURE_NO_DEPRECATE;__STDC__;PACKAGE_NAME="libgc-mono";PACKAGE_TARNAME="libgc-mono";PACKAGE_VERSION="6.6";PACKAGE_STRING="libgc-mono 6.6";PACKAGE_BUGREPORT="Hans_Boehm%40hp.com";GC_WIN32_THREADS=1;NO_GETENV=1;GC_INSIDE_DLL=1;GC_NOT_DLL=1;STDC_HEADERS=1;HAVE_SYS_TYPES_H=1;HAVE_SYS_STAT_H=1;HAVE_STDLIB_H=1;HAVE_STRING_H=1;HAVE_MEMORY_H=1;HAVE_STRINGS_H=1;HAVE_INTTYPES_H=1;HAVE_STDINT_H=1;HAVE_UNISTD_H=1;SILENT=1;NO_SIGNALS=1;NO_EXECUTE_PERMISSION=1;JAVA_FINALIZATION=1;GC_GCJ_SUPPORT=1;ATOMIC_UNCOLLECTABLE=1;_IN_LIBGC=1;WINVER=0x0502;_WIN32_WINNT=0x0502;_WIN32_IE=0x0501;WIN32_THREADS;FD_SETSIZE=1024 + true + EnableFastChecks + MultiThreadedDebugDLL + true + + + $(OutDir)vc80.pdb + ProgramDatabase + CompileAsC + 4311;4312;4996;4005;%(DisableSpecificWarnings) + + + $(OutDir)libgc.lib + + + + + X64 + + + Disabled + ..\libgc\include;%(AdditionalIncludeDirectories) + _DEBUG;__x86_64__;WIN64;_WIN64;WIN32;_WIN32;__WIN32__;_WINDOWS;WINDOWS;HOST_WIN32;TARGET_WIN32;_CRT_SECURE_NO_DEPRECATE;__STDC__;PACKAGE_NAME="libgc-mono";PACKAGE_TARNAME="libgc-mono";PACKAGE_VERSION="6.6";PACKAGE_STRING="libgc-mono 6.6";PACKAGE_BUGREPORT="Hans_Boehm%40hp.com";GC_WIN32_THREADS=1;NO_GETENV=1;GC_INSIDE_DLL=1;GC_NOT_DLL=1;STDC_HEADERS=1;HAVE_SYS_TYPES_H=1;HAVE_SYS_STAT_H=1;HAVE_STDLIB_H=1;HAVE_STRING_H=1;HAVE_MEMORY_H=1;HAVE_STRINGS_H=1;HAVE_INTTYPES_H=1;HAVE_STDINT_H=1;HAVE_UNISTD_H=1;SILENT=1;NO_SIGNALS=1;NO_EXECUTE_PERMISSION=1;JAVA_FINALIZATION=1;GC_GCJ_SUPPORT=1;ATOMIC_UNCOLLECTABLE=1;_IN_LIBGC=1;WINVER=0x0502;_WIN32_WINNT=0x0502;_WIN32_IE=0x0501;WIN32_THREADS;FD_SETSIZE=1024 true EnableFastChecks MultiThreadedDebugDLL @@ -138,7 +254,27 @@ MinSpace ..\libgc\include;%(AdditionalIncludeDirectories) - NDEBUG;__x86_64__;WIN64;_WIN64;WIN32;_WIN32;__WIN32__;_WINDOWS;WINDOWS;HOST_WIN32;TARGET_WIN32;_CRT_SECURE_NO_DEPRECATE;__STDC__;PACKAGE_NAME="libgc-mono";PACKAGE_TARNAME="libgc-mono";PACKAGE_VERSION="6.6";PACKAGE_STRING="libgc-mono 6.6";PACKAGE_BUGREPORT="Hans_Boehm%40hp.com";GC_WIN32_THREADS=1;NO_GETENV=1;GC_INSIDE_DLL=1;GC_NOT_DLL=1;STDC_HEADERS=1;HAVE_SYS_TYPES_H=1;HAVE_SYS_STAT_H=1;HAVE_STDLIB_H=1;HAVE_STRING_H=1;HAVE_MEMORY_H=1;HAVE_STRINGS_H=1;HAVE_INTTYPES_H=1;HAVE_STDINT_H=1;HAVE_UNISTD_H=1;SILENT=1;NO_SIGNALS=1;NO_EXECUTE_PERMISSION=1;JAVA_FINALIZATION=1;GC_GCJ_SUPPORT=1;ATOMIC_UNCOLLECTABLE=1;_IN_LIBGC=1;WINVER=0x0502;_WIN32_WINNT=0x0502;_WIN32_IE=0x0501;WIN32_THREADS;FD_SETSIZE=1024;%(PreprocessorDefinitions) + NDEBUG;__x86_64__;WIN64;_WIN64;WIN32;_WIN32;__WIN32__;_WINDOWS;WINDOWS;HOST_WIN32;TARGET_WIN32;_CRT_SECURE_NO_DEPRECATE;__STDC__;PACKAGE_NAME="libgc-mono";PACKAGE_TARNAME="libgc-mono";PACKAGE_VERSION="6.6";PACKAGE_STRING="libgc-mono 6.6";PACKAGE_BUGREPORT="Hans_Boehm%40hp.com";GC_WIN32_THREADS=1;NO_GETENV=1;GC_INSIDE_DLL=1;GC_NOT_DLL=1;STDC_HEADERS=1;HAVE_SYS_TYPES_H=1;HAVE_SYS_STAT_H=1;HAVE_STDLIB_H=1;HAVE_STRING_H=1;HAVE_MEMORY_H=1;HAVE_STRINGS_H=1;HAVE_INTTYPES_H=1;HAVE_STDINT_H=1;HAVE_UNISTD_H=1;SILENT=1;NO_SIGNALS=1;NO_EXECUTE_PERMISSION=1;JAVA_FINALIZATION=1;GC_GCJ_SUPPORT=1;ATOMIC_UNCOLLECTABLE=1;_IN_LIBGC=1;WINVER=0x0502;_WIN32_WINNT=0x0502;_WIN32_IE=0x0501;WIN32_THREADS;FD_SETSIZE=1024;%(PreprocessorDefinitions) + MultiThreadedDLL + true + + + $(OutDir)vc80.pdb + ProgramDatabase + CompileAsC + + + $(OutDir)libgc.lib + + + + + X64 + + + MinSpace + ..\libgc\include;%(AdditionalIncludeDirectories) + NDEBUG;__x86_64__;WIN64;_WIN64;WIN32;_WIN32;__WIN32__;_WINDOWS;WINDOWS;HOST_WIN32;TARGET_WIN32;_CRT_SECURE_NO_DEPRECATE;__STDC__;PACKAGE_NAME="libgc-mono";PACKAGE_TARNAME="libgc-mono";PACKAGE_VERSION="6.6";PACKAGE_STRING="libgc-mono 6.6";PACKAGE_BUGREPORT="Hans_Boehm%40hp.com";GC_WIN32_THREADS=1;NO_GETENV=1;GC_INSIDE_DLL=1;GC_NOT_DLL=1;STDC_HEADERS=1;HAVE_SYS_TYPES_H=1;HAVE_SYS_STAT_H=1;HAVE_STDLIB_H=1;HAVE_STRING_H=1;HAVE_MEMORY_H=1;HAVE_STRINGS_H=1;HAVE_INTTYPES_H=1;HAVE_STDINT_H=1;HAVE_UNISTD_H=1;SILENT=1;NO_SIGNALS=1;NO_EXECUTE_PERMISSION=1;JAVA_FINALIZATION=1;GC_GCJ_SUPPORT=1;ATOMIC_UNCOLLECTABLE=1;_IN_LIBGC=1;WINVER=0x0502;_WIN32_WINNT=0x0502;_WIN32_IE=0x0501;WIN32_THREADS;FD_SETSIZE=1024;%(PreprocessorDefinitions) MultiThreadedDLL true diff --git a/msvc/libmonoruntime.vcxproj b/msvc/libmonoruntime.vcxproj index c65a603ff9f..cc68a310147 100644 --- a/msvc/libmonoruntime.vcxproj +++ b/msvc/libmonoruntime.vcxproj @@ -109,7 +109,9 @@ + + diff --git a/msvc/mono.def b/msvc/mono.def index 72c3c4c0d7e..fa6ae83fe1b 100644 --- a/msvc/mono.def +++ b/msvc/mono.def @@ -84,6 +84,7 @@ mono_class_from_mono_type mono_class_from_name mono_class_from_name_case mono_class_from_typeref +mono_class_from_typeref_checked mono_class_get mono_class_get_byref_type mono_class_get_com_object_class @@ -161,10 +162,21 @@ mono_context_get mono_context_get_desc mono_context_init mono_context_set +mono_counter_get_name +mono_counter_get_section +mono_counter_get_size +mono_counter_get_type +mono_counter_get_unit +mono_counter_get_variance mono_counters_cleanup mono_counters_dump mono_counters_enable +mono_counters_foreach +mono_counters_init +mono_counters_on_register mono_counters_register +mono_counters_register_with_size +mono_counters_sample mono_custom_attrs_construct mono_custom_attrs_free mono_custom_attrs_from_assembly @@ -209,6 +221,7 @@ mono_debug_symfile_is_loaded mono_debug_symfile_lookup_locals mono_debug_symfile_lookup_location mono_debug_symfile_lookup_method +mono_debugger_agent_register_transport mono_debugger_insert_breakpoint mono_debugger_method_has_breakpoint mono_debugger_run_finally @@ -250,6 +263,7 @@ mono_domain_try_unload mono_domain_unload mono_dwarf_escape_path mono_emit_native_call +mono_enable_debug_domain_unload mono_environment_exitcode_get mono_environment_exitcode_set mono_error_cleanup @@ -325,6 +339,9 @@ mono_gc_out_of_memory mono_gc_reference_queue_add mono_gc_reference_queue_free mono_gc_reference_queue_new +mono_gc_register_finalizer_callbacks +mono_gc_toggleref_add +mono_gc_toggleref_register_callback mono_gc_walk_heap mono_gc_wbarrier_arrayref_copy mono_gc_wbarrier_generic_nostore @@ -537,6 +554,7 @@ mono_metadata_guid_heap mono_metadata_implmap_from_method mono_metadata_init mono_metadata_interfaces_from_typedef +mono_metadata_load_generic_param_constraints_checked mono_metadata_load_generic_params mono_metadata_locate mono_metadata_locate_token @@ -650,6 +668,7 @@ mono_parse_default_optimizations mono_path_canonicalize mono_path_resolve_symlinks mono_pe_file_open +mono_perfcounter_foreach mono_perfcounters_init mono_pmip mono_poll @@ -688,6 +707,7 @@ mono_profiler_install_thread_name mono_profiler_install_transition mono_profiler_load mono_profiler_set_events +mono_profiler_set_statistical_mode mono_property_get_flags mono_property_get_get_method mono_property_get_name @@ -704,6 +724,7 @@ mono_property_set_value mono_ptr_class_get mono_raise_exception mono_realloc_native_code +mono_reflection_assembly_get_assembly mono_reflection_free_type_info mono_reflection_get_custom_attrs mono_reflection_get_custom_attrs_blob @@ -736,6 +757,7 @@ mono_runtime_resource_check_limit mono_runtime_resource_limit mono_runtime_resource_set_callback mono_runtime_run_main +mono_runtime_set_main_args mono_runtime_set_shutting_down mono_security_core_clr_get_options mono_security_core_clr_require_elevated_permissions @@ -748,6 +770,7 @@ mono_sem_wait mono_set_assemblies_path mono_set_break_policy mono_set_config_dir +mono_set_crash_chaining mono_set_defaults mono_set_dirs mono_set_is_debugger_attached @@ -776,6 +799,7 @@ mono_signature_vararg_start mono_signbit_double mono_signbit_float mono_stack_walk +mono_stack_walk_async_safe mono_stack_walk_no_il mono_store_remote_field mono_store_remote_field_new @@ -783,6 +807,7 @@ mono_string_chars mono_string_equal mono_string_from_bstr mono_string_from_utf16 +mono_string_from_utf32 mono_string_hash mono_string_intern mono_string_is_interned @@ -791,8 +816,10 @@ mono_string_new mono_string_new_len mono_string_new_size mono_string_new_utf16 +mono_string_new_utf32 mono_string_new_wrapper mono_string_to_utf16 +mono_string_to_utf32 mono_string_to_utf8 mono_string_to_utf8_checked mono_stringify_assembly_name @@ -802,9 +829,20 @@ mono_thread_cleanup mono_thread_create mono_thread_current mono_thread_detach +mono_thread_detach_if_exiting mono_thread_exit mono_thread_get_main mono_thread_get_undeniable_exception +mono_thread_info_clear_interruption +mono_thread_info_exit +mono_thread_info_finish_interrupt +mono_thread_info_get_stack_bounds +mono_thread_info_interrupt +mono_thread_info_open_handle +mono_thread_info_prepare_interrupt +mono_thread_info_self_interrupt +mono_thread_info_tls_get +mono_thread_info_tls_set mono_thread_init mono_thread_is_foreign mono_thread_manage @@ -812,13 +850,22 @@ mono_thread_new_init mono_thread_set_main mono_thread_set_manage_callback mono_thread_stop +mono_threads_attach_tools_thread +mono_threads_core_clear_interruption +mono_threads_core_finish_interrupt +mono_threads_core_prepare_interrupt +mono_threads_core_self_interrupt +mono_threads_create_thread mono_threads_get_default_stacksize mono_threads_request_thread_dump mono_threads_set_default_stacksize mono_tls_key_get_offset mono_tls_key_set_offset mono_trace_set_level_string +mono_trace_set_log_handler mono_trace_set_mask_string +mono_trace_set_print_handler +mono_trace_set_printerr_handler mono_type_create_from_typespec mono_type_full_name mono_type_generic_inst_is_valuetype diff --git a/msvc/monoposixhelper.vcxproj b/msvc/monoposixhelper.vcxproj index f771bbb15e1..04d54d9ffb0 100644 --- a/msvc/monoposixhelper.vcxproj +++ b/msvc/monoposixhelper.vcxproj @@ -83,7 +83,7 @@ Disabled ..\eglib\src;..\;%(AdditionalIncludeDirectories) - _DEBUG;__i386__;TARGET_X86;WIN32;_WIN32;__WIN32__;_WINDOWS;WINDOWS;HOST_WIN32;TARGET_WIN32;_CRT_SECURE_NO_DEPRECATE;HAVE_CONFIG_H;%(PreprocessorDefinitions) + _DEBUG;__i386__;TARGET_X86;_WIN32_WINNT=0x0502;WIN32;_WIN32;__WIN32__;_WINDOWS;WINDOWS;HOST_WIN32;TARGET_WIN32;_CRT_SECURE_NO_DEPRECATE;HAVE_CONFIG_H;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL diff --git a/msvc/monosgen.def b/msvc/monosgen.def index 2c7a641e8a7..4bfb1538aed 100644 --- a/msvc/monosgen.def +++ b/msvc/monosgen.def @@ -84,6 +84,7 @@ mono_class_from_mono_type mono_class_from_name mono_class_from_name_case mono_class_from_typeref +mono_class_from_typeref_checked mono_class_get mono_class_get_byref_type mono_class_get_com_object_class @@ -161,10 +162,21 @@ mono_context_get mono_context_get_desc mono_context_init mono_context_set +mono_counter_get_name +mono_counter_get_section +mono_counter_get_size +mono_counter_get_type +mono_counter_get_unit +mono_counter_get_variance mono_counters_cleanup mono_counters_dump mono_counters_enable +mono_counters_foreach +mono_counters_init +mono_counters_on_register mono_counters_register +mono_counters_register_with_size +mono_counters_sample mono_custom_attrs_construct mono_custom_attrs_free mono_custom_attrs_from_assembly @@ -251,6 +263,7 @@ mono_domain_try_unload mono_domain_unload mono_dwarf_escape_path mono_emit_native_call +mono_enable_debug_domain_unload mono_environment_exitcode_get mono_environment_exitcode_set mono_error_cleanup @@ -327,7 +340,7 @@ mono_gc_reference_queue_add mono_gc_reference_queue_free mono_gc_reference_queue_new mono_gc_register_bridge_callbacks -mono_gc_scan_for_specific_ref +mono_gc_register_finalizer_callbacks mono_gc_toggleref_add mono_gc_toggleref_register_callback mono_gc_wait_for_bridge_processing @@ -543,7 +556,7 @@ mono_metadata_guid_heap mono_metadata_implmap_from_method mono_metadata_init mono_metadata_interfaces_from_typedef -mono_metadata_load_generic_param_constraints +mono_metadata_load_generic_param_constraints_checked mono_metadata_load_generic_params mono_metadata_locate mono_metadata_locate_token @@ -657,6 +670,7 @@ mono_parse_default_optimizations mono_path_canonicalize mono_path_resolve_symlinks mono_pe_file_open +mono_perfcounter_foreach mono_perfcounters_init mono_pmip mono_poll @@ -695,6 +709,7 @@ mono_profiler_install_thread_name mono_profiler_install_transition mono_profiler_load mono_profiler_set_events +mono_profiler_set_statistical_mode mono_property_get_flags mono_property_get_get_method mono_property_get_name @@ -711,6 +726,7 @@ mono_property_set_value mono_ptr_class_get mono_raise_exception mono_realloc_native_code +mono_reflection_assembly_get_assembly mono_reflection_free_type_info mono_reflection_get_custom_attrs mono_reflection_get_custom_attrs_blob @@ -743,6 +759,7 @@ mono_runtime_resource_check_limit mono_runtime_resource_limit mono_runtime_resource_set_callback mono_runtime_run_main +mono_runtime_set_main_args mono_runtime_set_shutting_down mono_security_core_clr_get_options mono_security_core_clr_require_elevated_permissions @@ -755,6 +772,7 @@ mono_sem_wait mono_set_assemblies_path mono_set_break_policy mono_set_config_dir +mono_set_crash_chaining mono_set_defaults mono_set_dirs mono_set_is_debugger_attached @@ -783,6 +801,7 @@ mono_signature_vararg_start mono_signbit_double mono_signbit_float mono_stack_walk +mono_stack_walk_async_safe mono_stack_walk_no_il mono_store_remote_field mono_store_remote_field_new @@ -790,6 +809,7 @@ mono_string_chars mono_string_equal mono_string_from_bstr mono_string_from_utf16 +mono_string_from_utf32 mono_string_hash mono_string_intern mono_string_is_interned @@ -798,8 +818,10 @@ mono_string_new mono_string_new_len mono_string_new_size mono_string_new_utf16 +mono_string_new_utf32 mono_string_new_wrapper mono_string_to_utf16 +mono_string_to_utf32 mono_string_to_utf8 mono_string_to_utf8_checked mono_stringify_assembly_name @@ -809,9 +831,20 @@ mono_thread_cleanup mono_thread_create mono_thread_current mono_thread_detach +mono_thread_detach_if_exiting mono_thread_exit mono_thread_get_main mono_thread_get_undeniable_exception +mono_thread_info_clear_interruption +mono_thread_info_exit +mono_thread_info_finish_interrupt +mono_thread_info_get_stack_bounds +mono_thread_info_interrupt +mono_thread_info_open_handle +mono_thread_info_prepare_interrupt +mono_thread_info_self_interrupt +mono_thread_info_tls_get +mono_thread_info_tls_set mono_thread_init mono_thread_is_foreign mono_thread_manage @@ -819,13 +852,22 @@ mono_thread_new_init mono_thread_set_main mono_thread_set_manage_callback mono_thread_stop +mono_threads_attach_tools_thread +mono_threads_core_clear_interruption +mono_threads_core_finish_interrupt +mono_threads_core_prepare_interrupt +mono_threads_core_self_interrupt +mono_threads_create_thread mono_threads_get_default_stacksize mono_threads_request_thread_dump mono_threads_set_default_stacksize mono_tls_key_get_offset mono_tls_key_set_offset mono_trace_set_level_string +mono_trace_set_log_handler mono_trace_set_mask_string +mono_trace_set_print_handler +mono_trace_set_printerr_handler mono_type_create_from_typespec mono_type_full_name mono_type_generic_inst_is_valuetype diff --git a/msvc/winsetup.bat b/msvc/winsetup.bat index 33a72f6b1bd..f67a8545693 100755 --- a/msvc/winsetup.bat +++ b/msvc/winsetup.bat @@ -1,6 +1,9 @@ @echo off cd .. +if exist config.h if not exist cygconfig.h copy config.h cygconfig.h +if exist eglib\config.h if not exist eglib\cygconfig.h copy eglib\config.h eglib\cygconfig.h copy winconfig.h config.h +copy eglib\winconfig.h eglib\config.h goto end :error echo fatal error: the VSDepenancies directory was not found in the "mono" directory diff --git a/runtime/Makefile.am b/runtime/Makefile.am index 7e5a019b823..1af1a1d1bfe 100644 --- a/runtime/Makefile.am +++ b/runtime/Makefile.am @@ -33,11 +33,6 @@ build_profiles = xammac else build_profiles = -if INSTALL_2_0 -build_profiles += net_2_0 net_3_5 -al_profile = net_2_0 -endif - if INSTALL_4_0 build_profiles += net_4_0 al_profile = net_4_0 @@ -99,13 +94,6 @@ endif BUILD_MCS TEST_SUPPORT_FILES = $(tmpinst)/bin/mono $(tmpinst)/bin/ilasm $(tmpinst)/bin/mcs $(tmpinst)/bin/gmcs $(tmpinst)/bin/dmcs $(tmpinst)/bin/al2 $(tmpinst)/bin/al -# now a misnomer, but it'll go away soon enough. -if ENABLE_NUNIT_TESTS -test_select = -else -test_select = ONLY_CENTUM_TESTS=yes -endif - mcs-do-test-profiles: cd $(mcs_topdir) && $(MAKE) NO_DIR_CHECK=1 PROFILES='$(test_profiles)' test-profiles @@ -134,9 +122,7 @@ mcs-compileall: mono-wrapper etc/mono/config if [ "net_4_0" = "$$profile" ]; then \ continue; \ fi; \ - if [ "net_3_5" = "$$profile" ]; then \ - MONO_PATH="$$mcs_topdir/class/lib/$$profile$(PLATFORM_PATH_SEPARATOR)$$mcs_topdir/class/lib/net_2_0$(PLATFORM_PATH_SEPARATOR)$$save_MONO_PATH"; \ - elif [ "xbuild_12" = "$$profile" ]; then \ + if [ "xbuild_12" = "$$profile" ]; then \ MONO_PATH="$$mcs_topdir/class/lib/$$profile$(PLATFORM_PATH_SEPARATOR)$$mcs_topdir/class/lib/net_4_5$(PLATFORM_PATH_SEPARATOR)$$save_MONO_PATH"; \ elif [ "xbuild_14" = "$$profile" ]; then \ MONO_PATH="$$mcs_topdir/class/lib/$$profile$(PLATFORM_PATH_SEPARATOR)$$mcs_topdir/class/lib/net_4_5$(PLATFORM_PATH_SEPARATOR)$$save_MONO_PATH"; \ @@ -159,7 +145,7 @@ if NACL_CODEGEN check-local: else check-local: mcs-compileall mcs-do-test-profiles - $(MAKE) $(test_select) mcs-do-run-test-profiles + $(MAKE) ONLY_CENTUM_TESTS=yes mcs-do-run-test-profiles endif # Compile all mcs tests diff --git a/scripts/Makefile.am b/scripts/Makefile.am index be62dd633ef..a89a33b2d3e 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -264,7 +264,7 @@ $(scripts_defaults): $(SCRIPT_IN) Makefile $(scripts_2_0): $(SCRIPT_IN) Makefile n=`echo $@ | sed 's,$(COMPAT_2_0_SUFFIX)$$,,'`; \ - $(REWRITE2) -e "s,@""exe_name@,$$n,g" $(srcdir)/$(SCRIPT_IN) | $(FILTER) > $@.tmp + $(REWRITE4) -e "s,@""exe_name@,$$n,g" $(srcdir)/$(SCRIPT_IN) | $(FILTER) > $@.tmp mv -f $@.tmp $@ $(scripts_4_0): $(SCRIPT_IN) Makefile diff --git a/scripts/dmcs.in b/scripts/dmcs.in index e59bacf91a8..d254e29c7b7 100755 --- a/scripts/dmcs.in +++ b/scripts/dmcs.in @@ -1,2 +1,2 @@ #!/bin/sh -exec @bindir@/mono $MONO_OPTIONS @mono_instdir@/4.5/mcs.exe -sdk:4 "$@" +exec @bindir@/mono $MONO_OPTIONS @mono_instdir@/4.5/mcs.exe "$@" diff --git a/scripts/gmcs.in b/scripts/gmcs.in index 64005f5c09f..d254e29c7b7 100755 --- a/scripts/gmcs.in +++ b/scripts/gmcs.in @@ -1,2 +1,2 @@ #!/bin/sh -exec @bindir@/mono $MONO_OPTIONS @mono_instdir@/4.5/mcs.exe -sdk:2 "$@" +exec @bindir@/mono $MONO_OPTIONS @mono_instdir@/4.5/mcs.exe "$@" diff --git a/tools/sgen/gcpausevis.py b/tools/sgen/gcpausevis.py index 87d3e64d4ed..52f0ab26ee3 100755 --- a/tools/sgen/gcpausevis.py +++ b/tools/sgen/gcpausevis.py @@ -39,81 +39,222 @@ if len (files) != 1: sys.exit (1) data = [] -minor_pausetimes = [] -major_pausetimes = [] + +class Event: + def __init__(self, **kwargs): + self.minor_work = kwargs['minor_work'] + self.major_work = kwargs['major_work'] + self.start = kwargs['start'] + self.stop = kwargs['stop'] + self.gc_type = kwargs['gc_type'] + def __repr__(self): + return 'Event(minor_work={}, major_work={}, start={}, stop={}, gc_type={})'.format( + self.minor_work, + self.major_work, + self.start, + self.stop, + self.gc_type, + ) grep_input = open (files [0]) proc = subprocess.Popen ([sgen_grep_path, '--pause-times'], stdin = grep_input, stdout = subprocess.PIPE) for line in iter (proc.stdout.readline, ''): - m = re.match ('^pause-time (\d+) (\d+) (\d+) (\d+)', line) + m = re.match ('^pause-time (\d+) (\d+) (\d+) (\d+) (\d+)', line) if m: + minor_work = major_work = False generation = int (m.group (1)) - concurrent = int (m.group (2)) - msecs = int (m.group (3)) / 10.0 / 1000.0 - start = int (m.group (4)) / 10.0 / 1000.0 - if generation == 0: - generation = "minor" - minor_pausetimes.append (msecs) - else: - generation = "major" - major_pausetimes.append (msecs) - if concurrent == 1: + concurrent = int (m.group (2)) != 0 + finish = int (m.group (3)) != 0 + msecs = int (m.group (4)) / 10.0 / 1000.0 + start = int (m.group (5)) / 10.0 / 1000.0 + + if concurrent: kind = "CONC" else: kind = "SYNC" - rec = (generation, start, start + msecs, kind) + + if generation == 0: + minor_work = True + if concurrent: + major_work = True + gc_type = "nursery+update" + else: + gc_type = "nursery" + else: + major_work = True + if concurrent: + if finish: + minor_work = True + gc_type = "nursery+finish" + else: + gc_type = "start" + else: + gc_type = "full" + + rec = Event( + minor_work=minor_work, + major_work=major_work, + start=start, + stop=start + msecs, + kind=kind, + gc_type=gc_type, + ) print rec data.append (rec) +class MajorGCEventGroup: + pass + +class FullMajorGCEventGroup(MajorGCEventGroup): + def __init__(self, event): + self.event = event + def __repr__(self): + return 'FullMajorGCEventGroup({})'.format( + self.event, + ) + +class ConcurrentMajorGCEventGroup(MajorGCEventGroup): + def __init__(self, start, updates, finish): + self.start = start + self.updates = updates + self.finish = finish + def __repr__(self): + return 'ConcurrentMajorEventGroup({}, {}, {})'.format( + self.start, + self.updates, + self.finish, + ) + +# ([Event], int) -> (MajorGCEventGroup, int) | None +def parse_next_major_gc(data, i): + assert i >= 0 + # Find start or full event. + while i < len(data) and data[i].gc_type not in ['start', 'full']: + i += 1 + if i == len(data): + return None + # If full event, done. + if data[i].gc_type == 'full': + return (FullMajorGCEventGroup(data[i]), i + 1) + start_event = data[i] + update_events = [] + # Filter update events and find finish event. + while i < len(data) and data[i].gc_type != 'nursery+finish': + if data[i].gc_type == 'nursery+update': + update_events.append(data[i]) + i += 1 + if i == len(data): + return None + finish_event = data[i] + i += 1 + return (ConcurrentMajorGCEventGroup(start_event, update_events, finish_event), i) + +# [Event] -> [MajorGCEventGroup] +def parse_major_gcs(data): + major_gc_events = [] + i = 0 + while True: + maybe_event_group = parse_next_major_gc(data, i) + if maybe_event_group is None: + return major_gc_events + event_group, i = maybe_event_group + major_gc_events.append(event_group) + if show_histogram: + minor_pausetimes = [] + major_pausetimes = [] + + for rec in data: + pause = rec.stop - rec.start + if rec.minor_work and rec.major_work and show_minor and show_major: + major_pausetimes.append (pause) + else: + if rec.minor_work: + minor_pausetimes.append (pause) + if rec.major_work: + major_pausetimes.append (pause) + pausetimes = [] + colors = [] if show_minor: - pausetimes += minor_pausetimes + pausetimes.append(minor_pausetimes) + colors.append('blue') if show_major: - pausetimes += major_pausetimes - plt.hist (pausetimes, 100) + pausetimes.append(major_pausetimes) + colors.append('red') + + plt.hist (pausetimes, 100, stacked=True, log=True, color=colors) plt.xlabel ('Pause time in msec') else: - data = np.array (data, dtype = [('caption', '|S20'), ('start', int), ('stop', int), ('kind', '|S20')]) - cap, start, stop=data['caption'], data['start'], data['stop'] - - #Check the status, because we paint all lines with the same color - #together - is_sync= (data['kind']=='SYNC') - not_sync=np.logical_not(is_sync) - - #Get unique captions and there indices and the inverse mapping - captions, unique_idx, caption_inv=np.unique(cap, 1,1) - print captions - - #Build y values from the number of unique captions. - y=(caption_inv+1)/float(len(captions)+1) - - #Plot function - def timelines(y, xstart, xstop,color='b'): - """Plot timelines at y from xstart to xstop with given color.""" - plt.hlines(y,xstart,xstop,color,lw=4) - plt.vlines(xstart, y+0.03,y-0.03,color,lw=2) - plt.vlines(xstop, y+0.03,y-0.03,color,lw=2) - - #Plot ok tl black - timelines(y[is_sync],start[is_sync],stop[is_sync],'r') - #Plot fail tl red - timelines(y[not_sync],start[not_sync],stop[not_sync],'k') - - #Setup the plot - ax=plt.gca() - #ax.xaxis_date() - #myFmt = DateFormatter('%H:%M:%S') - #ax.xaxis.set_major_formatter(myFmt) - #ax.xaxis.set_major_locator(SecondLocator(0,interval=20)) - - #To adjust the xlimits a timedelta is needed. - delta=(stop.max()-start.min())/10 - - plt.yticks(y[unique_idx],captions) - plt.ylim(0,1) - plt.xlim(start.min()-delta, stop.max()+delta) - plt.xlabel('Time') + major_gc_event_groups = parse_major_gcs(data) + + def bar(**kwargs): + indices = kwargs['indices'] + pauses = kwargs['pauses'] + color = kwargs['color'] + if 'bottom' in kwargs: + bottom = kwargs['bottom'] + else: + bottom = 0 + plt.bar( + [index for index in indices if pauses[index] is not None], + np.array([pause for pause in pauses if pause is not None]), + color=color, + bottom=bottom, + ) + + indices = np.arange(len(major_gc_event_groups)) + start_pauses = [ + event_group.start.stop - event_group.start.start + if isinstance(event_group, ConcurrentMajorGCEventGroup) else None + for event_group in major_gc_event_groups + ] + bar( + indices=indices, + pauses=start_pauses, + color='red', + ) + update_pauses = [ + sum([ + update_event.stop - update_event.start + for update_event in event_group.updates + ]) if isinstance(event_group, ConcurrentMajorGCEventGroup) else None + for event_group in major_gc_event_groups + ] + bar( + indices=indices, + pauses=update_pauses, + color='green', + bottom=[pause for pause in start_pauses if pause is not None], + ) + finish_pauses = [ + event_group.finish.stop - event_group.finish.start + if isinstance(event_group, ConcurrentMajorGCEventGroup) else None + for event_group in major_gc_event_groups + ] + start_update_pauses = [ + a + b + for a, b in zip(start_pauses, update_pauses) + if a is not None and b is not None + ] + bar( + indices=indices, + pauses=finish_pauses, + color='blue', + bottom=start_update_pauses, + ) + full_pauses = [ + event_group.event.stop - event_group.event.start + if isinstance(event_group, FullMajorGCEventGroup) else None + for event_group in major_gc_event_groups + ] + bar( + indices=indices, + pauses=full_pauses, + color='black', + ) + + plt.ylabel("Pause Time (ms)") + plt.xlabel("Collection") plt.show() diff --git a/tools/sgen/sgen-grep-binprot.c b/tools/sgen/sgen-grep-binprot.c index e881fd02f9e..984f3a23993 100644 --- a/tools/sgen/sgen-grep-binprot.c +++ b/tools/sgen/sgen-grep-binprot.c @@ -23,10 +23,11 @@ read_entry (FILE *in, void **data) return SGEN_PROTOCOL_EOF; switch (TYPE (type)) { case SGEN_PROTOCOL_COLLECTION_FORCE: size = sizeof (SGenProtocolCollectionForce); break; - case SGEN_PROTOCOL_COLLECTION_BEGIN: size = sizeof (SGenProtocolCollection); break; - case SGEN_PROTOCOL_COLLECTION_END: size = sizeof (SGenProtocolCollection); break; + case SGEN_PROTOCOL_COLLECTION_BEGIN: size = sizeof (SGenProtocolCollectionBegin); break; + case SGEN_PROTOCOL_COLLECTION_END: size = sizeof (SGenProtocolCollectionEnd); break; case SGEN_PROTOCOL_CONCURRENT_START: size = 0; break; - case SGEN_PROTOCOL_CONCURRENT_UPDATE_FINISH: size = 0; break; + case SGEN_PROTOCOL_CONCURRENT_UPDATE: size = 0; break; + case SGEN_PROTOCOL_CONCURRENT_FINISH: size = 0; break; case SGEN_PROTOCOL_WORLD_STOPPING: size = sizeof (SGenProtocolWorldStopping); break; case SGEN_PROTOCOL_WORLD_STOPPED: size = sizeof (SGenProtocolWorldStopped); break; case SGEN_PROTOCOL_WORLD_RESTARTING: size = sizeof (SGenProtocolWorldRestarting); break; @@ -40,6 +41,7 @@ read_entry (FILE *in, void **data) case SGEN_PROTOCOL_MARK: size = sizeof (SGenProtocolMark); break; case SGEN_PROTOCOL_SCAN_BEGIN: size = sizeof (SGenProtocolScanBegin); break; case SGEN_PROTOCOL_SCAN_VTYPE_BEGIN: size = sizeof (SGenProtocolScanVTypeBegin); break; + case SGEN_PROTOCOL_SCAN_PROCESS_REFERENCE: size = sizeof (SGenProtocolScanProcessReference); break; case SGEN_PROTOCOL_WBARRIER: size = sizeof (SGenProtocolWBarrier); break; case SGEN_PROTOCOL_GLOBAL_REMSET: size = sizeof (SGenProtocolGlobalRemset); break; case SGEN_PROTOCOL_PTR_UPDATE: size = sizeof (SGenProtocolPtrUpdate); break; @@ -82,7 +84,8 @@ is_always_match (int type) case SGEN_PROTOCOL_COLLECTION_BEGIN: case SGEN_PROTOCOL_COLLECTION_END: case SGEN_PROTOCOL_CONCURRENT_START: - case SGEN_PROTOCOL_CONCURRENT_UPDATE_FINISH: + case SGEN_PROTOCOL_CONCURRENT_UPDATE: + case SGEN_PROTOCOL_CONCURRENT_FINISH: case SGEN_PROTOCOL_WORLD_STOPPING: case SGEN_PROTOCOL_WORLD_STOPPED: case SGEN_PROTOCOL_WORLD_RESTARTING: @@ -94,8 +97,6 @@ is_always_match (int type) case SGEN_PROTOCOL_CEMENT_RESET: case SGEN_PROTOCOL_DOMAIN_UNLOAD_BEGIN: case SGEN_PROTOCOL_DOMAIN_UNLOAD_END: - case SGEN_PROTOCOL_GRAY_ENQUEUE: - case SGEN_PROTOCOL_GRAY_DEQUEUE: return TRUE; default: return FALSE; @@ -117,21 +118,27 @@ print_entry (int type, void *data) break; } case SGEN_PROTOCOL_COLLECTION_BEGIN: { - SGenProtocolCollection *entry = data; + SGenProtocolCollectionBegin *entry = data; printf ("collection begin %d generation %d\n", entry->index, entry->generation); break; } case SGEN_PROTOCOL_COLLECTION_END: { - SGenProtocolCollection *entry = data; - printf ("collection end %d generation %d\n", entry->index, entry->generation); + SGenProtocolCollectionEnd *entry = data; + long long scanned = entry->num_scanned_objects; + long long unique = entry->num_unique_scanned_objects; + printf ("collection end %d generation %d scanned %lld unique %lld %0.2f%%\n", entry->index, entry->generation, scanned, unique, unique ? 100.0 * (double) scanned / (double) unique : 0.0); break; } case SGEN_PROTOCOL_CONCURRENT_START: { printf ("concurrent start\n"); break; } - case SGEN_PROTOCOL_CONCURRENT_UPDATE_FINISH: { - printf ("concurrent update or finish\n"); + case SGEN_PROTOCOL_CONCURRENT_UPDATE: { + printf ("concurrent update\n"); + break; + } + case SGEN_PROTOCOL_CONCURRENT_FINISH: { + printf ("concurrent finish\n"); break; } case SGEN_PROTOCOL_WORLD_STOPPING: { @@ -180,7 +187,7 @@ print_entry (int type, void *data) } case SGEN_PROTOCOL_PIN_STAGE: { SGenProtocolPinStage *entry = data; - printf ("pin stage addr ptr %p addr %p thread %p\n", entry->addr_ptr, entry->addr, entry->thread); + printf ("pin stage addr ptr %p addr %p\n", entry->addr_ptr, entry->addr); break; } case SGEN_PROTOCOL_PIN: { @@ -203,6 +210,11 @@ print_entry (int type, void *data) printf ("scan_vtype_begin obj %p size %d\n", entry->obj, entry->size); break; } + case SGEN_PROTOCOL_SCAN_PROCESS_REFERENCE: { + SGenProtocolScanProcessReference *entry = data; + printf ("scan_process_reference obj %p ptr %p value %p\n", entry->obj, entry->ptr, entry->value); + break; + } case SGEN_PROTOCOL_WBARRIER: { SGenProtocolWBarrier *entry = data; printf ("wbarrier ptr %p value %p value_vtable %p\n", entry->ptr, entry->value, entry->value_vtable); @@ -339,7 +351,7 @@ is_match (gpointer ptr, int type, void *data) } case SGEN_PROTOCOL_PIN_STAGE: { SGenProtocolPinStage *entry = data; - return ptr == entry->addr_ptr || ptr == entry->addr || ptr == entry->thread; + return ptr == entry->addr_ptr || ptr == entry->addr; } case SGEN_PROTOCOL_PIN: { SGenProtocolPin *entry = data; @@ -357,6 +369,10 @@ is_match (gpointer ptr, int type, void *data) SGenProtocolScanVTypeBegin *entry = data; return matches_interval (ptr, entry->obj, entry->size); } + case SGEN_PROTOCOL_SCAN_PROCESS_REFERENCE: { + SGenProtocolScanProcessReference *entry = data; + return ptr == entry->obj || ptr == entry->ptr || ptr == entry->value; + } case SGEN_PROTOCOL_WBARRIER: { SGenProtocolWBarrier *entry = data; return ptr == entry->ptr || ptr == entry->value; @@ -484,6 +500,7 @@ main (int argc, char *argv[]) gboolean pause_times = FALSE; gboolean pause_times_stopped = FALSE; gboolean pause_times_concurrent = FALSE; + gboolean pause_times_finish = FALSE; long long pause_times_ts = 0; for (i = 0; i < num_args; ++i) { @@ -513,20 +530,24 @@ main (int argc, char *argv[]) SGenProtocolWorldStopping *entry = data; assert (!pause_times_stopped); pause_times_concurrent = FALSE; + pause_times_finish = FALSE; pause_times_ts = entry->timestamp; pause_times_stopped = TRUE; break; } + case SGEN_PROTOCOL_CONCURRENT_FINISH: + pause_times_finish = TRUE; case SGEN_PROTOCOL_CONCURRENT_START: - case SGEN_PROTOCOL_CONCURRENT_UPDATE_FINISH: + case SGEN_PROTOCOL_CONCURRENT_UPDATE: pause_times_concurrent = TRUE; break; case SGEN_PROTOCOL_WORLD_RESTARTED: { SGenProtocolWorldRestarted *entry = data; assert (pause_times_stopped); - printf ("pause-time %d %d %lld %lld\n", + printf ("pause-time %d %d %d %lld %lld\n", entry->generation, pause_times_concurrent, + pause_times_finish, entry->timestamp - pause_times_ts, pause_times_ts); pause_times_stopped = FALSE; diff --git a/winconfig.h b/winconfig.h index b6d74e1cb41..21cc0d506d7 100644 --- a/winconfig.h +++ b/winconfig.h @@ -1,6 +1,10 @@ /* config.h. Generated from config.h.in by configure. */ /* config.h.in. Generated from configure.ac by autoheader. */ +#ifndef _MSC_VER +#include "cygconfig.h" +#else + /* The architecture this is running on */ #if defined(_M_IA64) #define ARCHITECTURE "ia64" @@ -629,4 +633,5 @@ /* #undef USE_MONO_MUTEX */ /* Version number of package */ -#define VERSION "2.11" +#define VERSION "3.12.1" +#endif