~$*
# Autotools-generated files
-Makefile
+/Makefile
Makefile.in
aclocal.m4
autom4te.cache
# Process this file with autoconf to produce a configure script.
#AC_PREREQ([2.62])
-AC_INIT(mono, [3.1.0],
+AC_INIT(mono, [3.3.0],
[http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
AC_CONFIG_SRCDIR([README])
AC_CHECK_HEADERS(execinfo.h)
+ AC_CHECK_HEADERS(sys/auxv.h)
+
AC_CHECK_FUNCS(getgrgid_r)
AC_CHECK_FUNCS(getgrnam_r)
AC_CHECK_FUNCS(getpwnam_r)
;;
esac
-
# The output of --cflags seems to include optimizations flags too
LLVM_CFLAGS=`$LLVM_CONFIG --cflags | sed -e 's/-O2//g' | sed -e 's/-O0//g' | sed -e 's/-fomit-frame-pointer//g' | sed -e 's/-fPIC//g'`
# LLVM is compiled with -fno-rtti, so we need this too, since our classes inherit
# from LLVM classes.
LLVM_CXXFLAGS="`$LLVM_CONFIG --cxxflags` -fno-rtti"
LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
- LLVM_LIBS=`$LLVM_CONFIG --libs core bitwriter jit mcjit $llvm_codegen`
+ if test "x$host" != "x$target"; then
+ # No need for jit libs
+ LLVM_LIBS=`$LLVM_CONFIG --libs core bitwriter`
+ else
+ LLVM_LIBS=`$LLVM_CONFIG --libs core bitwriter jit mcjit $llvm_codegen`
+ fi
LLVM_LIBS="$LLVM_LDFLAGS $LLVM_LIBS -lstdc++"
# Should be something like '2.6' or '2.7svn'
arch_target=arm;
ACCESS_UNALIGNED="no"
JIT_SUPPORTED=yes
- CPPFLAGS="$CPPFLAGS -D__ARM_EABI__ -DHAVE_ARMV6=1"
+ CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
# libgc's gc_locks.h depends on this
- CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DHAVE_ARMV6"
+ CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC"
sgen_supported=true
;;
arm*-linux*)
# AOT_SUPPORTED="no"
# ;;
s390x-*-linux*)
- TARGET=S390x;
+ TARGET=S390X;
arch_target=s390x;
ACCESS_UNALIGNED="yes"
JIT_SUPPORTED=yes
arch_target=arm;
ACCESS_UNALIGNED="no"
JIT_SUPPORTED=yes
- CPPFLAGS="$CPPFLAGS -D__ARM_EABI__ -DHAVE_ARMV6=1"
+ CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
jit_wanted=true
# Can't use tls, since it depends on the runtime detection of tls offsets
# in mono-compiler.h
esac
fi
-# FIXME: Define the others as well
case "$TARGET" in
X86)
AC_DEFINE(TARGET_X86, 1, [...])
AC_DEFINE(TARGET_POWERPC, 1, [...])
AC_DEFINE(TARGET_POWERPC64, 1, [...])
;;
-S390x)
+S390X)
AC_DEFINE(TARGET_S390X, 1, [...])
;;
MIPS)
AC_DEFINE(TARGET_MIPS, 1, [...])
;;
+IA64)
+ AC_DEFINE(TARGET_IA64, 1, [...])
+ ;;
+SPARC)
+ AC_DEFINE(TARGET_SPARC, 1, [...])
+ ;;
+SPARC64)
+ AC_DEFINE(TARGET_SPARC64, 1, [...])
+ ;;
esac
+dnl Use GCC atomic ops if they work on the target.
+if test x$GCC = "xyes"; then
+ case $TARGET in
+ X86 | AMD64 | ARM | POWERPC | POWERPC64 | MIPS)
+ AC_DEFINE(USE_GCC_ATOMIC_OPS, 1, [...])
+ ;;
+ esac
+fi
+
if test "x$target_mach" = "xyes"; then
if test "x$TARGET" = "xARM"; then
AC_DEFINE(TARGET_IOS,1,[The JIT/AOT targets iOS])
CPPFLAGS="$CPPFLAGS -DARM_FPU_$fpu=1"
unset fpu
- if test x$cross_compiling = xno; then
- AC_MSG_CHECKING(for ARMV6)
- AC_TRY_RUN([
- int main () { __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r" (0) : "memory"); return 0; }
- ], armv6=yes, armv6=no)
-
- AC_MSG_RESULT($armv6)
- if test ${armv6} = yes; then
- AC_DEFINE(HAVE_ARMV6, 1, "Host supports ARMV6 instructions")
- # libgc's gc_locks.h depends on this
- CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DHAVE_ARMV6"
- fi
+ dnl *********************************************
+ dnl *** Check which ARM version(s) we can use ***
+ dnl *********************************************
+ AC_MSG_CHECKING(which ARM version to use)
+
+ AC_TRY_COMPILE([], [
+ #if !defined(__ARM_ARCH_5T__) && !defined(__ARM_ARCH_5TE__) && !defined(__ARM_ARCH_5TEJ__)
+ #error Not on ARM v5.
+ #endif
+ return 0;
+ ], [
+ arm_v5=yes
+ ], [])
+
+ AC_TRY_COMPILE([], [
+ #if !defined(__ARM_ARCH_6J__) && !defined(__ARM_ARCH_6ZK__) && !defined(__ARM_ARCH_6K__) && !defined(__ARM_ARCH_6T2__) && !defined(__ARM_ARCH_6M__)
+ #error Not on ARM v6.
+ #endif
+ return 0;
+ ], [
+ arm_v5=yes
+ arm_v6=yes
+ ], [])
+
+ AC_TRY_COMPILE([], [
+ #if !defined(__ARM_ARCH_7A__) && !defined(__ARM_ARCH_7R__) && !defined(__ARM_ARCH_7EM__) && !defined(__ARM_ARCH_7M__) && !defined(__ARM_ARCH_7S__)
+ #error Not on ARM v7.
+ #endif
+ return 0;
+ ], [
+ arm_v5=yes
+ arm_v6=yes
+ arm_v7=yes
+ ], [])
+
+ if test x$arm_v5 = xyes; then
+ AC_DEFINE(HAVE_ARMV5, 1, [ARM v5])
+ CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DHAVE_ARMV5=1"
+ fi
+
+ if test x$arm_v6 = xyes; then
+ AC_DEFINE(HAVE_ARMV6, 1, [ARM v6])
+ CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DHAVE_ARMV6=1"
+ fi
+
+ if test x$arm_v7 = xyes; then
+ AC_DEFINE(HAVE_ARMV7, 1, [ARM v7])
+ CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DHAVE_ARMV7=1"
fi
fi
AM_CONDITIONAL(X86, test x$TARGET = xX86)
AM_CONDITIONAL(AMD64, test x$TARGET = xAMD64)
AM_CONDITIONAL(IA64, test x$TARGET = xIA64)
-AM_CONDITIONAL(M68K, test x$TARGET = xM68K)
AM_CONDITIONAL(MIPS, test x$TARGET = xMIPS)
AM_CONDITIONAL(POWERPC, test x$TARGET = xPOWERPC)
AM_CONDITIONAL(POWERPC64, test x$TARGET = xPOWERPC64)
AM_CONDITIONAL(ARM, test x$TARGET = xARM)
-AM_CONDITIONAL(S390x, test x$TARGET = xS390x)
+AM_CONDITIONAL(S390X, test x$TARGET = xS390X)
AM_CONDITIONAL(HOST_X86, test x$HOST = xX86)
AM_CONDITIONAL(HOST_AMD64, test x$HOST = xAMD64)
AM_CONDITIONAL(HOST_ARM, test x$HOST = xARM)
# define NACL_ALIGN()
# endif
inline static int GC_test_and_set(volatile unsigned int *addr) {
-#if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7__)
- int ret, tmp;
- __asm__ __volatile__ (
- "1:\n"
- NACL_ALIGN()
- MASK_REGISTER("%3", "al")
- "ldrex %0, [%3]\n"
- MASK_REGISTER("%3", "al")
- "strex %1, %2, [%3]\n"
- "teq %1, #0\n"
- "bne 1b\n"
- : "=&r" (ret), "=&r" (tmp)
- : "r" (1), "r" (addr)
- : "memory", "cc");
- return ret;
-#else
- int oldval;
- /* SWP on ARM is very similar to XCHG on x86. Doesn't lock the
- * bus because there are no SMP ARM machines. If/when there are,
- * this code will likely need to be updated. */
- /* See linuxthreads/sysdeps/arm/pt-machine.h in glibc-2.1 */
- __asm__ __volatile__(MASK_REGISTER("%2", "al")
- "swp %0, %1, [%2]"
- : "=&r"(oldval)
- : "r"(1), "r"(addr)
- : "memory");
- return oldval;
-#endif
+ return (int) __sync_lock_test_and_set (addr, 1);
}
# define GC_TEST_AND_SET_DEFINED
inline static void GC_clear(volatile unsigned int *addr) {
-#ifdef HAVE_ARMV6
- /* Memory barrier */
-#ifdef __native_client__
- /* NaCl requires ARMv7 CPUs. */
- __asm__ __volatile__("dsb" : : : "memory");
-#else
- __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r" (0) : "memory");
-#endif
-#endif
+ __sync_synchronize ();
+
*(addr) = 0;
}
# define GC_CLEAR_DEFINED
Enables the maximum JIT verbosity for the specified method. This is
very helpfull to diagnose a miscompilation problems of a specific
method.
+.TP
+\fBMONO_VERBOSE_HWCAP\fR
+If set, makes the JIT output information about detected CPU features
+(such as SSE, CMOV, FCMOV, etc) to stdout.
.SH VALGRIND
If you want to use Valgrind, you will find the file `mono.supp'
useful, it contains the suppressions for the GC which trigger
--- /dev/null
+#! -*- makefile -*-
+
+BOOTSTRAP_PROFILE = build
+
+BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
+MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
+
+# Use system resgen as we don't want local System.Windows.Forms dependency
+RESGEN = resgen2
+
+profile-check:
+ @:
+
+DEFAULT_REFERENCES = -r:mscorlib.dll
+PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:NET_3_5 -d:NET_4_0 -d:NET_4_5 -d:MOBILE -d:FULL_AOT_RUNTIME -d:DISABLE_REMOTING -d:DISABLE_COM -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES) $(PLATFORM_DEBUG_FLAGS)
+FRAMEWORK_VERSION = 2.1
+NO_TEST = yes
+
+# the tuner takes care of the install
+NO_INSTALL = yes
# Default PLATFORM and PROFILE if they're not already defined.
ifndef PLATFORM
+$(info *** PLATFORM is not defined.)
ifeq ($(OS),Windows_NT)
+$(info *** Assuming PLATFORM is 'win32'.)
PLATFORM = win32
else
+$(info *** Assuming PLATFORM is 'linux'.)
PLATFORM = linux
endif
endif
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.IQueryable<>))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.IOrderedQueryable<>))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.IQueryProvider))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.Expression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.BinaryExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.ConditionalExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.ConstantExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.ElementInit))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.LambdaExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.Expression<>))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.ExpressionType))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.ExpressionVisitor))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.InvocationExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.ListInitExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.MemberBinding))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.MemberAssignment))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.MemberBindingType))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.MemberExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.MemberInitExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.MemberListBinding))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.MemberMemberBinding))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.MethodCallExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.NewArrayExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.NewExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.ParameterExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.TypeBinaryExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.UnaryExpression))]
+#if !FULL_AOT_RUNTIME
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.BlockExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.CatchBlock))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.DebugInfoExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.DefaultExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.GotoExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.GotoExpressionKind))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.IndexExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.LabelExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.LabelTarget))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.LoopExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.RuntimeVariablesExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.SwitchCase))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.SwitchExpression))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.SymbolDocumentInfo))]
+[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Linq.Expressions.TryExpression))]
+#endif
monodroid_SUBDIRS := $(mobile_dirs) $(monodroid_dirs)
monotouch_SUBDIRS := $(mobile_dirs)
monotouch_runtime_SUBDIRS := $(monotouch_runtime_dirs)
+mobile_static_SUBDIRS := $(mobile_dirs)
mobile_SUBDIRS := $(mobile_dirs)
net_3_5_SUBDIRS := $(net_3_5_only_dirs)
net_4_0_SUBDIRS := $(common_dirs) $(net_2_0_dirs) $(net_4_0_dirs) $(net_4_0_only_dirs)
{
cat $Resource | while read SRC; do
SRC=`echo $SRC | $tr '/' '\\\\'`
-SRC=`echo $SRC | sed 's/-resource://' | gawk -F , '{print " RelPath = \"" $1 "\"\n CustomToolNameSpace = \"" $2 "\""}' | fgrep -v \"\"`
+SRC=`echo $SRC | sed 's/-resource://' | awk -F , '{print " RelPath = \"" $1 "\"\n CustomToolNameSpace = \"" $2 "\""}' | fgrep -v \"\"`
cat << EOT
<File
Log.LogWarning ("Unable to find framework corresponding to the target framework moniker '{0}'. " +
"Framework assembly references will be resolved from the GAC, which might not be " +
"the intended behavior.", TargetFrameworkMoniker);
+ if (moniker.Identifier.Equals (".NETPortable"))
+ return CheckPclReferenceAssemblies (moniker);
return true;
}
return true;
}
+ bool CheckPclReferenceAssemblies (FrameworkMoniker moniker)
+ {
+ // Check for a supported profile
+ var check = new FrameworkMoniker (".NETPortable", "v4.0", "Profile24");
+ if (GetFrameworkDirectoriesForMoniker (check) != null)
+ Log.LogError ("Unsupported PCL Profile '{0}'.", moniker);
+ else
+ Log.LogError ("PCL Reference Assemblies not installed.");
+ return false;
+ }
+
Framework GetFrameworkDirectoriesForMoniker (FrameworkMoniker moniker)
{
string dirs = String.Join (PathSeparatorAsString, new string [] {
Evaluator.Run ("d.GetType ();");
}
#endif
+
+#if NET_4_5
+ [Test]
+ public void AwaitExpression ()
+ {
+ Evaluator.WaitOnTask = true;
+ var res = Evaluator.Evaluate("var res = await System.Threading.Tasks.Task.FromResult (1) + await System.Threading.Tasks.Task.FromResult (2);");
+ res = Evaluator.Evaluate ("res;");
+ Assert.AreEqual (3, res, "#1");
+ }
+#endif
}
}
\ No newline at end of file
public AStruct field_struct;
public object field_boxed_struct;
public GStruct<int> generic_field_struct;
+ public KeyValuePair<int, object> boxed_struct_field;
[ThreadStatic]
public static int tls_i;
public static bool is_attached = Debugger.IsAttached;
}
public static void vtypes () {
- Tests t = new Tests () { field_struct = new AStruct () { i = 42, s = "S", k = 43 }, generic_field_struct = new GStruct<int> () { i = 42 }, field_boxed_struct = new AStruct () { i = 42 }};
+ Tests t = new Tests () { field_struct = new AStruct () { i = 42, s = "S", k = 43 }, generic_field_struct = new GStruct<int> () { i = 42 }, field_boxed_struct = new AStruct () { i = 42 }, boxed_struct_field = new KeyValuePair<int, object> (1, (long)42 ) };
AStruct s = new AStruct { i = 44, s = "T", k = 45 };
AStruct[] arr = new AStruct[] {
new AStruct () { i = 1, s = "S1" },
return e;
}
+ Event step_until (ThreadMirror t, string method_name) {
+ Event e;
+ while (true) {
+ e = single_step (t);
+ if ((e as StepEvent).Method.Name == method_name)
+ break;
+ }
+ return e;
+ }
+
void check_arg_val (StackFrame frame, int pos, Type type, object eval) {
object val = frame.GetArgument (pos);
Assert.IsTrue (val is PrimitiveValue);
Assert.AreEqual ("AStruct", s.Type.Name);
AssertValue (42, s ["i"]);
+ // Check round tripping of boxed struct fields (#12354)
+ obj = o.GetValue (o.Type.GetField ("boxed_struct_field"));
+ o.SetValue (o.Type.GetField ("boxed_struct_field"), obj);
+ obj = o.GetValue (o.Type.GetField ("boxed_struct_field"));
+ s = obj as StructMirror;
+ AssertValue (1, s ["key"]);
+ obj = s ["value"];
+ Assert.IsTrue (obj is StructMirror);
+ s = obj as StructMirror;
+ AssertValue (42, s ["m_value"]);
+
// vtypes as arguments
s = frame.GetArgument (0) as StructMirror;
AssertValue (44, s ["i"]);
// this on vtype methods
e = run_until ("vtypes2");
-
- // Skip nop
- e = single_step (e.Thread);
-
- e = single_step (e.Thread);
+ e = step_until (e.Thread, "foo");
frame = e.Thread.GetFrames () [0];
// this on static vtype methods
e = run_until ("vtypes3");
-
- // Skip nop
- e = single_step (e.Thread);
-
- e = single_step (e.Thread);
+ e = step_until (e.Thread, "static_foo");
frame = e.Thread.GetFrames () [0];
Location l;
- vm.Resume ();
+ while (true) {
+ vm.Resume ();
+
+ e = GetNextEvent ();
+ Assert.IsTrue (e is StepEvent);
+ if (e.Thread.GetFrames ()[0].Method.Name == "ln1")
+ break;
+ }
+ // Do an additional step over so we are not on the beginning line of the method
+ step_req.Disable ();
+ step_req.Depth = StepDepth.Over;
+ step_req.Enable ();
+ vm.Resume ();
e = GetNextEvent ();
- Assert.IsTrue (e is StepEvent);
+ Assert.IsTrue (e is StepEvent);
l = e.Thread.GetFrames ()[0].Location;
+ Console.WriteLine (l);
Assert.AreEqual (3, l.ColumnNumber);
step_req.Disable ();
}
public string GetWorkingDirectory () {
- int len = 256;
-
- while (true) {
- StringBuilder sb = new StringBuilder (len);
-
- int res = Syscall.readlink ("/proc/" + pid + "/cwd", sb);
- if (res == -1)
- throw new IOException ("Syscall.readlink () failed with error " + res + ".");
- else if (res == len) {
- len = len * 2;
- } else {
- return sb.ToString ();
- }
- }
+ return UnixPath.ReadLink ("/proc/" + pid + "/cwd");
}
/*
+Mono.Unix/ReadlinkTest.cs
Mono.Unix/StdioFileStreamTest.cs
Mono.Unix/UnixEncodingTest.cs
Mono.Unix/UnixGroupTest.cs
[MarshalAs (UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(FileNameMarshaler))]
string newpath);
+ delegate long DoReadlinkFun (byte[] target);
+
+ // Helper function for readlink(string, StringBuilder) and readlinkat (int, string, StringBuilder)
+ static int ReadlinkIntoStringBuilder (DoReadlinkFun doReadlink, [Out] StringBuilder buf, ulong bufsiz)
+ {
+ // bufsiz > int.MaxValue can't work because StringBuilder can store only int.MaxValue chars
+ int bufsizInt = checked ((int) bufsiz);
+ var target = new byte [bufsizInt];
+
+ var r = doReadlink (target);
+ if (r < 0)
+ return checked ((int) r);
+
+ buf.Length = 0;
+ var chars = UnixEncoding.Instance.GetChars (target, 0, checked ((int) r));
+ // Make sure that at more bufsiz chars are written
+ buf.Append (chars, 0, System.Math.Min (bufsizInt, chars.Length));
+ if (r == bufsizInt) {
+ // may not have read full contents; fill 'buf' so that caller can properly check
+ buf.Append (new string ('\x00', bufsizInt - buf.Length));
+ }
+ return buf.Length;
+ }
+
// readlink(2)
- // int readlink(const char *path, char *buf, size_t bufsize);
+ // ssize_t readlink(const char *path, char *buf, size_t bufsize);
+ public static int readlink (string path, [Out] StringBuilder buf, ulong bufsiz)
+ {
+ return ReadlinkIntoStringBuilder (target => readlink (path, target), buf, bufsiz);
+ }
+
+ public static int readlink (string path, [Out] StringBuilder buf)
+ {
+ return readlink (path, buf, (ulong) buf.Capacity);
+ }
+
[DllImport (MPH, SetLastError=true,
EntryPoint="Mono_Posix_Syscall_readlink")]
- public static extern int readlink (
+ private static extern long readlink (
[MarshalAs (UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(FileNameMarshaler))]
- string path, [Out] StringBuilder buf, ulong bufsiz);
+ string path, byte[] buf, ulong bufsiz);
- public static int readlink (string path, [Out] StringBuilder buf)
+ public static long readlink (string path, byte[] buf)
{
- return readlink (path, buf, (ulong) buf.Capacity);
+ return readlink (path, buf, (ulong) buf.LongLength);
}
[DllImport (LIBC, SetLastError=true)]
}
// readlinkat(2)
- // int readlinkat(int dirfd, const char *pathname, char *buf, size_t bufsize);
+ // ssize_t readlinkat(int dirfd, const char *pathname, char *buf, size_t bufsize);
+ public static int readlinkat (int dirfd, string pathname, [Out] StringBuilder buf, ulong bufsiz)
+ {
+ return ReadlinkIntoStringBuilder (target => readlinkat (dirfd, pathname, target), buf, bufsiz);
+ }
+
+ public static int readlinkat (int dirfd, string pathname, [Out] StringBuilder buf)
+ {
+ return readlinkat (dirfd, pathname, buf, (ulong) buf.Capacity);
+ }
+
[DllImport (MPH, SetLastError=true,
EntryPoint="Mono_Posix_Syscall_readlinkat")]
- public static extern int readlinkat (int dirfd,
+ private static extern long readlinkat (int dirfd,
[MarshalAs (UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(FileNameMarshaler))]
- string pathname, [Out] StringBuilder buf, ulong bufsiz);
+ string pathname, byte[] buf, ulong bufsiz);
- public static int readlinkat (int dirfd, string pathname, [Out] StringBuilder buf)
+ public static long readlinkat (int dirfd, string pathname, byte[] buf)
{
- return readlinkat (dirfd, pathname, buf, (ulong) buf.Capacity);
+ return readlinkat (dirfd, pathname, buf, (ulong) buf.LongLength);
}
[DllImport (LIBC, SetLastError=true)]
// Read the specified symbolic link. If the file isn't a symbolic link,
// return null; otherwise, return the contents of the symbolic link.
- //
- // readlink(2) is horribly evil, as there is no way to query how big the
- // symlink contents are. Consequently, it's trial and error...
internal static string ReadSymbolicLink (string path)
{
- StringBuilder buf = new StringBuilder (256);
+ string target = TryReadLink (path);
+ if (target == null) {
+ Native.Errno errno = Native.Stdlib.GetLastError ();
+ if (errno != Native.Errno.EINVAL)
+ UnixMarshal.ThrowExceptionForError (errno);
+ }
+ return target;
+ }
+
+ public static string TryReadLink (string path)
+ {
+ byte[] buf = new byte[256];
do {
- int r = Native.Syscall.readlink (path, buf);
- if (r < 0) {
- Native.Errno e;
- switch (e = Native.Stdlib.GetLastError()) {
- case Native.Errno.EINVAL:
- // path isn't a symbolic link
- return null;
- default:
- UnixMarshal.ThrowExceptionForError (e);
- break;
- }
- }
- else if (r == buf.Capacity) {
- buf.Capacity *= 2;
- }
+ long r = Native.Syscall.readlink (path, buf);
+ if (r < 0)
+ return null;
+ else if (r == buf.Length)
+ buf = new byte[checked (buf.LongLength * 2)];
else
- return buf.ToString (0, r);
+ return UnixEncoding.Instance.GetString (buf, 0, checked ((int) r));
} while (true);
}
- // Read the specified symbolic link. If the file isn't a symbolic link,
- // return null; otherwise, return the contents of the symbolic link.
- //
- // readlink(2) is horribly evil, as there is no way to query how big the
- // symlink contents are. Consequently, it's trial and error...
- private static string ReadSymbolicLink (string path, out Native.Errno errno)
+ public static string TryReadLinkAt (int dirfd, string path)
{
- errno = (Native.Errno) 0;
- StringBuilder buf = new StringBuilder (256);
+ byte[] buf = new byte[256];
do {
- int r = Native.Syscall.readlink (path, buf);
- if (r < 0) {
- errno = Native.Stdlib.GetLastError ();
+ long r = Native.Syscall.readlinkat (dirfd, path, buf);
+ if (r < 0)
return null;
- }
- else if (r == buf.Capacity) {
- buf.Capacity *= 2;
- }
+ else if (r == buf.Length)
+ buf = new byte[checked (buf.LongLength * 2)];
else
- return buf.ToString (0, r);
+ return UnixEncoding.Instance.GetString (buf, 0, checked ((int) r));
} while (true);
}
- public static string TryReadLink (string path)
+ public static string ReadLink (string path)
{
- Native.Errno errno;
- return ReadSymbolicLink (path, out errno);
+ string target = TryReadLink (path);
+ if (target == null)
+ UnixMarshal.ThrowExceptionForLastError ();
+ return target;
}
- public static string ReadLink (string path)
+ public static string ReadLinkAt (int dirfd, string path)
{
- Native.Errno errno;
- path = ReadSymbolicLink (path, out errno);
- if (errno != 0)
- UnixMarshal.ThrowExceptionForError (errno);
- return path;
+ string target = TryReadLinkAt (dirfd, path);
+ if (target == null)
+ UnixMarshal.ThrowExceptionForLastError ();
+ return target;
}
public static bool IsPathRooted (string path)
public string ContentsPath {
get {
- return ReadLink ();
+ return UnixPath.ReadLink (FullPath);
}
}
public bool HasContents {
get {
- return TryReadLink () != null;
+ return UnixPath.TryReadLink (FullPath) != null;
}
}
public UnixFileSystemInfo GetContents ()
{
- ReadLink ();
return UnixFileSystemInfo.GetFileSystemEntry (
UnixPath.Combine (UnixPath.GetDirectoryName (FullPath),
ContentsPath));
{
return Native.Syscall.lstat (path, out stat) == 0;
}
-
- private string ReadLink ()
- {
- string r = TryReadLink ();
- if (r == null)
- UnixMarshal.ThrowExceptionForLastError ();
- return r;
- }
-
- private string TryReadLink ()
- {
- StringBuilder sb = new StringBuilder ((int) base.Length+1);
- int r = Native.Syscall.readlink (FullPath, sb);
- if (r == -1)
- return null;
- return sb.ToString (0, r);
- }
}
}
--- /dev/null
+//
+// readlink() / readlinkat() Test Cases
+//
+// Authors:
+// Steffen Kiess (s-kiess@web.de)
+//
+// Copyright (C) 2013 Steffen Kiess
+//
+
+using System;
+using System.IO;
+using System.Text;
+
+using Mono.Unix;
+using Mono.Unix.Native;
+
+using NUnit.Framework;
+
+namespace MonoTests.Mono.Unix
+{
+ [TestFixture, Category ("NotDotNet")]
+ public class ReadlinkTest {
+
+ static string[] Targets = {
+ // Simple test cases
+ "a",
+ "test",
+ // With non-ASCII characters
+ "ä",
+ "test ö test",
+ // With non-UTF8 bytes
+ UnixEncoding.Instance.GetString (new byte[] {0xff, 0x80, 0x41, 0x80}),
+ // Size is roughly initial size of buffer
+ new string ('a', 255),
+ new string ('a', 256),
+ new string ('a', 257),
+ // With non-ASCII characters, size is roughly initial size of buffer
+ "ä" + new string ('a', 253), // 254 chars, 255 bytes
+ "ä" + new string ('a', 254), // 255 chars, 256 bytes
+ "ä" + new string ('a', 255), // 256 chars, 257 bytes
+ "ä" + new string ('a', 256), // 257 chars, 258 bytes
+ new string ('a', 253) + "ä", // 254 chars, 255 bytes
+ new string ('a', 254) + "ä", // 255 chars, 256 bytes
+ new string ('a', 255) + "ä", // 256 chars, 257 bytes
+ new string ('a', 256) + "ä", // 257 chars, 258 bytes
+ // With non-UTF8 bytes, size is roughly initial size of buffer
+ "\0\u00ff" + new string ('a', 253), // 255 chars, 254 bytes
+ "\0\u00ff" + new string ('a', 254), // 256 chars, 255 bytes
+ "\0\u00ff" + new string ('a', 255), // 257 chars, 256 bytes
+ "\0\u00ff" + new string ('a', 256), // 258 chars, 257 bytes
+ new string ('a', 253) + "\0\u00ff", // 255 chars, 254 bytes
+ new string ('a', 254) + "\0\u00ff", // 256 chars, 255 bytes
+ new string ('a', 255) + "\0\u00ff", // 257 chars, 256 bytes
+ new string ('a', 256) + "\0\u00ff", // 258 chars, 257 bytes
+ };
+
+ bool HaveReadlinkAt;
+ string TempFolder;
+ int TempFD;
+
+ [SetUp]
+ public void SetUp ()
+ {
+ HaveReadlinkAt = false;
+ try {
+ Syscall.readlinkat (-1, "", new byte[1]);
+ HaveReadlinkAt = true;
+ } catch (EntryPointNotFoundException) {
+ }
+
+
+ TempFolder = Path.Combine (Path.GetTempPath (), this.GetType ().FullName);
+
+ if (Directory.Exists (TempFolder))
+ //Directory.Delete (TempFolder, true); // Fails for long link target paths
+ new UnixDirectoryInfo (TempFolder).Delete (true);
+
+ Directory.CreateDirectory (TempFolder);
+
+ TempFD = Syscall.open (TempFolder, OpenFlags.O_RDONLY | OpenFlags.O_DIRECTORY);
+ if (TempFD < 0)
+ UnixMarshal.ThrowExceptionForLastError ();
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ if (Syscall.close (TempFD) < 0)
+ UnixMarshal.ThrowExceptionForLastError ();
+
+ if (Directory.Exists (TempFolder))
+ //Directory.Delete (TempFolder, true); // Fails for long link target paths
+ new UnixDirectoryInfo (TempFolder).Delete (true);
+ }
+
+ void CreateLink (string s)
+ {
+ string link = UnixPath.Combine (TempFolder, "link");
+
+ //File.Delete (link); // Fails for long link target paths
+ if (Syscall.unlink (link) < 0 && Stdlib.GetLastError () != Errno.ENOENT)
+ UnixMarshal.ThrowExceptionForLastError ();
+
+ if (Syscall.symlink (s, link) < 0)
+ UnixMarshal.ThrowExceptionForLastError ();
+ }
+
+ [Test]
+ public void ReadLink ()
+ {
+ foreach (string s in Targets) {
+ string link = UnixPath.Combine (TempFolder, "link");
+
+ CreateLink (s);
+
+ var target = UnixPath.ReadLink (link);
+ Assert.AreEqual (s, target);
+ }
+ }
+
+ [Test]
+ public void ReadLinkAt ()
+ {
+ if (!HaveReadlinkAt)
+ return;
+
+ foreach (string s in Targets) {
+ CreateLink (s);
+
+ var target = UnixPath.ReadLinkAt (TempFD, "link");
+ Assert.AreEqual (s, target);
+ }
+ }
+
+ [Test]
+ public void TryReadLink ()
+ {
+ foreach (string s in Targets) {
+ string link = UnixPath.Combine (TempFolder, "link");
+
+ CreateLink (s);
+
+ var target = UnixPath.TryReadLink (link);
+ Assert.AreEqual (s, target);
+ }
+ }
+
+ [Test]
+ public void TryReadLinkAt ()
+ {
+ if (!HaveReadlinkAt)
+ return;
+
+ foreach (string s in Targets) {
+ CreateLink (s);
+
+ var target = UnixPath.TryReadLinkAt (TempFD, "link");
+ Assert.AreEqual (s, target);
+ }
+ }
+
+ [Test]
+ public void readlink_byte ()
+ {
+ foreach (string s in Targets) {
+ string link = UnixPath.Combine (TempFolder, "link");
+
+ CreateLink (s);
+
+ string target = null;
+ byte[] buf = new byte[256];
+ do {
+ long r = Syscall.readlink (link, buf);
+ if (r < 0)
+ UnixMarshal.ThrowExceptionForLastError ();
+ Assert.GreaterOrEqual (buf.Length, r);
+ if (r == buf.Length)
+ buf = new byte[checked (buf.Length * 2)];
+ else
+ target = UnixEncoding.Instance.GetString (buf, 0, checked ((int) r));
+ } while (target == null);
+
+ Assert.AreEqual (s, target);
+ }
+ }
+
+ [Test]
+ public void readlinkat_byte ()
+ {
+ if (!HaveReadlinkAt)
+ return;
+
+ foreach (string s in Targets) {
+ CreateLink (s);
+
+ string target = null;
+ byte[] buf = new byte[256];
+ do {
+ long r = Syscall.readlinkat (TempFD, "link", buf);
+ if (r < 0)
+ UnixMarshal.ThrowExceptionForLastError ();
+ Assert.GreaterOrEqual (buf.Length, r);
+ if (r == buf.Length)
+ buf = new byte[checked (buf.Length * 2)];
+ else
+ target = UnixEncoding.Instance.GetString (buf, 0, checked ((int) r));
+ } while (target == null);
+
+ Assert.AreEqual (s, target);
+ }
+ }
+
+ [Test]
+ public void readlink_char ()
+ {
+ foreach (string s in Targets) {
+ string link = UnixPath.Combine (TempFolder, "link");
+
+ CreateLink (s);
+
+ var sb = new StringBuilder (256);
+ do {
+ int oldCapacity = sb.Capacity;
+ int r = Syscall.readlink (link, sb);
+ Assert.AreEqual (oldCapacity, sb.Capacity);
+ if (r < 0)
+ UnixMarshal.ThrowExceptionForLastError ();
+ Assert.AreEqual (r, sb.Length);
+ Assert.GreaterOrEqual (sb.Capacity, r);
+ if (r == sb.Capacity)
+ checked { sb.Capacity *= 2; }
+ else
+ break;
+ } while (true);
+ var target = sb.ToString ();
+
+ Assert.AreEqual (s, target);
+ }
+ }
+
+ [Test]
+ public void readlinkat_char ()
+ {
+ if (!HaveReadlinkAt)
+ return;
+
+ foreach (string s in Targets) {
+ CreateLink (s);
+
+ var sb = new StringBuilder (256);
+ do {
+ int oldCapacity = sb.Capacity;
+ int r = Syscall.readlinkat (TempFD, "link", sb);
+ Assert.AreEqual (oldCapacity, sb.Capacity);
+ if (r < 0)
+ UnixMarshal.ThrowExceptionForLastError ();
+ Assert.AreEqual (r, sb.Length);
+ Assert.GreaterOrEqual (sb.Capacity, r);
+ if (r == sb.Capacity)
+ checked { sb.Capacity *= 2; }
+ else
+ break;
+ } while (true);
+ var target = sb.ToString ();
+
+ Assert.AreEqual (s, target);
+ }
+ }
+
+ [Test]
+ public void ReadlinkMultiByteChar ()
+ {
+ string link = UnixPath.Combine (TempFolder, "link");
+
+ CreateLink ("á");
+
+ var sb = new StringBuilder (2);
+ int res = Syscall.readlink (link, sb);
+ if (res < 0)
+ UnixMarshal.ThrowExceptionForLastError ();
+
+ Assert.AreEqual (res, 2);
+ Assert.AreEqual (sb.Length, 2);
+ Assert.AreEqual (sb.Capacity, 2);
+ Assert.AreEqual (sb.ToString (), "á\u0000");
+ }
+ }
+}
EXTRA_DISTFILES = \
src/ComponentModel/Strings.resx
-VALID_PROFILE := $(filter net_4_0 net_4_5 monotouch monodroid, $(PROFILE))
+VALID_PROFILE := $(filter net_4_0 net_4_5 monotouch monodroid mobile_static, $(PROFILE))
ifndef VALID_PROFILE
LIBRARY_NAME = dummy-System.ComponentModel.Composition.dll
NO_INSTALL = yes
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
// -----------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// -----------------------------------------------------------------------
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
// -----------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// -----------------------------------------------------------------------
{
if(!metadataViewType.IsAttributeDefined<MetadataViewImplementationAttribute>())
{
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
try
{
proxyType = MetadataViewGenerator.GenerateView(metadataViewType);
}
catch (TargetInvocationException ex)
{
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
//Unwrap known failures that we want to present as CompositionContractMismatchException
if(metadataViewType.IsInterface)
{
private Type CreateStandardDelegateType()
{
-#if MONOTOUCH
+#if FULL_AOT_RUNTIME
throw new NotImplementedException ();
#else
ParameterInfo[] parameters = this._method.GetParameters();
TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)
# This is a .NET 3.5+ assembly
-VALID_PROFILE := $(filter net_2_0 net_4_0 net_4_5 monotouch monodroid, $(PROFILE))
+VALID_PROFILE := $(filter net_2_0 net_4_0 net_4_5 monotouch monodroid mobile_static, $(PROFILE))
ifndef VALID_PROFILE
LIBRARY_NAME = dummy-System.ComponentModel.DataAnnotations.dll
NO_INSTALL = yes
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+
+#if !MOBILE
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
}
}
}
+#endif
\ No newline at end of file
--- /dev/null
+#include net_4_5_System.ComponentModel.DataAnnotations.dll.sources
using System;
using System.Reflection;
+#if !FULL_AOT_RUNTIME
using System.Reflection.Emit;
+#endif
namespace System.Linq.Expressions {
//
using System;
+#if !FULL_AOT_RUNTIME
using System.Reflection.Emit;
+#endif
namespace System.Linq.Expressions {
using System;
using System.Reflection;
+#if !FULL_AOT_RUNTIME
using System.Reflection.Emit;
+#endif
namespace System.Linq.Expressions {
using System;
using System.Collections.ObjectModel;
using System.Reflection;
+#if !FULL_AOT_RUNTIME
using System.Reflection.Emit;
+#endif
namespace System.Linq.Expressions {
using System.Globalization;
using System.Linq;
using System.Reflection;
+#if !FULL_AOT_RUNTIME
using System.Reflection.Emit;
+#endif
namespace System.Linq.Expressions {
namespace System.Linq.Expressions {
-#if MONOTOUCH
+#if FULL_AOT_RUNTIME
public
#endif
abstract class ExpressionVisitor {
using System;
using System.Collections.Generic;
using System.Reflection;
+#if !FULL_AOT_RUNTIME
using System.Reflection.Emit;
+#endif
using System.Runtime.CompilerServices;
namespace System.Linq.Expressions {
using System.Collections.ObjectModel;
using System.Collections.Generic;
using System.Reflection;
+#if !FULL_AOT_RUNTIME
using System.Reflection.Emit;
+#endif
+
namespace System.Linq.Expressions {
public Delegate Compile ()
{
-#if TARGET_JVM || MONOTOUCH
+#if FULL_AOT_RUNTIME
return new System.Linq.jvm.Runner (this).CreateDelegate ();
#else
var context = new CompilationContext ();
#endif
}
-#if TARGET_JVM || MONOTOUCH
+#if FULL_AOT_RUNTIME
internal Delegate Compile (System.Linq.jvm.ExpressionInterpreter interpreter)
{
return new System.Linq.jvm.Runner (this, interpreter).CreateDelegate ();
using System;
using System.Reflection;
+#if !FULL_AOT_RUNTIME
using System.Reflection.Emit;
+#endif
using System.Text;
namespace System.Linq.Expressions {
using System;
using System.Reflection;
+#if !FULL_AOT_RUNTIME
using System.Reflection.Emit;
+#endif
namespace System.Linq.Expressions {
using System;
using System.Reflection;
+#if !FULL_AOT_RUNTIME
using System.Reflection.Emit;
+#endif
namespace System.Linq.Expressions {
using System;
using System.Collections.ObjectModel;
using System.Reflection;
+#if !FULL_AOT_RUNTIME
using System.Reflection.Emit;
+#endif
namespace System.Linq.Expressions {
using System;
using System.Collections.ObjectModel;
using System.Reflection;
+#if !FULL_AOT_RUNTIME
using System.Reflection.Emit;
+#endif
namespace System.Linq.Expressions {
using System;
using System.Collections.ObjectModel;
using System.Reflection;
+#if !FULL_AOT_RUNTIME
using System.Reflection.Emit;
+#endif
namespace System.Linq.Expressions {
using System.Collections.ObjectModel;
using System.Linq;
using System.Reflection;
+#if !FULL_AOT_RUNTIME
using System.Reflection.Emit;
+#endif
namespace System.Linq.Expressions {
using System;
using System.Collections.ObjectModel;
using System.Reflection;
+#if !FULL_AOT_RUNTIME
using System.Reflection.Emit;
+#endif
namespace System.Linq.Expressions {
//
using System;
+#if !FULL_AOT_RUNTIME
using System.Reflection.Emit;
+#endif
namespace System.Linq.Expressions {
//
using System;
+#if !FULL_AOT_RUNTIME
using System.Reflection.Emit;
+#endif
namespace System.Linq.Expressions {
using System;
using System.Reflection;
+#if !FULL_AOT_RUNTIME
using System.Reflection.Emit;
+#endif
namespace System.Linq.Expressions {
return new AdjustmentRule (dateStart, dateEnd, daylightDelta, daylightTransitionStart, daylightTransitionEnd);
}
+ private AdjustmentRule (SerializationInfo info, StreamingContext context)
+ {
+ if (info == null)
+ throw new ArgumentNullException ("info");
+ dateStart = (DateTime) info.GetValue ("DateStart", typeof (DateTime));
+ dateEnd = (DateTime) info.GetValue ("DateEnd", typeof (DateTime));
+ daylightDelta = (TimeSpan) info.GetValue ("DaylightDelta", typeof (TimeSpan));
+ daylightTransitionStart = (TimeZoneInfo.TransitionTime) info.GetValue ("DaylightTransitionStart", typeof (TimeZoneInfo.TransitionTime));
+ daylightTransitionEnd = (TimeZoneInfo.TransitionTime) info.GetValue ("DaylightTransitionEnd", typeof (TimeZoneInfo.TransitionTime));
+ }
+
private AdjustmentRule (
DateTime dateStart,
DateTime dateEnd,
public void GetObjectData (SerializationInfo info, StreamingContext context)
#endif
{
- throw new NotImplementedException ();
+ if (info == null)
+ throw new ArgumentNullException ("info");
+ info.AddValue ("DateStart", DateStart);
+ info.AddValue ("DateEnd", DateEnd);
+ info.AddValue ("DaylightDelta", DaylightDelta);
+ info.AddValue ("DaylightTransitionStart", DaylightTransitionStart);
+ info.AddValue ("DaylightTransitionEnd", DaylightTransitionEnd);
}
#if NET_4_0
void IDeserializationCallback.OnDeserialization (object sender)
public void OnDeserialization (object sender)
#endif
{
- throw new NotImplementedException ();
+ try {
+ TimeZoneInfo.AdjustmentRule.Validate (dateStart, dateEnd, daylightDelta,
+ daylightTransitionStart, daylightTransitionEnd);
+ } catch (ArgumentException ex) {
+ throw new SerializationException ("invalid serialization data", ex);
+ }
+ }
+
+ private static void Validate (
+ DateTime dateStart,
+ DateTime dateEnd,
+ TimeSpan daylightDelta,
+ TransitionTime daylightTransitionStart,
+ TransitionTime daylightTransitionEnd)
+ {
+ if (dateStart.Kind != DateTimeKind.Unspecified || dateEnd.Kind != DateTimeKind.Unspecified)
+ throw new ArgumentException ("the Kind property of dateStart or dateEnd parameter does not equal DateTimeKind.Unspecified");
+
+ if (daylightTransitionStart == daylightTransitionEnd)
+ throw new ArgumentException ("daylightTransitionStart parameter cannot equal daylightTransitionEnd parameter");
+
+ if (dateStart.Ticks % TimeSpan.TicksPerDay != 0 || dateEnd.Ticks % TimeSpan.TicksPerDay != 0)
+ throw new ArgumentException ("dateStart or dateEnd parameter includes a time of day value");
+
+ if (dateEnd < dateStart)
+ throw new ArgumentOutOfRangeException ("dateEnd is earlier than dateStart");
+
+ if (daylightDelta > new TimeSpan (14, 0, 0) || daylightDelta < new TimeSpan (-14, 0, 0))
+ throw new ArgumentOutOfRangeException ("daylightDelta is less than -14 or greater than 14 hours");
+
+ if (daylightDelta.Ticks % TimeSpan.TicksPerSecond != 0)
+ throw new ArgumentOutOfRangeException ("daylightDelta parameter does not represent a whole number of seconds");
}
}
}
return new TransitionTime (timeOfDay, month, week, dayOfWeek);
}
+ private TransitionTime (SerializationInfo info, StreamingContext context)
+ {
+ if (info == null)
+ throw new ArgumentNullException ("info");
+ timeOfDay = (DateTime) info.GetValue ("TimeOfDay", typeof (DateTime));
+ month = (byte) info.GetValue ("Month", typeof (byte));
+ week = (byte) info.GetValue ("Week", typeof (byte));
+ day = (byte) info.GetValue ("Day", typeof (byte));
+ dayOfWeek = (DayOfWeek) info.GetValue ("DayOfWeek", typeof (DayOfWeek));
+ isFixedDateRule = (bool) info.GetValue ("IsFixedDateRule", typeof (bool));
+
+ if (isFixedDateRule)
+ {
+ week = -1;
+ dayOfWeek = (DayOfWeek) (-1);
+ }
+ if (!isFixedDateRule)
+ day = -1;
+ }
+
private TransitionTime (
DateTime timeOfDay,
int month,
public void GetObjectData (SerializationInfo info, StreamingContext context)
#endif
{
- throw new NotImplementedException ();
- }
+ if (info == null)
+ throw new ArgumentNullException ("info");
+ info.AddValue ("TimeOfDay", TimeOfDay);
+ info.AddValue ("Month", System.Convert.ToByte(Month));
+ if (week > -1)
+ info.AddValue ("Week", System.Convert.ToByte(week));
+ else
+ info.AddValue ("Week", (byte) 1);
+ if (day > -1)
+ info.AddValue ("Day", System.Convert.ToByte(day));
+ else
+ info.AddValue ("Day", (byte) 1);
+ if (dayOfWeek != ((System.DayOfWeek) (-1)))
+ info.AddValue ("DayOfWeek", dayOfWeek);
+ else
+ info.AddValue ("DayOfWeek", DayOfWeek.Sunday);
+ info.AddValue ("IsFixedDateRule", IsFixedDateRule);
+ }
public override bool Equals (object obj)
{
public void OnDeserialization (object sender)
#endif
{
- throw new NotImplementedException ();
+ try {
+ TimeZoneInfo.TransitionTime.Validate (timeOfDay, month, week, day, dayOfWeek, isFixedDateRule);
+ } catch (ArgumentException ex) {
+ throw new SerializationException ("invalid serialization data", ex);
+ }
+ }
+
+ private static void Validate (DateTime timeOfDay, int month,int week, int day, DayOfWeek dayOfWeek, bool isFixedDateRule)
+ {
+ if (timeOfDay.Year != 1 || timeOfDay.Month != 1 || timeOfDay.Day != 1)
+ throw new ArgumentException ("timeOfDay parameter has a non-default date component");
+
+ if (timeOfDay.Kind != DateTimeKind.Unspecified)
+ throw new ArgumentException ("timeOfDay parameter Kind's property is not DateTimeKind.Unspecified");
+
+ if (timeOfDay.Ticks % TimeSpan.TicksPerMillisecond != 0)
+ throw new ArgumentException ("timeOfDay parameter does not represent a whole number of milliseconds");
+
+ if (day < 1 || day > 31) {
+ if (!(!isFixedDateRule && day == -1))
+ throw new ArgumentOutOfRangeException ("day parameter is less than 1 or greater than 31");
+ }
+
+ if (week < 1 || week > 5) {
+ if (!(isFixedDateRule && week == -1))
+ throw new ArgumentOutOfRangeException ("week parameter is less than 1 or greater than 5");
+ }
+
+ if (month < 1 || month > 12)
+ throw new ArgumentOutOfRangeException ("month parameter is less than 1 or greater than 12");
+
+ if (dayOfWeek != DayOfWeek.Sunday &&
+ dayOfWeek != DayOfWeek.Monday &&
+ dayOfWeek != DayOfWeek.Tuesday &&
+ dayOfWeek != DayOfWeek.Wednesday &&
+ dayOfWeek != DayOfWeek.Thursday &&
+ dayOfWeek != DayOfWeek.Friday &&
+ dayOfWeek != DayOfWeek.Saturday) {
+ if (!(isFixedDateRule && dayOfWeek == (DayOfWeek) (-1)))
+ throw new ArgumentOutOfRangeException ("dayOfWeek parameter is not a member od DayOfWeek enumeration");
+ }
}
}
}
public void GetObjectData (SerializationInfo info, StreamingContext context)
#endif
{
- throw new NotImplementedException ();
+ if (info == null)
+ throw new ArgumentNullException ("info");
+ info.AddValue ("Id", id);
+ info.AddValue ("DisplayName", displayName);
+ info.AddValue ("StandardName", standardDisplayName);
+ info.AddValue ("DaylightName", daylightDisplayName);
+ info.AddValue ("BaseUtcOffset", baseUtcOffset);
+ info.AddValue ("AdjustmentRules", adjustmentRules);
+ info.AddValue ("SupportsDaylightSavingTime", SupportsDaylightSavingTime);
}
//FIXME: change this to a generic Dictionary and allow caching for FindSystemTimeZoneById
public void OnDeserialization (object sender)
#endif
{
- throw new NotImplementedException ();
+ try {
+ TimeZoneInfo.Validate (id, baseUtcOffset, adjustmentRules);
+ } catch (ArgumentException ex) {
+ throw new SerializationException ("invalid serialization data", ex);
+ }
+ }
+
+ private static void Validate (string id, TimeSpan baseUtcOffset, AdjustmentRule [] adjustmentRules)
+ {
+ if (id == null)
+ throw new ArgumentNullException ("id");
+
+ if (id == String.Empty)
+ throw new ArgumentException ("id parameter is an empty string");
+
+ if (baseUtcOffset.Ticks % TimeSpan.TicksPerMinute != 0)
+ throw new ArgumentException ("baseUtcOffset parameter does not represent a whole number of minutes");
+
+ if (baseUtcOffset > new TimeSpan (14, 0, 0) || baseUtcOffset < new TimeSpan (-14, 0, 0))
+ throw new ArgumentOutOfRangeException ("baseUtcOffset parameter is greater than 14 hours or less than -14 hours");
+
+#if STRICT
+ if (id.Length > 32)
+ throw new ArgumentException ("id parameter shouldn't be longer than 32 characters");
+#endif
+
+ if (adjustmentRules != null && adjustmentRules.Length != 0) {
+ AdjustmentRule prev = null;
+ foreach (AdjustmentRule current in adjustmentRules) {
+ if (current == null)
+ throw new InvalidTimeZoneException ("one or more elements in adjustmentRules are null");
+
+ if ((baseUtcOffset + current.DaylightDelta < new TimeSpan (-14, 0, 0)) ||
+ (baseUtcOffset + current.DaylightDelta > new TimeSpan (14, 0, 0)))
+ throw new InvalidTimeZoneException ("Sum of baseUtcOffset and DaylightDelta of one or more object in adjustmentRules array is greater than 14 or less than -14 hours;");
+
+ if (prev != null && prev.DateStart > current.DateStart)
+ throw new InvalidTimeZoneException ("adjustment rules specified in adjustmentRules parameter are not in chronological order");
+
+ if (prev != null && prev.DateEnd > current.DateStart)
+ throw new InvalidTimeZoneException ("some adjustment rules in the adjustmentRules parameter overlap");
+
+ if (prev != null && prev.DateEnd == current.DateStart)
+ throw new InvalidTimeZoneException ("a date can have multiple adjustment rules applied to it");
+
+ prev = current;
+ }
+ }
}
public string ToSerializedString ()
return DisplayName;
}
+ private TimeZoneInfo (SerializationInfo info, StreamingContext context)
+ {
+ if (info == null)
+ throw new ArgumentNullException ("info");
+ id = (string) info.GetValue ("Id", typeof (string));
+ displayName = (string) info.GetValue ("DisplayName", typeof (string));
+ standardDisplayName = (string) info.GetValue ("StandardName", typeof (string));
+ daylightDisplayName = (string) info.GetValue ("DaylightName", typeof (string));
+ baseUtcOffset = (TimeSpan) info.GetValue ("BaseUtcOffset", typeof (TimeSpan));
+ adjustmentRules = (TimeZoneInfo.AdjustmentRule []) info.GetValue ("AdjustmentRules", typeof (TimeZoneInfo.AdjustmentRule []));
+ supportsDaylightSavingTime = (bool) info.GetValue ("SupportsDaylightSavingTime", typeof (bool));
+ }
+
private TimeZoneInfo (string id, TimeSpan baseUtcOffset, string displayName, string standardDisplayName, string daylightDisplayName, TimeZoneInfo.AdjustmentRule [] adjustmentRules, bool disableDaylightSavingTime)
{
if (id == null)
}
[Test]
+ // #12987
+ [Category ("MobileNotWorking")]
public void CoalesceNullableSlotIntoInteger ()
{
var s = Expression.Parameter (typeof (Slot?), "s");
using System;
+using System.IO;
+using System.Runtime.Serialization.Formatters.Binary;
using NUnit.Framework;
#if NET_2_0
TimeZoneInfo.TransitionTime daylightTransitionEnd = TimeZoneInfo.TransitionTime.CreateFixedDateRule (new DateTime (1,1,1,2,0,0), 10, 11);
TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (dateStart, dateEnd, new TimeSpan (55), daylightTransitionStart, daylightTransitionEnd);
}
- }
+ }
+
+ [TestFixture]
+ public class NonExceptional
+ {
+ [Test]
+ public void Serialization_Deserialization ()
+ {
+ TimeZoneInfo.TransitionTime start = TimeZoneInfo.TransitionTime.CreateFloatingDateRule (new DateTime (1,1,1,1,0,0), 3, 5, DayOfWeek.Sunday);
+ TimeZoneInfo.TransitionTime end = TimeZoneInfo.TransitionTime.CreateFloatingDateRule (new DateTime (1,1,1,2,0,0), 10, 5, DayOfWeek.Sunday);
+ TimeZoneInfo.AdjustmentRule rule = TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (DateTime.MinValue.Date, DateTime.MaxValue.Date, new TimeSpan (1,0,0), start, end);
+ MemoryStream stream = new MemoryStream ();
+ BinaryFormatter formatter = new BinaryFormatter ();
+ formatter.Serialize (stream, rule);
+ stream.Position = 0;
+ TimeZoneInfo.AdjustmentRule deserialized = (TimeZoneInfo.AdjustmentRule) formatter.Deserialize (stream);
+ stream.Close ();
+ stream.Dispose ();
+
+ Assert.IsTrue (rule.Equals (deserialized));
+ }
+ }
}
}
#endif
using System;
+using System.IO;
+using System.Runtime.Serialization.Formatters.Binary;
using NUnit.Framework;
#if NET_2_0
Assert.IsFalse (tt2.Equals (tt1), "1!=2");
Assert.IsFalse (tt1.Equals (tt2), "2!=1");
}
+
+ [Test]
+ public void Serialize_Deserialize_FloatingDateRule ()
+ {
+ TimeZoneInfo.TransitionTime floatingDateRule = TimeZoneInfo.TransitionTime.CreateFloatingDateRule(new DateTime(1, 1, 1, 1, 0, 0), 3, 5, DayOfWeek.Sunday);
+ MemoryStream stream = new MemoryStream ();
+ BinaryFormatter formatter = new BinaryFormatter ();
+ formatter.Serialize (stream, floatingDateRule);
+ stream.Position = 0;
+ TimeZoneInfo.TransitionTime deserialized = (TimeZoneInfo.TransitionTime) formatter.Deserialize (stream);
+ stream.Close ();
+ stream.Dispose ();
+ Assert.AreEqual (floatingDateRule, deserialized);
+ }
+
+ [Test]
+ public void Serialize_Deserialize_FixedDateRule ()
+ {
+ TimeZoneInfo.TransitionTime fixedDateRule = TimeZoneInfo.TransitionTime.CreateFixedDateRule(new DateTime(1, 1, 1, 1, 0, 0), 3, 12);
+ MemoryStream stream = new MemoryStream ();
+ BinaryFormatter formatter = new BinaryFormatter ();
+ formatter.Serialize (stream, fixedDateRule);
+ stream.Position = 0;
+ TimeZoneInfo.TransitionTime deserialized = (TimeZoneInfo.TransitionTime) formatter.Deserialize (stream);
+ stream.Close ();
+ stream.Dispose ();
+ Assert.AreEqual (fixedDateRule, deserialized);
+ }
}
}
}
*/
using System;
+using System.IO;
+using System.Runtime.Serialization.Formatters.Binary;
using System.Collections;
using NUnit.Framework;
Assert.IsTrue (utc.HasSameRules (custom));
}
}
+
+ [TestFixture]
+ public class SerializationTests
+ {
+ [Test]
+ public void Serialization_Deserialization ()
+ {
+ TimeZoneInfo.TransitionTime start = TimeZoneInfo.TransitionTime.CreateFloatingDateRule (new DateTime (1,1,1,1,0,0), 3, 5, DayOfWeek.Sunday);
+ TimeZoneInfo.TransitionTime end = TimeZoneInfo.TransitionTime.CreateFloatingDateRule (new DateTime (1,1,1,2,0,0), 10, 5, DayOfWeek.Sunday);
+ TimeZoneInfo.AdjustmentRule rule = TimeZoneInfo.AdjustmentRule.CreateAdjustmentRule (DateTime.MinValue.Date, DateTime.MaxValue.Date, new TimeSpan (1,0,0), start, end);
+ TimeZoneInfo london = TimeZoneInfo.CreateCustomTimeZone ("Europe/London", new TimeSpan (0), "Europe/London", "British Standard Time", "British Summer Time", new TimeZoneInfo.AdjustmentRule [] {rule});
+ MemoryStream stream = new MemoryStream ();
+ BinaryFormatter formatter = new BinaryFormatter ();
+ formatter.Serialize (stream, london);
+ stream.Position = 0;
+ TimeZoneInfo deserialized = (TimeZoneInfo) formatter.Deserialize (stream);
+ stream.Close ();
+ stream.Dispose ();
+ Assert.AreEqual (london, deserialized);
+ }
+ }
}
}
#endif
--- /dev/null
+#include mobile_System.Core.dll.sources
+#include static_System.Core.dll.sources
+System.Linq.jvm/Conversion.cs
+System.Linq.jvm/ExpressionInterpreter.cs
+System.Linq.jvm/Runner.cs
+System.Linq.jvm/Math.cs
+System/TimeZoneInfo.MonoTouch.cs
--- /dev/null
+#include net_4_5_System.Data.Services.Client.dll.sources
-r:J2SE.Helpers.dll \
$(OTHER_LIB_MCS_FLAGS)
else
-MOBILE := $(filter monotouch monodroid mobile, $(PROFILE))
+MOBILE := $(filter monotouch monodroid mobile mobile_static, $(PROFILE))
ifdef MOBILE
LIB_MCS_FLAGS += \
-r:Mono.Data.Tds.dll \
using System;
using System.Collections;
using System.Reflection;
+#if !FULL_AOT_RUNTIME
using System.Reflection.Emit;
+#endif
namespace System.Data.Common
{
{
if (row == null)
throw new IndexOutOfRangeException ("The given datarow is not in the current DataRowCollection.");
- int index = List.IndexOf (row);
+ int index = this.IndexOf (row);
if (index < 0)
throw new IndexOutOfRangeException ("The given datarow is not in the current DataRowCollection.");
List.RemoveAt (index);
--- /dev/null
+#include mobile_System.Data.dll.sources
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Runtime.Serialization;
+using System.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ [Serializable]
+ public class ActiveDirectoryOperationException : Exception, ISerializable
+ {
+ public int ErrorCode {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ActiveDirectoryOperationException (string message, Exception inner, int errorCode) : base(message, inner)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public ActiveDirectoryOperationException (string message, int errorCode) : base(message)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public ActiveDirectoryOperationException (string message, Exception inner) : base(message, inner)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public ActiveDirectoryOperationException (string message) : base(message)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public ActiveDirectoryOperationException () : base("DSUnknownFailure")
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected ActiveDirectoryOperationException (SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]
+ public override void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public abstract class ActiveDirectoryPartition : IDisposable
+ {
+ public string Name {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ protected ActiveDirectoryPartition ()
+ {
+ }
+
+ public void Dispose ()
+ {
+ }
+
+ protected virtual void Dispose (bool disposing)
+ {
+
+ }
+
+ public override string ToString ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true)]
+ public abstract DirectoryEntry GetDirectoryEntry ();
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Collections;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class ActiveDirectoryReplicationMetadata : DictionaryBase
+ {
+ public AttributeMetadata this [string name] {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ReadOnlyStringCollection AttributeNames {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public AttributeMetadataCollection Values {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool Contains (string attributeName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void CopyTo (AttributeMetadata[] array, int index)
+ {
+ throw new NotImplementedException ();
+ }
+
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public enum ActiveDirectoryRole
+ {
+ SchemaRole,
+ NamingRole,
+ PdcRole,
+ RidRole,
+ InfrastructureRole
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Collections;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class ActiveDirectoryRoleCollection : ReadOnlyCollectionBase
+ {
+ public ActiveDirectoryRole this [int index] {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool Contains (ActiveDirectoryRole role)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public int IndexOf (ActiveDirectoryRole role)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void CopyTo (ActiveDirectoryRole[] roles, int index)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class ActiveDirectorySchedule
+ {
+ public bool[,,] RawSchedule {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ActiveDirectorySchedule ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public ActiveDirectorySchedule (ActiveDirectorySchedule schedule) : this()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void SetSchedule (DayOfWeek day, HourOfDay fromHour, MinuteOfHour fromMinute, HourOfDay toHour, MinuteOfHour toMinute)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void SetSchedule (DayOfWeek[] days, HourOfDay fromHour, MinuteOfHour fromMinute, HourOfDay toHour, MinuteOfHour toMinute)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void SetDailySchedule (HourOfDay fromHour, MinuteOfHour fromMinute, HourOfDay toHour, MinuteOfHour toMinute)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void ResetSchedule ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true)]
+ public class ActiveDirectorySchema : ActiveDirectoryPartition
+ {
+ public DirectoryServer SchemaRoleOwner {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ protected override void Dispose (bool disposing)
+ {
+
+ }
+
+ public static ActiveDirectorySchema GetSchema (DirectoryContext context)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void RefreshSchema ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public ActiveDirectorySchemaClass FindClass (string ldapDisplayName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public ActiveDirectorySchemaClass FindDefunctClass (string commonName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public ReadOnlyActiveDirectorySchemaClassCollection FindAllClasses ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public ReadOnlyActiveDirectorySchemaClassCollection FindAllClasses (SchemaClassType type)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public ReadOnlyActiveDirectorySchemaClassCollection FindAllDefunctClasses ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public ActiveDirectorySchemaProperty FindProperty (string ldapDisplayName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public ActiveDirectorySchemaProperty FindDefunctProperty (string commonName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public ReadOnlyActiveDirectorySchemaPropertyCollection FindAllProperties ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public ReadOnlyActiveDirectorySchemaPropertyCollection FindAllProperties (PropertyTypes type)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public ReadOnlyActiveDirectorySchemaPropertyCollection FindAllDefunctProperties ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ public override DirectoryEntry GetDirectoryEntry ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static ActiveDirectorySchema GetCurrentSchema ()
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true)]
+ public class ActiveDirectorySchemaClass : IDisposable
+ {
+ public string Name {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public string CommonName {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public string Oid {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public string Description {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool IsDefunct {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ActiveDirectorySchemaClassCollection PossibleSuperiors {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ReadOnlyActiveDirectorySchemaClassCollection PossibleInferiors {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ActiveDirectorySchemaPropertyCollection MandatoryProperties {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ActiveDirectorySchemaPropertyCollection OptionalProperties {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ActiveDirectorySchemaClassCollection AuxiliaryClasses {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ActiveDirectorySchemaClass SubClassOf {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public SchemaClassType Type {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public Guid SchemaGuid {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ActiveDirectorySecurity DefaultObjectSecurityDescriptor {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ActiveDirectorySchemaClass (DirectoryContext context, string ldapDisplayName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void Dispose ()
+ {
+
+ }
+
+ protected virtual void Dispose (bool disposing)
+ {
+
+ }
+
+ public static ActiveDirectorySchemaClass FindByName (DirectoryContext context, string ldapDisplayName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public ReadOnlyActiveDirectorySchemaPropertyCollection GetAllProperties ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void Save ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override string ToString ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public DirectoryEntry GetDirectoryEntry ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Collections;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class ActiveDirectorySchemaClassCollection : CollectionBase
+ {
+ public ActiveDirectorySchemaClass this [int index] {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public int Add (ActiveDirectorySchemaClass schemaClass)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void AddRange (ActiveDirectorySchemaClass[] schemaClasses)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void AddRange (ActiveDirectorySchemaClassCollection schemaClasses)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void AddRange (ReadOnlyActiveDirectorySchemaClassCollection schemaClasses)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void Remove (ActiveDirectorySchemaClass schemaClass)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void Insert (int index, ActiveDirectorySchemaClass schemaClass)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public bool Contains (ActiveDirectorySchemaClass schemaClass)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void CopyTo (ActiveDirectorySchemaClass[] schemaClasses, int index)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public int IndexOf (ActiveDirectorySchemaClass schemaClass)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnClearComplete ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnInsertComplete (int index, object value)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnRemoveComplete (int index, object value)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnSetComplete (int index, object oldValue, object newValue)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnValidate (object value)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true)]
+ public class ActiveDirectorySchemaProperty : IDisposable
+ {
+ public string Name {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public string CommonName {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public string Oid {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ActiveDirectorySyntax Syntax {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public string Description {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool IsSingleValued {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool IsIndexed {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool IsIndexedOverContainer {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool IsInAnr {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool IsOnTombstonedObject {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool IsTupleIndexed {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool IsInGlobalCatalog {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public int RangeLower {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public int RangeUpper {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool IsDefunct {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ActiveDirectorySchemaProperty Link {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public int? LinkId {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public Guid SchemaGuid {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ActiveDirectorySchemaProperty (DirectoryContext context, string ldapDisplayName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void Dispose ()
+ {
+ }
+
+ protected virtual void Dispose (bool disposing)
+ {
+
+ }
+
+ public static ActiveDirectorySchemaProperty FindByName (DirectoryContext context, string ldapDisplayName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void Save ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override string ToString ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public DirectoryEntry GetDirectoryEntry ()
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Collections;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class ActiveDirectorySchemaPropertyCollection : CollectionBase
+ {
+ public ActiveDirectorySchemaProperty this [int index] {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public int Add (ActiveDirectorySchemaProperty schemaProperty)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void AddRange (ActiveDirectorySchemaProperty[] properties)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void AddRange (ActiveDirectorySchemaPropertyCollection properties)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void AddRange (ReadOnlyActiveDirectorySchemaPropertyCollection properties)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void Remove (ActiveDirectorySchemaProperty schemaProperty)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void Insert (int index, ActiveDirectorySchemaProperty schemaProperty)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public bool Contains (ActiveDirectorySchemaProperty schemaProperty)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void CopyTo (ActiveDirectorySchemaProperty[] properties, int index)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public int IndexOf (ActiveDirectorySchemaProperty schemaProperty)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnClearComplete ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnInsertComplete (int index, object value)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnRemoveComplete (int index, object value)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnSetComplete (int index, object oldValue, object newValue)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnValidate (object value)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Security.AccessControl;
+using System.Security.Principal;
+
+namespace System.DirectoryServices
+{
+ public class ActiveDirectorySecurity : DirectoryObjectSecurity
+ {
+ public override Type AccessRightType {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public override Type AccessRuleType {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public override Type AuditRuleType {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ActiveDirectorySecurity ()
+ {
+ }
+
+ public void AddAccessRule (ActiveDirectoryAccessRule rule)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void SetAccessRule (ActiveDirectoryAccessRule rule)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void ResetAccessRule (ActiveDirectoryAccessRule rule)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void RemoveAccess (IdentityReference identity, AccessControlType type)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public bool RemoveAccessRule (ActiveDirectoryAccessRule rule)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void RemoveAccessRuleSpecific (ActiveDirectoryAccessRule rule)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override bool ModifyAccessRule (AccessControlModification modification, AccessRule rule, out bool modified)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override void PurgeAccessRules (IdentityReference identity)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void AddAuditRule (ActiveDirectoryAuditRule rule)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void SetAuditRule (ActiveDirectoryAuditRule rule)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void RemoveAudit (IdentityReference identity)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public bool RemoveAuditRule (ActiveDirectoryAuditRule rule)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void RemoveAuditRuleSpecific (ActiveDirectoryAuditRule rule)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override bool ModifyAuditRule (AccessControlModification modification, AuditRule rule, out bool modified)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override void PurgeAuditRules (IdentityReference identity)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public sealed override AccessRule AccessRuleFactory (IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public sealed override AccessRule AccessRuleFactory (IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type, Guid objectGuid, Guid inheritedObjectGuid)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public sealed override AuditRule AuditRuleFactory (IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public sealed override AuditRule AuditRuleFactory (IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags, Guid objectGuid, Guid inheritedObjectGuid)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Collections;
+using System.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true)]
+ public class ActiveDirectorySite : IDisposable
+ {
+ public string Name {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public DomainCollection Domains {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ActiveDirectorySubnetCollection Subnets {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ReadOnlyDirectoryServerCollection Servers {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ReadOnlySiteCollection AdjacentSites {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ReadOnlySiteLinkCollection SiteLinks {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public DirectoryServer InterSiteTopologyGenerator {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ActiveDirectorySiteOptions Options {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public string Location {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ReadOnlyDirectoryServerCollection BridgeheadServers {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public DirectoryServerCollection PreferredSmtpBridgeheadServers {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public DirectoryServerCollection PreferredRpcBridgeheadServers {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ActiveDirectorySchedule IntraSiteReplicationSchedule {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public static ActiveDirectorySite FindByName (DirectoryContext context, string siteName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public ActiveDirectorySite (DirectoryContext context, string siteName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static ActiveDirectorySite GetComputerSite ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void Save ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void Delete ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override string ToString ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public DirectoryEntry GetDirectoryEntry ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void Dispose ()
+ {
+
+ }
+
+ protected virtual void Dispose (bool disposing)
+ {
+
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Collections;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class ActiveDirectorySiteCollection : CollectionBase
+ {
+ public ActiveDirectorySite this [int index] {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public int Add (ActiveDirectorySite site)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void AddRange (ActiveDirectorySite[] sites)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void AddRange (ActiveDirectorySiteCollection sites)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public bool Contains (ActiveDirectorySite site)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void CopyTo (ActiveDirectorySite[] array, int index)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public int IndexOf (ActiveDirectorySite site)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void Insert (int index, ActiveDirectorySite site)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void Remove (ActiveDirectorySite site)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnClearComplete ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnInsertComplete (int index, object value)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnRemoveComplete (int index, object value)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnSetComplete (int index, object oldValue, object newValue)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnValidate (object value)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Collections;
+using System.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true)]
+ public class ActiveDirectorySiteLink : IDisposable
+ {
+ public string Name {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ActiveDirectoryTransportType TransportType {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ActiveDirectorySiteCollection Sites {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public int Cost {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public TimeSpan ReplicationInterval {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool ReciprocalReplicationEnabled {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool NotificationEnabled {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool DataCompressionEnabled {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ActiveDirectorySchedule InterSiteReplicationSchedule {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ActiveDirectorySiteLink (DirectoryContext context, string siteLinkName) : this(context, siteLinkName, ActiveDirectoryTransportType.Rpc, null)
+ {
+ }
+
+ public ActiveDirectorySiteLink (DirectoryContext context, string siteLinkName, ActiveDirectoryTransportType transport) : this(context, siteLinkName, transport, null)
+ {
+ }
+
+ public ActiveDirectorySiteLink (DirectoryContext context, string siteLinkName, ActiveDirectoryTransportType transport, ActiveDirectorySchedule schedule)
+ {
+ }
+
+ public static ActiveDirectorySiteLink FindByName (DirectoryContext context, string siteLinkName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static ActiveDirectorySiteLink FindByName (DirectoryContext context, string siteLinkName, ActiveDirectoryTransportType transport)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void Save ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void Delete ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override string ToString ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public DirectoryEntry GetDirectoryEntry ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void Dispose ()
+ {
+ }
+
+ protected virtual void Dispose (bool disposing)
+ {
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+
+using System;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ [Flags]
+ public enum ActiveDirectorySiteOptions
+ {
+ None = 0,
+ AutoTopologyDisabled = 1,
+ TopologyCleanupDisabled = 2,
+ AutoMinimumHopDisabled = 4,
+ StaleServerDetectDisabled = 8,
+ AutoInterSiteTopologyDisabled = 16,
+ GroupMembershipCachingEnabled = 32,
+ ForceKccWindows2003Behavior = 64,
+ UseWindows2000IstgElection = 128,
+ RandomBridgeHeaderServerSelectionDisabled = 256,
+ UseHashingForReplicationSchedule = 512,
+ RedundantServerTopologyEnabled = 1024
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true)]
+ public class ActiveDirectorySubnet : IDisposable
+ {
+ public string Name {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ActiveDirectorySite Site {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public string Location {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public static ActiveDirectorySubnet FindByName (DirectoryContext context, string subnetName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public ActiveDirectorySubnet (DirectoryContext context, string subnetName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public ActiveDirectorySubnet (DirectoryContext context, string subnetName, string siteName) : this(context, subnetName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void Save ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void Delete ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override string ToString ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public DirectoryEntry GetDirectoryEntry ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void Dispose ()
+ {
+
+ }
+
+ protected virtual void Dispose (bool disposing)
+ {
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Collections;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class ActiveDirectorySubnetCollection : CollectionBase
+ {
+ public ActiveDirectorySubnet this [int index] {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public int Add (ActiveDirectorySubnet subnet)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void AddRange (ActiveDirectorySubnet[] subnets)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void AddRange (ActiveDirectorySubnetCollection subnets)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public bool Contains (ActiveDirectorySubnet subnet)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void CopyTo (ActiveDirectorySubnet[] array, int index)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public int IndexOf (ActiveDirectorySubnet subnet)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void Insert (int index, ActiveDirectorySubnet subnet)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void Remove (ActiveDirectorySubnet subnet)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnClear ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnClearComplete ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnInsertComplete (int index, object value)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnRemoveComplete (int index, object value)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnSetComplete (int index, object oldValue, object newValue)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnValidate (object value)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+
+using System;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public enum ActiveDirectorySyntax
+ {
+ CaseExactString,
+ CaseIgnoreString,
+ NumericString,
+ DirectoryString,
+ OctetString,
+ SecurityDescriptor,
+ Int,
+ Int64,
+ Bool,
+ Oid,
+ GeneralizedTime,
+ UtcTime,
+ DN,
+ DNWithBinary,
+ DNWithString,
+ Enumeration,
+ IA5String,
+ PrintableString,
+ Sid,
+ AccessPointDN,
+ ORName,
+ PresentationAddress,
+ ReplicaLink
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public enum ActiveDirectoryTransportType
+ {
+ Rpc,
+ Smtp
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true)]
+ public class ApplicationPartition : ActiveDirectoryPartition
+ {
+ public DirectoryServerCollection DirectoryServers {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public string SecurityReferenceDomain {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ApplicationPartition (DirectoryContext context, string distinguishedName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public ApplicationPartition (DirectoryContext context, string distinguishedName, string objectClass)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void Dispose (bool disposing)
+ {
+
+ }
+
+ public static ApplicationPartition GetApplicationPartition (DirectoryContext context)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static ApplicationPartition FindByName (DirectoryContext context, string distinguishedName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public DirectoryServer FindDirectoryServer ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public DirectoryServer FindDirectoryServer (string siteName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public DirectoryServer FindDirectoryServer (bool forceRediscovery)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public DirectoryServer FindDirectoryServer (string siteName, bool forceRediscovery)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public ReadOnlyDirectoryServerCollection FindAllDirectoryServers ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public ReadOnlyDirectoryServerCollection FindAllDirectoryServers (string siteName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public ReadOnlyDirectoryServerCollection FindAllDiscoverableDirectoryServers ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public ReadOnlyDirectoryServerCollection FindAllDiscoverableDirectoryServers (string siteName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void Delete ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void Save ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ public override DirectoryEntry GetDirectoryEntry ()
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Collections;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class ApplicationPartitionCollection : ReadOnlyCollectionBase
+ {
+ public ApplicationPartition this [int index] {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool Contains (ApplicationPartition applicationPartition)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public int IndexOf (ApplicationPartition applicationPartition)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void CopyTo (ApplicationPartition[] applicationPartitions, int index)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Collections;
+using System.Runtime.InteropServices;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class AttributeMetadata
+ {
+ public string Name {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public int Version {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public DateTime LastOriginatingChangeTime {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public Guid LastOriginatingInvocationId {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public long OriginatingChangeUsn {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public long LocalChangeUsn {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public string OriginatingServer {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Collections;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class AttributeMetadataCollection : ReadOnlyCollectionBase
+ {
+ public AttributeMetadata this [int index] {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool Contains (AttributeMetadata metadata)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public int IndexOf (AttributeMetadata metadata)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void CopyTo (AttributeMetadata[] metadata, int index)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Net;
+using System.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ [EnvironmentPermission(SecurityAction.Assert, Unrestricted = true)]
+ public class DirectoryContext
+ {
+ public string Name {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public string UserName {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public DirectoryContextType ContextType {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ [DirectoryServicesPermission(SecurityAction.Demand, Unrestricted = true)]
+ public DirectoryContext (DirectoryContextType contextType)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [DirectoryServicesPermission(SecurityAction.Demand, Unrestricted = true)]
+ public DirectoryContext (DirectoryContextType contextType, string name)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [DirectoryServicesPermission(SecurityAction.Demand, Unrestricted = true)]
+ public DirectoryContext (DirectoryContextType contextType, string username, string password)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [DirectoryServicesPermission(SecurityAction.Demand, Unrestricted = true)]
+ public DirectoryContext (DirectoryContextType contextType, string name, string username, string password)
+ {
+ throw new NotImplementedException ();
+ }
+
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public enum DirectoryContextType
+ {
+ Domain,
+ Forest,
+ DirectoryServer,
+ ConfigurationSet,
+ ApplicationPartition
+ }
+}
\ No newline at end of file
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true)]
+ public abstract class DirectoryServer : IDisposable
+ {
+ public string Name {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ReadOnlyStringCollection Partitions {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public abstract string IPAddress {
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ get;
+ }
+
+ public abstract string SiteName {
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ get;
+ }
+
+ public abstract SyncUpdateCallback SyncFromAllServersCallback {
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ get;
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ set;
+ }
+
+ public abstract ReplicationConnectionCollection InboundConnections {
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ get;
+ }
+
+ public abstract ReplicationConnectionCollection OutboundConnections {
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ get;
+ }
+
+ internal DirectoryContext Context {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public void Dispose ()
+ {
+
+ }
+
+ protected virtual void Dispose (bool disposing)
+ {
+
+ }
+
+ public override string ToString ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void MoveToAnotherSite (string siteName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public DirectoryEntry GetDirectoryEntry ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ public abstract void CheckReplicationConsistency ();
+
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ public abstract ReplicationCursorCollection GetReplicationCursors (string partition);
+
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ public abstract ReplicationOperationInformation GetReplicationOperationInformation ();
+
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ public abstract ReplicationNeighborCollection GetReplicationNeighbors (string partition);
+
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ public abstract ReplicationNeighborCollection GetAllReplicationNeighbors ();
+
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ public abstract ReplicationFailureCollection GetReplicationConnectionFailures ();
+
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ public abstract ActiveDirectoryReplicationMetadata GetReplicationMetadata (string objectPath);
+
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ public abstract void SyncReplicaFromServer (string partition, string sourceServer);
+
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ public abstract void TriggerSyncReplicaFromNeighbors (string partition);
+
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ public abstract void SyncReplicaFromAllServers (string partition, SyncFromAllServersOptions options);
+ }
+
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Collections;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class DirectoryServerCollection : CollectionBase
+ {
+ public DirectoryServer this [int index] {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public int Add (DirectoryServer server)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void AddRange (DirectoryServer[] servers)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public bool Contains (DirectoryServer server)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void CopyTo (DirectoryServer[] array, int index)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public int IndexOf (DirectoryServer server)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void Insert (int index, DirectoryServer server)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void Remove (DirectoryServer server)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnClear ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnClearComplete ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnInsertComplete (int index, object value)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnRemoveComplete (int index, object value)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnSetComplete (int index, object oldValue, object newValue)
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void OnValidate (object value)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true)]
+ public class Domain : ActiveDirectoryPartition
+ {
+ public Forest Forest {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public DomainControllerCollection DomainControllers {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public DomainCollection Children {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public DomainMode DomainMode {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public Domain Parent {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public DomainController PdcRoleOwner {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public DomainController RidRoleOwner {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public DomainController InfrastructureRoleOwner {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public static Domain GetDomain (DirectoryContext context)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static Domain GetComputerDomain ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void RaiseDomainFunctionality (DomainMode domainMode)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public DomainController FindDomainController ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public DomainController FindDomainController (string siteName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public DomainController FindDomainController (LocatorOptions flag)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public DomainController FindDomainController (string siteName, LocatorOptions flag)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public DomainControllerCollection FindAllDomainControllers ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public DomainControllerCollection FindAllDomainControllers (string siteName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public DomainControllerCollection FindAllDiscoverableDomainControllers ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public DomainControllerCollection FindAllDiscoverableDomainControllers (string siteName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ public override DirectoryEntry GetDirectoryEntry ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public TrustRelationshipInformationCollection GetAllTrustRelationships ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public TrustRelationshipInformation GetTrustRelationship (string targetDomainName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public bool GetSelectiveAuthenticationStatus (string targetDomainName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void SetSelectiveAuthenticationStatus (string targetDomainName, bool enable)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public bool GetSidFilteringStatus (string targetDomainName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void SetSidFilteringStatus (string targetDomainName, bool enable)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void DeleteLocalSideOfTrustRelationship (string targetDomainName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void DeleteTrustRelationship (Domain targetDomain)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void VerifyOutboundTrustRelationship (string targetDomainName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void VerifyTrustRelationship (Domain targetDomain, TrustDirection direction)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void CreateLocalSideOfTrustRelationship (string targetDomainName, TrustDirection direction, string trustPassword)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void CreateTrustRelationship (Domain targetDomain, TrustDirection direction)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void UpdateLocalSideOfTrustRelationship (string targetDomainName, string newTrustPassword)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void UpdateLocalSideOfTrustRelationship (string targetDomainName, TrustDirection newTrustDirection, string newTrustPassword)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void UpdateTrustRelationship (Domain targetDomain, TrustDirection newTrustDirection)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void RepairTrustRelationship (Domain targetDomain)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static Domain GetCurrentDomain ()
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Collections;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class DomainCollection : ReadOnlyCollectionBase
+ {
+ public Domain this [int index] {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool Contains (Domain domain)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public int IndexOf (Domain domain)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void CopyTo (Domain[] domains, int index)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Net;
+using System.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true)]
+ public class DomainController : DirectoryServer
+ {
+ public Forest Forest {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public DateTime CurrentTime {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public long HighestCommittedUsn {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public string OSVersion {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ActiveDirectoryRoleCollection Roles {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public Domain Domain {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public override string IPAddress {
+ [DnsPermission(SecurityAction.Assert, Unrestricted = true), DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public override string SiteName {
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public override SyncUpdateCallback SyncFromAllServersCallback {
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ get {
+ throw new NotImplementedException ();
+ }
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public override ReplicationConnectionCollection InboundConnections {
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public override ReplicationConnectionCollection OutboundConnections {
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ protected DomainController ()
+ {
+ }
+
+ protected override void Dispose (bool disposing)
+ {
+ base.Dispose ();
+
+ }
+
+ public static DomainController GetDomainController (DirectoryContext context)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static DomainController FindOne (DirectoryContext context)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static DomainController FindOne (DirectoryContext context, string siteName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static DomainController FindOne (DirectoryContext context, LocatorOptions flag)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static DomainController FindOne (DirectoryContext context, string siteName, LocatorOptions flag)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static DomainControllerCollection FindAll (DirectoryContext context)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static DomainControllerCollection FindAll (DirectoryContext context, string siteName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ public virtual GlobalCatalog EnableGlobalCatalog ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ public virtual bool IsGlobalCatalog ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void TransferRoleOwnership (ActiveDirectoryRole role)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void SeizeRoleOwnership (ActiveDirectoryRole role)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ public virtual DirectorySearcher GetDirectorySearcher ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ public override void CheckReplicationConsistency ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ public override ReplicationCursorCollection GetReplicationCursors (string partition)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ public override ReplicationOperationInformation GetReplicationOperationInformation ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ public override ReplicationNeighborCollection GetReplicationNeighbors (string partition)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ public override ReplicationNeighborCollection GetAllReplicationNeighbors ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ public override ReplicationFailureCollection GetReplicationConnectionFailures ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ public override ActiveDirectoryReplicationMetadata GetReplicationMetadata (string objectPath)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ public override void SyncReplicaFromServer (string partition, string sourceServer)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ public override void TriggerSyncReplicaFromNeighbors (string partition)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ public override void SyncReplicaFromAllServers (string partition, SyncFromAllServersOptions options)
+ {
+ throw new NotImplementedException ();
+ }
+
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Collections;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class DomainControllerCollection : ReadOnlyCollectionBase
+ {
+ public DomainController this [int index] {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool Contains (DomainController domainController)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public int IndexOf (DomainController domainController)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void CopyTo (DomainController[] domainControllers, int index)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public enum DomainMode
+ {
+ Windows2000MixedDomain,
+ Windows2000NativeDomain,
+ Windows2003InterimDomain,
+ Windows2003Domain,
+ Windows2008Domain,
+ Windows2008R2Domain
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true)]
+ public class Forest : IDisposable
+ {
+ public string Name {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ReadOnlySiteCollection Sites {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public DomainCollection Domains {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public GlobalCatalogCollection GlobalCatalogs {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ApplicationPartitionCollection ApplicationPartitions {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ForestMode ForestMode {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public Domain RootDomain {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ActiveDirectorySchema Schema {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public DomainController SchemaRoleOwner {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public DomainController NamingRoleOwner {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public void Dispose ()
+ {
+ this.Dispose (true);
+ }
+
+ protected void Dispose (bool disposing)
+ {
+
+ }
+
+ public static Forest GetForest (DirectoryContext context)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void RaiseForestFunctionality (ForestMode forestMode)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override string ToString ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public GlobalCatalog FindGlobalCatalog ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public GlobalCatalog FindGlobalCatalog (string siteName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public GlobalCatalog FindGlobalCatalog (LocatorOptions flag)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public GlobalCatalog FindGlobalCatalog (string siteName, LocatorOptions flag)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public GlobalCatalogCollection FindAllGlobalCatalogs ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public GlobalCatalogCollection FindAllGlobalCatalogs (string siteName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public GlobalCatalogCollection FindAllDiscoverableGlobalCatalogs ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public GlobalCatalogCollection FindAllDiscoverableGlobalCatalogs (string siteName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public TrustRelationshipInformationCollection GetAllTrustRelationships ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public ForestTrustRelationshipInformation GetTrustRelationship (string targetForestName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public bool GetSelectiveAuthenticationStatus (string targetForestName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void SetSelectiveAuthenticationStatus (string targetForestName, bool enable)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public bool GetSidFilteringStatus (string targetForestName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void SetSidFilteringStatus (string targetForestName, bool enable)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void DeleteLocalSideOfTrustRelationship (string targetForestName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void DeleteTrustRelationship (Forest targetForest)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void VerifyOutboundTrustRelationship (string targetForestName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void VerifyTrustRelationship (Forest targetForest, TrustDirection direction)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void CreateLocalSideOfTrustRelationship (string targetForestName, TrustDirection direction, string trustPassword)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void CreateTrustRelationship (Forest targetForest, TrustDirection direction)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void UpdateLocalSideOfTrustRelationship (string targetForestName, string newTrustPassword)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void UpdateLocalSideOfTrustRelationship (string targetForestName, TrustDirection newTrustDirection, string newTrustPassword)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void UpdateTrustRelationship (Forest targetForest, TrustDirection newTrustDirection)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void RepairTrustRelationship (Forest targetForest)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static Forest GetCurrentForest ()
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public enum ForestMode
+ {
+ Windows2000Forest,
+ Windows2003InterimForest,
+ Windows2003Forest,
+ Windows2008Forest,
+ Windows2008R2Forest
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Collections;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class ForestTrustDomainInfoCollection : ReadOnlyCollectionBase
+ {
+ public ForestTrustDomainInformation this [int index] {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool Contains (ForestTrustDomainInformation information)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public int IndexOf (ForestTrustDomainInformation information)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void CopyTo (ForestTrustDomainInformation[] array, int index)
+ {
+ throw new NotImplementedException ();
+ }
+
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class ForestTrustDomainInformation
+ {
+ public string DnsName {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public string NetBiosName {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public string DomainSid {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ForestTrustDomainStatus Status {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+
+using System;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public enum ForestTrustDomainStatus
+ {
+ Enabled,
+ SidAdminDisabled,
+ SidConflictDisabled,
+ NetBiosNameAdminDisabled = 4,
+ NetBiosNameConflictDisabled = 8
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Collections.Specialized;
+using System.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true)]
+ public class ForestTrustRelationshipInformation : TrustRelationshipInformation
+ {
+ public TopLevelNameCollection TopLevelNames {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public StringCollection ExcludedTopLevelNames {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ForestTrustDomainInfoCollection TrustedDomainInformation {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public void Save ()
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Collections;
+using System.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true)]
+ public class GlobalCatalog : DomainController
+ {
+ public static GlobalCatalog GetGlobalCatalog (DirectoryContext context)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public new static GlobalCatalog FindOne (DirectoryContext context)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public new static GlobalCatalog FindOne (DirectoryContext context, string siteName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public new static GlobalCatalog FindOne (DirectoryContext context, LocatorOptions flag)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public new static GlobalCatalog FindOne (DirectoryContext context, string siteName, LocatorOptions flag)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public new static GlobalCatalogCollection FindAll (DirectoryContext context)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public new static GlobalCatalogCollection FindAll (DirectoryContext context, string siteName)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ public override GlobalCatalog EnableGlobalCatalog ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public DomainController DisableGlobalCatalog ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ public override bool IsGlobalCatalog ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public ReadOnlyActiveDirectorySchemaPropertyCollection FindAllProperties ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true), DirectoryServicesPermission(SecurityAction.InheritanceDemand, Unrestricted = true)]
+ public override DirectorySearcher GetDirectorySearcher ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Collections;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class GlobalCatalogCollection : ReadOnlyCollectionBase
+ {
+ public GlobalCatalog this [int index] {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool Contains (GlobalCatalog globalCatalog)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public int IndexOf (GlobalCatalog globalCatalog)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void CopyTo (GlobalCatalog[] globalCatalogs, int index)
+ {
+ throw new NotImplementedException ();
+ }
+
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public enum HourOfDay
+ {
+ Zero, // midnight
+ One,
+ Two,
+ Three,
+ Four,
+ Five,
+ Six,
+ Seven,
+ Eight,
+ Nine,
+ Ten,
+ Eleven,
+ Twelve,
+ Thirteen,
+ Fourteen,
+ Fifteen,
+ Sixteen,
+ Seventeen,
+ Eighteen,
+ Nineteen,
+ Twenty,
+ TwentyOne,
+ TwentyTwo,
+ TwentyThree
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ [Flags]
+ public enum LocatorOptions : long
+ {
+ ForceRediscovery = 1L,
+ KdcRequired = 1024L,
+ TimeServerRequired = 2048L,
+ WriteableRequired = 4096L,
+ AvoidSelf = 16384L
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public enum MinuteOfHour
+ {
+ Zero,
+ Fifteen = 15,
+ Thirty = 30,
+ FortyFive = 45
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public enum NotificationStatus
+ {
+ NoNotification,
+ IntraSiteOnly,
+ NotificationAlways
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+
+using System;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ [Flags]
+ public enum PropertyTypes
+ {
+ Indexed = 2,
+ InGlobalCatalog = 4
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Collections;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class ReadOnlyActiveDirectorySchemaClassCollection : ReadOnlyCollectionBase
+ {
+ public ActiveDirectorySchemaClass this [int index] {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool Contains (ActiveDirectorySchemaClass schemaClass)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public int IndexOf (ActiveDirectorySchemaClass schemaClass)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void CopyTo (ActiveDirectorySchemaClass[] classes, int index)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Collections;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class ReadOnlyActiveDirectorySchemaPropertyCollection : ReadOnlyCollectionBase
+ {
+ public ActiveDirectorySchemaProperty this [int index] {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool Contains (ActiveDirectorySchemaProperty schemaProperty)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public int IndexOf (ActiveDirectorySchemaProperty schemaProperty)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void CopyTo (ActiveDirectorySchemaProperty[] properties, int index)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Collections;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class ReadOnlyDirectoryServerCollection : ReadOnlyCollectionBase
+ {
+ public DirectoryServer this [int index] {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool Contains (DirectoryServer directoryServer)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public int IndexOf (DirectoryServer directoryServer)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void CopyTo (DirectoryServer[] directoryServers, int index)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Collections;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class ReadOnlySiteCollection : ReadOnlyCollectionBase
+ {
+ public ActiveDirectorySite this [int index] {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool Contains (ActiveDirectorySite site)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public int IndexOf (ActiveDirectorySite site)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void CopyTo (ActiveDirectorySite[] sites, int index)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Collections;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class ReadOnlySiteLinkCollection : ReadOnlyCollectionBase
+ {
+ public ActiveDirectorySiteLink this [int index] {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool Contains (ActiveDirectorySiteLink link)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public int IndexOf (ActiveDirectorySiteLink link)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void CopyTo (ActiveDirectorySiteLink[] links, int index)
+ {
+ base.InnerList.CopyTo (links, index);
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Collections;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class ReadOnlyStringCollection : ReadOnlyCollectionBase
+ {
+ public string this [int index] {
+ get { throw new NotImplementedException (); }
+ }
+
+ public bool Contains (string value)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public int IndexOf (string value)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void CopyTo (string[] values, int index)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.ComponentModel;
+using System.Runtime.InteropServices;
+using System.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ [DirectoryServicesPermission(SecurityAction.LinkDemand, Unrestricted = true)]
+ public class ReplicationConnection : IDisposable
+ {
+ public string Name {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public string SourceServer {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public string DestinationServer {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool Enabled {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ActiveDirectoryTransportType TransportType {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool GeneratedByKcc {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool ReciprocalReplicationEnabled {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public NotificationStatus ChangeNotificationStatus {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool DataCompressionEnabled {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool ReplicationScheduleOwnedByUser {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ReplicationSpan ReplicationSpan {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ActiveDirectorySchedule ReplicationSchedule {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public static ReplicationConnection FindByName (DirectoryContext context, string name)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public ReplicationConnection (DirectoryContext context, string name, DirectoryServer sourceServer) : this(context, name, sourceServer, null, ActiveDirectoryTransportType.Rpc)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public ReplicationConnection (DirectoryContext context, string name, DirectoryServer sourceServer, ActiveDirectorySchedule schedule) : this(context, name, sourceServer, schedule, ActiveDirectoryTransportType.Rpc)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public ReplicationConnection (DirectoryContext context, string name, DirectoryServer sourceServer, ActiveDirectoryTransportType transport) : this(context, name, sourceServer, null, transport)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public ReplicationConnection (DirectoryContext context, string name, DirectoryServer sourceServer, ActiveDirectorySchedule schedule, ActiveDirectoryTransportType transport)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void Dispose ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected virtual void Dispose (bool disposing)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void Delete ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void Save ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override string ToString ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public DirectoryEntry GetDirectoryEntry ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Collections;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class ReplicationConnectionCollection : ReadOnlyCollectionBase
+ {
+ public ReplicationConnection this [int index] {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool Contains (ReplicationConnection connection)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public int IndexOf (ReplicationConnection connection)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void CopyTo (ReplicationConnection[] connections, int index)
+ {
+ throw new NotImplementedException ();
+ }
+
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Runtime.InteropServices;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class ReplicationCursor
+ {
+ public string PartitionName {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public Guid SourceInvocationId {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public long UpToDatenessUsn {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public string SourceServer {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public DateTime LastSuccessfulSyncTime {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ }
+}
\ No newline at end of file
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Collections;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class ReplicationCursorCollection : ReadOnlyCollectionBase
+ {
+ public ReplicationCursor this [int index] {
+ get { throw new NotImplementedException (); }
+ }
+
+ public bool Contains (ReplicationCursor cursor)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public int IndexOf (ReplicationCursor cursor)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void CopyTo (ReplicationCursor[] values, int index)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Collections;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class ReplicationFailure
+ {
+ public string SourceServer {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public DateTime FirstFailureTime {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public int ConsecutiveFailureCount {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public int LastErrorCode {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public string LastErrorMessage {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+
+using System;
+using System.Collections;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class ReplicationFailureCollection : ReadOnlyCollectionBase
+ {
+ public ReplicationFailure this[int index]
+ {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool Contains(ReplicationFailure failure)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public int IndexOf(ReplicationFailure failure)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void CopyTo(ReplicationFailure[] failures, int index)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Collections;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class ReplicationNeighbor
+ {
+ [Flags]
+ public enum ReplicationNeighborOptions : long
+ {
+ Writeable = 16L,
+ SyncOnStartup = 32L,
+ ScheduledSync = 64L,
+ UseInterSiteTransport = 128L,
+ TwoWaySync = 512L,
+ ReturnObjectParent = 2048L,
+ FullSyncInProgress = 65536L,
+ FullSyncNextPacket = 131072L,
+ NeverSynced = 2097152L,
+ Preempted = 16777216L,
+ IgnoreChangeNotifications = 67108864L,
+ DisableScheduledSync = 134217728L,
+ CompressChanges = 268435456L,
+ NoChangeNotifications = 536870912L,
+ PartialAttributeSet = 1073741824L
+ }
+
+ public string PartitionName {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public string SourceServer {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ActiveDirectoryTransportType TransportType {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ReplicationNeighbor.ReplicationNeighborOptions ReplicationNeighborOption {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public Guid SourceInvocationId {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public long UsnLastObjectChangeSynced {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public long UsnAttributeFilter {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public DateTime LastSuccessfulSync {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public DateTime LastAttemptedSync {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public int LastSyncResult {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public string LastSyncMessage {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public int ConsecutiveFailureCount {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Collections;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class ReplicationNeighborCollection : ReadOnlyCollectionBase
+ {
+ public ReplicationNeighbor this [int index] {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool Contains (ReplicationNeighbor neighbor)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public int IndexOf (ReplicationNeighbor neighbor)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void CopyTo (ReplicationNeighbor[] neighbors, int index)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Collections;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class ReplicationOperation
+ {
+ public DateTime TimeEnqueued {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public int OperationNumber {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public int Priority {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ReplicationOperationType OperationType {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public string PartitionName {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public string SourceServer {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Collections;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class ReplicationOperationCollection : ReadOnlyCollectionBase
+ {
+ public ReplicationOperation this [int index] {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool Contains (ReplicationOperation operation)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public int IndexOf (ReplicationOperation operation)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void CopyTo (ReplicationOperation[] operations, int index)
+ {
+ throw new NotImplementedException ();
+ }
+
+ private int Add (ReplicationOperation operation)
+ {
+ throw new NotImplementedException ();
+ }
+
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class ReplicationOperationInformation
+ {
+ public DateTime OperationStartTime {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ReplicationOperation CurrentOperation {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ReplicationOperationCollection PendingOperations {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public enum ReplicationOperationType
+ {
+ Sync,
+ Add,
+ Delete,
+ Modify,
+ UpdateReference
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public enum ReplicationSpan
+ {
+ IntraSite,
+ InterSite
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public enum SchemaClassType
+ {
+ Type88,
+ Structural,
+ Abstract,
+ Auxiliary
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public enum SyncFromAllServersErrorCategory
+ {
+ ErrorContactingServer,
+ ErrorReplicating,
+ ServerUnreachable
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class SyncFromAllServersErrorInformation
+ {
+ public SyncFromAllServersErrorCategory ErrorCategory {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public int ErrorCode {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public string ErrorMessage {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public string TargetServer {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public string SourceServer {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public enum SyncFromAllServersEvent
+ {
+ Error,
+ SyncStarted,
+ SyncCompleted,
+ Finished
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Runtime.Serialization;
+using System.Security.Permissions;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ [Serializable]
+ public class SyncFromAllServersOperationException : ActiveDirectoryOperationException, ISerializable
+ {
+ public SyncFromAllServersErrorInformation[] ErrorInformation {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public SyncFromAllServersOperationException (string message, Exception inner, SyncFromAllServersErrorInformation[] errors) : base(message, inner)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public SyncFromAllServersOperationException (string message, Exception inner) : base(message, inner)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public SyncFromAllServersOperationException (string message) : base(message)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public SyncFromAllServersOperationException () : base("DSSyncAllFailure")
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected SyncFromAllServersOperationException (SerializationInfo info, StreamingContext context) : base(info, context)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]
+ public override void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ [Flags]
+ public enum SyncFromAllServersOptions
+ {
+ None = 0,
+ AbortIfServerUnavailable = 1,
+ SyncAdjacentServerOnly = 2,
+ CheckServerAlivenessOnly = 8,
+ SkipInitialCheck = 16,
+ PushChangeOutward = 32,
+ CrossSite = 64
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+
+using System;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public delegate bool SyncUpdateCallback(SyncFromAllServersEvent eventType, string targetServer, string sourceServer, SyncFromAllServersOperationException exception);
+}
\ No newline at end of file
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class TopLevelName
+ {
+ public string Name {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public TopLevelNameStatus Status {
+ get {
+ throw new NotImplementedException ();
+ }
+ set {
+ throw new NotImplementedException ();
+ }
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Collections;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class TopLevelNameCollection : ReadOnlyCollectionBase
+ {
+ public TopLevelName this [int index] {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool Contains (TopLevelName name)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public int IndexOf (TopLevelName name)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void CopyTo (TopLevelName[] names, int index)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+
+using System;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public enum TopLevelNameStatus
+ {
+ Enabled,
+ NewlyCreated,
+ AdminDisabled,
+ ConflictDisabled = 4
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+
+using System;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public enum TrustDirection
+ {
+ Inbound = 1,
+ Outbound,
+ Bidirectional
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class TrustRelationshipInformation
+ {
+ public string SourceName {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public string TargetName {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public TrustType TrustType {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public TrustDirection TrustDirection {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Collections;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public class TrustRelationshipInformationCollection : ReadOnlyCollectionBase
+ {
+ public TrustRelationshipInformation this [int index] {
+ get {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public bool Contains (TrustRelationshipInformation information)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public int IndexOf (TrustRelationshipInformation information)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public void CopyTo (TrustRelationshipInformation[] array, int index)
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+
+using System;
+
+namespace System.DirectoryServices.ActiveDirectory
+{
+ public enum TrustType
+ {
+ TreeRoot,
+ ParentChild,
+ CrossLink,
+ External,
+ Forest,
+ Kerberos,
+ Unknown
+ }
+}
Assembly/AssemblyInfo.cs
../../build/common/Consts.cs.in
../../build/common/Locale.cs
+System.DirectoryServices/ActiveDirectoryAccessRule.cs
+System.DirectoryServices/ActiveDirectoryAuditRule.cs
+System.DirectoryServices/ActiveDirectoryRights.cs
+System.DirectoryServices/ActiveDirectorySecurityInheritance.cs
System.DirectoryServices/AuthenticationTypes.cs
System.DirectoryServices/DirectoryEntries.cs
System.DirectoryServices/DirectoryEntry.cs
System.DirectoryServices/SortOption.cs
../../build/common/MonoTODOAttribute.cs
System.DirectoryServices.Design/DirectoryEntryConverter.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectoryOperationException.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectoryPartition.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectoryReplicationMetadata.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectoryRole.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectoryRoleCollection.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectorySchedule.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectorySchema.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectorySchemaClass.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectorySchemaClassCollection.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectorySchemaProperty.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectorySchemaPropertyCollection.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectorySecurity.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectorySite.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectorySiteCollection.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectorySiteLink.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectorySiteOptions.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectorySubnet.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectorySubnetCollection.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectorySyntax.cs
+System.DirectoryServices.ActiveDirectory/ActiveDirectoryTransportType.cs
+System.DirectoryServices.ActiveDirectory/ApplicationPartition.cs
+System.DirectoryServices.ActiveDirectory/ApplicationPartitionCollection.cs
+System.DirectoryServices.ActiveDirectory/AttributeMetadata.cs
+System.DirectoryServices.ActiveDirectory/AttributeMetadataCollection.cs
+System.DirectoryServices.ActiveDirectory/DirectoryContext.cs
+System.DirectoryServices.ActiveDirectory/DirectoryContextType.cs
+System.DirectoryServices.ActiveDirectory/DirectoryServer.cs
+System.DirectoryServices.ActiveDirectory/DirectoryServerCollection.cs
+System.DirectoryServices.ActiveDirectory/Domain.cs
+System.DirectoryServices.ActiveDirectory/DomainCollection.cs
+System.DirectoryServices.ActiveDirectory/DomainController.cs
+System.DirectoryServices.ActiveDirectory/DomainControllerCollection.cs
+System.DirectoryServices.ActiveDirectory/DomainMode.cs
+System.DirectoryServices.ActiveDirectory/Forest.cs
+System.DirectoryServices.ActiveDirectory/ForestMode.cs
+System.DirectoryServices.ActiveDirectory/ForestTrustDomainInformation.cs
+System.DirectoryServices.ActiveDirectory/ForestTrustDomainInfoCollection.cs
+System.DirectoryServices.ActiveDirectory/ForestTrustDomainStatus.cs
+System.DirectoryServices.ActiveDirectory/ForestTrustRelationshipInformation.cs
+System.DirectoryServices.ActiveDirectory/GlobalCatalog.cs
+System.DirectoryServices.ActiveDirectory/GlobalCatalogCollection.cs
+System.DirectoryServices.ActiveDirectory/HourOfDay.cs
+System.DirectoryServices.ActiveDirectory/LocatorOptions.cs
+System.DirectoryServices.ActiveDirectory/MinuteOfHour.cs
+System.DirectoryServices.ActiveDirectory/NotificationStatus.cs
+System.DirectoryServices.ActiveDirectory/PropertyTypes.cs
+System.DirectoryServices.ActiveDirectory/ReadOnlyActiveDirectorySchemaClassCollection.cs
+System.DirectoryServices.ActiveDirectory/ReadOnlyActiveDirectorySchemaPropertyCollection.cs
+System.DirectoryServices.ActiveDirectory/ReadOnlyDirectoryServerCollection.cs
+System.DirectoryServices.ActiveDirectory/ReadOnlySiteCollection.cs
+System.DirectoryServices.ActiveDirectory/ReadOnlySiteLinkCollection.cs
+System.DirectoryServices.ActiveDirectory/ReadOnlyStringCollection.cs
+System.DirectoryServices.ActiveDirectory/ReplicationConnection.cs
+System.DirectoryServices.ActiveDirectory/ReplicationConnectionCollection.cs
+System.DirectoryServices.ActiveDirectory/ReplicationCursor.cs
+System.DirectoryServices.ActiveDirectory/ReplicationCursorCollection.cs
+System.DirectoryServices.ActiveDirectory/ReplicationFailure.cs
+System.DirectoryServices.ActiveDirectory/ReplicationFailureCollection.cs
+System.DirectoryServices.ActiveDirectory/ReplicationNeighbor.cs
+System.DirectoryServices.ActiveDirectory/ReplicationNeighborCollection.cs
+System.DirectoryServices.ActiveDirectory/ReplicationOperation.cs
+System.DirectoryServices.ActiveDirectory/ReplicationOperationCollection.cs
+System.DirectoryServices.ActiveDirectory/ReplicationOperationInformation.cs
+System.DirectoryServices.ActiveDirectory/ReplicationOperationType.cs
+System.DirectoryServices.ActiveDirectory/ReplicationSpan.cs
+System.DirectoryServices.ActiveDirectory/SchemaClassType.cs
+System.DirectoryServices.ActiveDirectory/SyncFromAllServersErrorCategory.cs
+System.DirectoryServices.ActiveDirectory/SyncFromAllServersErrorInformation.cs
+System.DirectoryServices.ActiveDirectory/SyncFromAllServersEvent.cs
+System.DirectoryServices.ActiveDirectory/SyncFromAllServersOperationException.cs
+System.DirectoryServices.ActiveDirectory/SyncFromAllServersOptions.cs
+System.DirectoryServices.ActiveDirectory/SyncUpdateCallback.cs
+System.DirectoryServices.ActiveDirectory/TopLevelName.cs
+System.DirectoryServices.ActiveDirectory/TopLevelNameCollection.cs
+System.DirectoryServices.ActiveDirectory/TopLevelNameStatus.cs
+System.DirectoryServices.ActiveDirectory/TrustDirection.cs
+System.DirectoryServices.ActiveDirectory/TrustRelationshipInformation.cs
+System.DirectoryServices.ActiveDirectory/TrustRelationshipInformationCollection.cs
+System.DirectoryServices.ActiveDirectory/TrustType.cs
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+
+using System;
+using System.Security.AccessControl;
+using System.Security.Principal;
+
+namespace System.DirectoryServices
+{
+ public class ActiveDirectoryAccessRule : ObjectAccessRule
+ {
+ public ActiveDirectoryRights ActiveDirectoryRights
+ {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ActiveDirectorySecurityInheritance InheritanceType
+ {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ActiveDirectoryAccessRule(IdentityReference identity, ActiveDirectoryRights adRights, AccessControlType type) : this(identity, (int)adRights, type, Guid.Empty, false, InheritanceFlags.None, PropagationFlags.None, Guid.Empty)
+ {
+ }
+
+ public ActiveDirectoryAccessRule(IdentityReference identity, ActiveDirectoryRights adRights, AccessControlType type, Guid objectType) : this(identity, (int)adRights, type, objectType, false, InheritanceFlags.None, PropagationFlags.None, Guid.Empty)
+ {
+ }
+
+ public ActiveDirectoryAccessRule(IdentityReference identity, ActiveDirectoryRights adRights, AccessControlType type, ActiveDirectorySecurityInheritance inheritanceType) : this(identity, (int)adRights, type, Guid.Empty, false, InheritanceFlags.None, PropagationFlags.None, Guid.Empty)
+ {
+ }
+
+ public ActiveDirectoryAccessRule(IdentityReference identity, ActiveDirectoryRights adRights, AccessControlType type, Guid objectType, ActiveDirectorySecurityInheritance inheritanceType) : this(identity, (int)adRights, type, objectType, false, InheritanceFlags.None, PropagationFlags.None, Guid.Empty)
+ {
+ }
+
+ public ActiveDirectoryAccessRule(IdentityReference identity, ActiveDirectoryRights adRights, AccessControlType type, ActiveDirectorySecurityInheritance inheritanceType, Guid inheritedObjectType) : this(identity, (int)adRights, type, Guid.Empty, false, InheritanceFlags.None, PropagationFlags.None, inheritedObjectType)
+ {
+ }
+
+ public ActiveDirectoryAccessRule(IdentityReference identity, ActiveDirectoryRights adRights, AccessControlType type, Guid objectType, ActiveDirectorySecurityInheritance inheritanceType, Guid inheritedObjectType) : this(identity, (int)adRights, type, objectType, false, InheritanceFlags.None, PropagationFlags.None, inheritedObjectType)
+ {
+ }
+
+ internal ActiveDirectoryAccessRule(IdentityReference identity, int accessMask, AccessControlType type, Guid objectType, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, Guid inheritedObjectType) : base(identity, accessMask, isInherited, inheritanceFlags, propagationFlags, objectType, inheritedObjectType, type)
+ {
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+
+using System;
+using System.Security.AccessControl;
+using System.Security.Principal;
+
+namespace System.DirectoryServices
+{
+ public class ActiveDirectoryAuditRule : ObjectAuditRule
+ {
+ public ActiveDirectoryRights ActiveDirectoryRights
+ {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ActiveDirectorySecurityInheritance InheritanceType
+ {
+ get
+ {
+ throw new NotImplementedException ();
+ }
+ }
+
+ public ActiveDirectoryAuditRule(IdentityReference identity, ActiveDirectoryRights adRights, AuditFlags auditFlags) : this(identity, (int)adRights, auditFlags, Guid.Empty, false, InheritanceFlags.None, PropagationFlags.None, Guid.Empty)
+ {
+ }
+
+ public ActiveDirectoryAuditRule(IdentityReference identity, ActiveDirectoryRights adRights, AuditFlags auditFlags, Guid objectType) : this(identity, (int)adRights, auditFlags, objectType, false, InheritanceFlags.None, PropagationFlags.None, Guid.Empty)
+ {
+ }
+
+ public ActiveDirectoryAuditRule(IdentityReference identity, ActiveDirectoryRights adRights, AuditFlags auditFlags, ActiveDirectorySecurityInheritance inheritanceType) : this(identity, (int)adRights, auditFlags, Guid.Empty, false, InheritanceFlags.None, PropagationFlags.None, Guid.Empty)
+ {
+ }
+
+ public ActiveDirectoryAuditRule(IdentityReference identity, ActiveDirectoryRights adRights, AuditFlags auditFlags, Guid objectType, ActiveDirectorySecurityInheritance inheritanceType) : this(identity, (int)adRights, auditFlags, objectType, false, InheritanceFlags.None, PropagationFlags.None, Guid.Empty)
+ {
+ }
+
+ public ActiveDirectoryAuditRule(IdentityReference identity, ActiveDirectoryRights adRights, AuditFlags auditFlags, ActiveDirectorySecurityInheritance inheritanceType, Guid inheritedObjectType) : this(identity, (int)adRights, auditFlags, Guid.Empty, false, InheritanceFlags.None, PropagationFlags.None, inheritedObjectType)
+ {
+ }
+
+ public ActiveDirectoryAuditRule(IdentityReference identity, ActiveDirectoryRights adRights, AuditFlags auditFlags, Guid objectType, ActiveDirectorySecurityInheritance inheritanceType, Guid inheritedObjectType) : this(identity, (int)adRights, auditFlags, objectType, false, InheritanceFlags.None, PropagationFlags.None, inheritedObjectType)
+ {
+ }
+
+ internal ActiveDirectoryAuditRule(IdentityReference identity, int accessMask, AuditFlags auditFlags, Guid objectGuid, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, Guid inheritedObjectType) : base(identity, accessMask, isInherited, inheritanceFlags, propagationFlags, objectGuid, inheritedObjectType, auditFlags)
+ {
+ }
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+
+using System;
+
+namespace System.DirectoryServices
+{
+ [Flags]
+ public enum ActiveDirectoryRights
+ {
+ Delete = 65536,
+ ReadControl = 131072,
+ WriteDacl = 262144,
+ WriteOwner = 524288,
+ Synchronize = 1048576,
+ AccessSystemSecurity = 16777216,
+ GenericRead = 131220,
+ GenericWrite = 131112,
+ GenericExecute = 131076,
+ GenericAll = 983551,
+ CreateChild = 1,
+ DeleteChild = 2,
+ ListChildren = 4,
+ Self = 8,
+ ReadProperty = 16,
+ WriteProperty = 32,
+ DeleteTree = 64,
+ ListObject = 128,
+ ExtendedRight = 256
+ }
+}
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+
+using System;
+
+namespace System.DirectoryServices
+{
+ public enum ActiveDirectorySecurityInheritance
+ {
+ None,
+ All,
+ Descendents,
+ SelfAndChildren,
+ Children
+ }
+}
switch (t.Kind) {
case Token.Type.SeparatorSemicolon:
- if (!NameValueHeaderValue.ParseParameters (lexer, out parameters))
+ if (!NameValueHeaderValue.TryParseParameters (lexer, out parameters))
return false;
break;
case Token.Type.End:
Debug.Assert (AllowsMany);
var c = (HttpHeaderValueCollection<U>) collection;
- c.Add ((U) value);
+
+ var list = value as List<U>;
+ if (list != null)
+ c.AddRange (list);
+ else
+ c.Add ((U) value);
}
protected override object CreateCollection (HttpHeaders headers, HeaderInfo headerInfo)
};
}
+ public static HeaderInfo CreateMultiList<T> (string name, TryParseDelegate<List<T>> parser, HttpHeaderKind headerKind) where T : class
+ {
+ return new HeaderTypeInfo<List<T>, T> (name, parser, headerKind) {
+ AllowsMany = true,
+ };
+ }
+
public object CreateCollection (HttpHeaders headers)
{
return CreateCollection (headers, this);
list.Add (item);
}
+ internal void AddRange (List<T> values)
+ {
+ list.AddRange (values);
+ }
+
public void Clear ()
{
list.Clear ();
HeaderInfo.CreateSingle<DateTimeOffset> ("Last-Modified", Parser.DateTime.TryParse, HttpHeaderKind.Content),
HeaderInfo.CreateSingle<Uri> ("Location", Parser.Uri.TryParse, HttpHeaderKind.Response),
HeaderInfo.CreateSingle<int> ("Max-Forwards", Parser.Int.TryParse, HttpHeaderKind.Request),
- HeaderInfo.CreateMulti<NameValueHeaderValue> ("Pragma", NameValueHeaderValue.TryParse, HttpHeaderKind.Request | HttpHeaderKind.Response),
+ HeaderInfo.CreateMultiList<NameValueHeaderValue> ("Pragma", NameValueHeaderValue.TryParsePragma, HttpHeaderKind.Request | HttpHeaderKind.Response),
HeaderInfo.CreateMulti<AuthenticationHeaderValue> ("Proxy-Authenticate", AuthenticationHeaderValue.TryParse, HttpHeaderKind.Response),
HeaderInfo.CreateSingle<AuthenticationHeaderValue> ("Proxy-Authorization", AuthenticationHeaderValue.TryParse, HttpHeaderKind.Request),
HeaderInfo.CreateSingle<RangeHeaderValue> ("Range", RangeHeaderValue.TryParse, HttpHeaderKind.Request),
switch (token.Value.Kind) {
case Token.Type.SeparatorSemicolon:
- if (!NameValueHeaderValue.ParseParameters (lexer, out parameters))
+ if (!NameValueHeaderValue.TryParseParameters (lexer, out parameters))
return false;
break;
case Token.Type.End:
switch (token.Value.Kind) {
case Token.Type.SeparatorSemicolon:
- if (!NameValueHeaderValue.ParseParameters (lexer, out parameters))
+ if (!NameValueHeaderValue.TryParseParameters (lexer, out parameters))
return false;
break;
case Token.Type.End:
throw new FormatException (input);
}
- internal static bool ParseParameters (Lexer lexer, out List<NameValueHeaderValue> result)
+ internal static bool TryParseParameters (Lexer lexer, out List<NameValueHeaderValue> result)
{
+ return TryParseCollection (lexer, out result, Token.Type.SeparatorSemicolon);
+ }
+
+ internal static bool TryParsePragma (string input, out List<NameValueHeaderValue> result)
+ {
+ return TryParseCollection (new Lexer (input), out result, Token.Type.SeparatorComma);
+ }
+
+ static bool TryParseCollection (Lexer lexer, out List<NameValueHeaderValue> result, Token.Type separator)
+ {
var list = new List<NameValueHeaderValue> ();
result = null;
t = lexer.Scan ();
}
- if (t == Token.Type.SeparatorSemicolon || t == Token.Type.End) {
+ if (t == separator|| t == Token.Type.End) {
list.Add (new NameValueHeaderValue () {
Name = lexer.GetStringValue (attr),
value = value
return false;
}
- } while (t == Token.Type.SeparatorSemicolon);
+ } while (t == separator);
result = list;
return true;
public static bool TryParse (string input, out NameValueWithParametersHeaderValue parsedValue)
{
List<NameValueHeaderValue> values;
- if (!ParseParameters (new Lexer (input), out values)) {
+ if (!TryParseParameters (new Lexer (input), out values)) {
parsedValue = null;
return false;
}
// Parameters parsing
if (t == Token.Type.SeparatorSemicolon) {
- if (!NameValueHeaderValue.ParseParameters (lexer, out result.parameters))
+ if (!NameValueHeaderValue.TryParseParameters (lexer, out result.parameters))
return false;
} else if (t != Token.Type.End) {
return false;
await request.Content.CopyToAsync (stream).ConfigureAwait (false);
}
- // FIXME: GetResponseAsync does not accept cancellationToken
- var wresponse = (HttpWebResponse) await wrequest.GetResponseAsync ().ConfigureAwait (false);
+ HttpWebResponse wresponse = null;
+ using (cancellationToken.Register (l => ((HttpWebRequest) l).Abort (), wrequest)) {
+ try {
+ wresponse = (HttpWebResponse) await wrequest.GetResponseAsync ().ConfigureAwait (false);
+ } catch (WebException we) {
+ if (we.Status != WebExceptionStatus.RequestCanceled)
+ throw;
+ }
+
+ if (cancellationToken.IsCancellationRequested) {
+ var cancelled = new TaskCompletionSource<HttpResponseMessage> ();
+ cancelled.SetCanceled ();
+ return await cancelled.Task;
+ }
+ }
+
return CreateResponseMessage (wresponse, request);
}
}
public Task LoadIntoBufferAsync ()
{
- return LoadIntoBufferAsync (65536);
+ return LoadIntoBufferAsync (int.MaxValue);
}
public async Task LoadIntoBufferAsync (long maxBufferSize)
} catch (FormatException) {
}
+ try {
+ headers.Add ("pragma", "nocache,RequestID=1,g=");
+ Assert.Fail ("pragma");
+ } catch (FormatException) {
+ }
+
headers.Add ("accept", "audio/y");
headers.Add ("accept-charset", "achs");
headers.Add ("accept-encoding", "aenc");
headers.Add ("expect", "exp");
headers.Add ("if-match", "\"v\"");
headers.Add ("if-none-match", "\"v2\"");
- headers.Add ("pragma", "p");
headers.Add ("TE", "0.8");
headers.Add ("trailer", "value2");
headers.Add ("transfer-encoding", "ttt");
headers.Add ("user-agent", "uaua");
headers.Add ("via", "prot v");
headers.Add ("warning", "4 ww \"t\"");
+ headers.Add ("pragma", "nocache,R=1,g");
Assert.IsTrue (headers.Accept.SequenceEqual (
new[] {
Assert.IsTrue (headers.IfNoneMatch.SequenceEqual (new EntityTagHeaderValue[] { new EntityTagHeaderValue ("\"tag2\"", true), new EntityTagHeaderValue ("\"v2\"", false) }));
Assert.AreEqual (new DateTimeOffset (DateTime.Today), headers.IfRange.Date);
Assert.AreEqual (headers.MaxForwards, 0x15b3);
- Assert.IsTrue (headers.Pragma.SequenceEqual (new NameValueHeaderValue[] { new NameValueHeaderValue ("name", "value"), new NameValueHeaderValue ("p", null) }));
Assert.AreEqual ("p", headers.ProxyAuthorization.Parameter);
Assert.AreEqual ("s", headers.ProxyAuthorization.Scheme);
Assert.AreEqual (5, headers.Range.Ranges.First ().From);
}
));
+ Assert.IsTrue (headers.Pragma.SequenceEqual (
+ new[] {
+ new NameValueHeaderValue ("name", "value"),
+ new NameValueHeaderValue ("nocache", null),
+ new NameValueHeaderValue ("R", "1"),
+ new NameValueHeaderValue ("g", null)
+ }
+ ));
}
[Test]
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
+#if NET_4_0
+
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.Cookie))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.CookieCollection))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.CookieContainer))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.NetworkInformation.NetworkChange))]
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Net.NetworkInformation.NetworkInterface))]
+#endif
\ No newline at end of file
Assembly/TypeForwarders.cs
../../build/common/Consts.cs
../../build/common/MonoTODOAttribute.cs
+System.Net/DnsPermission.cs
System.Net/IPEndPointCollection.cs
--- /dev/null
+/******************************************************************************
+* The MIT License
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the Software), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+* SOFTWARE.
+*******************************************************************************/
+using System;
+using System.Runtime;
+using System.Security;
+using System.Security.Permissions;
+
+namespace System.Net
+{
+ [Serializable]
+ public sealed class DnsPermission : CodeAccessPermission, IUnrestrictedPermission
+ {
+ public DnsPermission (PermissionState state)
+ {
+
+ }
+
+ public bool IsUnrestricted ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override IPermission Copy ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override IPermission Union (IPermission target)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override IPermission Intersect (IPermission target)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override bool IsSubsetOf (IPermission target)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override void FromXml (SecurityElement securityElement)
+ {
+ throw new NotImplementedException ();
+ }
+
+ public override SecurityElement ToXml ()
+ {
+ throw new NotImplementedException ();
+ }
+ }
+}
--- /dev/null
+#include mobile_System.Runtime.Serialization.dll.sources
}
if (Feed.Description != null)
- Feed.Description.WriteTo (writer, "description", AtomNamespace);
+ Feed.Description.WriteTo (writer, "subtitle", AtomNamespace);
if (Feed.ImageUrl != null)
writer.WriteElementString ("logo", AtomNamespace, Feed.ImageUrl.ToString ());
+#if !MOBILE
+
using System;
using System.ServiceModel;
using System.ServiceModel.Activation;
}
}
}
+
+#endif
\ No newline at end of file
+#if !MOBILE
using System;
using System.IO;
using System.ServiceModel;
}
}
}
+#endif
\ No newline at end of file
-
+#if !MOBILE
using System;
using System.ServiceModel.Configuration;
using NUnit.Framework;
}
}
}
+#endif
\ No newline at end of file
{
return GetRequestClientFormatter (operationDescription, endpoint);
}
-
+#if !MOBILE
public IDispatchMessageFormatter DoGetReplyDispatchFormatter (OperationDescription operationDescription, ServiceEndpoint endpoint)
{
return GetReplyDispatchFormatter (operationDescription, endpoint);
{
return GetRequestDispatchFormatter (operationDescription, endpoint);
}
-
+#endif
public event Action<ServiceEndpoint, ClientRuntime> ApplyClientBehaviorInvoked;
public override void ApplyClientBehavior (ServiceEndpoint endpoint, ClientRuntime client)
Assert.AreEqual (0, pl.Count, "#1");
}
+#if !MOBILE
[Test]
public void ApplyDispatchBehavior ()
{
Assert.AreEqual (0, ed.DispatchRuntime.Operations.Count, "#4-0"); // hmm... really?
}
+#endif
[Test]
public void GetMessageFormatters ()
var b = new WebHttpBehaviorExt ();
Assert.IsNotNull (b.DoGetRequestClientFormatter (od, se), "#1");
Assert.IsNotNull (b.DoGetReplyClientFormatter (od, se), "#2");
+#if !MOBILE
Assert.IsNotNull (b.DoGetRequestDispatchFormatter (od, se), "#3");
Assert.IsNotNull (b.DoGetReplyDispatchFormatter (od, se), "#4");
+#endif
}
[Test]
}
}
+#if !MOBILE
[Test]
public void RequestClientFormatter2 ()
{
// TODO: test DeserializeReply too (it is supported unlike above).
}
+#endif
[ServiceContract]
public interface IMyService
public class MyService: IMyService
{
+#if !MOBILE
[OperationBehavior]
+#endif
public string Echo (string input)
{
return input;
Assert.IsTrue (od.Behaviors.Contains (typeof (WebGetAttribute)), "Operation is recognized as WebGet");
}
+#if !MOBILE
[Test]
public void MessageFormatterSupportsRaw ()
{
formatter.DeserializeRequest (msg, pars);
Assert.IsTrue (pars [0] is Stream, "ret");
}
-
+#endif
[ServiceContract]
public interface IMultipleParametersGet
{
-#if NET_4_0
+#if NET_4_0 && !MOBILE
using System;
using System.IO;
using System.Runtime.Serialization;
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !MOBILE
using System;
using System.Net;
using System.Runtime.Serialization;
}
}
}
+#endif
\ No newline at end of file
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !MOBILE
using System;
using System.Globalization;
using System.Runtime.Serialization;
#endregion
}
}
+#endif
\ No newline at end of file
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !MOBILE
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
SyndicationFeed feed = new SyndicationFeed ();
feed.BaseUri = new Uri ("http://mono-project.com");
feed.Copyright = new TextSyndicationContent ("No rights reserved");
+ feed.Description = new TextSyndicationContent ("A sample feed for unit testing");
feed.Generator = "mono test generator";
// .NET bug: it ignores this value.
feed.Id = "urn:myid";
StringWriter sw = new StringWriter ();
using (XmlWriter w = CreateWriter (sw))
new Atom10FeedFormatter (feed).WriteTo (w);
- Assert.AreEqual ("<feed xml:base=\"http://mono-project.com/\" xmlns=\"http://www.w3.org/2005/Atom\"><title type=\"text\"></title><id>XXX</id><rights type=\"text\">No rights reserved</rights><updated>2008-01-01T00:00:00Z</updated><logo>http://mono-project.com/images/mono.png</logo><generator>mono test generator</generator></feed>", DummyId (sw.ToString ()));
+ Assert.AreEqual ("<feed xml:base=\"http://mono-project.com/\" xmlns=\"http://www.w3.org/2005/Atom\"><title type=\"text\"></title><id>XXX</id><rights type=\"text\">No rights reserved</rights><updated>2008-01-01T00:00:00Z</updated><subtitle type=\"text\">A sample feed for unit testing</subtitle><logo>http://mono-project.com/images/mono.png</logo><generator>mono test generator</generator></feed>", DummyId (sw.ToString ()));
}
[Test]
}
}
}
+#endif
\ No newline at end of file
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !MOBILE
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
}
}
}
+#endif
\ No newline at end of file
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !MOBILE
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
}
}
}
+#endif
\ No newline at end of file
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !MOBILE
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
}
}
}
+#endif
\ No newline at end of file
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !MOBILE
+
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
}
}
}
+#endif
\ No newline at end of file
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !MOBILE
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
}
}
}
+#endif
\ No newline at end of file
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !MOBILE
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
}
}
}
+#endif
\ No newline at end of file
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !MOBILE
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
}
}
}
+#endif
\ No newline at end of file
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !MOBILE
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
}
}
}
+#endif
\ No newline at end of file
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !MOBILE
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
}
}
}
+#endif
\ No newline at end of file
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !MOBILE
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
}
}
}
+#endif
\ No newline at end of file
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !MOBILE
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
}
}
}
+#endif
\ No newline at end of file
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !MOBILE
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
}
}
}
+#endif
\ No newline at end of file
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !MOBILE
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
}
}
}
+#endif
\ No newline at end of file
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
+#if !MOBILE
using System.ServiceModel.Syndication;
+#endif
using System.ServiceModel.Web;
using System.Xml;
using NUnit.Framework;
[Test]
public void Current ()
{
+#if !MOBILE
Assert.IsNull (WebOperationContext.Current, "#1");
+#endif
var binding = new WebHttpBinding ();
var address = new EndpointAddress ("http://localhost:37564");
var ch = (IContextChannel) WebChannelFactory<IHogeService>.CreateChannel (binding, address);
using (var ocs = new OperationContextScope (ch)) {
+#if !MOBILE
Assert.IsNotNull (WebOperationContext.Current, "#2");
Assert.IsNotNull (WebOperationContext.Current.OutgoingRequest, "#3");
Assert.IsNotNull (WebOperationContext.Current.IncomingRequest, "#4");
Assert.IsNotNull (WebOperationContext.Current.IncomingResponse, "#5");
Assert.IsNotNull (WebOperationContext.Current.OutgoingResponse, "#6"); // pointless though.
+#endif
}
ch.Close ();
}
-#if NET_4_0
+#if NET_4_0 && !MOBILE
[Test]
public void CreateAtom10Response ()
{
string TestJson3 (string s1, string s2);
}
-#if NET_4_0
+#if NET_4_0 && !MOBILE
public class HogeService : IHogeService
{
static XmlWriterSettings settings = new XmlWriterSettings () { OmitXmlDeclaration = true };
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\r
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
//\r
+#if !MOBILE\r
using System;\r
using System.Collections.Generic;\r
using System.Linq;\r
\r
}\r
}\r
+#endif
\ No newline at end of file
Assert.AreEqual ("http", b.Scheme, "#1");
Assert.AreEqual (Encoding.UTF8, b.WriteEncoding, "#2");
Assert.AreEqual (0x10000, b.MaxBufferSize, "#3");
+#if !MOBILE
Assert.AreEqual (0x80000, b.MaxBufferPoolSize, "#4");
+#endif
Assert.AreEqual (0x10000, b.MaxReceivedMessageSize, "#5");
Assert.IsFalse (((IBindingRuntimePreferences) b).ReceiveSynchronously, "#6");
}
var t = new UriTemplate ("*");
var m = t.Match (new Uri ("http://localhost"), new Uri ("http://localhost/hoge/ppp"));
Assert.IsNotNull (m, "#0");
- Assert.IsEmpty (m.QueryParameters, "#1.0");
+ Assert.AreEqual (0, m.QueryParameters.Count, "#1.0");
Assert.AreEqual ("hoge", m.WildcardPathSegments [0], "#2");
Assert.AreEqual ("ppp", m.WildcardPathSegments [1], "#3");
}
--- /dev/null
+#include mobile_System.ServiceModel.Web.dll.sources
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Reflection.Emit;
// created on 28/08/2004 at 17:07
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Reflection.Emit;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Reflection.Emit;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Reflection.Emit;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Reflection.Emit;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Reflection.Emit;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Reflection.Emit;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Reflection.Emit;
// created on 28/08/2004 at 17:30
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Reflection.Emit;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Collections;
using System.Reflection;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.IO;
using System.Collections;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Reflection.Emit;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.IO;
using System.Collections;
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.IO;
using System.Collections;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Reflection.Emit;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Reflection.Emit;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Reflection.Emit;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Reflection.Emit;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Reflection.Emit;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Collections;
using System.Reflection;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Collections;
using System.Reflection.Emit;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Reflection.Emit;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Reflection.Emit;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Reflection.Emit;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Reflection.Emit;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Globalization;
using System.Reflection;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Collections;
using System.IO;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Reflection.Emit;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.IO;
using System.Collections;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Reflection.Emit;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Reflection.Emit;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Reflection.Emit;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Reflection.Emit;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Collections;
using System.IO;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Reflection.Emit;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Reflection.Emit;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Collections;
using System.Reflection;
// created on 28/08/2004 at 17:30
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Reflection.Emit;
// Copyright (C) 2009 Novell, Inc
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Collections;
#if NET_2_0
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Reflection.Emit;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Reflection.Emit;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Reflection.Emit;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Reflection.Emit;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Reflection.Emit;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Reflection.Emit;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.IO;
// Copyright (C) Lluis Sanchez Gual, 2004
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Reflection;
using System.Reflection.Emit;
{
var l = new List<MethodInfo> ();
foreach (var t in GetAllInterfaceTypes (type)) {
-#if MONOTOUCH
+#if FULL_AOT_RUNTIME
// The MethodBase[] from t.GetMethods () is cast to a IEnumerable <MethodInfo>
// when passed to List<MethodInfo>.AddRange, which in turn casts it to
// ICollection <MethodInfo>. The full-aot compiler has no idea of this, so
public virtual TChannel CreateChannel (EndpointAddress address, Uri via)
{
-#if MONOTOUCH
+#if FULL_AOT_RUNTIME
throw new InvalidOperationException ("MonoTouch does not support dynamic proxy code generation. Override this method or its caller to return specific client proxy instance");
#else
var existing = Endpoint.Address;
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if !MONOTOUCH
+#if !FULL_AOT_RUNTIME
using System;
using System.Collections.Generic;
using System.Reflection;
{
TDetail detail;
-#if MONOTOUCH
+#if FULL_AOT_RUNTIME
// WCF creates FaultExceptions using reflection, so unless we reference
// the corresponding ctor, it will not be possible to use FaultExceptions
// in MonoTouch. This ctor reference will work as long as TDetail
--- /dev/null
+#include mobile_System.ServiceModel.dll.sources
SUBDIRS =
include ../../build/rules.make
-MOBILE_PROFILE := $(filter monotouch monodroid mobile, $(PROFILE))
+MOBILE_PROFILE := $(filter monotouch monodroid mobile mobile_static, $(PROFILE))
LIBRARY = System.Transactions.dll
ifdef MOBILE_PROFILE
include ../../build/rules.make
LIBRARY = System.Web.Services.dll
-MOBILE := $(filter monotouch monodroid mobile, $(PROFILE))
+MOBILE := $(filter monotouch monodroid mobile mobile_static, $(PROFILE))
ifdef MOBILE
LIB_MCS_FLAGS = \
-nowarn:649 -nowarn:169 \
--- /dev/null
+#include mobile_System.Web.Services.dll.sources
static ConfigurationProperty maxUrlLengthProp;
static ConfigurationProperty encoderTypeProp;
static ConfigurationProperty relaxedUrlToFileSystemMappingProp;
+#endif
+#if NET_4_5
+ static ConfigurationProperty targetFrameworkProp;
#endif
static ConfigurationPropertyCollection properties;
ConfigurationPropertyOptions.None);
relaxedUrlToFileSystemMappingProp = new ConfigurationProperty ("relaxedUrlToFileSystemMapping", typeof (bool), false);
#endif
+#if NET_4_5
+ targetFrameworkProp = new ConfigurationProperty ("targetFramework", typeof (Version), new Version (4, 0),
+ PropertyHelper.VersionConverter,
+ PropertyHelper.DefaultValidator,
+ ConfigurationPropertyOptions.None);
+#endif
properties = new ConfigurationPropertyCollection();
properties.Add (apartmentThreadingProp);
properties.Add (maxUrlLengthProp);
properties.Add (encoderTypeProp);
properties.Add (relaxedUrlToFileSystemMappingProp);
+#endif
+#if NET_4_5
+ properties.Add (targetFrameworkProp);
#endif
}
get { return (bool) base [relaxedUrlToFileSystemMappingProp]; }
set { base [relaxedUrlToFileSystemMappingProp] = value; }
}
+#endif
+#if NET_4_5
+ [ConfigurationProperty ("targetFramework", DefaultValue = "4.0")]
+ [TypeConverter ("System.Web.Configuration.VersionConverter")]
+ public Version TargetFramework {
+ get { return (Version) base [targetFrameworkProp]; }
+ set { base [targetFrameworkProp] = value; }
+ }
#endif
protected internal override ConfigurationPropertyCollection Properties {
get { return properties; }
static string EncodeHeaderString (string input)
{
StringBuilder sb = null;
- char ch;
for (int i = 0; i < input.Length; i++) {
- ch = input [i];
+ char ch = input [i];
if ((ch < 32 && ch != 9) || ch == 127)
StringBuilderAppend (String.Format ("%{0:x2}", (int)ch), ref sb);
return s;
StringBuilder output = new StringBuilder ();
- char ch;
int len = s.Length;
for (int i = 0; i < len; i++) {
- switch (s [i]) {
+ char ch = s [i];
+ switch (ch) {
case '&' :
output.Append ("&");
break;
break;
default:
- ch = s [i];
if (ch > 159 && ch < 256) {
output.Append ("&#");
output.Append (((int) ch).ToString (Helpers.InvariantCulture));
StringBuilder output = new StringBuilder ();
int len = s.Length;
- for (int i = 0; i < len; i++)
- switch (s [i]) {
- case '&' :
- output.Append ("&");
- break;
- case '"' :
- output.Append (""");
- break;
- case '<':
- output.Append ("<");
- break;
+
+ for (int i = 0; i < len; i++) {
+ char ch = s [i];
+ switch (ch) {
+ case '&' :
+ output.Append ("&");
+ break;
+ case '"' :
+ output.Append (""");
+ break;
+ case '<':
+ output.Append ("<");
+ break;
#if NET_4_0
- case '\'':
- output.Append ("'");
- break;
+ case '\'':
+ output.Append ("'");
+ break;
#endif
- default:
- output.Append (s [i]);
- break;
+ default:
+ output.Append (ch);
+ break;
}
-
+ }
+
return output.ToString();
}
internal static HttpRuntimeSection Section { get { return runtime_section; } }
public static bool UsingIntegratedPipeline { get { return false; } }
+
+#if NET_4_5
+ public static Version IISVersion {
+ get {
+ // Null means not hosted by IIS
+ return null;
+ }
+ }
+
+ public static Version TargetFramework {
+ get {
+ return runtime_section.TargetFramework;
+ }
+ }
+#endif
[SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
public static void Close ()
--- /dev/null
+#include mobile_System.Xml.dll.sources
{
GenerateCompileUnitStart (compileUnit);
- GenerateGlobalNamespace (compileUnit);
+ List<CodeNamespaceImport> imports = null;
+ foreach (CodeNamespace codeNamespace in compileUnit.Namespaces) {
+ if (!string.IsNullOrEmpty (codeNamespace.Name))
+ continue;
+
+ if (codeNamespace.Imports.Count == 0)
+ continue;
+
+ if (imports == null)
+ imports = new List<CodeNamespaceImport> ();
+
+ foreach (CodeNamespaceImport i in codeNamespace.Imports)
+ imports.Add (i);
+ }
+
+ if (imports != null) {
+ imports.Sort ((a, b) => a.Namespace.CompareTo (b.Namespace));
+ foreach (var import in imports)
+ GenerateNamespaceImport (import);
+
+ Output.WriteLine ();
+ }
if (compileUnit.AssemblyCustomAttributes.Count > 0) {
OutputAttributes (compileUnit.AssemblyCustomAttributes,
Output.WriteLine ("");
}
- GenerateLocalNamespaces (compileUnit);
-
- GenerateCompileUnitEnd (compileUnit);
- }
+ CodeNamespaceImportCollection global_imports = null;
+ foreach (CodeNamespace codeNamespace in compileUnit.Namespaces) {
+ if (string.IsNullOrEmpty (codeNamespace.Name)) {
+ global_imports = codeNamespace.Imports;
+ codeNamespace.Imports = new CodeNamespaceImportCollection ();
+ }
- private void GenerateGlobalNamespace (CodeCompileUnit compileUnit) {
- CodeNamespace globalNamespace = null;
+ GenerateNamespace (codeNamespace);
- foreach (CodeNamespace codeNamespace in compileUnit.Namespaces)
- if (string.IsNullOrEmpty (codeNamespace.Name))
- globalNamespace = codeNamespace;
-
- if (globalNamespace != null)
- GenerateNamespace (globalNamespace);
- }
+ if (global_imports != null) {
+ codeNamespace.Imports = global_imports;
+ global_imports = null;
+ }
+ }
- private void GenerateLocalNamespaces (CodeCompileUnit compileUnit) {
- foreach (CodeNamespace codeNamespace in compileUnit.Namespaces)
- if (!string.IsNullOrEmpty (codeNamespace.Name))
- GenerateNamespace (codeNamespace);
+ GenerateCompileUnitEnd (compileUnit);
}
protected override void GenerateDefaultValueExpression (CodeDefaultValueExpression e)
}
return imports;
}
+ internal set {
+ imports = value;
+ }
}
public string Name {
int right = len-1;
while (left <= right) {
- int guess = (left + right) >> 1;
+ int guess = left + ((right - left) >> 1);
int cmp = Compare (table[guess].Key, key);
if (cmp == 0) return guess;
#endif
public class ObservableCollection<T> : Collection<T>, INotifyCollectionChanged, INotifyPropertyChanged {
[Serializable]
- sealed class Reentrant : IDisposable {
- private int count = 0;
+#if !MOBILE
+ [TypeForwardedFrom (Consts.WindowsBase_3_0)]
+#endif
+ sealed class SimpleMonitor : IDisposable {
+ private int _busyCount;
- public Reentrant()
+ public SimpleMonitor()
{
}
public void Enter()
{
- count++;
+ _busyCount++;
}
public void Dispose()
{
- count--;
+ _busyCount--;
}
public bool Busy
{
- get { return count > 0; }
+ get { return _busyCount > 0; }
}
}
- private Reentrant reentrant = new Reentrant ();
+ private SimpleMonitor _monitor = new SimpleMonitor ();
public ObservableCollection ()
{
{
}
+ [field:NonSerialized]
public virtual event NotifyCollectionChangedEventHandler CollectionChanged;
+ [field:NonSerialized]
protected virtual event PropertyChangedEventHandler PropertyChanged;
event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged {
protected IDisposable BlockReentrancy ()
{
- reentrant.Enter ();
- return reentrant;
+ _monitor.Enter ();
+ return _monitor;
}
protected void CheckReentrancy ()
NotifyCollectionChangedEventHandler eh = CollectionChanged;
// Only have a problem if we have more than one event listener.
- if (reentrant.Busy && eh != null && eh.GetInvocationList ().Length > 1)
+ if (_monitor.Busy && eh != null && eh.GetInvocationList ().Length > 1)
throw new InvalidOperationException ("Cannot modify the collection while reentrancy is blocked.");
}
}
if (ipv6Supported == -1) {
+ // We need to put a try/catch around ConfigurationManager methods as will always throw an exception
+ // when run in a mono embedded application. This occurs as embedded applications do not have a setup
+ // for application config. The exception is not thrown when called from a normal .NET application.
+ //
+ // We, then, need to guard calls to the ConfigurationManager. If the config is not found or throws an
+ // exception, will fall through to the existing Socket / API directly below in the code.
+ //
+ // Also note that catching ConfigurationErrorsException specifically would require library dependency
+ // System.Configuration, and wanted to avoid that.
#if !NET_2_1
#if CONFIGURATION_DEP
- SettingsSection config;
- config = (SettingsSection) System.Configuration.ConfigurationManager.GetSection ("system.net/settings");
- if (config != null)
- ipv6Supported = config.Ipv6.Enabled ? -1 : 0;
+ try {
+ SettingsSection config;
+ config = (SettingsSection) System.Configuration.ConfigurationManager.GetSection ("system.net/settings");
+ if (config != null)
+ ipv6Supported = config.Ipv6.Enabled ? -1 : 0;
+ } catch {
+ ipv6Supported = -1;
+ }
#else
- NetConfig config = System.Configuration.ConfigurationSettings.GetConfig("system.net/settings") as NetConfig;
- if (config != null)
- ipv6Supported = config.ipv6Enabled ? -1 : 0;
+ try {
+ NetConfig config = System.Configuration.ConfigurationSettings.GetConfig("system.net/settings") as NetConfig;
+ if (config != null)
+ ipv6Supported = config.ipv6Enabled ? -1 : 0;
+ } catch {
+ ipv6Supported = -1;
+ }
#endif
#endif
if (ipv6Supported != 0) {
if (local_path [0] == '/')
local_path = local_path.Substring (1);
- Uri initial = new Uri ("ftp://dummy-host" + initial_path);
+ UriBuilder initialBuilder = new UriBuilder () {
+ Scheme = "ftp",
+ Host = "dummy-host",
+ Path = initial_path,
+ };
+ Uri initial = initialBuilder.Uri;
result = new Uri (initial, local_path).LocalPath;
}
static HybridDictionary prefixes = new HybridDictionary ();
static bool isDefaultWebProxySet;
static IWebProxy defaultWebProxy;
-
-#if !NET_2_1
static RequestCachePolicy defaultCachePolicy;
-#endif
- // Constructors
-
+
static WebRequest ()
{
-#if NET_2_1
+#if MOBILE
IWebRequestCreate http = new HttpRequestCreator ();
RegisterPrefix ("http", http);
RegisterPrefix ("https", http);
- #if MOBILE
RegisterPrefix ("file", new FileWebRequestCreator ());
RegisterPrefix ("ftp", new FtpRequestCreator ());
- #endif
#else
- defaultCachePolicy = new HttpRequestCachePolicy (HttpRequestCacheLevel.NoCacheNoStore);
#if CONFIGURATION_DEP
object cfg = ConfigurationManager.GetSection ("system.net/webRequestModules");
WebRequestModulesSection s = cfg as WebRequestModulesSection;
set { throw GetMustImplement (); }
}
-#if !NET_2_1
[MonoTODO ("Implement the caching system. Currently always returns a policy with the NoCacheNoStore level")]
public virtual RequestCachePolicy CachePolicy
{
}
}
- public static RequestCachePolicy DefaultCachePolicy
- {
- get { return defaultCachePolicy; }
+ public static RequestCachePolicy DefaultCachePolicy {
+ get {
+ return defaultCachePolicy ?? (defaultCachePolicy = new HttpRequestCachePolicy (HttpRequestCacheLevel.NoCacheNoStore));
+ }
set {
throw GetMustImplement ();
}
}
-#endif
public virtual WebHeaderCollection Headers {
get { throw GetMustImplement (); }
[Test]
public void AttributeAndGlobalNamespaceWithImportTest ()
{
- var import = new CodeNamespaceImport ("Z");
- AddGlobalNamespaceWithImport (codeUnit, import);
- AddAssemblyAttribute (codeUnit, "A");
-
- Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
- "using Z;{0}{0}[assembly: A()]{0}{0}", NewLine), Generate ());
- }
-
- private static void AddGlobalNamespaceWithImport (CodeCompileUnit codeUnit, CodeNamespaceImport import) {
CodeNamespace ns = new CodeNamespace ();
- ns.Imports.Add (import);
+ ns.Imports.Add (new CodeNamespaceImport ("Z"));
+ ns.Imports.Add (new CodeNamespaceImport ("A"));
codeUnit.Namespaces.Add (ns);
- }
- private static void AddAssemblyAttribute (CodeCompileUnit codeUnit, string attributeName) {
CodeAttributeDeclaration attrDec = new CodeAttributeDeclaration ();
- attrDec.Name = attributeName;
+ attrDec.Name = "A";
codeUnit.AssemblyCustomAttributes.Add (attrDec);
+
+ Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+ "using A;{0}using Z;{0}{0}[assembly: A()]{0}{0}{0}", NewLine), Generate ());
+ }
+
+ [Test]
+ public void GlobalAttributeBeforeType ()
+ {
+ StringWriter writer = new StringWriter ();
+ writer.NewLine = NewLine;
+
+ codeUnit = new CodeCompileUnit () {
+ AssemblyCustomAttributes = {
+ new CodeAttributeDeclaration (
+ new CodeTypeReference (typeof (CLSCompliantAttribute)),
+ new CodeAttributeArgument (new CodePrimitiveExpression (false))),
+ },
+ Namespaces = {
+ new CodeNamespace () {
+ Types = {
+ new CodeTypeDeclaration ("Resources"),
+ },
+ }
+ },
+ };
+
+ generator.GenerateCodeFromCompileUnit (codeUnit, writer, options);
+ writer.Close ();
+
+ Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+ "[assembly: System.CLSCompliantAttribute(false)]{0}{0}{0}{0}public class Resources {{{0}}}{0}", NewLine), Generate ());
}
}
}
site1Dot = "96.126.105.110",\r
site2Name = "info.diku.dk",\r
site2Dot = "130.225.96.4",\r
- noneExistingSite = "www.unlikely.novell.com";\r
+ noneExistingSite = "unlikely.xamarin.com";\r
private uint site1IP = 1852407392, site2IP = 2195808260; // Big-Endian\r
\r
[Test]\r
[Test]
public void DownloadFile1 ()
{
- ServerDownload sp = new ServerDownload ();
+ DownloadFile (new ServerDownload ());
+ }
+
+ void DownloadFile (ServerDownload sp)
+ {
sp.Start ();
string uri = String.Format ("ftp://{0}:{1}/file.txt", sp.IPAddress, sp.Port);
try {
}
}
+ [Test]
+ public void DownloadFile2 ()
+ {
+ // Some embedded FTP servers in Industrial Automation Hardware report
+ // the PWD using backslashes, but allow forward slashes for CWD.
+ DownloadFile (new ServerDownload (@"\Users\someuser", "/Users/someuser/"));
+ }
+
[Test]
public void DeleteFile1 ()
{
}
class ServerDownload : FtpServer {
+
+ string Pwd, Cwd;
+
+ public ServerDownload ()
+ : this (null, null)
+ {
+ }
+
+ public ServerDownload (string pwd, string cwd)
+ {
+ Pwd = pwd ?? "/home/someuser";
+ Cwd = cwd ?? "/home/someuser/";
+ }
+
protected override void Run ()
{
Socket client = control.Accept ();
return;
}
- if (!DoInitialDialog (writer, reader, "/home/someuser", "/home/someuser/")) {
+ if (!DoInitialDialog (writer, reader, Pwd, Cwd)) {
client.Close ();
return;
}
--- /dev/null
+#include mobile_System.dll.sources
+MonoTouch/MonoPInvokeCallbackAttribute.cs
+../Mono.Security/Mono.Security.Authenticode/PrivateKey.cs
+../Mono.Security/Mono.Security.Cryptography/MD5SHA1.cs
+../Mono.Security/Mono.Security.Cryptography/TlsHMAC.cs
+../Mono.Security/Mono.Security.Protocol.Ntlm/ChallengeResponse.cs
+../Mono.Security/Mono.Security.Protocol.Ntlm/ChallengeResponse2.cs
+../Mono.Security/Mono.Security.Protocol.Ntlm/MessageBase.cs
+../Mono.Security/Mono.Security.Protocol.Ntlm/NtlmAuthLevel.cs
+../Mono.Security/Mono.Security.Protocol.Ntlm/NtlmFlags.cs
+../Mono.Security/Mono.Security.Protocol.Ntlm/Type1Message.cs
+../Mono.Security/Mono.Security.Protocol.Ntlm/Type2Message.cs
+../Mono.Security/Mono.Security.Protocol.Ntlm/Type3Message.cs
+../Mono.Security/Mono.Security.Protocol.Tls/Alert.cs
+../Mono.Security/Mono.Security.Protocol.Tls/CipherAlgorithmType.cs
+../Mono.Security/Mono.Security.Protocol.Tls/CipherSuite.cs
+../Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteCollection.cs
+../Mono.Security/Mono.Security.Protocol.Tls/CipherSuiteFactory.cs
+../Mono.Security/Mono.Security.Protocol.Tls/ClientContext.cs
+../Mono.Security/Mono.Security.Protocol.Tls/ClientRecordProtocol.cs
+../Mono.Security/Mono.Security.Protocol.Tls/ClientSessionCache.cs
+../Mono.Security/Mono.Security.Protocol.Tls/ContentType.cs
+../Mono.Security/Mono.Security.Protocol.Tls/Context.cs
+../Mono.Security/Mono.Security.Protocol.Tls/DebugHelper.cs
+../Mono.Security/Mono.Security.Protocol.Tls/ExchangeAlgorithmType.cs
+../Mono.Security/Mono.Security.Protocol.Tls/HandshakeState.cs
+../Mono.Security/Mono.Security.Protocol.Tls/HashAlgorithmType.cs
+../Mono.Security/Mono.Security.Protocol.Tls/HttpsClientStream.cs
+../Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs
+../Mono.Security/Mono.Security.Protocol.Tls/RSASslSignatureDeformatter.cs
+../Mono.Security/Mono.Security.Protocol.Tls/RSASslSignatureFormatter.cs
+../Mono.Security/Mono.Security.Protocol.Tls/SecurityCompressionType.cs
+../Mono.Security/Mono.Security.Protocol.Tls/SecurityParameters.cs
+../Mono.Security/Mono.Security.Protocol.Tls/SecurityProtocolType.cs
+../Mono.Security/Mono.Security.Protocol.Tls/ServerContext.cs
+../Mono.Security/Mono.Security.Protocol.Tls/ServerRecordProtocol.cs
+../Mono.Security/Mono.Security.Protocol.Tls/SslClientStream.cs
+../Mono.Security/Mono.Security.Protocol.Tls/SslCipherSuite.cs
+../Mono.Security/Mono.Security.Protocol.Tls/SslHandshakeHash.cs
+../Mono.Security/Mono.Security.Protocol.Tls/SslServerStream.cs
+../Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs
+../Mono.Security/Mono.Security.Protocol.Tls/TlsCipherSuite.cs
+../Mono.Security/Mono.Security.Protocol.Tls/TlsClientSettings.cs
+../Mono.Security/Mono.Security.Protocol.Tls/TlsException.cs
+../Mono.Security/Mono.Security.Protocol.Tls/TlsServerSettings.cs
+../Mono.Security/Mono.Security.Protocol.Tls/TlsStream.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake/ClientCertificateType.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeMessage.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake/HandshakeType.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificate.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientCertificateVerify.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientFinished.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientHello.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsClientKeyExchange.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificate.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerCertificateRequest.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerFinished.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHello.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerHelloDone.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Client/TlsServerKeyExchange.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificate.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientCertificateVerify.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientFinished.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientHello.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsClientKeyExchange.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificate.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerCertificateRequest.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerFinished.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHello.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerHelloDone.cs
+../Mono.Security/Mono.Security.Protocol.Tls.Handshake.Server/TlsServerKeyExchange.cs
+../Mono.Security/Mono.Security.X509.Extensions/AuthorityKeyIdentifierExtension.cs
+../Mono.Security/Mono.Security.X509.Extensions/ExtendedKeyUsageExtension.cs
+../Mono.Security/Mono.Security.X509.Extensions/GeneralNames.cs
+../Mono.Security/Mono.Security.X509.Extensions/NetscapeCertTypeExtension.cs
+../Mono.Security/Mono.Security.X509.Extensions/SubjectAltNameExtension.cs
{
[Serializable]
public class ObservableCollection<T> : Collection<T>, INotifyCollectionChanged, INotifyPropertyChanged {
-
- private class Reentrant : IDisposable {
- private int count = 0;
+ [Serializable]
+ sealed class SimpleMonitor : IDisposable {
+ private int _busyCount;
- public Reentrant()
+ public SimpleMonitor()
{
}
public void Enter()
{
- count++;
+ _busyCount++;
}
public void Dispose()
{
- count--;
+ _busyCount--;
}
public bool Busy
{
- get { return count > 0; }
+ get { return _busyCount > 0; }
}
}
- private Reentrant reentrant = new Reentrant ();
+ private SimpleMonitor _monitor = new SimpleMonitor ();
public ObservableCollection()
{
{
}
+ [field:NonSerialized]
public virtual event NotifyCollectionChangedEventHandler CollectionChanged;
+ [field:NonSerialized]
protected virtual event PropertyChangedEventHandler PropertyChanged;
event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged {
protected IDisposable BlockReentrancy ()
{
- reentrant.Enter ();
- return reentrant;
+ _monitor.Enter ();
+ return _monitor;
}
protected void CheckReentrancy ()
NotifyCollectionChangedEventHandler eh = CollectionChanged;
// Only have a problem if we have more than one event listener.
- if (reentrant.Busy && eh != null && eh.GetInvocationList ().Length > 1)
+ if (_monitor.Busy && eh != null && eh.GetInvocationList ().Length > 1)
throw new InvalidOperationException ("Cannot modify the collection while reentrancy is blocked.");
}
TEST_RESOURCES = $(TEST_RESX_RESOURCES) $(TEST_RESX_RESOURCES_SATELITE)
-$(test_lib): $(TEST_RESOURCES) satellite-assemblies
+satellite_assembly1 = es-ES/$(patsubst %.dll,%.Resources.dll,$(test_lib))
+satellite_assembly2 = nn-NO/$(patsubst %.dll,%.Resources.dll,$(test_lib))
-satellite-assemblies:
+$(test_lib): $(TEST_RESOURCES) $(satellite_assembly1) $(satellite_assembly2)
+
+$(satellite_assembly1): Test/resources/culture-es-ES.cs Test/resources/Resources.es-ES.resources
@mkdir -p es-ES
- $(CSCOMPILE) -target:library -r:$(corlib) Test/resources/culture-es-ES.cs -resource:Test/resources/Resources.es-ES.resources -out:es-ES/$(patsubst %.dll,%.Resources.dll,$(test_lib))
+ $(CSCOMPILE) -target:library -r:$(corlib) Test/resources/culture-es-ES.cs -resource:Test/resources/Resources.es-ES.resources -out:$@
+
+$(satellite_assembly2): Test/resources/culture-nn-NO.cs Test/resources/Resources.nn-NO.resources
@mkdir -p nn-NO
- $(CSCOMPILE) -target:library -r:$(corlib) Test/resources/culture-nn-NO.cs -resource:Test/resources/Resources.nn-NO.resources -out:nn-NO/$(patsubst %.dll,%.Resources.dll,$(test_lib))
+ $(CSCOMPILE) -target:library -r:$(corlib) Test/resources/culture-nn-NO.cs -resource:Test/resources/Resources.nn-NO.resources -out:$@
vtsdir = Test/System.Runtime.Serialization.Formatters.Binary/VersionTolerantSerialization
vtslibs = \
int IEqualityComparer.GetHashCode (object obj)
{
- var comparer = obj as IEqualityComparer;
+ var comparer = obj as IStructuralEquatable;
if (comparer != null)
return comparer.GetHashCode (this);
bool IEqualityComparer.Equals (object x, object y)
{
- var comparer = x as IEqualityComparer;
+ var comparer = x as IStructuralEquatable;
if (comparer != null)
return comparer.Equals (y, this);
MemoryStream ms = new MemoryStream ();
FlushBuffer (ms);
ms.Write (array, offset, numBytes);
+
+ // Set arguments to new compounded buffer
offset = 0;
- numBytes = (int) ms.Length;
+ array = ms.ToArray ();
+ numBytes = array.Length;
}
- WriteDelegate w = new WriteDelegate (WriteInternal);
+ WriteDelegate w = WriteInternal;
return w.BeginInvoke (array, offset, numBytes, userCallback, stateObject);
}
throw new InvalidOperationException ("Method '" + Name + "' does not have a method body.");
}
if (ilgen != null)
- ilgen.label_fixup ();
+ ilgen.label_fixup (this);
}
internal void GenerateDebugInfo (ISymbolWriter symbolWriter)
if (ilgen == null || ilgen.ILOffset == 0)
throw new InvalidOperationException ("Method '" + name + "' does not have a method body.");
- ilgen.label_fixup ();
+ ilgen.label_fixup (this);
// Have to create all DynamicMethods referenced by this one
try {
throw new NotImplementedException ();
}
- internal void label_fixup ()
+ internal void label_fixup (MethodBase mb)
{
for (int i = 0; i < num_fixups; ++i) {
if (labels [fixups [i].label_idx].addr < 0)
- throw new ArgumentException ("Label not marked");
+ throw new ArgumentException (string.Format ("Label #{0} is not marked in method `{1}'", fixups [i].label_idx + 1, mb.Name));
// Diff is the offset from the end of the jump instruction to the address of the label
int diff = labels [fixups [i].label_idx].addr - (fixups [i].pos + fixups [i].offset);
if (fixups [i].offset == 1) {
DeclaringType.FullName, Name));
}
if (ilgen != null)
- ilgen.label_fixup ();
+ ilgen.label_fixup (this);
}
internal void GenerateDebugInfo (ISymbolWriter symbolWriter)
return attrs;
}
- static bool ShouldPrintFullName (Type type) {
- return type.IsGenericType || (type.IsClass && (!type.IsPointer ||
- (!type.GetElementType ().IsPrimitive && !type.GetElementType ().IsNested)));
- }
-
public override string ToString () {
StringBuilder sb = new StringBuilder ();
Type retType = ReturnType;
- if (ShouldPrintFullName (retType))
+ if (Type.ShouldPrintFullName (retType))
sb.Append (retType.ToString ());
else
sb.Append (retType.Name);
sb.Append ("]");
}
sb.Append ("(");
- ParameterInfo[] p = GetParametersInternal ();
- for (int i = 0; i < p.Length; ++i) {
- if (i > 0)
- sb.Append (", ");
- Type pt = p[i].ParameterType;
- bool byref = pt.IsByRef;
- if (byref)
- pt = pt.GetElementType ();
- if (ShouldPrintFullName (pt))
- sb.Append (pt.ToString ());
- else
- sb.Append (pt.Name);
- if (byref)
- sb.Append (" ByRef");
- }
+
+ var p = GetParametersInternal ();
+ ParameterInfo.FormatParameters (sb, p);
+
if ((CallingConvention & CallingConventions.VarArgs) != 0) {
if (p.Length > 0)
sb.Append (", ");
//
-// System.Reflection/MonoProperty.cs
-// The class used to represent Properties from the mono runtime.
+// MonoProperty.cs: The class used to represent Properties from the mono runtime.
//
-// Author:
+// Authors:
// Paolo Molaro (lupus@ximian.com)
// Patrik Torstensson (patrik.torstensson@labs2.com)
+// Marek Safar (marek.safar@gmail.com)
//
// (C) 2001 Ximian, Inc. http://www.ximian.com
// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
+// Copyright 2013 Xamarin, Inc (http://www.xamarin.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Security;
+using System.Text;
namespace System.Reflection {
return null;
}
- public override ParameterInfo[] GetIndexParameters()
+ public override ParameterInfo[] GetIndexParameters ()
{
CachePropertyInfo (PInfo.GetMethod | PInfo.SetMethod);
- ParameterInfo[] res;
+ ParameterInfo[] src;
+ int length;
if (info.get_method != null) {
- res = info.get_method.GetParameters ();
+ src = info.get_method.GetParametersInternal ();
+ length = src.Length;
} else if (info.set_method != null) {
- ParameterInfo[] src = info.set_method.GetParametersInternal ();
- res = new ParameterInfo [src.Length - 1];
- Array.Copy (src, res, res.Length);
+ src = info.set_method.GetParametersInternal ();
+ length = src.Length - 1;
} else
return EmptyArray<ParameterInfo>.Value;
- for (int i = 0; i < res.Length; ++i) {
- ParameterInfo pinfo = res [i];
- res [i] = new ParameterInfo (pinfo, this);
+ var dest = new ParameterInfo [length];
+ for (int i = 0; i < length; ++i) {
+ dest [i] = new ParameterInfo (src [i], this);
}
- return res;
+ return dest;
}
public override MethodInfo GetSetMethod (bool nonPublic)
method.Invoke (obj, invokeAttr, binder, parms, culture);
}
- public override string ToString () {
- return PropertyType.ToString () + " " + Name;
+ public override string ToString ()
+ {
+ var sb = new StringBuilder ();
+
+ Type retType = PropertyType;
+ if (Type.ShouldPrintFullName (retType))
+ sb.Append (retType.ToString ());
+ else
+ sb.Append (retType.Name);
+
+ sb.Append (" ");
+ sb.Append (Name);
+
+ var pi = GetIndexParameters ();
+ if (pi.Length > 0) {
+ sb.Append (" [");
+ ParameterInfo.FormatParameters (sb, pi);
+ sb.Append ("]");
+ }
+
+ return sb.ToString ();
}
public override Type[] GetOptionalCustomModifiers () {
// System.Reflection.ParameterInfo
//
-// Sean MacIsaac (macisaac@ximian.com)
+// Authors:
+// Sean MacIsaac (macisaac@ximian.com)
+// Marek Safar (marek.safar@gmail.com)
//
// (C) 2001 Ximian, Inc.
// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
+// Copyright 2013 Xamarin, Inc (http://www.xamarin.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Collections.Generic;
+using System.Text;
namespace System.Reflection
{
this.NameImpl = pinfo.Name;
this.PositionImpl = pinfo.Position;
this.AttrsImpl = pinfo.Attributes;
+ this.DefaultValueImpl = pinfo.DefaultValueImpl;
//this.parent = pinfo;
}
return result;
}
+ internal static void FormatParameters (StringBuilder sb, ParameterInfo[] p)
+ {
+ for (int i = 0; i < p.Length; ++i) {
+ if (i > 0)
+ sb.Append (", ");
+
+ Type pt = p[i].ParameterType;
+ bool byref = pt.IsByRef;
+ if (byref)
+ pt = pt.GetElementType ();
+
+ if (Type.ShouldPrintFullName (pt))
+ sb.Append (pt.ToString ());
+ else
+ sb.Append (pt.Name);
+
+ if (byref)
+ sb.Append (" ByRef");
+ }
+ }
+
public virtual Type ParameterType {
get {return ClassImpl;}
}
internal void RunSynchronouslyCore (TaskScheduler scheduler)
{
SetupScheduler (scheduler);
- var saveStatus = status;
Status = TaskStatus.WaitingToRun;
try {
throw new TaskSchedulerException (inner);
}
- Status = saveStatus;
- Start (scheduler);
+ Schedule ();
Wait ();
}
#endregion
throw new ArgumentOutOfRangeException ("millisecondsDelay");
var task = new Task (TaskActionInvoker.Delay, millisecondsDelay, cancellationToken, TaskCreationOptions.None, null, TaskConstants.Finished);
- task.SetupScheduler (TaskScheduler.Current);
+ task.SetupScheduler (TaskScheduler.Default);
if (millisecondsDelay != Timeout.Infinite)
task.scheduler.QueueTask (task);
public bool TrySetApartmentState (ApartmentState state)
{
- /* Only throw this exception when changing the
- * state of another thread. See bug 324338
- */
- if ((this != CurrentThread) &&
- (ThreadState & ThreadState.Unstarted) == 0)
+ if ((ThreadState & ThreadState.Unstarted) == 0)
throw new ThreadStateException ("Thread was in an invalid state for the operation being executed.");
- if ((ApartmentState)Internal.apartment_state != ApartmentState.Unknown)
+ if ((ApartmentState)Internal.apartment_state != ApartmentState.Unknown &&
+ (ApartmentState)Internal.apartment_state != state)
return false;
Internal.apartment_state = (byte)state;
return idx;
}
- static WaitCallback TimerCaller = new WaitCallback (TimerCB);
static void TimerCB (object o)
{
Timer timer = (Timer) o;
- try {
- timer.callback (timer.state);
- } catch {}
+ timer.callback (timer.state);
}
void SchedulerThread ()
list.RemoveAt (i);
count--;
i--;
- ThreadPool.UnsafeQueueUserWorkItem (TimerCaller, timer);
+ ThreadPool.UnsafeQueueUserWorkItem (TimerCB, timer);
long period = timer.period_ms;
long due_time = timer.due_time_ms;
bool no_more = (period == -1 || ((period == 0 || period == Timeout.Infinite) && due_time != Timeout.Infinite));
private static TextWriter stderr;
private static TextReader stdin;
-#if NET_4_5 && !MOBILE
- static TextWriter console_stdout;
- static TextWriter console_stderr;
- static TextReader console_stdin;
-#endif
-
static Console ()
{
#if NET_2_1
// FULL_AOT_RUNTIME is used (instead of MONOTOUCH) since we only want this code when running on
// iOS (simulator or devices) and *not* when running tools (e.g. btouch #12179) that needs to use
// the mscorlib.dll shipped with Xamarin.iOS
-#if FULL_AOT_RUNTIME
+#if MONOTOUCH && FULL_AOT_RUNTIME
stdout = new NSLogWriter ();
#else
stdout = new UnexceptionalStreamWriter (OpenStandardOutput (0), outputEncoding);
#endif
stdout = TextWriter.Synchronized (stdout, true);
-#if FULL_AOT_RUNTIME
+#if MONOTOUCH && FULL_AOT_RUNTIME
stderr = new NSLogWriter ();
#else
stderr = new UnexceptionalStreamWriter (OpenStandardError (0), outputEncoding);
}
#endif
-#if NET_4_5 && !MOBILE
- console_stderr = stderr;
- console_stdout = stdout;
- console_stdin = stdin;
-#endif
-
#if MONODROID
if (LogcatTextWriter.IsRunningOnAndroid ()) {
stdout = TextWriter.Synchronized (new LogcatTextWriter ("mono-stdout", stdout));
#if NET_4_5
public static bool IsErrorRedirected {
get {
- return stderr != console_stderr || ConsoleDriver.IsErrorRedirected;
+ return ConsoleDriver.IsErrorRedirected;
}
}
public static bool IsOutputRedirected {
get {
- return stdout != console_stdout || ConsoleDriver.IsOutputRedirected;
+ return ConsoleDriver.IsOutputRedirected;
}
}
public static bool IsInputRedirected {
get {
- return stdin != console_stdin || ConsoleDriver.IsInputRedirected;
+ return ConsoleDriver.IsInputRedirected;
}
}
#endif
using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Text;
-#if FULL_AOT_RUNTIME
+#if MONOTOUCH
using Crimson.CommonCrypto;
#endif
[StructLayout (LayoutKind.Sequential)]
[ComVisible (true)]
public struct Guid : IFormattable, IComparable, IComparable<Guid>, IEquatable<Guid> {
-#if FULL_AOT_RUNTIME
+#if MONOTOUCH
static Guid () {
if (MonoTouchAOTHelper.FalseFlag) {
var comparer = new System.Collections.Generic.GenericComparer <Guid> ();
private static RandomNumberGenerator _fastRng;
#endif
+#if FULL_AOT_RUNTIME && !MONOTOUCH
+ // NSA approved random generator.
+ static void LameRandom (byte [] b)
+ {
+ var r = new Random ();
+ r.NextBytes (b);
+ }
+#endif
+
// generated as per section 3.4 of the specification
public static Guid NewGuid ()
{
_rng = RandomNumberGenerator.Create ();
_rng.GetBytes (b);
}
-#else
+#elif MONOTOUCH
Cryptor.GetRandom (b);
+#else
+ LameRandom (b);
#endif
Guid res = new Guid (b);
case StringComparison.InvariantCultureIgnoreCase:
return CultureInfo.InvariantCulture.CompareInfo.IsSuffix (this, value, CompareOptions.IgnoreCase);
case StringComparison.Ordinal:
- return CultureInfo.CurrentCulture.CompareInfo.IsSuffix (this, value, CompareOptions.Ordinal);
+ return CultureInfo.InvariantCulture.CompareInfo.IsSuffix (this, value, CompareOptions.Ordinal);
case StringComparison.OrdinalIgnoreCase:
- return CultureInfo.CurrentCulture.CompareInfo.IsSuffix (this, value, CompareOptions.OrdinalIgnoreCase);
+ return CultureInfo.InvariantCulture.CompareInfo.IsSuffix (this, value, CompareOptions.OrdinalIgnoreCase);
default:
string msg = Locale.GetText ("Invalid value '{0}' for StringComparison", comparisonType);
throw new ArgumentException (msg, "comparisonType");
return FullName;
}
+ internal static bool ShouldPrintFullName (Type type)
+ {
+ return type.IsGenericType || (type.IsClass && (!type.IsPointer ||
+ (!type.GetElementType ().IsPrimitive && !type.GetElementType ().IsNested)));
+ }
+
internal virtual Type InternalResolve ()
{
return UnderlyingSystemType;
obj = Marshal.PtrToStringBSTR(Marshal.ReadIntPtr(addr));
break;
// GetObjectForIUnknown is excluded from Marshal using FULL_AOT_RUNTIME
-#if !MONOTOUCH
+#if !DISABLE_COM
case VarEnum.VT_UNKNOWN:
case VarEnum.VT_DISPATCH:
{
--- /dev/null
+//
+// StructuralComparisonsTest.cs
+//
+// Authors:
+// Marek Safar <marek.safar@gmail.com>
+//
+// Copyright (C) 2013 Xamarin Inc (http://www.xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_4_0
+
+using System.Collections;
+using NUnit.Framework;
+
+namespace MonoTests.System.Collections
+{
+ [TestFixture]
+ public class StructuralComparisonsTest
+ {
+ [Test]
+ public void EqualsTest ()
+ {
+ int[] a1 = new[] { 9, 1, 3, 4 };
+ int[] a2 = new[] { 9, 1, 3, 4 };
+
+ Assert.IsTrue (StructuralComparisons.StructuralEqualityComparer.Equals (a1, a2), "#1");
+ Assert.IsFalse (StructuralComparisons.StructuralEqualityComparer.Equals (null, a2), "#2");
+ Assert.IsFalse (StructuralComparisons.StructuralEqualityComparer.Equals (a1, null), "#3");
+ Assert.IsTrue (StructuralComparisons.StructuralEqualityComparer.Equals (null, null), "#4");
+ Assert.IsTrue (StructuralComparisons.StructuralEqualityComparer.Equals (4, 4), "#5");
+ Assert.IsFalse (StructuralComparisons.StructuralEqualityComparer.Equals (4, 5), "#6");
+ }
+ }
+}
+
+#endif
\ No newline at end of file
Assert.AreEqual (31748, new CultureInfo ("zh-CHT").LCID);
Assert.AreEqual (31748, new CultureInfo ("zh-CHT").Parent.LCID);
}
+
+ [Test]
+ [SetCulture ("zh-TW")]
+ public void ParentOfZh ()
+ {
+ Assert.AreEqual (31748, CultureInfo.CurrentCulture.Parent.LCID);
+ Assert.AreEqual (31748, CultureInfo.CurrentCulture.Parent.Parent.LCID);
+ }
[Test]
public void CurrentCulture ()
using System.IO;
using System.Runtime.InteropServices;
using System.Text;
+using System.Threading;
namespace MonoTests.System.IO
{
stream.EndWrite (stream.BeginWrite (new byte[8], 0, 8, null, null));
}
+ static IAsyncResult DoBeginWrite(Stream stream, ManualResetEvent mre, byte[] RandomBuffer)
+ {
+ return stream.BeginWrite (RandomBuffer, 0, RandomBuffer.Length, ar => {
+ stream.EndWrite (ar);
+
+ // we don't supply an ManualResetEvent so this will throw an NRE on the second run
+ // which nunit-console will ignore (but other test runners don't like that)
+ if (mre == null)
+ return;
+
+ DoBeginWrite (stream, null, RandomBuffer).AsyncWaitHandle.WaitOne ();
+ mre.Set ();
+ }, null);
+ }
+
+ [Test]
+ public void BeginWrite_Recursive ()
+ {
+ string path = TempFolder + Path.DirectorySeparatorChar + "temp";
+ DeleteFile (path);
+
+ using (FileStream stream = new FileStream (path, FileMode.OpenOrCreate, FileAccess.Write)) {
+ var mre = new ManualResetEvent (false);
+ var RandomBuffer = new byte[1024];
+ DoBeginWrite (stream, mre, RandomBuffer);
+ Assert.IsTrue (mre.WaitOne (5000), "#1");
+ }
+ }
+
[Test]
[Category("TargetJvmNotSupported")] // File locking not supported for TARGET_JVM
[ExpectedException (typeof (ObjectDisposedException))]
}
}
#endif
-#if NET_2_0
+
public class A<T>
{
public string Property {
PropertyInfo property = type.GetProperty ("Property");
Assert.AreEqual (typeof (string).FullName, property.GetValue (instance, null));
}
-#endif
+ [Test]
+ public void ToStringTest ()
+ {
+ var pa = typeof (TestC).GetProperty ("Item");
+ Assert.AreEqual ("Int32 Item [System.Double[]]", pa.ToString ());
+ }
static bool HasAttribute (object [] attrs, Type attributeType)
{
Assert.IsTrue (ex.InnerException is ObjectDisposedException);
}
}
+
+ public class DefaultValueTest
+ {
+ public string this[int val, string param = "test"]
+ {
+ get{ return val + param; }
+ }
+ }
+
+
+ [Test]
+ public void PropertyWithDefaultValue ()
+ {
+ var parameters = typeof (DefaultValueTest).GetProperty ("Item").GetIndexParameters ();
+ var defaultParam = parameters[parameters.Length - 1];
+ Assert.AreEqual ("param", defaultParam.Name, "#1");
+ Assert.AreEqual ("test", defaultParam.DefaultValue, "#2");
+ }
}
}
}
}
+ class NonInlineableScheduler : TaskScheduler
+ {
+ protected override IEnumerable<Task> GetScheduledTasks ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ protected override void QueueTask (Task task)
+ {
+ if (!base.TryExecuteTask (task))
+ throw new ApplicationException ();
+ }
+
+ protected override bool TryExecuteTaskInline (Task task, bool taskWasPreviouslyQueued)
+ {
+ return false;
+ }
+ }
+
Task[] tasks;
const int max = 6;
Assert.AreEqual ('d', d.Result, "#3r");
}
+ [Test]
+ public void ContinueWith_CustomScheduleRejected ()
+ {
+ var scheduler = new NonInlineableScheduler ();
+ var t = Task.Factory.StartNew (delegate { }).
+ ContinueWith (r => {}, CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, scheduler);
+
+ Assert.IsTrue (t.Wait (5000));
+ }
+
[Test]
public void FromResult ()
{
Assert.IsTrue (exception_occured, "Thread1 Started Invalid Exception Occured");
}
+ [Test]
+ public void TestSetApartmentStateSameState ()
+ {
+ Thread t1 = new Thread (new ThreadStart (Start));
+ t1.SetApartmentState (ApartmentState.STA);
+ Assert.AreEqual (ApartmentState.STA, t1.ApartmentState, "Thread1 Set Once");
+
+ t1.SetApartmentState (ApartmentState.STA);
+ Assert.AreEqual (ApartmentState.STA, t1.ApartmentState, "Thread1 Set twice");
+ }
+
+ [Test]
+ [ExpectedException(typeof(InvalidOperationException))]
+ public void TestSetApartmentStateDiffState ()
+ {
+ Thread t1 = new Thread (new ThreadStart (Start));
+ t1.SetApartmentState (ApartmentState.STA);
+ Assert.AreEqual (ApartmentState.STA, t1.ApartmentState, "Thread1 Set Once");
+
+ t1.SetApartmentState (ApartmentState.MTA);
+ }
+
+ [Test]
+ public void TestTrySetApartmentState ()
+ {
+ Thread t1 = new Thread (new ThreadStart (Start));
+ t1.SetApartmentState (ApartmentState.STA);
+ Assert.AreEqual (ApartmentState.STA, t1.ApartmentState, "#1");
+
+ bool result = t1.TrySetApartmentState (ApartmentState.MTA);
+ Assert.IsFalse (result, "#2");
+
+ result = t1.TrySetApartmentState (ApartmentState.STA);
+ Assert.IsTrue (result, "#3");
+ }
+
+ [Test]
+ public void TestTrySetApartmentStateRunning ()
+ {
+ Thread t1 = new Thread (new ThreadStart (Start));
+ t1.SetApartmentState (ApartmentState.STA);
+ Assert.AreEqual (ApartmentState.STA, t1.ApartmentState, "#1");
+
+ t1.Start ();
+
+ try {
+ t1.TrySetApartmentState (ApartmentState.STA);
+ Assert.Fail ("#2");
+ } catch (ThreadStateException) {
+ }
+
+ t1.Join ();
+ }
+
[Test]
public void Volatile () {
double v3 = 55667;
}
+#if !MONOTOUCH
[Test]
public void TestDisposeOnCallback ()
{
+ // this test is bad, as the provided `state` (t1) is null and will throw an NRE inside the callback
+ // that was ignored before 238785a3e3d510528228fc551625975bc508c2f3 and most unit test runner won't
+ // report it since the NRE will not happen on the main thread (but Touch.Unit will)
Timer t1 = null;
t1 = new Timer (new TimerCallback (CallbackTestDisposeOnCallback), t1, 0, 10);
Thread.Sleep (200);
{
((Timer) foo).Dispose ();
}
-
+#endif
+
private void Callback (object foo)
{
Bucket b = foo as Bucket;
}
#if !MOBILE
+
+#if NET_4_5
+ [Test]
+ public void RedirectedTest ()
+ {
+ if (Console.IsErrorRedirected) {
+ // Assert.Inconclusive ();
+ return;
+ }
+
+ Console.SetError (TextWriter.Null);
+ Assert.IsFalse (Console.IsErrorRedirected);
+ }
+#endif
+
// Bug 678357
[Test]
public void EncodingTest ()
System.Collections/ReadOnlyCollectionBaseTest.cs
System.Collections/SortedListTest.cs
System.Collections/StackTest.cs
+System.Collections/StructuralComparisonsTest.cs
System.Collections.Generic/ComparerTest.cs
System.Collections.Generic/DictionaryTest.cs
System.Collections.Generic/EqualityComparerTest.cs
--- /dev/null
+#include corlib.dll.sources
--- /dev/null
+.assembly extern mscorlib
+{
+}
+
+.assembly extern 'CS0012-lib-missing'
+{
+}
+
+.assembly 'CS0012-21-lib'
+{
+ .hash algorithm 0x00008004
+ .ver 0:0:0:0
+}
+
+.module 'CS0012-21-lib.dll'
+
+
+.class public auto ansi beforefieldinit B
+ extends class ['CS0012-lib-missing']X`1/Y/Z/W<int32>
+{
+ .method public hidebysig specialname rtspecialname
+ instance void .ctor() cil managed
+ {
+ // Code size 7 (0x7)
+ .maxstack 8
+ IL_0000: ldarg.0
+ IL_0001: call instance void class ['CS0012-lib-missing']X`1/Y/Z/W<int32>::.ctor()
+ IL_0006: ret
+ }
+
+}
$(wildcard dlls/second/*.cs)
TEST_SUPPORT_FILES = \
- CS0012-lib.dll CS0012-2-lib.dll CS0012-3-lib.dll CS0012-4-lib.dll CS0012-5-lib.dll CS0012-6-lib.dll CS0012-9-lib.dll CS0012-10-lib.dll CS0012-11-lib.dll CS0012-12-lib.dll CS0012-13-lib.dll CS0012-14-lib.dll CS0012-15-lib.dll CS0012-16-lib.dll CS0012-17-lib.dll CS0012-18-lib.dll CS0029-26-lib.dll \
+ CS0012-lib.dll CS0012-2-lib.dll CS0012-3-lib.dll CS0012-4-lib.dll CS0012-5-lib.dll CS0012-6-lib.dll CS0012-9-lib.dll CS0012-10-lib.dll CS0012-11-lib.dll CS0012-12-lib.dll CS0012-13-lib.dll CS0012-14-lib.dll CS0012-15-lib.dll CS0012-16-lib.dll CS0012-17-lib.dll CS0012-18-lib.dll CS0012-21-lib.dll CS0029-26-lib.dll \
CS0103-2-lib.dll CS0118-2-lib.dll CS0122-8-lib.dll CS0122-10-lib.dll CS0122-14-lib.dll CS0122-15-lib.dll CS0122-19-lib.dll CS0122-35-lib.dll CS0122-36-lib.dll CS0143-lib.dll CS0144-3-lib.dll CS0165-19-lib.dll \
CS0205-3-lib.dll CS0229-3-lib.dll CS0229-4-lib.dll CS0266-25-lib.dll \
CS0315-2-lib.dll \
--- /dev/null
+// CS0012: The type `X`1.Y.Z.W' is defined in an assembly that is not referenced. Consider adding a reference to assembly `CS0012-lib-missing, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
+// Line: 9
+// Compiler options: -r:CS0012-21-lib.dll
+
+public class C
+{
+ public static void Main ()
+ {
+ new B ();
+ }
+}
\ No newline at end of file
public static void Main ()
{
int a = 4, b = 5;
- X x = (X) -a;
+X x = (X) -a;
System.Console.WriteLine (x.i);
}
}
-// CS0118: `Test.SomeDel' is a `type' but a `variable' was expected
-// Line: 14
+// CS0118: `C' is a `type' but a `variable' was expected
+// Line: 8
-using System;
-
-namespace Test
+class C
{
- public delegate void SomeDel (Action a);
-
- public class TestClass
+ public static void Main ()
{
- public void TestMethod ()
- {
- SomeDel (() => { });
- }
+ int i = (C) +1;
}
-}
\ No newline at end of file
+}
+++ /dev/null
-// CS0118: `A.Test' is a `type' but a `variable' was expected
-// Line: 10
-
-class A
-{
- delegate string Test (string t);
-
- public static void Main ()
- {
- Test ("t");
- }
-}
--- /dev/null
+// CS0119: Expression denotes a `type', where a `variable', `value' or `method group' was expected
+// Line: 14
+
+using System;
+
+namespace Test
+{
+ public delegate void SomeDel (Action a);
+
+ public class TestClass
+ {
+ public void TestMethod ()
+ {
+ SomeDel (() => { });
+ }
+ }
+}
\ No newline at end of file
// CS0119: Expression denotes a `type', where a `variable', `value' or `method group' was expected
-// Line: 8
+// Line: 10
-class C
+class A
{
+ delegate string Test (string t);
+
public static void Main ()
{
- int i = (C) +1;
+ Test ("t");
}
}
--- /dev/null
+// CS0472: The result of comparing value type `byte' with null is always `false'
+// Line: 9
+// Compiler options: -warnaserror -warn:2
+
+class C
+{
+ public static bool Test (byte value)
+ {
+ if (value == null)
+ return false;
+
+ return true;
+ }
+}
--- /dev/null
+// CS0576: Namespace `global::' contains a definition with same name as alias `A'
+// Line: 12
+
+using A = System;
+
+namespace A.Foo
+{
+ class X
+ {
+ public static void Main ()
+ {
+ A.GG ();
+ }
+ }
+}
\ No newline at end of file
protected override void DoEmit (EmitContext ec)
{
- GetResultExpression (ec).Emit (ec);
+ using (ec.With (BuilderContext.Options.OmitDebugInfo, true)) {
+ GetResultExpression (ec).Emit (ec);
+ }
}
public Expression GetResultExpression (EmitContext ec)
var fe_awaiter = new FieldExpr (awaiter, loc);
fe_awaiter.InstanceExpression = new CompilerGeneratedThis (ec.CurrentType, loc);
- //
- // awaiter = expr.GetAwaiter ();
- //
+ Label skip_continuation = ec.DefineLabel ();
+
using (ec.With (BuilderContext.Options.OmitDebugInfo, true)) {
+ //
+ // awaiter = expr.GetAwaiter ();
+ //
fe_awaiter.EmitAssign (ec, expr, false, false);
- }
- Label skip_continuation = ec.DefineLabel ();
+ Expression completed_expr;
+ if (IsDynamic) {
+ var rc = new ResolveContext (ec.MemberContext);
- Expression completed_expr;
- if (IsDynamic) {
- var rc = new ResolveContext (ec.MemberContext);
+ Arguments dargs = new Arguments (1);
+ dargs.Add (new Argument (fe_awaiter));
+ completed_expr = new DynamicMemberBinder ("IsCompleted", dargs, loc).Resolve (rc);
- Arguments dargs = new Arguments (1);
- dargs.Add (new Argument (fe_awaiter));
- completed_expr = new DynamicMemberBinder ("IsCompleted", dargs, loc).Resolve (rc);
+ dargs = new Arguments (1);
+ dargs.Add (new Argument (completed_expr));
+ completed_expr = new DynamicConversion (ec.Module.Compiler.BuiltinTypes.Bool, 0, dargs, loc).Resolve (rc);
+ } else {
+ var pe = PropertyExpr.CreatePredefined (awaiter_definition.IsCompleted, loc);
+ pe.InstanceExpression = fe_awaiter;
+ completed_expr = pe;
+ }
- dargs = new Arguments (1);
- dargs.Add (new Argument (completed_expr));
- completed_expr = new DynamicConversion (ec.Module.Compiler.BuiltinTypes.Bool, 0, dargs, loc).Resolve (rc);
- } else {
- var pe = PropertyExpr.CreatePredefined (awaiter_definition.IsCompleted, loc);
- pe.InstanceExpression = fe_awaiter;
- completed_expr = pe;
+ completed_expr.EmitBranchable (ec, skip_continuation, true);
}
- completed_expr.EmitBranchable (ec, skip_continuation, true);
-
base.DoEmit (ec);
//
var args = new Arguments (2);
args.Add (new Argument (awaiter, Argument.AType.Ref));
args.Add (new Argument (new CompilerGeneratedThis (CurrentType, Location), Argument.AType.Ref));
- mg.EmitCall (ec, args);
+ using (ec.With (BuilderContext.Options.OmitDebugInfo, true)) {
+ mg.EmitCall (ec, args);
+ }
}
public void EmitInitializer (EmitContext ec)
Arguments args = new Arguments (1);
args.Add (new Argument (exceptionVariable));
- mg.EmitCall (ec, args);
+ using (ec.With (BuilderContext.Options.OmitDebugInfo, true)) {
+ mg.EmitCall (ec, args);
+ }
}
public void EmitSetResult (EmitContext ec)
args.Add (new Argument (new LocalVariableReference (hoisted_return, Location)));
}
- mg.EmitCall (ec, args);
+ using (ec.With (BuilderContext.Options.OmitDebugInfo, true)) {
+ mg.EmitCall (ec, args);
+ }
}
protected override TypeSpec[] ResolveBaseTypes (out FullNamedExpression base_class)
get; set;
}
- public virtual void AddCompilerGeneratedClass (CompilerGeneratedContainer c)
+ public void AddCompilerGeneratedClass (CompilerGeneratedContainer c)
{
- containers.Add (c);
+ AddTypeContainerMember (c);
}
public virtual void AddPartial (TypeDefinition next_part)
next_part.PartialContainer = existing;
- if (containers == null)
- containers = new List<TypeContainer> ();
-
- containers.Add (next_part);
+ AddTypeContainerMember (next_part);
}
public virtual void AddTypeContainer (TypeContainer tc)
{
- containers.Add (tc);
+ AddTypeContainerMember (tc);
var tparams = tc.MemberName.TypeParameters;
if (tparams != null && tc.PartialContainer != null) {
}
}
+ protected virtual void AddTypeContainerMember (TypeContainer tc)
+ {
+ containers.Add (tc);
+ }
+
public virtual void CloseContainer ()
{
if (containers != null) {
public string GetSignatureForMetadata ()
{
-#if STATIC
if (Parent is TypeDefinition) {
return Parent.GetSignatureForMetadata () + "+" + TypeNameParser.Escape (MemberName.Basename);
}
var sb = new StringBuilder ();
CreateMetadataName (sb);
return sb.ToString ();
-#else
- throw new NotImplementedException ();
-#endif
}
public virtual void RemoveContainer (TypeContainer cont)
{
AddNameToContainer (tc, tc.Basename);
- if (containers == null)
- containers = new List<TypeContainer> ();
-
- members.Add (tc);
base.AddTypeContainer (tc);
}
- public override void AddCompilerGeneratedClass (CompilerGeneratedContainer c)
+ protected override void AddTypeContainerMember (TypeContainer tc)
{
- members.Add (c);
+ members.Add (tc);
if (containers == null)
containers = new List<TypeContainer> ();
- base.AddCompilerGeneratedClass (c);
+ base.AddTypeContainerMember (tc);
}
//
}
if (set_base_type) {
- if (base_type != null) {
- spec.BaseType = base_type;
-
- // Set base type after type creation
- TypeBuilder.SetParent (base_type.GetMetaInfo ());
- } else {
- TypeBuilder.SetParent (null);
- }
+ SetBaseType ();
}
return true;
}
+ void SetBaseType ()
+ {
+ if (base_type == null) {
+ TypeBuilder.SetParent (null);
+ return;
+ }
+
+ if (spec.BaseType == base_type)
+ return;
+
+ spec.BaseType = base_type;
+
+ if (IsPartialPart)
+ spec.UpdateInflatedInstancesBaseType ();
+
+ // Set base type after type creation
+ TypeBuilder.SetParent (base_type.GetMetaInfo ());
+ }
+
public override void ExpandBaseInterfaces ()
{
if (!IsPartialPart)
if (iface_type.Arity > 0) {
// TODO: passing `this' is wrong, should be base type iface instead
- TypeManager.CheckTypeVariance (iface_type, Variance.Covariant, this);
+ VarianceDecl.CheckTypeVariance (iface_type, Variance.Covariant, this);
if (((InflatedTypeSpec) iface_type).HasDynamicArgument () && !IsCompilerGenerated) {
Report.Error (1966, Location,
base.Emit ();
- for (int i = 0; i < members.Count; i++)
- members[i].Emit ();
+ for (int i = 0; i < members.Count; i++) {
+ var m = members[i];
+ if ((m.caching_flags & Flags.CloseTypeCreated) != 0)
+ continue;
+
+ m.Emit ();
+ }
EmitIndexerName ();
CheckAttributeClsCompliance ();
Parent.PartialContainer.VerifyImplements (this);
}
- ModifiersExtensions.Check (Modifiers.AllowedExplicitImplFlags, explicit_mod_flags, 0, Location, Report);
+ Modifiers allowed_explicit = Modifiers.AllowedExplicitImplFlags;
+ if (this is Method)
+ allowed_explicit |= Modifiers.ASYNC;
+
+ ModifiersExtensions.Check (allowed_explicit, explicit_mod_flags, 0, Location, Report);
}
return base.Define ();
{
base.DoMemberTypeDependentChecks ();
- TypeManager.CheckTypeVariance (MemberType, ExpectedMemberTypeVariance, this);
+ VarianceDecl.CheckTypeVariance (MemberType, ExpectedMemberTypeVariance, this);
}
public override void Emit()
return true;
}
+ public void MarkCallEntry (Location loc)
+ {
+ if (!EmitAccurateDebugInfo)
+ return;
+
+ //
+ // TODO: This should emit different kind of sequence point to make
+ // step-over work for statement over multiple lines
+ //
+ // Debugging experience for Foo (A () + B ()) where A and B are
+ // on separate lines is not great
+ //
+ Mark (loc);
+ }
+
public void DefineLocalVariable (string name, LocalBuilder builder)
{
if ((flags & Options.OmitDebugInfo) != 0)
// Emit explicit sequence point for expressions like Foo.Bar () to help debugger to
// break at right place when LHS expression can be stepped-into
//
- // TODO: The list is probably not comprehensive, need to do more testing
- //
- if (InstanceExpression is PropertyExpr || InstanceExpression is Invocation || InstanceExpression is IndexerExpr ||
- InstanceExpression is New || InstanceExpression is DelegateInvocation)
- ec.Mark (loc.Value);
+ ec.MarkCallEntry (loc.Value);
}
//
this.targs = targs;
}
- protected override Expression DoResolve (ResolveContext ec)
+ protected override Expression DoResolve (ResolveContext rc)
{
- Expression expr_resolved = expr.Resolve (ec,
- ResolveFlags.VariableOrValue | ResolveFlags.Type);
+ var sn = expr as SimpleName;
+ const ResolveFlags flags = ResolveFlags.VariableOrValue | ResolveFlags.Type;
+
+ //
+ // Resolve the expression with flow analysis turned off, we'll do the definite
+ // assignment checks later. This is because we don't know yet what the expression
+ // will resolve to - it may resolve to a FieldExpr and in this case we must do the
+ // definite assignment check on the actual field and not on the whole struct.
+ //
+ using (rc.Set (ResolveContext.Options.OmitStructFlowAnalysis)) {
+ if (sn != null) {
+ expr = sn.LookupNameExpression (rc, MemberLookupRestrictions.ReadAccess | MemberLookupRestrictions.ExactArity);
+
+ //
+ // Resolve expression which does have type set as we need expression type
+ // with disable flow analysis as we don't know whether left side expression
+ // is used as variable or type
+ //
+ if (expr is VariableReference || expr is ConstantExpr || expr is Linq.TransparentMemberAccess) {
+ using (rc.With (ResolveContext.Options.DoFlowAnalysis, false)) {
+ expr = expr.Resolve (rc);
+ }
+ } else if (expr is TypeParameterExpr) {
+ expr.Error_UnexpectedKind (rc, flags, sn.Location);
+ expr = null;
+ }
+ } else {
+ expr = expr.Resolve (rc, flags);
+ }
+ }
- if (expr_resolved == null)
+ if (expr == null)
return null;
- TypeSpec expr_type = expr_resolved.Type;
+ TypeSpec expr_type = expr.Type;
if (expr_type.IsPointer || expr_type.Kind == MemberKind.Void || expr_type == InternalType.NullLiteral || expr_type == InternalType.AnonymousMethod) {
- expr_resolved.Error_OperatorCannotBeApplied (ec, loc, ".", expr_type);
+ expr.Error_OperatorCannotBeApplied (rc, loc, ".", expr_type);
return null;
}
if (targs != null) {
- if (!targs.Resolve (ec))
+ if (!targs.Resolve (rc))
return null;
}
var results = new List<string> ();
- if (expr_resolved is Namespace){
- Namespace nexpr = expr_resolved as Namespace;
+ if (expr is Namespace) {
+ Namespace nexpr = expr as Namespace;
string namespaced_partial;
if (partial_name == null)
else
namespaced_partial = nexpr.Name + "." + partial_name;
- ec.CurrentMemberDefinition.GetCompletionStartingWith (namespaced_partial, results);
+ rc.CurrentMemberDefinition.GetCompletionStartingWith (namespaced_partial, results);
if (partial_name != null)
results = results.Select (l => l.Substring (partial_name.Length)).ToList ();
} else {
- var r = MemberCache.GetCompletitionMembers (ec, expr_type, partial_name).Select (l => l.Name);
+ var r = MemberCache.GetCompletitionMembers (rc, expr_type, partial_name).Select (l => l.Name);
AppendResults (results, partial_name, r);
}
"The type `{0}' cannot be declared const", t.GetSignatureForError ());
}
}
+
+ public override void Accept (StructuralVisitor visitor)
+ {
+ visitor.Visit (this);
+ }
}
public class ConstSpec : FieldSpec
if (this.type == type)
return this;
- if (!Convert.ImplicitNumericConversionExists (this.type, type))
+ if (!Convert.ImplicitNumericConversionExists (this.type, type))
return null;
bool fail;
{
return null;
}
+
+ public override Constant ConvertImplicitly (TypeSpec type)
+ {
+ if (IsDefaultValue && type.BuiltinType == BuiltinTypeSpec.Type.Object)
+ return new NullConstant (type, loc);
+
+ return base.ConvertImplicitly (type);
+ }
}
//
// Keeps track of global data changes to undo on parser error
//
public Undo undo;
+
+ bool? interactive_async;
Stack<Linq.QueryBlock> linq_clause_blocks;
{
var lt = (LocatedToken) $3;
$$ = new MemberName ((MemberName) $1, lt.Value, lt.Location);
+ lbag.AddLocation ($$, GetLocation ($2));
}
| error
{
}
opt_semicolon
{
- lbag.AppendToMember (current_container, GetLocation ($11), GetLocation ($14), GetLocation ($16));
+ if ($16 == null) {
+ lbag.AppendToMember (current_container, GetLocation ($11), GetLocation ($14));
+ } else {
+ lbag.AppendToMember (current_container, GetLocation ($11), GetLocation ($14), GetLocation ($16));
+ }
$$ = pop_current_class ();
}
| opt_attributes opt_modifiers opt_partial STRUCT error
{
--lexer.parsing_block;
current_field.Initializer = (Expression) $3;
+ lbag.AppendToMember (current_field, GetLocation ($1));
end_block (lexer.Location);
current_local_parameters = null;
}
}
opt_semicolon
{
- lbag.AppendToMember (current_container, GetLocation ($11), GetLocation ($13));
+ if ($15 == null) {
+ lbag.AppendToMember (current_container, GetLocation ($11), GetLocation ($13));
+ } else {
+ lbag.AppendToMember (current_container, GetLocation ($11), GetLocation ($13), GetLocation ($15));
+ }
$$ = pop_current_class ();
}
| opt_attributes opt_modifiers opt_partial INTERFACE error
: opt_attributes opt_type_parameter_variance IDENTIFIER
{
var lt = (LocatedToken)$3;
- $$ = new TypeParameter (new MemberName (lt.Value, lt.Location), (Attributes)$1, (Variance) $2);
+ $$ = new TypeParameter (new MemberName (lt.Value, lt.Location), (Attributes)$1, (VarianceDecl) $2);
}
| error
{
else
Error_SyntaxError (yyToken);
- $$ = new TypeParameter (MemberName.Null, null, Variance.None);
+ $$ = new TypeParameter (MemberName.Null, null, null);
}
;
| OPEN_BRACE expression_list CLOSE_BRACE
{
if ($2 == null)
- $$ = null;
+ $$ = new CollectionElementInitializer (GetLocation ($1));
else
$$ = new CollectionElementInitializer ((List<Expression>)$2, GetLocation ($1));
+
+ lbag.AddLocation ($$, GetLocation ($2));
}
| OPEN_BRACE CLOSE_BRACE
{
report.Error (1920, GetLocation ($1), "An element initializer cannot be empty");
- $$ = null;
+ $$ = new CollectionElementInitializer (GetLocation ($1));
+ lbag.AddLocation ($$, GetLocation ($2));
}
;
} else if (current_anonymous_method is AnonymousMethodExpression) {
report.Error (4035, GetLocation ($1),
"The `await' operator can only be used when its containing anonymous method is marked with the `async' modifier");
+ } else if (interactive_async != null) {
+ current_block.Explicit.RegisterAsyncAwait ();
+ interactive_async = true;
} else {
report.Error (4033, GetLocation ($1),
"The `await' operator can only be used when its containing method is marked with the `async' modifier");
}
opt_semicolon
{
- lbag.AppendToMember (current_container, GetLocation ($11), GetLocation ($13), GetLocation ($15));
+ if ($15 == null) {
+ lbag.AppendToMember (current_container, GetLocation ($11), GetLocation ($13));
+ } else {
+ lbag.AppendToMember (current_container, GetLocation ($11), GetLocation ($13), GetLocation ($15));
+ }
$$ = pop_current_class ();
}
;
opt_type_parameter_variance
: /* empty */
{
- $$ = Variance.None;
+ $$ = null;
}
| type_parameter_variance
{
type_parameter_variance
: OUT
{
- $$ = Variance.Covariant;
+ $$ = new VarianceDecl (Variance.Covariant, GetLocation ($1));
}
| IN
{
- $$ = Variance.Contravariant;
+ $$ = new VarianceDecl (Variance.Contravariant, GetLocation ($1));
}
;
: expression
{
Expression expr = (Expression) $1;
- ExpressionStatement s;
-
- s = new OptionalAssign (new SimpleName ("$retval", lexer.Location), expr, lexer.Location);
- $$ = new StatementExpression (s);
+ $$ = new StatementExpression (new OptionalAssign (expr, lexer.Location));
}
| error
{
Fixed f = new Fixed ((Fixed.VariableDeclaration) $9, (Statement) $10, GetLocation ($1));
current_block.AddStatement (f);
+ lbag.AddStatement (f, GetLocation ($2), GetLocation ($8));
$$ = end_block (GetLocation ($8));
}
;
var lt = (LocatedToken) $2;
var rv = new Linq.RangeVariable (lt.Value, lt.Location);
- $$ = new Linq.QueryExpression (new Linq.QueryStartClause ((Linq.QueryBlock)current_block, (Expression)$4, rv, GetLocation ($1)));
+ var clause = new Linq.QueryStartClause ((Linq.QueryBlock)current_block, (Expression)$4, rv, GetLocation ($1));
+ lbag.AddLocation (clause, GetLocation ($3));
+ $$ = new Linq.QueryExpression (clause);
}
| FROM_FIRST type identifier_inside_body IN expression
{
var lt = (LocatedToken) $3;
var rv = new Linq.RangeVariable (lt.Value, lt.Location);
- $$ = new Linq.QueryExpression (
- new Linq.QueryStartClause ((Linq.QueryBlock)current_block, (Expression)$5, rv, GetLocation ($1)) {
+ var clause = new Linq.QueryStartClause ((Linq.QueryBlock)current_block, (Expression)$5, rv, GetLocation ($1)) {
IdentifierType = (FullNamedExpression)$2
- }
- );
+ };
+ lbag.AddLocation (clause, GetLocation ($4));
+ $$ = new Linq.QueryExpression (clause);
}
;
var lt = (LocatedToken) $2;
var rv = new Linq.RangeVariable (lt.Value, lt.Location);
- $$ = new Linq.QueryExpression (new Linq.QueryStartClause ((Linq.QueryBlock)current_block, (Expression)$4, rv, GetLocation ($1)));
+ var clause = new Linq.QueryStartClause ((Linq.QueryBlock)current_block, (Expression)$4, rv, GetLocation ($1));
+ lbag.AddLocation (clause, GetLocation ($3));
+ $$ = new Linq.QueryExpression (clause);
}
| FROM type identifier_inside_body IN expression
{
var lt = (LocatedToken) $3;
var rv = new Linq.RangeVariable (lt.Value, lt.Location);
- $$ = new Linq.QueryExpression (
- new Linq.QueryStartClause ((Linq.QueryBlock)current_block, (Expression)$5, rv, GetLocation ($1)) {
+ var clause = new Linq.QueryStartClause ((Linq.QueryBlock)current_block, (Expression)$5, rv, GetLocation ($1)) {
IdentifierType = (FullNamedExpression)$2
- }
- );
+ };
+ lbag.AddLocation (clause, GetLocation ($4));
+ $$ = new Linq.QueryExpression (clause);
}
;
current_block = current_block.Parent;
((Linq.QueryBlock)current_block).AddRangeVariable (sn);
+ lbag.AddLocation ($$, GetLocation ($3));
}
| FROM type identifier_inside_body IN
{
current_block = current_block.Parent;
((Linq.QueryBlock)current_block).AddRangeVariable (sn);
+
+ lbag.AddLocation ($$, GetLocation ($4));
}
;
$$ = new Linq.Join (block, sn, (Expression)$6, outer_selector, (Linq.QueryBlock) current_block, GetLocation ($1)) {
IdentifierType = (FullNamedExpression)$2
};
+ lbag.AddLocation ($$, GetLocation ($3), GetLocation ($6), GetLocation ($9));
} else {
//
// Set equals right side parent to beginning of linq query, it is not accessible therefore cannot cause name collisions
mods |= Modifiers.UNSAFE;
current_local_parameters = pars;
- Method method = new Method (
+ var method = new InteractiveMethod (
current_type,
new TypeExpression (compiler.BuiltinTypes.Void, Location.Null),
mods,
- new MemberName ("Host"),
- pars,
- null /* attributes */);
+ pars);
current_type.AddMember (method);
-
oob_stack.Push (method);
+
+ interactive_async = false;
+
++lexer.parsing_block;
start_block (lexer.Location);
}
interactive_statement_list opt_COMPLETE_COMPLETION
{
--lexer.parsing_block;
- Method method = (Method) oob_stack.Pop ();
-
+ var method = (InteractiveMethod) oob_stack.Pop ();
method.Block = (ToplevelBlock) end_block(lexer.Location);
+ if (interactive_async == true) {
+ method.ChangeToAsync ();
+ }
+
InteractiveResult = (Class) pop_current_class ();
current_local_parameters = null;
}
// will contain types only but it can have numerous values for members
// like methods where both return type and all parameters are checked
//
- public List<TypeSpec> GetMissingDependencies ()
+ public List<MissingTypeSpecReference> GetMissingDependencies ()
+ {
+ return GetMissingDependencies (this);
+ }
+
+ public List<MissingTypeSpecReference> GetMissingDependencies (MemberSpec caller)
{
if ((state & (StateFlags.MissingDependency | StateFlags.MissingDependency_Undetected)) == 0)
return null;
state &= ~StateFlags.MissingDependency_Undetected;
var imported = definition as ImportedDefinition;
- List<TypeSpec> missing;
+ List<MissingTypeSpecReference> missing;
if (imported != null) {
- missing = ResolveMissingDependencies ();
+ missing = ResolveMissingDependencies (caller);
} else if (this is ElementTypeSpec) {
- missing = ((ElementTypeSpec) this).Element.GetMissingDependencies ();
+ missing = ((ElementTypeSpec) this).Element.GetMissingDependencies (caller);
} else {
missing = null;
}
return missing;
}
- public abstract List<TypeSpec> ResolveMissingDependencies ();
+ public abstract List<MissingTypeSpecReference> ResolveMissingDependencies (MemberSpec caller);
protected virtual bool IsNotCLSCompliant (out bool attrValue)
{
var ctype = ctx.CurrentType;
if (ma == Modifiers.PRIVATE) {
- if (ctype == null)
+ if (ctype == null || parentType == null)
return false;
//
// It's only accessible to the current class or children
return false;
}
- TypeManager.CheckTypeVariance (ret_type, Variance.Covariant, this);
+ VarianceDecl.CheckTypeVariance (ret_type, Variance.Covariant, this);
var resolved_rt = new TypeExpression (ret_type, Location);
InvokeBuilder = new Method (this, resolved_rt, MethodModifiers, new MemberName (InvokeMethodName), p, null);
//
var call = new CallEmitter ();
call.InstanceExpression = InstanceExpr;
- call.EmitPredefined (ec, method, arguments);
+ call.EmitPredefined (ec, method, arguments, loc);
}
public override void EmitStatement (EmitContext ec)
/// </remarks>
public Expression Resolve (ResolveContext ec, ResolveFlags flags)
{
- if (eclass != ExprClass.Unresolved)
+ if (eclass != ExprClass.Unresolved) {
+ if ((flags & ExprClassToResolveFlags) == 0) {
+ Error_UnexpectedKind (ec, flags, loc);
+ return null;
+ }
+
return this;
+ }
Expression e;
try {
return e;
} catch (Exception ex) {
- if (loc.IsNull || ec.Module.Compiler.Settings.DebugFlags > 0 || ex is CompletionResult || ec.Report.IsDisabled || ex is FatalException)
+ if (loc.IsNull || ec.Module.Compiler.Settings.DebugFlags > 0 || ex is CompletionResult || ec.Report.IsDisabled || ex is FatalException ||
+ ec.Report.Printer is NullReportPrinter)
throw;
ec.Report.Error (584, loc, "Internal compiler error: {0}", ex.Message);
}
if ((restrictions & MemberLookupRestrictions.InvocableOnly) != 0) {
- if (member is MethodSpec)
+ if (member is MethodSpec) {
+ //
+ // Interface members that are hidden by class members are removed from the set. This
+ // step only has an effect if T is a type parameter and T has both an effective base
+ // class other than object and a non-empty effective interface set
+ //
+ var tps = queried_type as TypeParameterSpec;
+ if (tps != null && tps.HasTypeConstraint)
+ members = RemoveHiddenTypeParameterMethods (members);
+
return new MethodGroupExpr (members, queried_type, loc);
+ }
if (!Invocation.IsMemberInvocable (member))
continue;
return null;
}
+ static IList<MemberSpec> RemoveHiddenTypeParameterMethods (IList<MemberSpec> members)
+ {
+ if (members.Count < 2)
+ return members;
+
+ //
+ // If M is a method, then all non-method members declared in an interface declaration
+ // are removed from the set, and all methods with the same signature as M declared in
+ // an interface declaration are removed from the set
+ //
+
+ bool copied = false;
+ for (int i = 0; i < members.Count; ++i) {
+ var method = members[i] as MethodSpec;
+ if (method == null) {
+ if (!copied) {
+ copied = true;
+ members = new List<MemberSpec> (members);
+ }
+
+ members.RemoveAt (i--);
+ continue;
+ }
+
+ if (!method.DeclaringType.IsInterface)
+ continue;
+
+ for (int ii = 0; ii < members.Count; ++ii) {
+ var candidate = members[ii] as MethodSpec;
+ if (candidate == null || !candidate.DeclaringType.IsClass)
+ continue;
+
+ if (!TypeSpecComparer.Override.IsEqual (candidate.Parameters, method.Parameters))
+ continue;
+
+ if (!copied) {
+ copied = true;
+ members = new List<MemberSpec> (members);
+ }
+
+ members.RemoveAt (i--);
+ break;
+ }
+ }
+
+ return members;
+ }
+
protected virtual void Error_NegativeArrayIndex (ResolveContext ec, Location loc)
{
throw new NotImplementedException ();
protected override Expression DoResolve (ResolveContext rc)
{
- var e = SimpleNameResolve (rc, null, false);
+ var e = SimpleNameResolve (rc, null);
var fe = e as FieldExpr;
if (fe != null) {
public override Expression DoResolveLValue (ResolveContext ec, Expression right_side)
{
- return SimpleNameResolve (ec, right_side, false);
+ return SimpleNameResolve (ec, right_side);
}
protected virtual void Error_TypeOrNamespaceNotFound (IMemberContext ctx)
}
if (e is TypeExpr) {
- e.Error_UnexpectedKind (rc, e, "variable", e.ExprClassName, loc);
+ // TypeExpression does not have correct location
+ if (e is TypeExpression)
+ e = new TypeExpression (e.Type, loc);
+
return e;
}
}
}
}
- Expression SimpleNameResolve (ResolveContext ec, Expression right_side, bool intermediate)
+ Expression SimpleNameResolve (ResolveContext ec, Expression right_side)
{
Expression e = LookupNameExpression (ec, right_side == null ? MemberLookupRestrictions.ReadAccess : MemberLookupRestrictions.None);
if (e == null)
return null;
- if (right_side != null) {
- if (e is FullNamedExpression && e.eclass != ExprClass.Unresolved) {
- e.Error_UnexpectedKind (ec, e, "variable", e.ExprClassName, loc);
- return null;
- }
+ if (e is FullNamedExpression && e.eclass != ExprClass.Unresolved) {
+ e.Error_UnexpectedKind (ec, e, "variable", e.ExprClassName, loc);
+ return e;
+ }
+ if (right_side != null) {
e = e.ResolveLValue (ec, right_side);
} else {
e = e.Resolve (ec);
InstanceExpression = ProbeIdenticalTypeName (ec, InstanceExpression, simple_name);
}
- InstanceExpression.Resolve (ec);
+ InstanceExpression.Resolve (ec, ResolveFlags.VariableOrValue | ResolveFlags.MethodGroup | ResolveFlags.Type);
}
}
//
public virtual MethodGroupExpr LookupExtensionMethod (ResolveContext rc)
{
- if (InstanceExpression == null)
+ if (InstanceExpression == null || InstanceExpression.eclass == ExprClass.Type)
return null;
InstanceExpression = InstanceExpression.Resolve (rc);
arg_moved = true;
}
+ if (arguments == orig_args) {
+ arguments = new Arguments (orig_args.Count);
+ arguments.AddRange (orig_args);
+ }
+
arguments[index] = arguments[i];
arguments[i] = temp;
Location.Initialize (ctx.SourceFiles);
}
+ /// <summary>
+ /// When set evaluator will automatically wait on Task of async methods. When not
+ /// set it's called responsibility to handle Task execution
+ /// </summary>
+ public bool WaitOnTask { get; set; }
+
/// <summary>
/// If true, turns type expressions into valid expressions
/// and calls the describe method on it
throw new ArgumentException ("Syntax error on input: partial input");
if (result_set == false)
- throw new ArgumentException ("The expression did not set a result");
+ throw new ArgumentException ("The expression failed to resolve");
return result;
}
host.SetBaseTypes (baseclass_list);
- host.CreateContainer ();
- host.DefineContainer ();
- host.Define ();
-
expression_method = (Method) host.Members[0];
+
+ if ((expression_method.ModFlags & Modifiers.ASYNC) != 0) {
+ //
+ // Host method is async. When WaitOnTask is set we wrap it with wait
+ //
+ // void AsyncWait (ref object $retval) {
+ // $retval = Host();
+ // ((Task)$retval).Wait(); // When WaitOnTask is set
+ // }
+ //
+ var p = new ParametersCompiled (
+ new Parameter (new TypeExpression (module.Compiler.BuiltinTypes.Object, Location.Null), "$retval", Parameter.Modifier.REF, null, Location.Null)
+ );
+
+ var method = new Method(host, new TypeExpression(module.Compiler.BuiltinTypes.Void, Location.Null),
+ Modifiers.PUBLIC | Modifiers.STATIC, new MemberName("AsyncWait"), p, null);
+
+ method.Block = new ToplevelBlock(method.Compiler, p, Location.Null);
+ method.Block.AddStatement(new StatementExpression (new SimpleAssign(
+ new SimpleName(p [0].Name, Location.Null),
+ new Invocation(new SimpleName(expression_method.MemberName.Name, Location.Null), new Arguments(0)),
+ Location.Null), Location.Null));
+
+ if (WaitOnTask) {
+ var task = new Cast (expression_method.TypeExpression, new SimpleName (p [0].Name, Location.Null), Location.Null);
+
+ method.Block.AddStatement (new StatementExpression (new Invocation (
+ new MemberAccess (task, "Wait", Location.Null),
+ new Arguments (0)), Location.Null));
+ }
+
+ host.AddMember(method);
+
+ expression_method = method;
+ }
+
+ host.CreateContainer();
+ host.DefineContainer();
+ host.Define();
+
} else {
expression_method = null;
}
#endif
}
+ class InteractiveMethod : Method
+ {
+ public InteractiveMethod(TypeDefinition parent, FullNamedExpression returnType, Modifiers mod, ParametersCompiled parameters)
+ : base(parent, returnType, mod, new MemberName("Host"), parameters, null)
+ {
+ }
+
+ public void ChangeToAsync ()
+ {
+ ModFlags |= Modifiers.ASYNC;
+ ModFlags &= ~Modifiers.UNSAFE;
+ type_expr = new TypeExpression(Module.PredefinedTypes.Task.TypeSpec, Location);
+ parameters = ParametersCompiled.EmptyReadOnlyParameters;
+ }
+
+ public override string GetSignatureForError()
+ {
+ return "InteractiveHost";
+ }
+ }
+
class HoistedEvaluatorVariable : HoistedVariable
{
public HoistedEvaluatorVariable (Field field)
/// the return value for an invocation.
/// </summary>
class OptionalAssign : SimpleAssign {
- public OptionalAssign (Expression t, Expression s, Location loc)
- : base (t, s, loc)
+ public OptionalAssign (Expression s, Location loc)
+ : base (null, s, loc)
{
}
+ public override Location StartLocation {
+ get {
+ return Location.Null;
+ }
+ }
+
protected override Expression DoResolve (ResolveContext ec)
{
Expression clone = source.Clone (new CloneContext ());
// A useful feature for the REPL: if we can resolve the expression
// as a type, Describe the type;
//
- if (ec.Module.Evaluator.DescribeTypeExpressions){
+ if (ec.Module.Evaluator.DescribeTypeExpressions && !(ec.CurrentAnonymousMethod is AsyncInitializer)) {
var old_printer = ec.Report.SetPrinter (new SessionReportPrinter ());
Expression tclone;
try {
}
source = clone;
+
+ var host = (Method) ec.MemberContext.CurrentMemberDefinition;
+
+ if (host.ParameterInfo.IsEmpty) {
+ eclass = ExprClass.Value;
+ type = InternalType.FakeInternalType;
+ return this;
+ }
+
+ target = new SimpleName (host.ParameterInfo[0].Name, Location);
+
return base.DoResolve (ec);
}
+
+ public override void EmitStatement(EmitContext ec)
+ {
+ if (target == null) {
+ source.Emit (ec);
+ return;
+ }
+
+ base.EmitStatement(ec);
+ }
}
public class Undo
public override void Emit (EmitContext ec)
{
var call = new CallEmitter ();
- call.EmitPredefined (ec, oper, arguments);
+ call.EmitPredefined (ec, oper, arguments, loc);
}
public override SLE.Expression MakeExpression (BuilderContext ctx)
return this;
}
- ec.Report.Error (39, loc, "Cannot convert type `{0}' to `{1}' via a built-in conversion",
- etype.GetSignatureForError (), type.GetSignatureForError ());
+ if (etype != InternalType.ErrorType) {
+ ec.Report.Error (39, loc, "Cannot convert type `{0}' to `{1}' via a built-in conversion",
+ etype.GetSignatureForError (), type.GetSignatureForError ());
+ }
return null;
}
if (right_expr.IsNull) {
if ((b.oper & Operator.EqualityMask) != 0) {
- if (!left_expr.Type.IsNullableType && left_expr.Type == left_unwrap)
- return b.CreateLiftedValueTypeResult (rc, left_unwrap);
+ if (!left_expr.Type.IsNullableType && BuiltinTypeSpec.IsPrimitiveType (left_expr.Type))
+ return b.CreateLiftedValueTypeResult (rc, left_expr.Type);
} else if ((b.oper & Operator.BitwiseMask) != 0) {
if (left_unwrap.BuiltinType != BuiltinTypeSpec.Type.Bool)
return Nullable.LiftedNull.CreateFromExpression (rc, b);
}
} else if (left_expr.IsNull) {
if ((b.oper & Operator.EqualityMask) != 0) {
- if (!right_expr.Type.IsNullableType && right_expr.Type == right_unwrap)
- return b.CreateLiftedValueTypeResult (rc, right_unwrap);
+ if (!right_expr.Type.IsNullableType && BuiltinTypeSpec.IsPrimitiveType (right_expr.Type))
+ return b.CreateLiftedValueTypeResult (rc, right_expr.Type);
} else if ((b.oper & Operator.BitwiseMask) != 0) {
if (right_unwrap.BuiltinType != BuiltinTypeSpec.Type.Bool)
return Nullable.LiftedNull.CreateFromExpression (rc, b);
if (l.IsPointer || r.IsPointer)
return ResolveOperatorPointer (rc, l, r);
+ // User operators
+ expr = ResolveUserOperator (rc, left, right);
+ if (expr != null)
+ return expr;
+
+
bool lenum = l.IsEnum;
bool renum = r.IsEnum;
if ((oper & (Operator.ComparisonMask | Operator.BitwiseMask)) != 0) {
return expr;
}
}
-
- // User operators
- expr = ResolveUserOperator (rc, left, right);
- if (expr != null)
- return expr;
}
//
Nullable.NullableInfo.GetEnumUnderlyingType (rc.Module, left.Type) :
EnumSpec.GetUnderlyingType (left.Type);
}
- } else if (IsEnumOrNullableEnum (left.Type)) {
- result_type = left.Type;
} else {
- result_type = right.Type;
+ if (IsEnumOrNullableEnum (left.Type)) {
+ result_type = left.Type;
+ } else {
+ result_type = right.Type;
+ }
+
+ if (expr is Nullable.LiftedBinaryOperator && !result_type.IsNullableType)
+ result_type = rc.Module.PredefinedTypes.Nullable.TypeSpec.MakeGenericType (rc.Module, new[] { result_type });
}
return EmptyCast.Create (expr, result_type);
//
// Now try lifted version of predefined operators
//
- result = ResolveOperatorPredefined (ec, ec.Module.OperatorsBinaryEqualityLifted, no_arg_conv);
- if (result != null)
- return result;
+ if (no_arg_conv && !l.IsNullableType) {
+ //
+ // Optimizes cases which won't match
+ //
+ } else {
+ result = ResolveOperatorPredefined (ec, ec.Module.OperatorsBinaryEqualityLifted, no_arg_conv);
+ if (result != null)
+ return result;
+ }
//
// The == and != operators permit one operand to be a value of a nullable
/// </remarks>
public override void EmitBranchable (EmitContext ec, Label target, bool on_true)
{
+ if (ec.HasSet (BuilderContext.Options.AsyncBody) && right.ContainsEmitWithAwait ()) {
+ left = left.EmitToField (ec);
+
+ if ((oper & Operator.LogicalMask) == 0) {
+ right = right.EmitToField (ec);
+ }
+ }
+
//
// This is more complicated than it looks, but its just to avoid
// duplicated tests: basically, we allow ==, !=, >, <, >= and <=
if (member_expr != null)
member_expr = member_expr.Resolve (ec);
} else {
- member_expr = expr.Resolve (ec, ResolveFlags.VariableOrValue | ResolveFlags.MethodGroup);
+ member_expr = expr.Resolve (ec);
}
if (member_expr == null)
}
if (vr != null) {
+ ec.MarkCallEntry (loc);
ec.Emit (OpCodes.Call, method);
return false;
}
}
if (type is TypeParameterSpec)
- return DoEmitTypeParameter (ec);
+ return DoEmitTypeParameter (ec);
+ ec.MarkCallEntry (loc);
ec.Emit (OpCodes.Newobj, method);
return true;
}
e = e.ResolveLValue (rc, right_side);
} else {
- e = e.Resolve (rc, ResolveFlags.VariableOrValue | ResolveFlags.Type);
+ e = e.Resolve (rc, ResolveFlags.VariableOrValue | ResolveFlags.Type | ResolveFlags.MethodGroup);
}
return e;
public override void Emit (EmitContext ec)
{
source.Emit (ec);
+ ec.MarkCallEntry (loc);
ec.Emit (OpCodes.Call, method);
}
this.loc = loc;
}
+ public CollectionElementInitializer (Location loc)
+ : base (null, null)
+ {
+ this.loc = loc;
+ }
+
public override Expression CreateExpressionTree (ResolveContext ec)
{
Arguments args = new Arguments (2);
return fs;
}
- public override List<TypeSpec> ResolveMissingDependencies ()
+ public override List<MissingTypeSpecReference> ResolveMissingDependencies (MemberSpec caller)
{
- return memberType.ResolveMissingDependencies ();
+ return memberType.ResolveMissingDependencies (this);
}
}
}
}
- public class FlowBranchingAsync : FlowBranchingBlock
+ public class FlowBranchingAsync : FlowBranchingBlock
{
readonly AsyncInitializer async_init;
#endif
namespace Mono.CSharp {
+ public class VarianceDecl
+ {
+ public VarianceDecl (Variance variance, Location loc)
+ {
+ this.Variance = variance;
+ this.Location = loc;
+ }
+
+ public Variance Variance { get; private set; }
+ public Location Location { get; private set; }
+
+ public static Variance CheckTypeVariance (TypeSpec t, Variance expected, IMemberContext member)
+ {
+ var tp = t as TypeParameterSpec;
+ if (tp != null) {
+ var v = tp.Variance;
+ if (expected == Variance.None && v != expected ||
+ expected == Variance.Covariant && v == Variance.Contravariant ||
+ expected == Variance.Contravariant && v == Variance.Covariant) {
+ ((TypeParameter) tp.MemberDefinition).ErrorInvalidVariance (member, expected);
+ }
+
+ return expected;
+ }
+
+ if (t.TypeArguments.Length > 0) {
+ var targs_definition = t.MemberDefinition.TypeParameters;
+ TypeSpec[] targs = TypeManager.GetTypeArguments (t);
+ for (int i = 0; i < targs.Length; ++i) {
+ var v = targs_definition[i].Variance;
+ CheckTypeVariance (targs[i], (Variance) ((int) v * (int) expected), member);
+ }
+
+ return expected;
+ }
+
+ var ac = t as ArrayContainer;
+ if (ac != null)
+ return CheckTypeVariance (ac.Element, expected, member);
+
+ return Variance.None;
+ }
+ }
+
public enum Variance
{
//
// is valid with respect to T
//
if (tp.IsMethodTypeParameter) {
- TypeManager.CheckTypeVariance (type, Variance.Contravariant, context);
+ VarianceDecl.CheckTypeVariance (type, Variance.Contravariant, context);
}
var tp_def = constraint_tp.MemberDefinition as TypeParameter;
GenericTypeParameterBuilder builder;
readonly TypeParameterSpec spec;
- public TypeParameter (int index, MemberName name, Constraints constraints, Attributes attrs, Variance variance)
+ public TypeParameter (int index, MemberName name, Constraints constraints, Attributes attrs, Variance Variance)
: base (null, name, attrs)
{
this.constraints = constraints;
- this.spec = new TypeParameterSpec (null, index, this, SpecialConstraint.None, variance, null);
+ this.spec = new TypeParameterSpec (null, index, this, SpecialConstraint.None, Variance, null);
}
//
// Used by parser
//
- public TypeParameter (MemberName name, Attributes attrs, Variance variance)
+ public TypeParameter (MemberName name, Attributes attrs, VarianceDecl variance)
: base (null, name, attrs)
{
- this.spec = new TypeParameterSpec (null, -1, this, SpecialConstraint.None, variance, null);
+ var var = variance == null ? Variance.None : variance.Variance;
+ this.spec = new TypeParameterSpec (null, -1, this, SpecialConstraint.None, var, null);
+ this.VarianceDecl = variance;
}
public TypeParameter (TypeParameterSpec spec, TypeSpec parentSpec, MemberName name, Attributes attrs)
}
}
+ public VarianceDecl VarianceDecl { get; private set; }
+
#endregion
//
// Copy constraint from resolved part to partial container
spec.SpecialConstraint = tp.spec.SpecialConstraint;
- spec.Interfaces = tp.spec.Interfaces;
+ spec.InterfacesDefined = tp.spec.InterfacesDefined;
spec.TypeArguments = tp.spec.TypeArguments;
spec.BaseType = tp.spec.BaseType;
//
// Check the interfaces constraints
//
- if (tparam.Interfaces != null) {
- foreach (TypeSpec iface in tparam.Interfaces) {
+ if (tparam.InterfacesDefined != null) {
+ foreach (TypeSpec iface in tparam.InterfacesDefined) {
if (!CheckConversion (mc, context, atype, tparam, iface, loc)) {
if (mc == null)
return false;
}
}
- public partial class TypeManager
- {
- public static Variance CheckTypeVariance (TypeSpec t, Variance expected, IMemberContext member)
- {
- var tp = t as TypeParameterSpec;
- if (tp != null) {
- Variance v = tp.Variance;
- if (expected == Variance.None && v != expected ||
- expected == Variance.Covariant && v == Variance.Contravariant ||
- expected == Variance.Contravariant && v == Variance.Covariant) {
- ((TypeParameter)tp.MemberDefinition).ErrorInvalidVariance (member, expected);
- }
-
- return expected;
- }
-
- if (t.TypeArguments.Length > 0) {
- var targs_definition = t.MemberDefinition.TypeParameters;
- TypeSpec[] targs = GetTypeArguments (t);
- for (int i = 0; i < targs.Length; ++i) {
- Variance v = targs_definition[i].Variance;
- CheckTypeVariance (targs[i], (Variance) ((int)v * (int)expected), member);
- }
-
- return expected;
- }
-
- if (t.IsArray)
- return CheckTypeVariance (GetElementType (t), expected, member);
-
- return Variance.None;
- }
- }
-
//
// Implements C# type inference
//
// IFoo<A<T>> foo; // A<T> is definition in this case
// }
//
- // TODO: Is full logic from CreateType needed here as well?
- //
if (!IsMissingType (type) && type.IsGenericTypeDefinition) {
- var targs = CreateGenericArguments (0, type.GetGenericArguments (), dtype);
+ var start_pos = spec.DeclaringType == null ? 0 : spec.DeclaringType.MemberDefinition.TypeParametersCount;
+ var targs = CreateGenericArguments (start_pos, type.GetGenericArguments (), dtype);
spec = spec.MakeGenericType (module, targs);
}
}
for (int i = nested_hierarchy.Count; i != 0; --i) {
var t = nested_hierarchy [i - 1];
- spec = MemberCache.FindNestedType (spec, t.Name, t.Arity);
+ if (t.Kind == MemberKind.MissingType)
+ spec = t;
+ else
+ spec = MemberCache.FindNestedType (spec, t.Name, t.Arity);
+
if (t.Arity > 0) {
spec = spec.MakeGenericType (module, targs.Skip (targs_pos).Take (spec.Arity).ToArray ());
targs_pos += t.Arity;
}
}
- string name = type.Name;
- int index = name.IndexOf ('`');
- if (index > 0)
- name = name.Substring (0, index);
+ if (spec.Kind == MemberKind.MissingType) {
+ spec = new TypeSpec (MemberKind.MissingType, spec, new ImportedTypeDefinition (type_def, this), type_def, Modifiers.PUBLIC);
+ spec.MemberCache = MemberCache.Empty;
+ } else {
+ if ((type_def.Attributes & TypeAttributes.VisibilityMask) == TypeAttributes.NestedPrivate && IgnorePrivateMembers)
+ return null;
- spec = MemberCache.FindNestedType (spec, name, targs.Length - targs_pos);
- if (spec == null)
- return null;
+ string name = type.Name;
+ int index = name.IndexOf ('`');
+ if (index > 0)
+ name = name.Substring (0, index);
- if (spec.Arity > 0) {
- spec = spec.MakeGenericType (module, targs.Skip (targs_pos).ToArray ());
+ spec = MemberCache.FindNestedType (spec, name, targs.Length - targs_pos);
+
+ if (spec.Arity > 0) {
+ spec = spec.MakeGenericType (module, targs.Skip (targs_pos).ToArray ());
+ }
}
}
}
- public static void Error_MissingDependency (IMemberContext ctx, List<TypeSpec> types, Location loc)
+ public static void Error_MissingDependency (IMemberContext ctx, List<MissingTypeSpecReference> missing, Location loc)
{
//
// Report details about missing type and most likely cause of the problem.
var report = ctx.Module.Compiler.Report;
- for (int i = 0; i < types.Count; ++i) {
- var t = types [i];
+ for (int i = 0; i < missing.Count; ++i) {
+ var t = missing [i].Type;
//
// Report missing types only once
string name = t.GetSignatureForError ();
+ var caller = missing[i].Caller;
+ if (caller.Kind != MemberKind.MissingType)
+ report.SymbolRelatedToPreviousError (caller);
+
if (t.MemberDefinition.DeclaringAssembly == ctx.Module.DeclaringAssembly) {
report.Error (1683, loc,
"Reference to type `{0}' claims it is defined in this assembly, but it is not defined in source or any added modules",
if (get == null && set == null)
continue;
- imported = importer.CreateProperty (p, declaringType, get, set);
+ try {
+ imported = importer.CreateProperty (p, declaringType, get, set);
+ } catch (Exception ex) {
+ throw new InternalErrorException (ex, "Could not import property `{0}' inside `{1}'",
+ p.Name, declaringType.GetSignatureForError ());
+ }
+
if (imported == null)
continue;
return ms;
}
- public override List<TypeSpec> ResolveMissingDependencies ()
+ public override List<MissingTypeSpecReference> ResolveMissingDependencies (MemberSpec caller)
{
- var missing = returnType.ResolveMissingDependencies ();
+ var missing = returnType.ResolveMissingDependencies (this);
foreach (var pt in parameters.Types) {
- var m = pt.GetMissingDependencies ();
+ var m = pt.GetMissingDependencies (this);
if (m == null)
continue;
if (missing == null)
- missing = new List<TypeSpec> ();
+ missing = new List<MissingTypeSpecReference> ();
missing.AddRange (m);
}
if (Arity > 0) {
foreach (var tp in GenericDefinition.TypeParameters) {
- var m = tp.GetMissingDependencies ();
+ var m = tp.GetMissingDependencies (this);
if (m == null)
continue;
if (missing == null)
- missing = new List<TypeSpec> ();
+ missing = new List<MissingTypeSpecReference> ();
missing.AddRange (m);
}
public override void AddTypeContainer (TypeContainer tc)
{
- containers.Add (tc);
+ AddTypeContainerMember (tc);
}
public override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)
return Compiler.Settings.IsConditionalSymbolDefined (value);
}
+
+ public override void Accept (StructuralVisitor visitor)
+ {
+ visitor.Visit (this);
+ }
}
MemberCore mc;
if (names_container.DefinedNames.TryGetValue (name, out mc)) {
if (tc is NamespaceContainer && mc is NamespaceContainer) {
- containers.Add (tc);
+ AddTypeContainerMember (tc);
return;
}
public override void GetCompletionStartingWith (string prefix, List<string> results)
{
+ if (Usings == null)
+ return;
+
foreach (var un in Usings) {
if (un.Alias != null)
continue;
if (aliases != null && arity == 0) {
UsingAliasNamespace uan;
if (aliases.TryGetValue (name, out uan)) {
- if (fne != null) {
+ if (fne != null && mode != LookupMode.Probing) {
// TODO: Namespace has broken location
//Report.SymbolRelatedToPreviousError (fne.Location, null);
Compiler.Report.SymbolRelatedToPreviousError (uan.Location, null);
return false;
}
+
+ public override void Accept (StructuralVisitor visitor)
+ {
+ visitor.Visit (this);
+ }
}
public class UsingNamespace
return null;
}
- TypeManager.CheckTypeVariance (parameter_type,
+ VarianceDecl.CheckTypeVariance (parameter_type,
(modFlags & Parameter.Modifier.RefOutMask) != 0 ? Variance.None : Variance.Contravariant,
rc);
return ps;
}
- public override List<TypeSpec> ResolveMissingDependencies ()
+ public override List<MissingTypeSpecReference> ResolveMissingDependencies (MemberSpec caller)
{
- return memberType.ResolveMissingDependencies ();
+ return memberType.ResolveMissingDependencies (this);
}
}
}
}
+ static readonly string[] attribute_target_auto = new string[] { "property", "field" };
+
+ Field backing_field;
+
public Property (TypeDefinition parent, FullNamedExpression type, Modifiers mod,
MemberName name, Attributes attrs)
: base (parent, type, mod,
{
visitor.Visit (this);
}
-
+
+ public override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)
+ {
+ if (a.Target == AttributeTargets.Field) {
+ backing_field.ApplyAttributeBuilder (a, ctor, cdata, pa);
+ return;
+ }
+
+ base.ApplyAttributeBuilder (a, ctor, cdata, pa);
+ }
void CreateAutomaticProperty ()
{
// Create backing field
- Field field = new BackingField (this);
- if (!field.Define ())
+ backing_field = new BackingField (this);
+ if (!backing_field.Define ())
return;
- Parent.PartialContainer.Members.Add (field);
+ Parent.PartialContainer.Members.Add (backing_field);
- FieldExpr fe = new FieldExpr (field, Location);
- if ((field.ModFlags & Modifiers.STATIC) == 0)
+ FieldExpr fe = new FieldExpr (backing_field, Location);
+ if ((backing_field.ModFlags & Modifiers.STATIC) == 0)
fe.InstanceExpression = new CompilerGeneratedThis (Parent.CurrentType, Location);
//
base.Emit ();
}
+
+ public override string[] ValidAttributeTargets {
+ get {
+ return Get != null && ((Get.ModFlags & Modifiers.COMPILER_GENERATED) != 0) ?
+ attribute_target_auto : base.ValidAttributeTargets;
+ }
+ }
}
/// <summary>
return es;
}
- public override List<TypeSpec> ResolveMissingDependencies ()
+ public override List<MissingTypeSpecReference> ResolveMissingDependencies (MemberSpec caller)
{
- return MemberType.ResolveMissingDependencies ();
+ return MemberType.ResolveMissingDependencies (this);
}
}
return spec;
}
- public override List<TypeSpec> ResolveMissingDependencies ()
+ public override List<MissingTypeSpecReference> ResolveMissingDependencies (MemberSpec caller)
{
- var missing = base.ResolveMissingDependencies ();
+ var missing = base.ResolveMissingDependencies (caller);
+
foreach (var pt in parameters.Types) {
- var m = pt.GetMissingDependencies ();
+ var m = pt.GetMissingDependencies (caller);
if (m == null)
continue;
if (missing == null)
- missing = new List<TypeSpec> ();
+ missing = new List<MissingTypeSpecReference> ();
missing.AddRange (m);
}
public bool ProcessWarningsList (string text, Action<int> action)
{
bool valid = true;
- foreach (string wid in text.Split (numeric_value_separator)) {
+ foreach (string wid in text.Split (numeric_value_separator, StringSplitOptions.RemoveEmptyEntries)) {
int id;
if (!int.TryParse (wid, NumberStyles.AllowLeadingWhite, CultureInfo.InvariantCulture, out id)) {
report.Error (1904, "`{0}' is not a valid warning number", wid);
public class StatementErrorExpression : Statement
{
- readonly Expression expr;
+ Expression expr;
public StatementErrorExpression (Expression expr)
{
protected override void CloneTo (CloneContext clonectx, Statement target)
{
- throw new NotImplementedException ();
+ var t = (StatementErrorExpression) target;
+
+ t.expr = expr.Clone (clonectx);
}
public override object Accept (StructuralVisitor visitor)
unreachable = top_level.End ();
}
} catch (Exception e) {
- if (e is CompletionResult || rc.Report.IsDisabled || e is FatalException)
+ if (e is CompletionResult || rc.Report.IsDisabled || e is FatalException || rc.Report.Printer is NullReportPrinter)
throw;
if (rc.CurrentBlock != null) {
}
}
}
+
+ struct TypeNameParser
+ {
+ internal static string Escape(string name)
+ {
+ if (name == null) {
+ return null;
+ }
+ StringBuilder sb = null;
+ for (int pos = 0; pos < name.Length; pos++) {
+ char c = name[pos];
+ switch (c) {
+ case '\\':
+ case '+':
+ case ',':
+ case '[':
+ case ']':
+ case '*':
+ case '&':
+ if (sb == null) {
+ sb = new StringBuilder(name, 0, pos, name.Length + 3);
+ }
+ sb.Append("\\").Append(c);
+ break;
+ default:
+ if (sb != null) {
+ sb.Append(c);
+ }
+ break;
+ }
+ }
+ return sb != null ? sb.ToString() : name;
+ }
+ }
}
return this;
}
- public override List<TypeSpec> ResolveMissingDependencies ()
+ public override List<MissingTypeSpecReference> ResolveMissingDependencies (MemberSpec caller)
{
- List<TypeSpec> missing = null;
+ List<MissingTypeSpecReference> missing = null;
if (Kind == MemberKind.MissingType) {
- missing = new List<TypeSpec> ();
- missing.Add (this);
+ missing = new List<MissingTypeSpecReference> ();
+ missing.Add (new MissingTypeSpecReference (this, caller));
return missing;
}
foreach (var targ in TypeArguments) {
if (targ.Kind == MemberKind.MissingType) {
if (missing == null)
- missing = new List<TypeSpec> ();
+ missing = new List<MissingTypeSpecReference> ();
- missing.Add (targ);
+ missing.Add (new MissingTypeSpecReference (targ, caller));
}
}
foreach (var iface in Interfaces) {
if (iface.Kind == MemberKind.MissingType) {
if (missing == null)
- missing = new List<TypeSpec> ();
+ missing = new List<MissingTypeSpecReference> ();
- missing.Add (iface);
+ missing.Add (new MissingTypeSpecReference (iface, caller));
}
}
}
if (MemberDefinition.TypeParametersCount > 0) {
foreach (var tp in MemberDefinition.TypeParameters) {
- var tp_missing = tp.GetMissingDependencies ();
+ var tp_missing = tp.GetMissingDependencies (this);
if (tp_missing != null) {
if (missing == null)
- missing = new List<TypeSpec> ();
+ missing = new List<MissingTypeSpecReference> ();
missing.AddRange (tp_missing);
}
if (missing != null || BaseType == null)
return missing;
- return BaseType.ResolveMissingDependencies ();
+ return BaseType.ResolveMissingDependencies (this);
}
public void SetMetaInfo (MetaType info)
{
modifiers |= Modifiers.METHOD_EXTENSION;
}
+
+ public void UpdateInflatedInstancesBaseType ()
+ {
+ //
+ // When nested class has a partial part the situation where parent type
+ // is inflated before its base type is defined can occur. In such case
+ // all inflated (should be only 1) instansted need to be updated
+ //
+ // partial class A<T> {
+ // partial class B : A<int> { }
+ // }
+ //
+ // partial class A<T> : X {}
+ //
+ if (inflated_instances == null)
+ return;
+
+ foreach (var inflated in inflated_instances) {
+ //
+ // Don't need to inflate possible generic type because for now the method
+ // is always used from within the nested type
+ //
+ inflated.Value.BaseType = base_type;
+ }
+ }
}
//
return pc;
}
}
+
+ public class MissingTypeSpecReference
+ {
+ public MissingTypeSpecReference (TypeSpec type, MemberSpec caller)
+ {
+ Type = type;
+ Caller = caller;
+ }
+
+ public TypeSpec Type { get; private set; }
+ public MemberSpec Caller { get; private set; }
+ }
}
VisitTypeContainer (ns);
}
+ public virtual void Visit (CompilationSourceFile csf)
+ {
+ VisitTypeContainer (csf);
+ }
+
public virtual void Visit (Class c)
{
VisitTypeContainer (c);
--- /dev/null
+using System;
+
+public class Z : IGenericInterface<Z>
+{
+ public Z Start ()
+ {
+ return this;
+ }
+
+ Z IGenericInterface<Z>.Start ()
+ {
+ throw new ApplicationException ();
+ }
+}
+
+public interface IGenericInterface<T>
+{
+ T Start ();
+}
+
+public class A<T> where T : Z, IGenericInterface<int>
+{
+ public void SomeOperation (T t)
+ {
+ t.Start ();
+ }
+}
+
+public class C : Z, IGenericInterface<int>
+{
+ int IGenericInterface<int>.Start ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ public static void Main ()
+ {
+ new A<C> ().SomeOperation (new C ());
+ }
+}
\ No newline at end of file
--- /dev/null
+using System;
+
+enum E
+{
+ V
+}
+
+class C
+{
+ public static void Main ()
+ {
+ byte? foo = 0;
+ E e = 0;
+ var res = foo - e;
+ Console.WriteLine (res);
+ var res2 = e - foo;
+ Console.WriteLine (res2);
+ res = null;
+ res2 = null;
+ }
+}
\ No newline at end of file
--- /dev/null
+// Compiler options: -target:library
+
+using System;
+
+namespace A
+{
+ public class B<T>
+ {
+ public abstract class C : System.IEquatable<C>
+ {
+ public abstract bool Equals (C other);
+ }
+ }
+}
--- /dev/null
+// Compiler options: -r:gtest-591-lib.dll
+
+using System;
+
+public class E
+{
+ public System.Collections.Generic.Dictionary<int, A.B<int>.C> F;
+ public static void Main ()
+ {
+ var e = new E ();
+ Console.WriteLine (e.F);
+ }
+}
--- /dev/null
+using System;
+using System.Reflection;
+
+class AAttribute : Attribute
+{
+}
+
+class Program
+{
+ [field: A]
+ public int Prop { get; set; }
+
+ public static int Main ()
+ {
+ var f = typeof (Program).GetFields (BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly);
+ if (f[0].GetCustomAttribute<AAttribute> () == null)
+ return 1;
+
+ return 0;
+ }
+}
+
Assert (1, e9.Compile ().Invoke (MyEnum.Value_2, MyEnum.Value_1));
}
- // CSC bug
void SubtractTest_10 ()
{
Expression<Func<MyEnum?, byte?, MyEnum?>> e10 = (a, b) => a - b;
--- /dev/null
+partial class A<T>
+{
+ internal partial class B : A<int>
+ {
+ public void Test ()
+ {
+ Foo (3);
+ }
+ }
+}
+
+partial class A<T> : X<T>
+{
+
+}
+
+class X<U>
+{
+ public void Foo (U arg)
+ {
+ }
+}
+
+class M
+{
+ public static void Main ()
+ {
+ new A<string>.B ().Test ();
+ }
+}
\ No newline at end of file
--- /dev/null
+namespace N
+{
+ public partial class A<T1, T2>
+ {
+ public partial class D
+ {
+ public class C : D
+ {
+ public void Test ()
+ {
+ Foo ();
+ }
+ }
+ }
+
+ public partial class D2<U>
+ {
+ public class C2 : D2<int>
+ {
+ public void Test ()
+ {
+ Foo (2);
+ }
+ }
+ }
+ }
+
+ public partial class A<T1, T2>
+ {
+ public partial class D : X
+ {
+ }
+
+ public partial class D2<U> : X2<U>
+ {
+ }
+ }
+
+ public class X2<W>
+ {
+ public void Foo (W arg)
+ {
+ }
+ }
+
+ public class X
+ {
+ public void Foo ()
+ {
+ }
+
+ public static void Main ()
+ {
+ new A<int, long>.D.C ().Test ();
+ new A<int, long>.D2<string>.C2 ().Test ();
+ }
+ }
+}
--- /dev/null
+namespace A
+{
+ public partial class B<T>
+ {
+ public partial class C
+ {
+ public class A { }
+ }
+ }
+}
+
+namespace A
+{
+ public abstract partial class B<T> where T : B<T>.C
+ {
+ }
+}
+
+namespace A
+{
+ public partial class B<T>
+ {
+ public partial class C : I
+ {
+ }
+ }
+}
+
+namespace A
+{
+ public interface Ibase
+ {
+ }
+
+ public partial class B<T>
+ {
+ public interface I : Ibase
+ {
+ }
+ }
+}
+
+namespace A
+{
+ class Bar : B<Bar>.C
+ {
+ }
+
+ public class Test
+ {
+ public static void Main ()
+ {
+ Ibase b = new Bar ();
+ System.Console.WriteLine (b != null);
+ }
+ }
+}
class C2
{
+ const object o2 = c2;
+ const string c2 = null;
+
public static void Main ()
{
- // BUG compatibility for now
- //const object o = null;
- //const string s = (string) o;
+ const object o = null;
+ const string s = (string) o;
}
}
--- /dev/null
+using System;
+
+public class C
+{
+ public static readonly C Token = new C ();
+
+ public static C operator & (C set, E value)
+ {
+ return Token;
+ }
+
+ public static implicit operator E (C c)
+ {
+ throw new ApplicationException ();
+ }
+}
+
+public enum E
+{
+ Item = 2
+}
+
+class FooClass
+{
+ public static int Main ()
+ {
+ C m = new C ();
+ var x = E.Item;
+ var res = m & x;
+ if (res != C.Token)
+ return 1;
+
+ res = m & E.Item;
+ if (res != C.Token)
+ return 2;
+
+ return 0;
+ }
+}
\ No newline at end of file
return 0;
}
+ async Task<bool> BinaryTest_6 ()
+ {
+ var t = Task.Delay (1);
+ if (t == await Task.WhenAny(new [] { t }))
+ return true;
+
+ return false;
+ }
+
async Task<int> CallTest_1 ()
{
return Call (
using System.Threading.Tasks;
// contextual async, parser tests
-
-class A
+class A : Iasync
{
async Task<int> async ()
{
var res = (int) await async ();
var res2 = (Int32) await async ();
}
+
+ async void Iasync.async ()
+ {
+ }
public static int Main ()
{
}
}
+interface Iasync
+{
+ void async ();
+}
+
class B
{
class async
<sequencepoints>
<entry il="0x0" row="4" col="2" file_ref="1" hidden="false" />
<entry il="0x1" row="5" col="3" file_ref="1" hidden="false" />
+ <entry il="0x2" row="5" col="3" file_ref="1" hidden="false" />
<entry il="0x7" row="6" col="2" file_ref="1" hidden="false" />
</sequencepoints>
<locals />
<method token="0x6000002">
<sequencepoints>
<entry il="0x0" row="12" col="2" file_ref="1" hidden="false" />
- <entry il="0x1" row="13" col="3" file_ref="1" hidden="false" />
+ <entry il="0x1" row="13" col="10" file_ref="1" hidden="false" />
<entry il="0x6" row="13" col="26" file_ref="1" hidden="false" />
<entry il="0x16" row="14" col="2" file_ref="1" hidden="false" />
</sequencepoints>
<entry il="0x1" row="25" col="10" file_ref="1" hidden="false" />
<entry il="0x9" row="26" col="3" file_ref="1" hidden="false" />
<entry il="0xa" row="27" col="3" file_ref="1" hidden="false" />
+ <entry il="0x18" row="25" col="14" file_ref="1" hidden="false" />
<entry il="0x1e" row="28" col="2" file_ref="1" hidden="false" />
</sequencepoints>
<locals>
<entry il="0x9" row="32" col="26" file_ref="1" hidden="false" />
<entry il="0x11" row="33" col="3" file_ref="1" hidden="false" />
<entry il="0x12" row="34" col="3" file_ref="1" hidden="false" />
+ <entry il="0x20" row="32" col="26" file_ref="1" hidden="false" />
+ <entry il="0x33" row="32" col="12" file_ref="1" hidden="false" />
<entry il="0x39" row="35" col="2" file_ref="1" hidden="false" />
</sequencepoints>
<locals>
<entry il="0x1" row="39" col="10" file_ref="1" hidden="false" />
<entry il="0x10" row="40" col="3" file_ref="1" hidden="false" />
<entry il="0x11" row="41" col="3" file_ref="1" hidden="false" />
+ <entry il="0x2e" row="39" col="13" file_ref="1" hidden="false" />
<entry il="0x34" row="42" col="2" file_ref="1" hidden="false" />
</sequencepoints>
<locals>
<method token="0x6000008">
<sequencepoints>
<entry il="0x0" row="45" col="2" file_ref="1" hidden="false" />
- <entry il="0x1" row="46" col="10" file_ref="1" hidden="false" />
+ <entry il="0x1" row="46" col="19" file_ref="1" hidden="false" />
<entry il="0x7" row="47" col="3" file_ref="1" hidden="false" />
<entry il="0x8" row="48" col="4" file_ref="1" hidden="false" />
+ <entry il="0xd" row="48" col="12" file_ref="1" hidden="false" />
<entry il="0x12" row="49" col="3" file_ref="1" hidden="false" />
+ <entry il="0x1f" row="46" col="14" file_ref="1" hidden="false" />
<entry il="0x25" row="50" col="2" file_ref="1" hidden="false" />
</sequencepoints>
<locals>
<sequencepoints>
<entry il="0x0" row="103" col="2" file_ref="1" hidden="false" />
<entry il="0x1" row="105" col="3" file_ref="1" hidden="false" />
+ <entry il="0x86" row="104" col="3" file_ref="1" hidden="false" />
<entry il="0xb3" row="107" col="5" file_ref="1" hidden="false" />
<entry il="0xb8" row="109" col="4" file_ref="1" hidden="false" />
<entry il="0xb9" row="110" col="5" file_ref="1" hidden="false" />
<entry il="0x1" row="175" col="3" file_ref="1" hidden="false" />
<entry il="0x2" row="176" col="3" file_ref="1" hidden="false" />
<entry il="0x3" row="177" col="4" file_ref="1" hidden="false" />
+ <entry il="0x8" row="177" col="12" file_ref="1" hidden="false" />
<entry il="0xd" row="178" col="3" file_ref="1" hidden="false" />
</sequencepoints>
<locals />
<sequencepoints>
<entry il="0x0" row="182" col="2" file_ref="1" hidden="false" />
<entry il="0x1" row="183" col="3" file_ref="1" hidden="false" />
+ <entry il="0x7" row="183" col="7" file_ref="1" hidden="false" />
<entry il="0x11" row="184" col="3" file_ref="1" hidden="false" />
<entry il="0x12" row="185" col="3" file_ref="1" hidden="false" />
<entry il="0x18" row="187" col="3" file_ref="1" hidden="false" />
<sequencepoints>
<entry il="0x0" row="192" col="2" file_ref="1" hidden="false" />
<entry il="0x1" row="193" col="3" file_ref="1" hidden="false" />
+ <entry il="0x7" row="193" col="7" file_ref="1" hidden="false" />
<entry il="0x11" row="194" col="3" file_ref="1" hidden="false" />
<entry il="0x12" row="195" col="3" file_ref="1" hidden="false" />
<entry il="0x18" row="196" col="8" file_ref="1" hidden="false" />
+ <entry il="0x1e" row="196" col="12" file_ref="1" hidden="false" />
<entry il="0x28" row="197" col="3" file_ref="1" hidden="false" />
<entry il="0x29" row="198" col="3" file_ref="1" hidden="false" />
<entry il="0x2f" row="200" col="3" file_ref="1" hidden="false" />
<entry il="0x0" row="246" col="2" file_ref="1" hidden="false" />
<entry il="0x1" row="247" col="3" file_ref="1" hidden="false" />
<entry il="0x2" row="250" col="3" file_ref="1" hidden="false" />
+ <entry il="0x3" row="250" col="3" file_ref="1" hidden="false" />
<entry il="0xe" row="248" col="4" file_ref="1" hidden="false" />
+ <entry il="0x10" row="250" col="3" file_ref="1" hidden="false" />
<entry il="0x16" row="251" col="3" file_ref="1" hidden="false" />
<entry il="0x17" row="252" col="3" file_ref="1" hidden="false" />
+ <entry il="0x1a" row="250" col="3" file_ref="1" hidden="false" />
+ <entry il="0x31" row="250" col="3" file_ref="1" hidden="false" />
<entry il="0x37" row="253" col="2" file_ref="1" hidden="false" />
</sequencepoints>
<locals>
<entry il="0x0" row="256" col="2" file_ref="1" hidden="false" />
<entry il="0x1" row="257" col="3" file_ref="1" hidden="false" />
<entry il="0x2" row="260" col="3" file_ref="1" hidden="false" />
+ <entry il="0x4" row="260" col="3" file_ref="1" hidden="false" />
<entry il="0xf" row="258" col="4" file_ref="1" hidden="false" />
+ <entry il="0x10" row="260" col="3" file_ref="1" hidden="false" />
<entry il="0x16" row="261" col="3" file_ref="1" hidden="false" />
<entry il="0x17" row="262" col="3" file_ref="1" hidden="false" />
+ <entry il="0x19" row="260" col="3" file_ref="1" hidden="false" />
<entry il="0x3c" row="263" col="2" file_ref="1" hidden="false" />
</sequencepoints>
<locals>
<entry il="0x0" row="266" col="2" file_ref="1" hidden="false" />
<entry il="0x1" row="267" col="3" file_ref="1" hidden="false" />
<entry il="0x2" row="269" col="6" file_ref="1" hidden="false" />
+ <entry il="0x6" row="269" col="6" file_ref="1" hidden="false" />
+ <entry il="0xe" row="269" col="6" file_ref="1" hidden="false" />
<entry il="0x24" row="268" col="3" file_ref="1" hidden="false" />
<entry il="0x2f" row="270" col="3" file_ref="1" hidden="false" />
<entry il="0x30" row="271" col="3" file_ref="1" hidden="false" />
</method>
<method token="0x6000006">
<sequencepoints>
+ <entry il="0x0" row="34" col="2" file_ref="1" hidden="false" />
<entry il="0xd" row="34" col="2" file_ref="1" hidden="false" />
<entry il="0xe" row="35" col="3" file_ref="1" hidden="false" />
<entry il="0x1b" row="37" col="2" file_ref="1" hidden="false" />
</method>
<method token="0x6000007">
<sequencepoints>
- <entry il="0x0" row="13" col="3" file_ref="1" hidden="false" />
+ <entry il="0x0" row="13" col="11" file_ref="1" hidden="false" />
</sequencepoints>
<locals />
<scopes />
<method token="0x6000008">
<sequencepoints>
<entry il="0x0" row="20" col="3" file_ref="1" hidden="false" />
- <entry il="0x1" row="21" col="4" file_ref="1" hidden="false" />
+ <entry il="0x1" row="21" col="12" file_ref="1" hidden="false" />
<entry il="0x6" row="22" col="3" file_ref="1" hidden="false" />
</sequencepoints>
<locals />
<method token="0x6000009">
<sequencepoints>
<entry il="0x0" row="28" col="3" file_ref="1" hidden="false" />
- <entry il="0x1" row="29" col="4" file_ref="1" hidden="false" />
+ <entry il="0x1" row="29" col="12" file_ref="1" hidden="false" />
<entry il="0x6" row="30" col="3" file_ref="1" hidden="false" />
</sequencepoints>
<locals />
<sequencepoints>
<entry il="0x0" row="6" col="2" file_ref="1" hidden="false" />
<entry il="0x1" row="7" col="3" file_ref="1" hidden="false" />
+ <entry il="0xb" row="7" col="21" file_ref="1" hidden="false" />
+ <entry il="0x16" row="5" col="6" file_ref="1" hidden="false" />
<entry il="0x1c" row="8" col="5" file_ref="1" hidden="false" />
</sequencepoints>
<locals />
<method token="0x6000003">
<sequencepoints>
<entry il="0x0" row="14" col="2" file_ref="1" hidden="false" />
- <entry il="0x1" row="15" col="3" file_ref="1" hidden="false" />
+ <entry il="0x1" row="15" col="11" file_ref="1" hidden="false" />
<entry il="0x7" row="17" col="4" file_ref="1" hidden="false" />
+ <entry il="0xe" row="17" col="4" file_ref="1" hidden="false" />
<entry il="0x13" row="20" col="4" file_ref="1" hidden="false" />
+ <entry il="0x1a" row="20" col="4" file_ref="1" hidden="false" />
<entry il="0x21" row="24" col="2" file_ref="1" hidden="false" />
</sequencepoints>
<locals>
<method token="0x6000004">
<sequencepoints>
<entry il="0x0" row="27" col="2" file_ref="1" hidden="false" />
- <entry il="0x1" row="28" col="3" file_ref="1" hidden="false" />
+ <entry il="0x1" row="28" col="14" file_ref="1" hidden="false" />
<entry il="0x7" row="30" col="4" file_ref="1" hidden="false" />
<entry il="0x12" row="31" col="4" file_ref="1" hidden="false" />
<entry il="0x1b" row="33" col="2" file_ref="1" hidden="false" />
</method>
<method token="0x6000003">
<sequencepoints>
+ <entry il="0xf" row="13" col="5" file_ref="1" hidden="false" />
+ <entry il="0x24" row="13" col="8" file_ref="1" hidden="false" />
<entry il="0x2a" row="11" col="2" file_ref="1" hidden="false" />
<entry il="0x2b" row="12" col="3" file_ref="1" hidden="false" />
+ <entry il="0x2d" row="14" col="4" file_ref="1" hidden="false" />
+ <entry il="0x40" row="13" col="4" file_ref="1" hidden="false" />
<entry il="0x46" row="16" col="3" file_ref="1" hidden="false" />
<entry il="0x4b" row="17" col="2" file_ref="1" hidden="false" />
</sequencepoints>
<sequencepoints>
<entry il="0x0" row="20" col="2" file_ref="1" hidden="false" />
<entry il="0x1" row="21" col="3" file_ref="1" hidden="false" />
+ <entry il="0x11" row="21" col="59" file_ref="1" hidden="false" />
+ <entry il="0x1c" row="21" col="53" file_ref="1" hidden="false" />
+ <entry il="0x2c" row="21" col="47" file_ref="1" hidden="false" />
<entry il="0x32" row="22" col="2" file_ref="1" hidden="false" />
</sequencepoints>
<locals>
<entry il="0x0" row="30" col="2" file_ref="1" hidden="false" />
<entry il="0x1" row="31" col="3" file_ref="1" hidden="false" />
<entry il="0x7" row="32" col="3" file_ref="1" hidden="false" />
- <entry il="0xe" row="33" col="3" file_ref="1" hidden="false" />
+ <entry il="0xe" row="33" col="15" file_ref="1" hidden="false" />
<entry il="0x14" row="34" col="3" file_ref="1" hidden="false" />
<entry il="0x81" row="35" col="2" file_ref="1" hidden="false" />
</sequencepoints>
<method token="0x6000009">
<sequencepoints>
<entry il="0x0" row="38" col="2" file_ref="1" hidden="false" />
- <entry il="0x1" row="39" col="3" file_ref="1" hidden="false" />
+ <entry il="0x1" row="39" col="15" file_ref="1" hidden="false" />
<entry il="0x7" row="40" col="3" file_ref="1" hidden="false" />
<entry il="0x1e4" row="41" col="2" file_ref="1" hidden="false" />
</sequencepoints>
<method token="0x6000004">
<sequencepoints>
<entry il="0x0" row="16" col="2" file_ref="1" hidden="false" />
- <entry il="0x1" row="17" col="3" file_ref="1" hidden="false" />
+ <entry il="0x1" row="17" col="15" file_ref="1" hidden="false" />
<entry il="0x23" row="17" col="23" file_ref="1" hidden="false" />
<entry il="0x2e" row="21" col="2" file_ref="1" hidden="false" />
</sequencepoints>
<method token="0x6000006">
<sequencepoints>
<entry il="0x0" row="29" col="2" file_ref="1" hidden="false" />
- <entry il="0x1" row="30" col="3" file_ref="1" hidden="false" />
+ <entry il="0x1" row="30" col="15" file_ref="1" hidden="false" />
<entry il="0x23" row="30" col="23" file_ref="1" hidden="false" />
<entry il="0x2e" row="31" col="2" file_ref="1" hidden="false" />
</sequencepoints>
<sequencepoints>
<entry il="0x21" row="34" col="2" file_ref="1" hidden="false" />
<entry il="0x22" row="35" col="3" file_ref="1" hidden="false" />
+ <entry il="0x23" row="35" col="15" file_ref="1" hidden="false" />
<entry il="0x2d" row="36" col="3" file_ref="1" hidden="false" />
<entry il="0x8b" row="37" col="3" file_ref="1" hidden="false" />
<entry il="0x3ab" row="38" col="3" file_ref="1" hidden="false" />
<sequencepoints>
<entry il="0x27" row="7" col="2" file_ref="1" hidden="false" />
<entry il="0x28" row="8" col="3" file_ref="1" hidden="false" />
+ <entry il="0x2d" row="8" col="11" file_ref="1" hidden="false" />
<entry il="0x32" row="9" col="3" file_ref="1" hidden="false" />
<entry il="0x41" row="10" col="3" file_ref="1" hidden="false" />
<entry il="0x42" row="11" col="4" file_ref="1" hidden="false" />
<sequencepoints>
<entry il="0x0" row="14" col="3" file_ref="1" hidden="false" />
<entry il="0x1" row="15" col="4" file_ref="1" hidden="false" />
+ <entry il="0x6" row="15" col="12" file_ref="1" hidden="false" />
<entry il="0xb" row="16" col="3" file_ref="1" hidden="false" />
</sequencepoints>
<locals />
<method token="0x6000005">
<sequencepoints>
<entry il="0x0" row="20" col="2" file_ref="1" hidden="false" />
- <entry il="0x1" row="21" col="3" file_ref="1" hidden="false" />
+ <entry il="0x1" row="21" col="9" file_ref="1" hidden="false" />
</sequencepoints>
<locals />
<scopes />
<sequencepoints>
<entry il="0x21" row="15" col="2" file_ref="1" hidden="false" />
<entry il="0x22" row="16" col="3" file_ref="1" hidden="false" />
+ <entry il="0x29" row="16" col="21" file_ref="1" hidden="false" />
<entry il="0x47" row="17" col="2" file_ref="1" hidden="false" />
</sequencepoints>
<locals />
<sequencepoints>
<entry il="0x0" row="8" col="2" file_ref="1" hidden="false" />
<entry il="0x1" row="9" col="3" file_ref="1" hidden="false" />
+ <entry il="0x2" row="9" col="3" file_ref="1" hidden="false" />
<entry il="0x7" row="9" col="8" file_ref="1" hidden="false" />
<entry il="0xd" row="10" col="2" file_ref="1" hidden="false" />
</sequencepoints>
<sequencepoints>
<entry il="0x0" row="13" col="2" file_ref="1" hidden="false" />
<entry il="0x1" row="14" col="3" file_ref="1" hidden="false" />
+ <entry il="0x2" row="14" col="3" file_ref="1" hidden="false" />
<entry il="0x7" row="14" col="11" file_ref="1" hidden="false" />
<entry il="0xd" row="15" col="2" file_ref="1" hidden="false" />
</sequencepoints>
<entry il="0x0" row="23" col="2" file_ref="1" hidden="false" />
<entry il="0x1" row="24" col="3" file_ref="1" hidden="false" />
<entry il="0x1f" row="25" col="3" file_ref="1" hidden="false" />
+ <entry il="0x20" row="25" col="3" file_ref="1" hidden="false" />
<entry il="0x25" row="25" col="8" file_ref="1" hidden="false" />
<entry il="0x2b" row="26" col="2" file_ref="1" hidden="false" />
</sequencepoints>
<method token="0x6000002">
<sequencepoints>
<entry il="0x0" row="6" col="2" file_ref="1" hidden="false" />
- <entry il="0x1" row="7" col="3" file_ref="1" hidden="false" />
- <entry il="0x7" row="7" col="30" file_ref="1" hidden="false" />
+ <entry il="0x1" row="7" col="14" file_ref="1" hidden="false" />
+ <entry il="0x7" row="7" col="34" file_ref="1" hidden="false" />
<entry il="0xd" row="8" col="2" file_ref="1" hidden="false" />
</sequencepoints>
<locals>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<symbols>
+ <files>
+ <file id="1" name="test-debug-27.cs" checksum="4a2fa40aa27e1d498f61d664c985ddf2" />
+ </files>
+ <methods>
+ <method token="0x6000001">
+ <sequencepoints>
+ <entry il="0x0" row="8" col="2" file_ref="1" hidden="false" />
+ <entry il="0x1" row="10" col="2" file_ref="1" hidden="false" />
+ </sequencepoints>
+ <locals />
+ <scopes />
+ </method>
+ <method token="0x6000002">
+ <sequencepoints>
+ <entry il="0x0" row="13" col="2" file_ref="1" hidden="false" />
+ <entry il="0x1" row="14" col="3" file_ref="1" hidden="false" />
+ <entry il="0x8" row="15" col="2" file_ref="1" hidden="false" />
+ </sequencepoints>
+ <locals />
+ <scopes />
+ </method>
+ <method token="0x6000003">
+ <sequencepoints />
+ <locals />
+ <scopes />
+ </method>
+ <method token="0x6000004">
+ <sequencepoints>
+ <entry il="0x0" row="21" col="2" file_ref="1" hidden="false" />
+ <entry il="0x1" row="22" col="3" file_ref="1" hidden="false" />
+ <entry il="0x8" row="23" col="2" file_ref="1" hidden="false" />
+ </sequencepoints>
+ <locals />
+ <scopes />
+ </method>
+ <method token="0x6000005">
+ <sequencepoints>
+ <entry il="0x0" row="26" col="2" file_ref="1" hidden="false" />
+ <entry il="0x1" row="27" col="3" file_ref="1" hidden="false" />
+ <entry il="0x8" row="28" col="2" file_ref="1" hidden="false" />
+ </sequencepoints>
+ <locals />
+ <scopes />
+ </method>
+ <method token="0x6000006">
+ <sequencepoints>
+ <entry il="0x0" row="31" col="2" file_ref="1" hidden="false" />
+ <entry il="0x1" row="32" col="10" file_ref="1" hidden="false" />
+ <entry il="0xc" row="33" col="2" file_ref="1" hidden="false" />
+ </sequencepoints>
+ <locals />
+ <scopes />
+ </method>
+ <method token="0x6000007">
+ <sequencepoints>
+ <entry il="0x0" row="36" col="2" file_ref="1" hidden="false" />
+ <entry il="0x1" row="37" col="3" file_ref="1" hidden="false" />
+ <entry il="0x8" row="38" col="2" file_ref="1" hidden="false" />
+ </sequencepoints>
+ <locals />
+ <scopes />
+ </method>
+ <method token="0x6000008">
+ <sequencepoints>
+ <entry il="0x0" row="41" col="2" file_ref="1" hidden="false" />
+ <entry il="0x1" row="42" col="3" file_ref="1" hidden="false" />
+ <entry il="0x1f" row="44" col="3" file_ref="1" hidden="false" />
+ <entry il="0x20" row="44" col="13" file_ref="1" hidden="false" />
+ <entry il="0x26" row="44" col="20" file_ref="1" hidden="false" />
+ <entry il="0x2d" row="45" col="2" file_ref="1" hidden="false" />
+ </sequencepoints>
+ <locals>
+ <entry name="f" il_index="0" scope_ref="0" />
+ <entry name="res" il_index="1" scope_ref="0" />
+ </locals>
+ <scopes />
+ </method>
+ <method token="0x6000009">
+ <sequencepoints>
+ <entry il="0x0" row="48" col="2" file_ref="1" hidden="false" />
+ <entry il="0x1" row="49" col="3" file_ref="1" hidden="false" />
+ <entry il="0x4" row="49" col="11" file_ref="1" hidden="false" />
+ <entry il="0x9" row="50" col="2" file_ref="1" hidden="false" />
+ </sequencepoints>
+ <locals>
+ <entry name="s" il_index="0" scope_ref="0" />
+ </locals>
+ <scopes />
+ </method>
+ <method token="0x600000a">
+ <sequencepoints>
+ <entry il="0x0" row="53" col="2" file_ref="1" hidden="false" />
+ <entry il="0x1" row="54" col="3" file_ref="1" hidden="false" />
+ <entry il="0xa" row="54" col="11" file_ref="1" hidden="false" />
+ <entry il="0x18" row="54" col="22" file_ref="1" hidden="false" />
+ <entry il="0x1f" row="55" col="2" file_ref="1" hidden="false" />
+ </sequencepoints>
+ <locals>
+ <entry name="i" il_index="0" scope_ref="0" />
+ </locals>
+ <scopes />
+ </method>
+ <method token="0x600000b">
+ <sequencepoints>
+ <entry il="0x0" row="58" col="2" file_ref="1" hidden="false" />
+ <entry il="0x1" row="59" col="3" file_ref="1" hidden="false" />
+ <entry il="0x6" row="59" col="11" file_ref="1" hidden="false" />
+ <entry il="0xc" row="60" col="2" file_ref="1" hidden="false" />
+ </sequencepoints>
+ <locals />
+ <scopes />
+ </method>
+ <method token="0x600000c">
+ <sequencepoints>
+ <entry il="0x0" row="63" col="2" file_ref="1" hidden="false" />
+ <entry il="0x1" row="64" col="3" file_ref="1" hidden="false" />
+ <entry il="0x8" row="65" col="2" file_ref="1" hidden="false" />
+ </sequencepoints>
+ <locals />
+ <scopes />
+ </method>
+ </methods>
+</symbols>
\ No newline at end of file
--- /dev/null
+using System;
+
+// Tests for explicit call sequence point
+
+struct S
+{
+ public S (int i)
+ {
+
+ }
+
+ public static implicit operator int (S s)
+ {
+ return 1;
+ }
+}
+
+class C
+{
+ public static int A ()
+ {
+ return 1;
+ }
+
+ public static int B (C c)
+ {
+ return 2;
+ }
+
+ public static C Test ()
+ {
+ return new C ();
+ }
+
+ public string Foo ()
+ {
+ return null;
+ }
+
+ void Test_1 ()
+ {
+ Func<int> f = A;
+
+ var res = f () + f ();
+ }
+
+ void Test_2 ()
+ {
+ var s = new S (0);
+ }
+
+ void Test_3 ()
+ {
+ int i = new S () + new S ();
+ }
+
+ void Test_4 ()
+ {
+ Test ().Foo ();
+ }
+
+ static int Main ()
+ {
+ return 0;
+ }
+}
+
+
--- /dev/null
+using System;
+
+
+class C
+{
+ static int Foo (string packageId, int version)
+ {
+ return Foo (packageId, version, ignoreDependencies: false, allowPrereleaseVersions: false);
+ }
+
+ static int Foo (string packageId, int version, bool ignoreDependencies, bool allowPrereleaseVersions)
+ {
+ return 1;
+ }
+
+ static int Foo (double package, bool ignoreDependencies, bool allowPrereleaseVersions, bool ignoreWalkInfo)
+ {
+ return 2;
+ }
+
+ public static int Main ()
+ {
+ if (Foo ("", 1) != 1)
+ return 1;
+
+ return 0;
+ }
+}
\ No newline at end of file
</method>\r
</type>\r
</test>\r
+ <test name="gtest-589.cs">\r
+ <type name="Z">\r
+ <method name="Z Start()" attrs="134">\r
+ <size>10</size>\r
+ </method>\r
+ <method name="Z IGenericInterface<Z>.Start()" attrs="481">\r
+ <size>7</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="A`1[T]">\r
+ <method name="Void SomeOperation(T)" attrs="134">\r
+ <size>16</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="C">\r
+ <method name="Int32 IGenericInterface<int>.Start()" attrs="481">\r
+ <size>7</size>\r
+ </method>\r
+ <method name="Void Main()" attrs="150">\r
+ <size>17</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
+ <test name="gtest-590.cs">\r
+ <type name="C">\r
+ <method name="Void Main()" attrs="150">\r
+ <size>132</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
+ <test name="gtest-591.cs">\r
+ <type name="E">\r
+ <method name="Void Main()" attrs="150">\r
+ <size>19</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
<test name="gtest-anontype-01.cs">\r
<type name="Test">\r
<method name="Int32 Main()" attrs="150">\r
</method>\r
</type>\r
</test>\r
+ <test name="gtest-autoproperty-08.cs">\r
+ <type name="AAttribute">\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="Program">\r
+ <method name="Int32 get_Prop()" attrs="2182">\r
+ <size>14</size>\r
+ </method>\r
+ <method name="Void set_Prop(Int32)" attrs="2182">\r
+ <size>8</size>\r
+ </method>\r
+ <method name="Int32 Main()" attrs="150">\r
+ <size>48</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
<test name="gtest-collectioninit-01.cs">\r
<type name="Test">\r
<method name="Void TestList(System.Collections.Generic.List`1[System.Int32], Int32)" attrs="145">\r
</method>\r
</type>\r
</test>\r
+ <test name="gtest-partial-07.cs">\r
+ <type name="A`1[T]">\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="A`1+B[T]">\r
+ <method name="Void Test()" attrs="134">\r
+ <size>9</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="X`1[U]">\r
+ <method name="Void Foo(U)" attrs="134">\r
+ <size>2</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="M">\r
+ <method name="Void Main()" attrs="150">\r
+ <size>12</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
+ <test name="gtest-partial-08.cs">\r
+ <type name="N.A`2[T1,T2]">\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="N.A`2+D[T1,T2]">\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="N.A`2+D+C[T1,T2]">\r
+ <method name="Void Test()" attrs="134">\r
+ <size>8</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="N.A`2+D2`1[T1,T2,U]">\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="N.A`2+D2`1+C2[T1,T2,U]">\r
+ <method name="Void Test()" attrs="134">\r
+ <size>9</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="N.X2`1[W]">\r
+ <method name="Void Foo(W)" attrs="134">\r
+ <size>2</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="N.X">\r
+ <method name="Void Foo()" attrs="134">\r
+ <size>2</size>\r
+ </method>\r
+ <method name="Void Main()" attrs="150">\r
+ <size>22</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
+ <test name="gtest-partial-09.cs">\r
+ <type name="A.B`1[T]">\r
+ <method name="Void .ctor()" attrs="6276">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="A.B`1+C[T]">\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="A.B`1+C+A[T]">\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="A.Bar">\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ <type name="A.Test">\r
+ <method name="Void Main()" attrs="150">\r
+ <size>20</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
<test name="gtest-var-04.cs">\r
<type name="Test">\r
<method name="Int32 Main()" attrs="150">\r
</method>\r
</type>\r
</test>\r
+ <test name="test-869.cs">\r
+ <type name="C">\r
+ <method name="C op_BitwiseAnd(C, E)" attrs="2198">\r
+ <size>14</size>\r
+ </method>\r
+ <method name="E op_Implicit(C)" attrs="2198">\r
+ <size>7</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ <method name="Void .cctor()" attrs="6289">\r
+ <size>11</size>\r
+ </method>\r
+ </type>\r
+ <type name="FooClass">\r
+ <method name="Int32 Main()" attrs="150">\r
+ <size>70</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
<test name="test-87.cs">\r
<type name="Top">\r
<method name="Int32 Main()" attrs="150">\r
<size>13</size>\r
</method>\r
</type>\r
- <type name="Tester+<CallTest_1>c__async11">\r
+ <type name="Tester">\r
+ <method name="Tester <CastTest_2>m__3A()" attrs="129">\r
+ <size>9</size>\r
+ </method>\r
+ </type>\r
+ <type name="Tester+<AssignTest_2>c__asyncA">\r
+ <method name="System.Nullable`1[System.SByte] <>m__1F()" attrs="145">\r
+ <size>17</size>\r
+ </method>\r
+ </type>\r
+ <type name="Tester+<BinaryTest_3>c__asyncE">\r
+ <method name="System.Nullable`1[System.Boolean] <>m__28()" attrs="145">\r
+ <size>14</size>\r
+ </method>\r
+ <method name="System.Nullable`1[System.Boolean] <>m__29()" attrs="145">\r
+ <size>17</size>\r
+ </method>\r
+ <method name="System.Nullable`1[System.Boolean] <>m__2A()" attrs="145">\r
+ <size>17</size>\r
+ </method>\r
+ <method name="System.Nullable`1[System.Boolean] <>m__2B()" attrs="145">\r
+ <size>14</size>\r
+ </method>\r
+ <method name="System.Nullable`1[System.Boolean] <>m__2C()" attrs="145">\r
+ <size>17</size>\r
+ </method>\r
+ <method name="System.Nullable`1[System.Boolean] <>m__2D()" attrs="145">\r
+ <size>14</size>\r
+ </method>\r
+ </type>\r
+ <type name="Tester+<BinaryTest_4>c__asyncF">\r
+ <method name="System.Nullable`1[System.Int16] <>m__2E()" attrs="145">\r
+ <size>14</size>\r
+ </method>\r
+ <method name="System.Nullable`1[System.Byte] <>m__2F()" attrs="145">\r
+ <size>17</size>\r
+ </method>\r
+ <method name="System.Nullable`1[System.Decimal] <>m__30()" attrs="145">\r
+ <size>20</size>\r
+ </method>\r
+ <method name="System.Nullable`1[System.Decimal] <>m__31()" attrs="145">\r
+ <size>17</size>\r
+ </method>\r
+ </type>\r
+ <type name="Tester">\r
+ <method name="System.Threading.Tasks.Task`1[System.Boolean] BinaryTest_6()" attrs="129">\r
+ <size>33</size>\r
+ </method>\r
+ </type>\r
+ <type name="Tester+<BinaryTest_6>c__async11">\r
+ <method name="Void MoveNext()" attrs="486">\r
+ <size>209</size>\r
+ </method>\r
+ <method name="Void SetStateMachine(IAsyncStateMachine)" attrs="486">\r
+ <size>13</size>\r
+ </method>\r
+ </type>\r
+ <type name="Tester+<CallTest_1>c__async12">\r
<method name="Void MoveNext()" attrs="486">\r
<size>430</size>\r
</method>\r
<size>9</size>\r
</method>\r
</type>\r
- <type name="Tester+<CallTest_2>c__async12">\r
+ <type name="Tester+<CallTest_2>c__async13">\r
<method name="Void MoveNext()" attrs="486">\r
<size>267</size>\r
</method>\r
<size>17</size>\r
</method>\r
</type>\r
- <type name="Tester+<CallTest_3>c__async13">\r
+ <type name="Tester+<CallTest_3>c__async14">\r
<method name="Void MoveNext()" attrs="486">\r
<size>237</size>\r
</method>\r
<size>10</size>\r
</method>\r
</type>\r
- <type name="Tester+<CallTest_4>c__async14">\r
+ <type name="Tester+<CallTest_4>c__async15">\r
<method name="Void MoveNext()" attrs="486">\r
<size>234</size>\r
</method>\r
<size>9</size>\r
</method>\r
</type>\r
- <type name="Tester+<CallTest_5>c__async15">\r
+ <type name="Tester+<CallTest_5>c__async16">\r
<method name="Void MoveNext()" attrs="486">\r
<size>250</size>\r
</method>\r
<size>13</size>\r
</method>\r
</type>\r
- <type name="Tester+<CastTest_1>c__async16">\r
+ <type name="Tester+<CastTest_1>c__async17">\r
<method name="Void MoveNext()" attrs="486">\r
<size>246</size>\r
</method>\r
<size>15</size>\r
</method>\r
</type>\r
- <type name="Tester+<CastTest_2>c__async17">\r
+ <type name="Tester+<CastTest_2>c__async18">\r
<method name="Void MoveNext()" attrs="486">\r
<size>233</size>\r
</method>\r
<size>13</size>\r
</method>\r
</type>\r
- <type name="Tester+<CoalescingTest_1>c__async18">\r
+ <type name="Tester+<CoalescingTest_1>c__async19">\r
<method name="Void MoveNext()" attrs="486">\r
<size>358</size>\r
</method>\r
<size>13</size>\r
</method>\r
</type>\r
- <type name="Tester+<CoalescingTest_2>c__async19">\r
+ <type name="Tester+<CoalescingTest_2>c__async1A">\r
<method name="Void MoveNext()" attrs="486">\r
<size>364</size>\r
</method>\r
<method name="Void SetStateMachine(IAsyncStateMachine)" attrs="486">\r
<size>13</size>\r
</method>\r
+ <method name="System.Nullable`1[System.Int16] <>m__3D()" attrs="145">\r
+ <size>17</size>\r
+ </method>\r
<method name="Byte <>m__3E()" attrs="145">\r
<size>9</size>\r
</method>\r
</type>\r
- <type name="Tester+<ConditionalTest_1>c__async1A">\r
+ <type name="Tester+<ConditionalTest_1>c__async1B">\r
<method name="Void MoveNext()" attrs="486">\r
<size>197</size>\r
</method>\r
<size>9</size>\r
</method>\r
</type>\r
- <type name="Tester+<ConditionalTest_2>c__async1B">\r
+ <type name="Tester+<ConditionalTest_2>c__async1C">\r
<method name="Void MoveNext()" attrs="486">\r
<size>329</size>\r
</method>\r
<size>9</size>\r
</method>\r
</type>\r
- <type name="Tester+<ConditionalTest_3>c__async1C">\r
+ <type name="Tester+<ConditionalTest_3>c__async1D">\r
<method name="Void MoveNext()" attrs="486">\r
<size>347</size>\r
</method>\r
<size>9</size>\r
</method>\r
</type>\r
- <type name="Tester+<ConditionalTest_4>c__async1D">\r
+ <type name="Tester+<ConditionalTest_4>c__async1E">\r
<method name="Void MoveNext()" attrs="486">\r
<size>243</size>\r
</method>\r
<size>9</size>\r
</method>\r
</type>\r
- <type name="Tester+<DelegateInvoke_4>c__async1E">\r
+ <type name="Tester+<DelegateInvoke_4>c__async1F">\r
<method name="Void MoveNext()" attrs="486">\r
<size>271</size>\r
</method>\r
<size>9</size>\r
</method>\r
</type>\r
- <type name="Tester+<EventInvoke_1>c__async1F">\r
+ <type name="Tester+<EventInvoke_1>c__async20">\r
<method name="Void MoveNext()" attrs="486">\r
<size>260</size>\r
</method>\r
<size>13</size>\r
</method>\r
</type>\r
- <type name="Tester+<FieldTest_1>c__async20">\r
+ <type name="Tester+<FieldTest_1>c__async21">\r
<method name="Void MoveNext()" attrs="486">\r
<size>535</size>\r
</method>\r
<size>9</size>\r
</method>\r
</type>\r
- <type name="Tester+<IndexerTest_1>c__async21">\r
+ <type name="Tester+<IndexerTest_1>c__async22">\r
<method name="Void MoveNext()" attrs="486">\r
<size>225</size>\r
</method>\r
<size>9</size>\r
</method>\r
</type>\r
- <type name="Tester+<IndexerTest_2>c__async22">\r
+ <type name="Tester+<IndexerTest_2>c__async23">\r
<method name="Void MoveNext()" attrs="486">\r
<size>335</size>\r
</method>\r
<size>9</size>\r
</method>\r
</type>\r
- <type name="Tester+<IndexerTest_3>c__async23">\r
+ <type name="Tester+<IndexerTest_3>c__async24">\r
<method name="Void MoveNext()" attrs="486">\r
<size>402</size>\r
</method>\r
<size>9</size>\r
</method>\r
</type>\r
- <type name="Tester+<IndexerTest_4>c__async24">\r
+ <type name="Tester+<IndexerTest_4>c__async25">\r
<method name="Void MoveNext()" attrs="486">\r
<size>442</size>\r
</method>\r
<size>10</size>\r
</method>\r
</type>\r
- <type name="Tester+<IndexerTest_5>c__async25">\r
+ <type name="Tester+<IndexerTest_5>c__async26">\r
<method name="Void MoveNext()" attrs="486">\r
<size>548</size>\r
</method>\r
<size>10</size>\r
</method>\r
</type>\r
- <type name="Tester+<IndexerTest_6>c__async26">\r
+ <type name="Tester+<IndexerTest_6>c__async27">\r
<method name="Void MoveNext()" attrs="486">\r
<size>544</size>\r
</method>\r
<size>10</size>\r
</method>\r
</type>\r
- <type name="Tester+<IndexerTest_7>c__async27">\r
+ <type name="Tester+<IndexerTest_7>c__async28">\r
<method name="Void MoveNext()" attrs="486">\r
<size>295</size>\r
</method>\r
<size>13</size>\r
</method>\r
</type>\r
- <type name="Tester+<IsTest_1>c__async28">\r
+ <type name="Tester+<IsTest_1>c__async29">\r
<method name="Void MoveNext()" attrs="486">\r
<size>233</size>\r
</method>\r
<size>13</size>\r
</method>\r
</type>\r
- <type name="Tester+<IsTest_2>c__async29">\r
+ <type name="Tester+<IsTest_2>c__async2A">\r
<method name="Void MoveNext()" attrs="486">\r
<size>233</size>\r
</method>\r
<method name="Void SetStateMachine(IAsyncStateMachine)" attrs="486">\r
<size>13</size>\r
</method>\r
+ <method name="System.Nullable`1[System.UInt32] <>m__59()" attrs="145">\r
+ <size>14</size>\r
+ </method>\r
</type>\r
- <type name="Tester+<LogicalUserOperator_1>c__async2A">\r
+ <type name="Tester+<LogicalUserOperator_1>c__async2B">\r
<method name="Void MoveNext()" attrs="486">\r
<size>391</size>\r
</method>\r
<size>13</size>\r
</method>\r
</type>\r
- <type name="Tester+<LogicalUserOperator_2>c__async2B">\r
+ <type name="Tester+<LogicalUserOperator_2>c__async2C">\r
<method name="Void MoveNext()" attrs="486">\r
<size>299</size>\r
</method>\r
<size>13</size>\r
</method>\r
</type>\r
- <type name="Tester+<LogicalUserOperator_3>c__async2C">\r
+ <type name="Tester+<LogicalUserOperator_3>c__async2D">\r
<method name="Void MoveNext()" attrs="486">\r
<size>390</size>\r
</method>\r
<size>13</size>\r
</method>\r
</type>\r
- <type name="Tester+<NewTest_1>c__async2D">\r
+ <type name="Tester+<NewTest_1>c__async2E">\r
<method name="Void MoveNext()" attrs="486">\r
<size>260</size>\r
</method>\r
<size>10</size>\r
</method>\r
</type>\r
- <type name="Tester+<NewTest_2>c__async2E">\r
+ <type name="Tester+<NewTest_2>c__async2F">\r
<method name="Void MoveNext()" attrs="486">\r
<size>348</size>\r
</method>\r
<size>13</size>\r
</method>\r
</type>\r
- <type name="Tester+<NewInitTest_1>c__async2F">\r
+ <type name="Tester+<NewInitTest_1>c__async30">\r
<method name="Void MoveNext()" attrs="486">\r
<size>1026</size>\r
</method>\r
<size>10</size>\r
</method>\r
</type>\r
- <type name="Tester+<NewInitTest_2>c__async30">\r
+ <type name="Tester+<NewInitTest_2>c__async31">\r
<method name="Void MoveNext()" attrs="486">\r
<size>739</size>\r
</method>\r
<size>10</size>\r
</method>\r
</type>\r
- <type name="Tester+<NewArrayInitTest_1>c__async31">\r
+ <type name="Tester+<NewArrayInitTest_1>c__async32">\r
<method name="Void MoveNext()" attrs="486">\r
<size>240</size>\r
</method>\r
<size>9</size>\r
</method>\r
</type>\r
- <type name="Tester+<NewArrayInitTest_2>c__async32">\r
+ <type name="Tester+<NewArrayInitTest_2>c__async33">\r
<method name="Void MoveNext()" attrs="486">\r
<size>355</size>\r
</method>\r
<size>9</size>\r
</method>\r
</type>\r
- <type name="Tester+<NewArrayInitTest_3>c__async33">\r
+ <type name="Tester+<NewArrayInitTest_3>c__async34">\r
<method name="Void MoveNext()" attrs="486">\r
<size>246</size>\r
</method>\r
<size>9</size>\r
</method>\r
</type>\r
- <type name="Tester+<NewArrayInitTest_4>c__async34">\r
+ <type name="Tester+<NewArrayInitTest_4>c__async35">\r
<method name="Void MoveNext()" attrs="486">\r
<size>427</size>\r
</method>\r
<size>9</size>\r
</method>\r
</type>\r
- <type name="Tester+<NewArrayInitTest_5>c__async35">\r
+ <type name="Tester+<NewArrayInitTest_5>c__async36">\r
<method name="Void MoveNext()" attrs="486">\r
<size>264</size>\r
</method>\r
<size>25</size>\r
</method>\r
</type>\r
- <type name="Tester+<NewArrayInitTest_6>c__async36">\r
+ <type name="Tester+<NewArrayInitTest_6>c__async37">\r
<method name="Void MoveNext()" attrs="486">\r
<size>266</size>\r
</method>\r
<size>9</size>\r
</method>\r
</type>\r
- <type name="Tester+<PropertyTest_1>c__async37">\r
+ <type name="Tester+<PropertyTest_1>c__async38">\r
<method name="Void MoveNext()" attrs="486">\r
<size>222</size>\r
</method>\r
<size>9</size>\r
</method>\r
</type>\r
- <type name="Tester+<PropertyTest_2>c__async38">\r
+ <type name="Tester+<PropertyTest_2>c__async39">\r
<method name="Void MoveNext()" attrs="486">\r
<size>295</size>\r
</method>\r
<size>9</size>\r
</method>\r
</type>\r
- <type name="Tester+<PropertyTest_3>c__async39">\r
+ <type name="Tester+<PropertyTest_3>c__async3A">\r
<method name="Void MoveNext()" attrs="486">\r
<size>645</size>\r
</method>\r
<size>9</size>\r
</method>\r
</type>\r
- <type name="Tester+<StringConcatTest_1>c__async3A">\r
+ <type name="Tester+<StringConcatTest_1>c__async3B">\r
<method name="Void MoveNext()" attrs="486">\r
<size>455</size>\r
</method>\r
<size>9</size>\r
</method>\r
</type>\r
- <type name="Tester+<UnaryTest_1>c__async3B">\r
+ <type name="Tester+<UnaryTest_1>c__async3C">\r
<method name="Void MoveNext()" attrs="486">\r
<size>233</size>\r
</method>\r
<size>9</size>\r
</method>\r
</type>\r
- <type name="Tester+<UnaryTest_2>c__async3C">\r
+ <type name="Tester+<UnaryTest_2>c__async3D">\r
<method name="Void MoveNext()" attrs="486">\r
<size>339</size>\r
</method>\r
<size>13</size>\r
</method>\r
</type>\r
- <type name="Tester+<UnaryTest_3>c__async3D">\r
+ <type name="Tester+<UnaryTest_3>c__async3E">\r
<method name="Void MoveNext()" attrs="486">\r
<size>372</size>\r
</method>\r
<size>9</size>\r
</method>\r
</type>\r
- <type name="Tester+<VariableInitializer_1>c__async3E">\r
+ <type name="Tester+<VariableInitializer_1>c__async3F">\r
<method name="Void MoveNext()" attrs="486">\r
<size>348</size>\r
</method>\r
<size>9</size>\r
</method>\r
</type>\r
- <type name="Tester">\r
- <method name="Tester <CastTest_2>m__3A()" attrs="129">\r
- <size>9</size>\r
- </method>\r
- </type>\r
- <type name="Tester+<ArrayAccessTest_5>c__async4+<ArrayAccessTest_5>c__AnonStorey3F">\r
+ <type name="Tester+<ArrayAccessTest_5>c__async4+<ArrayAccessTest_5>c__AnonStorey40">\r
<method name="Int32 <>m__12()" attrs="131">\r
<size>25</size>\r
</method>\r
<size>7</size>\r
</method>\r
</type>\r
- <type name="Tester+<BinaryTest_2>c__asyncD+<BinaryTest_2>c__AnonStorey40">\r
+ <type name="Tester+<BinaryTest_2>c__asyncD+<BinaryTest_2>c__AnonStorey41">\r
<method name="Boolean <>m__25()" attrs="131">\r
<size>24</size>\r
</method>\r
<size>7</size>\r
</method>\r
</type>\r
- <type name="Tester+<CallTest_5>c__async15+<CallTest_5>c__AnonStorey41">\r
+ <type name="Tester+<CallTest_5>c__async16+<CallTest_5>c__AnonStorey42">\r
<method name="Int32 <>m__38()" attrs="131">\r
<size>25</size>\r
</method>\r
<size>7</size>\r
</method>\r
</type>\r
- <type name="Tester+<EventInvoke_1>c__async1F+<EventInvoke_1>c__AnonStorey42">\r
+ <type name="Tester+<EventInvoke_1>c__async20+<EventInvoke_1>c__AnonStorey43">\r
<method name="System.Action <>m__47()" attrs="131">\r
<size>23</size>\r
</method>\r
<size>7</size>\r
</method>\r
</type>\r
- <type name="Tester+<IndexerTest_3>c__async23+<IndexerTest_3>c__AnonStorey43">\r
+ <type name="Tester+<IndexerTest_3>c__async24+<IndexerTest_3>c__AnonStorey44">\r
<method name="Int32 <>m__4E()" attrs="131">\r
<size>25</size>\r
</method>\r
<size>7</size>\r
</method>\r
</type>\r
- <type name="Tester+<IndexerTest_4>c__async24+<IndexerTest_4>c__AnonStorey44">\r
+ <type name="Tester+<IndexerTest_4>c__async25+<IndexerTest_4>c__AnonStorey45">\r
<method name="Int32 <>m__50()" attrs="131">\r
<size>25</size>\r
</method>\r
<size>7</size>\r
</method>\r
</type>\r
- <type name="Tester+<IndexerTest_5>c__async25+<IndexerTest_5>c__AnonStorey45">\r
+ <type name="Tester+<IndexerTest_5>c__async26+<IndexerTest_5>c__AnonStorey46">\r
<method name="Int32 <>m__52()" attrs="131">\r
<size>25</size>\r
</method>\r
<size>7</size>\r
</method>\r
</type>\r
- <type name="Tester+<IndexerTest_7>c__async27+<IndexerTest_7>c__AnonStorey46">\r
+ <type name="Tester+<IndexerTest_7>c__async28+<IndexerTest_7>c__AnonStorey47">\r
<method name="Int32 <>m__57()" attrs="131">\r
<size>25</size>\r
</method>\r
<size>7</size>\r
</method>\r
</type>\r
- <type name="Tester+<UnaryTest_2>c__async3C+<UnaryTest_2>c__AnonStorey47">\r
- <method name="Void .ctor()" attrs="6278">\r
- <size>7</size>\r
- </method>\r
- </type>\r
- <type name="Tester+<AssignTest_2>c__asyncA">\r
- <method name="System.Nullable`1[System.SByte] <>m__1F()" attrs="145">\r
- <size>17</size>\r
- </method>\r
- </type>\r
- <type name="Tester+<BinaryTest_3>c__asyncE">\r
- <method name="System.Nullable`1[System.Boolean] <>m__28()" attrs="145">\r
- <size>14</size>\r
- </method>\r
- <method name="System.Nullable`1[System.Boolean] <>m__29()" attrs="145">\r
- <size>17</size>\r
- </method>\r
- <method name="System.Nullable`1[System.Boolean] <>m__2A()" attrs="145">\r
- <size>17</size>\r
- </method>\r
- <method name="System.Nullable`1[System.Boolean] <>m__2B()" attrs="145">\r
- <size>14</size>\r
- </method>\r
- <method name="System.Nullable`1[System.Boolean] <>m__2C()" attrs="145">\r
- <size>17</size>\r
- </method>\r
- <method name="System.Nullable`1[System.Boolean] <>m__2D()" attrs="145">\r
- <size>14</size>\r
- </method>\r
- </type>\r
- <type name="Tester+<BinaryTest_4>c__asyncF">\r
- <method name="System.Nullable`1[System.Int16] <>m__2E()" attrs="145">\r
- <size>14</size>\r
- </method>\r
- <method name="System.Nullable`1[System.Byte] <>m__2F()" attrs="145">\r
- <size>17</size>\r
- </method>\r
- <method name="System.Nullable`1[System.Decimal] <>m__30()" attrs="145">\r
- <size>20</size>\r
- </method>\r
- <method name="System.Nullable`1[System.Decimal] <>m__31()" attrs="145">\r
- <size>17</size>\r
- </method>\r
- </type>\r
- <type name="Tester+<CoalescingTest_2>c__async19">\r
- <method name="System.Nullable`1[System.Int16] <>m__3D()" attrs="145">\r
- <size>17</size>\r
- </method>\r
- </type>\r
- <type name="Tester+<IsTest_2>c__async29">\r
- <method name="System.Nullable`1[System.UInt32] <>m__59()" attrs="145">\r
- <size>14</size>\r
- </method>\r
- </type>\r
- <type name="Tester+<UnaryTest_2>c__async3C+<UnaryTest_2>c__AnonStorey47">\r
+ <type name="Tester+<UnaryTest_2>c__async3D+<UnaryTest_2>c__AnonStorey48">\r
<method name="System.Nullable`1[System.Int16] <>m__7D()" attrs="131">\r
<size>14</size>\r
</method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
</type>\r
</test>\r
<test name="test-async-14.cs">\r
<size>0</size>\r
</method>\r
</type>\r
- <type name="A+<async>c__async0">\r
- <method name="Void MoveNext()" attrs="486">\r
- <size>38</size>\r
- </method>\r
- </type>\r
<type name="A+<async>c__async1">\r
<method name="Void MoveNext()" attrs="486">\r
- <size>37</size>\r
+ <size>38</size>\r
</method>\r
</type>\r
<type name="A">\r
<size>35</size>\r
</method>\r
</type>\r
- <type name="A+<CastTest>c__async2">\r
- <method name="Void MoveNext()" attrs="486">\r
- <size>285</size>\r
- </method>\r
- </type>\r
- <type name="A+<async>c__async0">\r
- <method name="Void SetStateMachine(IAsyncStateMachine)" attrs="486">\r
- <size>13</size>\r
- </method>\r
- </type>\r
<type name="A+<async>c__async1">\r
<method name="Void SetStateMachine(IAsyncStateMachine)" attrs="486">\r
<size>13</size>\r
</method>\r
</type>\r
- <type name="A+<CastTest>c__async2">\r
- <method name="Void SetStateMachine(IAsyncStateMachine)" attrs="486">\r
- <size>13</size>\r
- </method>\r
- </type>\r
<type name="C">\r
<method name="Void Test(Boolean)" attrs="145">\r
<size>20</size>\r
<size>14</size>\r
</method>\r
</type>\r
+ <type name="A">\r
+ <method name="Void Iasync.async()" attrs="481">\r
+ <size>27</size>\r
+ </method>\r
+ </type>\r
+ <type name="A+<async>c__async2">\r
+ <method name="Void MoveNext()" attrs="486">\r
+ <size>37</size>\r
+ </method>\r
+ <method name="Void SetStateMachine(IAsyncStateMachine)" attrs="486">\r
+ <size>13</size>\r
+ </method>\r
+ </type>\r
+ <type name="A+<CastTest>c__async3">\r
+ <method name="Void MoveNext()" attrs="486">\r
+ <size>285</size>\r
+ </method>\r
+ <method name="Void SetStateMachine(IAsyncStateMachine)" attrs="486">\r
+ <size>13</size>\r
+ </method>\r
+ </type>\r
+ <type name="A+async>c__async0">\r
+ <method name="Void MoveNext()" attrs="486">\r
+ <size>31</size>\r
+ </method>\r
+ <method name="Void SetStateMachine(IAsyncStateMachine)" attrs="486">\r
+ <size>13</size>\r
+ </method>\r
+ </type>\r
</test>\r
<test name="test-async-23.cs">\r
<type name="MyContext">\r
</method>\r
</type>\r
</test>\r
+ <test name="test-debug-27.cs">\r
+ <type name="S">\r
+ <method name="Int32 op_Implicit(S)" attrs="2198">\r
+ <size>10</size>\r
+ </method>\r
+ <method name="Void .ctor(Int32)" attrs="6278">\r
+ <size>2</size>\r
+ </method>\r
+ </type>\r
+ <type name="C">\r
+ <method name="Int32 A()" attrs="150">\r
+ <size>10</size>\r
+ </method>\r
+ <method name="Int32 B(C)" attrs="150">\r
+ <size>10</size>\r
+ </method>\r
+ <method name="C Test()" attrs="150">\r
+ <size>14</size>\r
+ </method>\r
+ <method name="System.String Foo()" attrs="134">\r
+ <size>10</size>\r
+ </method>\r
+ <method name="Void Test_1()" attrs="129">\r
+ <size>46</size>\r
+ </method>\r
+ <method name="Void Test_2()" attrs="129">\r
+ <size>10</size>\r
+ </method>\r
+ <method name="Void Test_3()" attrs="129">\r
+ <size>32</size>\r
+ </method>\r
+ <method name="Void Test_4()" attrs="129">\r
+ <size>13</size>\r
+ </method>\r
+ <method name="Int32 Main()" attrs="145">\r
+ <size>10</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
<test name="test-externalias-01.cs">\r
<type name="Test">\r
<method name="Int32 Main()" attrs="150">\r
</method>\r
</type>\r
</test>\r
+ <test name="test-named-08.cs">\r
+ <type name="C">\r
+ <method name="Int32 Foo(System.String, Int32)" attrs="145">\r
+ <size>18</size>\r
+ </method>\r
+ <method name="Int32 Foo(System.String, Int32, Boolean, Boolean)" attrs="145">\r
+ <size>10</size>\r
+ </method>\r
+ <method name="Int32 Foo(Double, Boolean, Boolean, Boolean)" attrs="145">\r
+ <size>10</size>\r
+ </method>\r
+ <method name="Int32 Main()" attrs="150">\r
+ <size>34</size>\r
+ </method>\r
+ <method name="Void .ctor()" attrs="6278">\r
+ <size>7</size>\r
+ </method>\r
+ </type>\r
+ </test>\r
<test name="test-partial-01.cs">\r
<type name="Foo.Hello">\r
<method name="Void .ctor()" attrs="6278">\r
eval.InteractiveBaseClass = typeof (InteractiveBaseShell);
eval.DescribeTypeExpressions = true;
+ eval.WaitOnTask = true;
CSharpShell shell;
#if !ON_DOTNET
%if %sgen == yes
%_bindir/mono-sgen
%endif
+%_bindir/mono-boehm
%_bindir/mono-test-install
%_bindir/mozroots
%_bindir/peverify
%_prefix/lib/mono/4.5/System.Windows.dll
%_prefix/lib/mono/4.5/System.Xml.Serialization.dll
%_prefix/lib/mono/4.5/Facades/*.dll
-%_prefix/lib/mono/4.5/Facades/*.dll.mdb
%_prefix/lib/mono/compat-2.0/ICSharpCode.SharpZipLib.dll
%_prefix/lib/mono/gac/Commons.Xml.Relaxng
%_prefix/lib/mono/gac/CustomMarshalers
%_libdir/pkgconfig/mono-2.pc
%if %sgen == yes
-%package -n libmonosgen-2_0-0
+%package -n libmonosgen-2_0-1
License: LGPL v2.1 only
Summary: A Library for embedding Mono in your Application (sgen version)
Group: Development/Libraries/C and C++
-%description -n libmonosgen-2_0-0
+%description -n libmonosgen-2_0-1
The Mono Project is an open development initiative that is working to
develop an open source, Unix version of the .NET development platform.
Its objective is to enable Unix developers to build and deploy
A Library for embedding Mono in your Application (sgen version).
-%files -n libmonosgen-2_0-0
+%files -n libmonosgen-2_0-1
%defattr(-, root, root)
-%_libdir/libmonosgen-2.0.so.0*
+%_libdir/libmonosgen-2.0.so.1*
-%post -n libmonosgen-2_0-0 -p /sbin/ldconfig
+%post -n libmonosgen-2_0-1 -p /sbin/ldconfig
-%postun -n libmonosgen-2_0-0 -p /sbin/ldconfig
+%postun -n libmonosgen-2_0-1 -p /sbin/ldconfig
%package -n libmonosgen-2_0-devel
License: LGPL v2.1 only
%_libdir/pkgconfig/monosgen-2.pc
%endif
+%package -n libmonoboehm-2_0-1
+License: LGPL v2.1 only
+Summary: A Library for embedding Mono in your Application (boehm version)
+Group: Development/Libraries/C and C++
+
+%description -n libmonoboehm-2_0-1
+The Mono Project is an open development initiative that is working to
+develop an open source, Unix version of the .NET development platform.
+Its objective is to enable Unix developers to build and deploy
+cross-platform .NET applications. The project will implement various
+technologies that have been submitted to the ECMA for standardization.
+
+A Library for embedding Mono in your Application (boehm version).
+
+%files -n libmonoboehm-2_0-1
+%defattr(-, root, root)
+%_libdir/libmonoboehm-2.0.so.1*
+
+%post -n libmonoboehm-2_0-1 -p /sbin/ldconfig
+
+%postun -n libmonoboehm-2_0-1 -p /sbin/ldconfig
+
+%package -n libmonoboehm-2_0-devel
+License: LGPL v2.1 only
+Summary: Development files for libmonosgen
+Group: Development/Languages/Mono
+Requires: mono-core == %version-%release
+Requires: libmono-2_0-devel
+
+%description -n libmonoboehm-2_0-devel
+The Mono Project is an open development initiative that is working to
+develop an open source, Unix version of the .NET development platform.
+Its objective is to enable Unix developers to build and deploy
+cross-platform .NET applications. The project will implement various
+technologies that have been submitted to the ECMA for standardization.
+
+Development files for libmonoboehm.
+
+%files -n libmonoboehm-2_0-devel
+%defattr(-, root, root)
+%_libdir/libmonoboehm-2.0.a
+%_libdir/libmonoboehm-2.0.so
+
%if %llvm == yes
%package -n libmono-llvm0
License: LGPL v2.1 only
%_prefix/lib/mono/gac/Mono.Debugger.Soft
%_prefix/lib/mono/gac/PEAPI
%_prefix/lib/mono/xbuild
-%_prefix/lib/mono/xbuild/Microsoft/Portable/v4.0/Microsoft.Portable.CSharp.targets
-%_prefix/lib/mono/xbuild/Microsoft/Portable/v4.5/Microsoft.Portable.CSharp.targets
%_prefix/lib/mono/xbuild-frameworks
%package -n monodoc-core
Requires: libmono-llvm0 = %version-%release
%endif
%if %sgen == yes
-Requires: libmonosgen-2_0-0 = %version-%release
+Requires: libmonosgen-2_0-1 = %version-%release
Requires: libmonosgen-2_0-devel = %version-%release
%endif
Requires: mono-data = %version-%release
#include <mono/metadata/loader.h>
#include <mono/metadata/assembly.h>
#include <mono/metadata/appdomain.h>
+#include <mono/utils/bsearch.h>
static void setup_filter (MonoImage *image);
static gboolean should_include_type (int idx);
loc.col_idx = MONO_INTERFACEIMPL_CLASS;
loc.idx = typedef_row;
- if (!bsearch (&loc, table->base, table->rows, table->row_size, table_locator))
+ if (!mono_binary_search (&loc, table->base, table->rows, table->row_size, table_locator))
return;
start = loc.result;
{
if (!tf->count)
return FALSE;
- return bsearch (&idx, tf->elems, tf->count, sizeof (int), int_cmp) != NULL;
+ return mono_binary_search (&idx, tf->elems, tf->count, sizeof (int), int_cmp) != NULL;
}
static gboolean
#include <mono/io-layer/wapi-private.h>
#include <mono/io-layer/misc-private.h>
#include <mono/io-layer/messages.h>
+#include <mono/utils/bsearch.h>
#undef DEBUG
ErrorDesc d, *result;
d.id = id;
- result = bsearch (&d, base, n, sizeof (ErrorDesc), msg_compare);
+ result = mono_binary_search (&d, base, n, sizeof (ErrorDesc), msg_compare);
if (result == NULL)
return NULL;
return result->txt;
EXTRA_DIST = make-bundle.pl sample-bundle $(win32_sources) $(unix_sources) $(null_sources) runtime.h \
tpool-poll.c tpool-epoll.c tpool-kqueue.c Makefile.am.in
+if HAS_EXTENSION_MODULE
+else
+Makefile.am: Makefile.am.in
+ cp $< $@
+endif
private_file_needs_copying (const char *src, struct stat *sbuf_src, char *dest)
{
struct stat sbuf_dest;
+ gchar *stat_src;
gchar *real_src = mono_portability_find_file (src, TRUE);
if (!real_src)
- real_src = (gchar*)src;
-
- if (stat (real_src, sbuf_src) == -1) {
+ stat_src = (gchar*)src;
+ else
+ stat_src = real_src;
+
+ if (stat (stat_src, sbuf_src) == -1) {
time_t tnow = time (NULL);
+
+ if (real_src)
+ g_free (real_src);
+
memset (sbuf_src, 0, sizeof (*sbuf_src));
sbuf_src->st_mtime = tnow;
sbuf_src->st_atime = tnow;
return TRUE;
}
+ if (real_src)
+ g_free (real_src);
+
if (stat (dest, &sbuf_dest) == -1)
return TRUE;
{
gint32 count;
do {
- count = mono_atomic_load_acquire (&data->refcount);
+ mono_atomic_load_acquire (count, gint32, &data->refcount);
g_assert (count >= 1 && count <= 2);
if (count == 1) {
g_free (data);
{"System.Data", 0},
{"System.Data.Linq", 2},
{"System.Data.OracleClient", 0},
+ {"System.Data.Services", 2},
+ {"System.Data.Services.Client", 2},
{"System.Data.SqlXml", 0},
{"System.Design", 0},
{"System.DirectoryServices", 0},
{"System.EnterpriseServices", 0},
{"System.Management", 0},
{"System.Messaging", 0},
+ {"System.Net", 2},
{"System.Runtime.Remoting", 0},
{"System.Runtime.Serialization", 3},
{"System.Runtime.Serialization.Formatters.Soap", 0},
{"System.Security", 0},
+ {"System.ServiceModel.Web", 2},
{"System.ServiceProcess", 0},
{"System.Transactions", 0},
{"System.Web", 0},
{"System.Web.Abstractions", 2},
+ {"System.Web.DynamicData", 2},
+ {"System.Web.Extensions", 2},
{"System.Web.Mobile", 0},
{"System.Web.Routing", 2},
{"System.Web.Services", 0},
{"System.Windows.Forms", 0},
{"System.Xml", 0},
+ {"System.Xml.Linq", 2},
+ {"WindowsBase", 3},
{"mscorlib", 0}
};
#endif
#include <mono/utils/mono-logger-internal.h>
#include <mono/utils/mono-memory-model.h>
#include <mono/utils/atomic.h>
+#include <mono/utils/bsearch.h>
+
MonoStats mono_stats;
gboolean mono_print_vtable = FALSE;
MonoGenericContainer *container = NULL;
MonoClass *gtd = class->generic_class ? mono_class_get_generic_type_definition (class) : NULL;
+ /*
+ * FIXME: We have a race condition here. It's possible that this function returns
+ * to its caller with `instance_size` set to `0` instead of the actual size. This
+ * is not a problem when the function is called recursively on the same class,
+ * because the size will be initialized by the outer invocation. What follows is a
+ * description of how it can occur in other cases, too. There it is a problem,
+ * because it can lead to the GC being asked to allocate an object of size `0`,
+ * which SGen chokes on. The race condition is triggered infrequently by
+ * `tests/sgen-suspend.cs`.
+ *
+ * This function is called for a class whenever one of its subclasses is inited.
+ * For example, it's called for every subclass of Object. What it does is this:
+ *
+ * if (class->setup_fields_called)
+ * return;
+ * ...
+ * class->instance_size = 0;
+ * ...
+ * class->setup_fields_called = 1;
+ * ... critical point
+ * class->instance_size = actual_instance_size;
+ *
+ * The last two steps are sometimes reversed, but that only changes the way in which
+ * the race condition works.
+ *
+ * Assume thread A goes through this function and makes it to the critical point.
+ * Now thread B runs the function and, since `setup_fields_called` is set, returns
+ * immediately, but `instance_size` is incorrect.
+ *
+ * The other case looks like this:
+ *
+ * if (class->setup_fields_called)
+ * return;
+ * ... critical point X
+ * class->instance_size = 0;
+ * ... critical point Y
+ * class->instance_size = actual_instance_size;
+ * ...
+ * class->setup_fields_called = 1;
+ *
+ * Assume thread A goes through the function and makes it to critical point X. Now
+ * thread B runs through the whole of the function, returning, assuming
+ * `instance_size` is set. At that point thread A gets to run and makes it to
+ * critical point Y, at which time `instance_size` is `0` again, invalidating thread
+ * B's assumption.
+ */
if (class->setup_fields_called)
return;
mono_memory_barrier ();
class->size_inited = 1;
class->fields_inited = 1;
+ class->setup_fields_called = 1;
return;
}
/*FIXME verify all callers if they should switch to mono_class_interface_offset_with_variance*/
int
mono_class_interface_offset (MonoClass *klass, MonoClass *itf) {
- MonoClass **result = bsearch (
+ MonoClass **result = mono_binary_search (
itf,
klass->interfaces_packed,
klass->interface_offsets_count,
{
MONO_ARCH_SAVE_REGS;
- return (GetFileType (handle) == FILE_TYPE_CHAR);
+ DWORD mode;
+ return GetConsoleMode (handle, &mode) != 0;
}
MonoBoolean
#include <mono/metadata/metadata-internals.h>
#include <mono/metadata/class-internals.h>
#include <mono/utils/mono-mmap.h>
+#include <mono/utils/bsearch.h>
#include <fcntl.h>
#ifdef HAVE_UNISTD_H
first_ie = (MonoSymbolFileMethodEntry *)
(symfile->raw_contents + read32(&(symfile->offset_table->_method_table_offset)));
- ie = bsearch (GUINT_TO_POINTER (mono_method_get_token (method)), first_ie,
+ ie = mono_binary_search (GUINT_TO_POINTER (mono_method_get_token (method)), first_ie,
read32(&(symfile->offset_table->_method_count)),
sizeof (MonoSymbolFileMethodEntry), compare_method);
*error=ERROR_SUCCESS;
MONO_CHECK_ARG_NULL (dest);
-
- if (dest_offset + count > mono_array_length (dest))
- return 0;
+
+ if (dest_offset > mono_array_length (dest) - count)
+ mono_raise_exception (mono_get_exception_argument ("array", "array too small. numBytes/offset wrong."));
buffer = mono_array_addr (dest, guchar, dest_offset);
result = ReadFile (handle, buffer, count, &n, NULL);
MONO_CHECK_ARG_NULL (src);
- if (src_offset + count > mono_array_length (src))
- return 0;
+ if (src_offset > mono_array_length (src) - count)
+ mono_raise_exception (mono_get_exception_argument ("array", "array too small. numBytes/offset wrong."));
buffer = mono_array_addr (src, guchar, src_offset);
result = WriteFile (handle, buffer, count, &n, NULL);
#include <mono/utils/mono-mmap.h>
#include <mono/utils/mono-io-portability.h>
#include <mono/utils/mono-digest.h>
+#include <mono/utils/bsearch.h>
#if defined (HOST_WIN32)
#include <windows.h>
static gpointer
find_method_icall (const IcallTypeDesc *imap, const char *name)
{
- const guint16 *nameslot = bsearch (name, icall_names_idx + imap->first_icall, icall_desc_num_icalls (imap), sizeof (icall_names_idx [0]), compare_method_imap);
+ const guint16 *nameslot = mono_binary_search (name, icall_names_idx + imap->first_icall, icall_desc_num_icalls (imap), sizeof (icall_names_idx [0]), compare_method_imap);
if (!nameslot)
return NULL;
return (gpointer)icall_functions [(nameslot - &icall_names_idx [0])];
static const IcallTypeDesc*
find_class_icalls (const char *name)
{
- const guint16 *nameslot = bsearch (name, icall_type_names_idx, Icall_type_num, sizeof (icall_type_names_idx [0]), compare_class_imap);
+ const guint16 *nameslot = mono_binary_search (name, icall_type_names_idx, Icall_type_num, sizeof (icall_type_names_idx [0]), compare_class_imap);
if (!nameslot)
return NULL;
return &icall_type_descs [nameslot - &icall_type_names_idx [0]];
static gpointer
find_method_icall (const IcallTypeDesc *imap, const char *name)
{
- const char **nameslot = bsearch (name, icall_names + imap->first_icall, icall_desc_num_icalls (imap), sizeof (icall_names [0]), compare_method_imap);
+ const char **nameslot = mono_binary_search (name, icall_names + imap->first_icall, icall_desc_num_icalls (imap), sizeof (icall_names [0]), compare_method_imap);
if (!nameslot)
return NULL;
return (gpointer)icall_functions [(nameslot - icall_names)];
static const IcallTypeDesc*
find_class_icalls (const char *name)
{
- const char **nameslot = bsearch (name, icall_type_names, Icall_type_num, sizeof (icall_type_names [0]), compare_class_imap);
+ const char **nameslot = mono_binary_search (name, icall_type_names, Icall_type_num, sizeof (icall_type_names [0]), compare_class_imap);
if (!nameslot)
return NULL;
return &icall_type_descs [nameslot - icall_type_names];
func = mono_lookup_internal_call (m);
if (!func)
return NULL;
- slot = bsearch (func, functions_sorted, G_N_ELEMENTS (icall_functions), sizeof (gpointer), func_cmp);
+ slot = mono_binary_search (func, functions_sorted, G_N_ELEMENTS (icall_functions), sizeof (gpointer), func_cmp);
if (!slot)
return NULL;
g_assert (slot);
free_hash (image->delegate_invoke_generic_cache);
free_hash (image->delegate_begin_invoke_generic_cache);
free_hash (image->delegate_end_invoke_generic_cache);
+ free_hash (image->synchronized_generic_cache);
free_hash (image->remoting_invoke_cache);
free_hash (image->runtime_invoke_cache);
free_hash (image->runtime_invoke_direct_cache);
#include <mono/metadata/locales.h>
#include <mono/metadata/culture-info.h>
#include <mono/metadata/culture-info-tables.h>
+#include <mono/utils/bsearch.h>
#ifndef DISABLE_NORMALIZATION
#include <mono/metadata/normalization-tables.h>
MONO_ARCH_SAVE_REGS;
- ne = bsearch (name, culture_name_entries, NUM_CULTURE_ENTRIES,
+ ne = mono_binary_search (name, culture_name_entries, NUM_CULTURE_ENTRIES,
sizeof (CultureInfoNameEntry), culture_name_locator);
if (ne == NULL)
{
const CultureInfoEntry *ci;
- ci = bsearch (&lcid, culture_entries, NUM_CULTURE_ENTRIES, sizeof (CultureInfoEntry), culture_lcid_locator);
+ ci = mono_binary_search (&lcid, culture_entries, NUM_CULTURE_ENTRIES, sizeof (CultureInfoEntry), culture_lcid_locator);
return ci;
}
MONO_ARCH_SAVE_REGS;
- ne = bsearch (&lcid, culture_entries, NUM_CULTURE_ENTRIES, sizeof (CultureInfoEntry), culture_lcid_locator);
+ ne = mono_binary_search (&lcid, culture_entries, NUM_CULTURE_ENTRIES, sizeof (CultureInfoEntry), culture_lcid_locator);
if (ne == NULL)
return FALSE;
MONO_ARCH_SAVE_REGS;
n = mono_string_to_utf8 (name);
- ne = bsearch (n, culture_name_entries, NUM_CULTURE_ENTRIES,
+ ne = mono_binary_search (n, culture_name_entries, NUM_CULTURE_ENTRIES,
sizeof (CultureInfoNameEntry), culture_name_locator);
if (ne == NULL) {
MONO_ARCH_SAVE_REGS;
n = mono_string_to_utf8 (name);
- ne = bsearch (n, region_name_entries, NUM_REGION_ENTRIES,
+ ne = mono_binary_search (n, region_name_entries, NUM_REGION_ENTRIES,
sizeof (RegionInfoNameEntry), region_name_locator);
if (ne == NULL) {
static void
mono_byvalarray_to_array (MonoArray *arr, gpointer native_arr, MonoClass *eltype, guint32 elnum);
+static void
+mono_byvalarray_to_byte_array (MonoArray *arr, gpointer native_arr, guint32 elnum);
+
static void
mono_array_to_byvalarray (gpointer native_arr, MonoArray *arr, MonoClass *eltype, guint32 elnum);
+static void
+mono_array_to_byte_byvalarray (gpointer native_arr, MonoArray *arr, guint32 elnum);
static MonoAsyncResult *
mono_delegate_begin_invoke (MonoDelegate *delegate, gpointer *params);
register_icall (mono_array_to_lparray, "mono_array_to_lparray", "ptr object", FALSE);
register_icall (mono_free_lparray, "mono_free_lparray", "void object ptr", FALSE);
register_icall (mono_byvalarray_to_array, "mono_byvalarray_to_array", "void object ptr ptr int32", FALSE);
+ register_icall (mono_byvalarray_to_byte_array, "mono_byvalarray_to_byte_array", "void object ptr int32", FALSE);
register_icall (mono_array_to_byvalarray, "mono_array_to_byvalarray", "void ptr object ptr int32", FALSE);
+ register_icall (mono_array_to_byte_byvalarray, "mono_array_to_byte_byvalarray", "void ptr object int32", FALSE);
register_icall (mono_delegate_to_ftnptr, "mono_delegate_to_ftnptr", "ptr object", FALSE);
register_icall (mono_ftnptr_to_delegate, "mono_ftnptr_to_delegate", "object ptr ptr", FALSE);
register_icall (mono_marshal_asany, "mono_marshal_asany", "ptr object int32 int32", FALSE);
g_assert_not_reached ();
}
+static void
+mono_byvalarray_to_byte_array (MonoArray *arr, gpointer native_arr, guint32 elnum)
+{
+ mono_byvalarray_to_array (arr, native_arr, mono_defaults.byte_class, elnum);
+}
+
static void
mono_array_to_byvalarray (gpointer native_arr, MonoArray *arr, MonoClass *elclass, guint32 elnum)
{
}
}
+static void
+mono_array_to_byte_byvalarray (gpointer native_arr, MonoArray *arr, guint32 elnum)
+{
+ mono_array_to_byvalarray (native_arr, arr, mono_defaults.byte_class, elnum);
+}
+
void
mono_string_utf8_to_builder (MonoStringBuilder *sb, char *text)
{
mono_mb_emit_ldloc (mb, 1);
mono_mb_emit_byte (mb, CEE_LDIND_REF);
mono_mb_emit_ldloc (mb, 0);
- mono_mb_emit_ptr (mb, mono_defaults.byte_class);
mono_mb_emit_icon (mb, mspec->data.array_data.num_elem);
- mono_mb_emit_icall (mb, mono_byvalarray_to_array);
+ mono_mb_emit_icall (mb, mono_byvalarray_to_byte_array);
break;
}
case MONO_MARSHAL_CONV_STR_BYVALSTR:
mono_mb_emit_ldloc (mb, 1);
mono_mb_emit_ldloc (mb, 0);
mono_mb_emit_byte (mb, CEE_LDIND_REF);
- mono_mb_emit_ptr (mb, mono_defaults.byte_class);
mono_mb_emit_icon (mb, mspec->data.array_data.num_elem);
- mono_mb_emit_icall (mb, mono_array_to_byvalarray);
+ mono_mb_emit_icall (mb, mono_array_to_byte_byvalarray);
mono_mb_patch_short_branch (mb, pos);
break;
}
res = mono_marshal_get_wrapper_info (wrapper);
if (res == NULL)
return wrapper;
- return res;
+ if (wrapper->is_inflated)
+ /*
+ * A method cannot be inflated and a wrapper at the same time, so the wrapper info
+ * contains an uninflated method.
+ */
+ return mono_class_inflate_generic_method (res, mono_method_get_context (wrapper));
+ else
+ return res;
case MONO_WRAPPER_MANAGED_TO_NATIVE:
info = mono_marshal_get_wrapper_info (wrapper);
if (info && (info->subtype == WRAPPER_SUBTYPE_NONE || info->subtype == WRAPPER_SUBTYPE_NATIVE_FUNC_AOT))
return klass;
}
+/*
+ * Wrappers for generic methods should be instances of generic wrapper methods, i.e .the wrapper for Sort<int> should be
+ * an instance of the wrapper for Sort<T>. This is required for full-aot to work.
+ */
+
+/*
+ * check_generic_wrapper_cache:
+ *
+ * Check CACHE for the wrapper of the generic instance ORIG_METHOD, and return it if it is found.
+ * KEY should be the key for ORIG_METHOD in the cache, while DEF_KEY should be the key of its
+ * generic method definition.
+ */
+static MonoMethod*
+check_generic_wrapper_cache (GHashTable *cache, MonoMethod *orig_method, gpointer key, gpointer def_key)
+{
+ MonoMethod *res;
+ MonoMethod *inst, *def;
+ MonoGenericContext *ctx;
+ MonoMethod *def_method;
+
+ g_assert (orig_method->is_inflated);
+ def_method = ((MonoMethodInflated*)orig_method)->declaring;
+ ctx = mono_method_get_context (orig_method);
+
+ /*
+ * Look for the instance
+ */
+ res = mono_marshal_find_in_cache (cache, key);
+ if (res)
+ return res;
+
+ /*
+ * Look for the definition
+ */
+ def = mono_marshal_find_in_cache (cache, def_key);
+ if (def) {
+ inst = mono_class_inflate_generic_method (def, ctx);
+ /* Cache it */
+ mono_memory_barrier ();
+ mono_marshal_lock ();
+ res = g_hash_table_lookup (cache, key);
+ if (!res) {
+ g_hash_table_insert (cache, key, inst);
+ res = inst;
+ }
+ mono_marshal_unlock ();
+ return res;
+ }
+ return NULL;
+}
+
+static MonoMethod*
+cache_generic_wrapper (GHashTable *cache, MonoMethod *orig_method, MonoMethod *def, MonoGenericContext *ctx, gpointer key)
+{
+ MonoMethod *inst, *res;
+
+ /*
+ * We use the same cache for the generic definition and the instances.
+ */
+ inst = mono_class_inflate_generic_method (def, ctx);
+ mono_memory_barrier ();
+ mono_marshal_lock ();
+ res = g_hash_table_lookup (cache, key);
+ if (!res) {
+ g_hash_table_insert (cache, key, inst);
+ res = inst;
+ }
+ mono_marshal_unlock ();
+ return res;
+}
+
static MonoMethod*
check_generic_delegate_wrapper_cache (GHashTable *cache, MonoMethod *orig_method, MonoMethod *def_method, MonoGenericContext *ctx)
{
static MonoType*
get_runtime_invoke_type (MonoType *t, gboolean ret)
{
- if (t->byref)
+ if (t->byref) {
+ if (t->type == MONO_TYPE_GENERICINST && mono_class_is_nullable (mono_class_from_mono_type (t)))
+ return t;
/* Can't share this with 'I' as that needs another indirection */
- return t;
+ return &mono_defaults.int_class->this_arg;
+ }
if (MONO_TYPE_IS_REFERENCE (t))
return &mono_defaults.object_class->byval_arg;
/* Can't share this as we push a string as this */
need_direct_wrapper = TRUE;
} else {
- if (method->klass->valuetype && mono_method_signature (method)->hasthis) {
- /*
- * Valuetype methods receive a managed pointer as the this argument.
- * Create a new signature to reflect this.
- */
- callsig = signature_dup_add_this (method->klass->image, mono_method_signature (method), method->klass);
- /* Can't share this as it would be shared with static methods taking an IntPtr argument */
- need_direct_wrapper = TRUE;
- } else {
- if (method->dynamic)
- callsig = signature_dup (method->klass->image, mono_method_signature (method));
- else
- callsig = mono_method_signature (method);
- }
+ if (method->dynamic)
+ callsig = signature_dup (method->klass->image, mono_method_signature (method));
+ else
+ callsig = mono_method_signature (method);
}
target_klass = get_wrapper_target_class (method->klass->image);
csig->ret = &mono_defaults.object_class->byval_arg;
if (method->klass->valuetype && mono_method_signature (method)->hasthis)
- csig->params [0] = callsig->params [0];
+ csig->params [0] = get_runtime_invoke_type (&method->klass->this_arg, FALSE);
else
csig->params [0] = &mono_defaults.object_class->byval_arg;
csig->params [1] = &mono_defaults.int_class->byval_arg;
MonoBoolean set_last_error = 0;
MonoBoolean best_fit_mapping = 0;
MonoBoolean throw_on_unmappable = 0;
+ MonoError error;
- mono_reflection_create_custom_attr_data_args (mono_defaults.corlib, attr->ctor, attr->data, attr->data_size, &typed_args, &named_args, &arginfo);
-
+ mono_reflection_create_custom_attr_data_args (mono_defaults.corlib, attr->ctor, attr->data, attr->data_size, &typed_args, &named_args, &arginfo, &error);
+ g_assert (mono_error_ok (&error));
g_assert (mono_array_length (typed_args) == 1);
/* typed args */
WrapperInfo *info;
MonoMethodSignature *sig;
MonoMethod *res;
+ MonoGenericContext *ctx = NULL;
+ MonoMethod *orig_method = NULL;
+ MonoGenericContainer *container = NULL;
+
+ if (method->is_inflated && !mono_method_get_context (method)->method_inst) {
+ orig_method = method;
+ ctx = &((MonoMethodInflated*)method)->context;
+ method = ((MonoMethodInflated*)method)->declaring;
+ container = mono_method_get_generic_container (method);
+ if (!container)
+ container = method->klass->generic_container;
+ g_assert (container);
+ }
mb = mono_mb_new (method->klass, method->name, MONO_WRAPPER_UNKNOWN);
#ifndef DISABLE_JIT
info = mono_wrapper_info_create (res, WRAPPER_SUBTYPE_SYNCHRONIZED_INNER);
info->d.synchronized_inner.method = method;
mono_marshal_set_wrapper_info (res, info);
+ if (ctx)
+ res = mono_class_inflate_generic_method (res, ctx);
return res;
}
MonoMethod *res;
GHashTable *cache;
int i, pos, this_local, ret_local = 0;
+ MonoGenericContext *ctx = NULL;
+ MonoMethod *orig_method = NULL;
+ MonoGenericContainer *container = NULL;
g_assert (method);
if (method->wrapper_type == MONO_WRAPPER_SYNCHRONIZED)
return method;
- cache = get_cache (&method->klass->image->synchronized_cache, mono_aligned_addr_hash, NULL);
- if ((res = mono_marshal_find_in_cache (cache, method)))
- return res;
+ /* FIXME: Support generic methods too */
+ if (method->is_inflated && !mono_method_get_context (method)->method_inst) {
+ orig_method = method;
+ ctx = &((MonoMethodInflated*)method)->context;
+ method = ((MonoMethodInflated*)method)->declaring;
+ container = mono_method_get_generic_container (method);
+ if (!container)
+ container = method->klass->generic_container;
+ g_assert (container);
+ }
+
+ /*
+ * Check cache
+ */
+ if (ctx) {
+ cache = get_cache (&method->klass->image->synchronized_generic_cache, mono_aligned_addr_hash, NULL);
+ res = check_generic_wrapper_cache (cache, orig_method, orig_method, method);
+ if (res)
+ return res;
+ } else {
+ cache = get_cache (&method->klass->image->synchronized_cache, mono_aligned_addr_hash, NULL);
+ if ((res = mono_marshal_find_in_cache (cache, method)))
+ return res;
+ }
sig = signature_dup (method->klass->image, mono_method_signature (method));
sig->pinvoke = 0;
for (i = 0; i < sig->param_count; i++)
mono_mb_emit_ldarg (mb, i + (sig->hasthis == TRUE));
- mono_mb_emit_managed_call (mb, method, NULL);
+ if (ctx)
+ mono_mb_emit_managed_call (mb, mono_class_inflate_generic_method (method, &container->context), NULL);
+ else
+ mono_mb_emit_managed_call (mb, method, NULL);
if (!MONO_TYPE_IS_VOID (sig->ret))
mono_mb_emit_stloc (mb, ret_local);
mono_mb_set_clauses (mb, 1, clause);
#endif
- res = mono_mb_create_and_cache (cache, method,
- mb, sig, sig->param_count + 16);
+ if (ctx) {
+ MonoMethod *def;
+ def = mono_mb_create_and_cache (cache, method, mb, sig, sig->param_count + 16);
+ res = cache_generic_wrapper (cache, orig_method, def, ctx, orig_method);
+ } else {
+ res = mono_mb_create_and_cache (cache, method,
+ mb, sig, sig->param_count + 16);
+ }
mono_mb_free (mb);
return res;
return ret;
}
+/*
+ * mono_marshal_get_array_accessor_wrapper:
+ *
+ * Return a wrapper which just calls METHOD, which should be an Array Get/Set/Address method.
+ */
+MonoMethod *
+mono_marshal_get_array_accessor_wrapper (MonoMethod *method)
+{
+ MonoMethodSignature *sig;
+ MonoMethodBuilder *mb;
+ MonoMethod *res;
+ GHashTable *cache;
+ int i;
+ MonoGenericContext *ctx = NULL;
+ MonoMethod *orig_method = NULL;
+ MonoGenericContainer *container = NULL;
+ WrapperInfo *info;
+
+ /*
+ * These wrappers are needed to avoid the JIT replacing the calls to these methods with intrinsics
+ * inside runtime invoke wrappers, thereby making the wrappers not unshareable.
+ * FIXME: Use generic methods.
+ */
+ /*
+ * Check cache
+ */
+ if (ctx) {
+ cache = NULL;
+ g_assert_not_reached ();
+ } else {
+ cache = get_cache (&method->klass->image->array_accessor_cache, mono_aligned_addr_hash, NULL);
+ if ((res = mono_marshal_find_in_cache (cache, method)))
+ return res;
+ }
+
+ sig = signature_dup (method->klass->image, mono_method_signature (method));
+ sig->pinvoke = 0;
+
+ mb = mono_mb_new (method->klass, method->name, MONO_WRAPPER_UNKNOWN);
+
+#ifndef DISABLE_JIT
+ /* Call the method */
+ if (sig->hasthis)
+ mono_mb_emit_ldarg (mb, 0);
+ for (i = 0; i < sig->param_count; i++)
+ mono_mb_emit_ldarg (mb, i + (sig->hasthis == TRUE));
+
+ if (ctx)
+ mono_mb_emit_managed_call (mb, mono_class_inflate_generic_method (method, &container->context), NULL);
+ else
+ mono_mb_emit_managed_call (mb, method, NULL);
+ mono_mb_emit_byte (mb, CEE_RET);
+#endif
+
+ if (ctx) {
+ MonoMethod *def;
+ def = mono_mb_create_and_cache (cache, method, mb, sig, sig->param_count + 16);
+ res = cache_generic_wrapper (cache, orig_method, def, ctx, orig_method);
+ } else {
+ res = mono_mb_create_and_cache (cache, method,
+ mb, sig, sig->param_count + 16);
+ info = mono_wrapper_info_create (res, WRAPPER_SUBTYPE_ARRAY_ACCESSOR);
+ info->d.array_accessor.method = method;
+ mono_marshal_set_wrapper_info (res, info);
+ }
+ mono_mb_free (mb);
+
+ return res;
+}
+
void*
mono_marshal_alloc (gulong size)
{
WRAPPER_SUBTYPE_SYNCHRONIZED_INNER,
WRAPPER_SUBTYPE_GSHAREDVT_IN,
WRAPPER_SUBTYPE_GSHAREDVT_OUT,
+ WRAPPER_SUBTYPE_ARRAY_ACCESSOR,
/* Subtypes of MONO_WRAPPER_MANAGED_TO_MANAGED */
WRAPPER_SUBTYPE_GENERIC_ARRAY_HELPER
} WrapperSubtype;
gpointer func;
} ICallWrapperInfo;
+typedef struct {
+ MonoMethod *method;
+} ArrayAccessorWrapperInfo;
+
/*
* This structure contains additional information to uniquely identify a given wrapper
* method. It can be retrieved by mono_marshal_get_wrapper_info () for certain types
GenericArrayHelperWrapperInfo generic_array_helper;
/* ICALL_WRAPPER */
ICallWrapperInfo icall;
+ /* ARRAY_ACCESSOR */
+ ArrayAccessorWrapperInfo array_accessor;
} d;
} WrapperInfo;
MonoMethod*
mono_marshal_get_array_address (int rank, int elem_size) MONO_INTERNAL;
+MonoMethod *
+mono_marshal_get_array_accessor_wrapper (MonoMethod *method) MONO_INTERNAL;
+
MonoMethod *
mono_marshal_get_generic_array_helper (MonoClass *class, MonoClass *iface,
gchar *name, MonoMethod *method) MONO_INTERNAL;
GHashTable *cominterop_wrapper_cache; /* LOCKING: marshal lock */
GHashTable *thunk_invoke_cache;
GHashTable *wrapper_param_names;
+ GHashTable *synchronized_generic_cache;
+ GHashTable *array_accessor_cache;
/*
* indexed by MonoClass pointers
#include <mono/metadata/attrdefs.h>
#include <mono/utils/strenc.h>
#include <mono/utils/mono-error-internals.h>
+#include <mono/utils/bsearch.h>
#include <string.h>
//#include <signal.h>
#include <ctype.h>
base = tinfo->base;
VERIFIER_DEBUG ( printf ("looking token %x table %d col %d rsize %d roff %d\n", coded_token, table, column, locator.col_size, locator.col_offset) );
- res = bsearch (&locator, base, tinfo->rows, tinfo->row_size, token_locator);
+ res = mono_binary_search (&locator, base, tinfo->rows, tinfo->row_size, token_locator);
if (!res)
return -1;
#include "marshal.h"
#include "debug-helpers.h"
#include <mono/utils/mono-error-internals.h>
-
+#include <mono/utils/bsearch.h>
+
/* Auxiliary structure used for caching inflated signatures */
typedef struct {
MonoMethodSignature *sig;
if (meta->uncompressed_metadata)
loc.idx = search_ptr_table (meta, MONO_TABLE_FIELD_POINTER, loc.idx);
- if (!bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, typedef_locator))
+ if (!mono_binary_search (&loc, tdef->base, tdef->rows, tdef->row_size, typedef_locator))
return 0;
/* loc_result is 0..1, needs to be mapped to table index (that is +1) */
if (meta->uncompressed_metadata)
loc.idx = search_ptr_table (meta, MONO_TABLE_METHOD_POINTER, loc.idx);
- if (!bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, typedef_locator))
+ if (!mono_binary_search (&loc, tdef->base, tdef->rows, tdef->row_size, typedef_locator))
return 0;
/* loc_result is 0..1, needs to be mapped to table index (that is +1) */
loc.col_idx = MONO_INTERFACEIMPL_CLASS;
loc.t = tdef;
- if (!bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
+ if (!mono_binary_search (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
return TRUE;
start = loc.result;
loc.col_idx = MONO_NESTED_CLASS_NESTED;
loc.t = tdef;
- if (!bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
+ if (!mono_binary_search (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
return 0;
/* loc_result is 0..1, needs to be mapped to table index (that is +1) */
loc.col_idx = MONO_CLASS_LAYOUT_PARENT;
loc.t = tdef;
- if (!bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
+ if (!mono_binary_search (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
return 0;
mono_metadata_decode_row (tdef, loc.result, cols, MONO_CLASS_LAYOUT_SIZE);
/* FIXME: Index translation */
- if (!bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
+ if (!mono_binary_search (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
return 0;
/* Find the first entry by searching backwards */
loc.col_idx = MONO_DECL_SECURITY_PARENT;
loc.t = tdef;
- if (!bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, declsec_locator))
+ if (!mono_binary_search (&loc, tdef->base, tdef->rows, tdef->row_size, declsec_locator))
return -1;
/* Find the first entry by searching backwards */
loc.col_idx = MONO_FIELD_LAYOUT_FIELD;
loc.t = tdef;
- if (tdef->base && bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator)) {
+ if (tdef->base && mono_binary_search (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator)) {
*offset = mono_metadata_decode_row_col (tdef, loc.result, MONO_FIELD_LAYOUT_OFFSET);
} else {
*offset = (guint32)-1;
loc.col_idx = MONO_FIELD_RVA_FIELD;
loc.t = tdef;
- if (tdef->base && bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator)) {
+ if (tdef->base && mono_binary_search (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator)) {
/*
* LAMESPEC: There is no signature, no nothing, just the raw data.
*/
if ((hint > 0) && (hint < tdef->rows) && (mono_metadata_decode_row_col (tdef, hint - 1, MONO_CONSTANT_PARENT) == index))
return hint;
- if (tdef->base && bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator)) {
+ if (tdef->base && mono_binary_search (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator)) {
return loc.result + 1;
}
return 0;
loc.col_idx = MONO_EVENT_MAP_PARENT;
loc.idx = index + 1;
- if (!bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
+ if (!mono_binary_search (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
return 0;
start = mono_metadata_decode_row_col (tdef, loc.result, MONO_EVENT_MAP_EVENTLIST);
loc.col_idx = MONO_METHOD_SEMA_ASSOCIATION;
loc.idx = ((index + 1) << MONO_HAS_SEMANTICS_BITS) | MONO_HAS_SEMANTICS_EVENT; /* Method association coded index */
- if (!bsearch (&loc, msemt->base, msemt->rows, msemt->row_size, table_locator))
+ if (!mono_binary_search (&loc, msemt->base, msemt->rows, msemt->row_size, table_locator))
return 0;
start = loc.result;
loc.col_idx = MONO_PROPERTY_MAP_PARENT;
loc.idx = index + 1;
- if (!bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
+ if (!mono_binary_search (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
return 0;
start = mono_metadata_decode_row_col (tdef, loc.result, MONO_PROPERTY_MAP_PROPERTY_LIST);
loc.col_idx = MONO_METHOD_SEMA_ASSOCIATION;
loc.idx = ((index + 1) << MONO_HAS_SEMANTICS_BITS) | MONO_HAS_SEMANTICS_PROPERTY; /* Method association coded index */
- if (!bsearch (&loc, msemt->base, msemt->rows, msemt->row_size, table_locator))
+ if (!mono_binary_search (&loc, msemt->base, msemt->rows, msemt->row_size, table_locator))
return 0;
start = loc.result;
loc.col_idx = MONO_IMPLMAP_MEMBER;
loc.idx = ((method_idx + 1) << MONO_MEMBERFORWD_BITS) | MONO_MEMBERFORWD_METHODDEF;
- if (!bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
+ if (!mono_binary_search (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
return 0;
return loc.result + 1;
/* FIXME: Index translation */
- if (!bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
+ if (!mono_binary_search (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
return NULL;
return mono_metadata_blob_heap (meta, mono_metadata_decode_row_col (tdef, loc.result, MONO_FIELD_MARSHAL_NATIVE_TYPE));
loc.col_idx = MONO_METHODIMPL_CLASS;
loc.idx = mono_metadata_token_index (type_token);
- if (!bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
+ if (!mono_binary_search (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
return TRUE;
start = loc.result;
loc.col_idx = MONO_GENERICPARAM_OWNER;
loc.t = tdef;
- if (!bsearch (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
+ if (!mono_binary_search (&loc, tdef->base, tdef->rows, tdef->row_size, table_locator))
return 0;
/* Find the first entry by searching backwards */
}
method->signature = signature;
+ if (!signature->hasthis)
+ method->flags |= METHOD_ATTRIBUTE_STATIC;
#ifndef DISABLE_JIT
if (max_stack < 8)
void mono_reflection_create_unmanaged_type (MonoReflectionType *type) MONO_INTERNAL;
void mono_reflection_register_with_runtime (MonoReflectionType *type) MONO_INTERNAL;
-void mono_reflection_create_custom_attr_data_args (MonoImage *image, MonoMethod *method, const guchar *data, guint32 len, MonoArray **typed_args, MonoArray **named_args, CattrNamedArg **named_arg_info) MONO_INTERNAL;
+void mono_reflection_create_custom_attr_data_args (MonoImage *image, MonoMethod *method, const guchar *data, guint32 len, MonoArray **typed_args, MonoArray **named_args, CattrNamedArg **named_arg_info, MonoError *error) MONO_INTERNAL;
MonoMethodSignature * mono_reflection_lookup_signature (MonoImage *image, MonoMethod *method, guint32 token) MONO_INTERNAL;
MonoArray* mono_param_get_objects_internal (MonoDomain *domain, MonoMethod *method, MonoClass *refclass) MONO_INTERNAL;
* NAMED_ARG_INFO will contain information about the named arguments.
*/
void
-mono_reflection_create_custom_attr_data_args (MonoImage *image, MonoMethod *method, const guchar *data, guint32 len, MonoArray **typed_args, MonoArray **named_args, CattrNamedArg **named_arg_info)
+mono_reflection_create_custom_attr_data_args (MonoImage *image, MonoMethod *method, const guchar *data, guint32 len, MonoArray **typed_args, MonoArray **named_args, CattrNamedArg **named_arg_info, MonoError *error)
{
MonoArray *typedargs, *namedargs;
MonoClass *attrklass;
guint32 i, j, num_named;
CattrNamedArg *arginfo = NULL;
- if (!mono_verifier_verify_cattr_content (image, method, data, len, NULL))
- return;
-
- mono_class_init (method->klass);
-
*typed_args = NULL;
*named_args = NULL;
*named_arg_info = NULL;
+
+ mono_error_init (error);
+
+ if (!mono_verifier_verify_cattr_content (image, method, data, len, NULL)) {
+ mono_error_set_generic_error (error, "System.Reflection", "CustomAttributeFormatException", "Binary format of the specified custom attribute was invalid.");
+ return;
+ }
+
+ mono_class_init (method->klass);
domain = mono_domain_get ();
MonoImage *image;
MonoMethod *method;
CattrNamedArg *arginfo;
+ MonoError error;
int i;
*ctor_args = NULL;
if (!mono_class_init (method->klass))
mono_raise_exception (mono_class_get_exception_for_failure (method->klass));
- mono_reflection_create_custom_attr_data_args (image, method, data, len, &typedargs, &namedargs, &arginfo);
+ mono_reflection_create_custom_attr_data_args (image, method, data, len, &typedargs, &namedargs, &arginfo, &error);
+ if (!mono_error_ok (&error))
+ mono_error_raise_exception (&error);
if (mono_loader_get_last_error ())
mono_raise_exception (mono_loader_error_prepare_exception (mono_loader_get_last_error ()));
TLAB_ACCESS_INIT;
size = ALIGN_UP (size);
+ SGEN_ASSERT (9, size >= sizeof (MonoObject), "Object too small");
g_assert (vtable->gc_descr);
if (size > SGEN_MAX_SMALL_OBJ_SIZE)
void *res;
#ifndef DISABLE_CRITICAL_REGION
TLAB_ACCESS_INIT;
+
+ if (G_UNLIKELY (has_per_allocation_action)) {
+ static int alloc_count;
+ int current_alloc = InterlockedIncrement (&alloc_count);
+
+ if (verify_before_allocs) {
+ if ((current_alloc % verify_before_allocs) == 0)
+ sgen_check_whole_heap_stw ();
+ }
+ if (collect_before_allocs) {
+ if (((current_alloc % collect_before_allocs) == 0) && nursery_section) {
+ LOCK_GC;
+ sgen_perform_collection (0, GENERATION_NURSERY, "collect-before-alloc-triggered", TRUE);
+ UNLOCK_GC;
+ }
+ }
+ }
+
ENTER_CRITICAL_REGION;
res = mono_gc_try_alloc_obj_nolock (vtable, size);
if (res) {
if (tlab_next_offset == -1 || tlab_temp_end_offset == -1)
return NULL;
#endif
-
+ if (collect_before_allocs)
+ return NULL;
if (!mono_runtime_has_tls_get ())
return NULL;
if (klass->instance_size > tlab_size)
return NULL;
if (klass->byval_arg.type == MONO_TYPE_STRING)
return mono_gc_get_managed_allocator_by_type (ATYPE_STRING);
- if (collect_before_allocs)
- return NULL;
/* Generic classes have dynamic field and can go above MAX_SMALL_OBJ_SIZE. */
if (ALIGN_TO (klass->instance_size, ALLOC_ALIGN) < MAX_SMALL_OBJ_SIZE && !mono_class_is_open_constructed_type (&klass->byval_arg))
return mono_gc_get_managed_allocator_by_type (ATYPE_SMALL);
#include "metadata/sgen-gray.h"
#include "metadata/sgen-protocol.h"
#include "utils/dtrace.h"
+#include "utils/mono-counters.h"
#define ptr_in_nursery sgen_ptr_in_nursery
}
}
+/*
+ * We're using (mostly) non-locking staging queues for finalizers and weak links to speed
+ * up registering them. Otherwise we'd have to take the GC lock.
+ *
+ * The queues are arrays of `StageEntry`, plus a `next_entry` index. Threads add entries to
+ * the queue via `add_stage_entry()` in a linear fashion until it fills up, in which case
+ * `process_stage_entries()` is called to drain it. A garbage collection will also drain
+ * the queues via the same function. That implies that `add_stage_entry()`, since it
+ * doesn't take a lock, must be able to run concurrently with `process_stage_entries()`,
+ * though it doesn't have to make progress while the queue is drained. In fact, once it
+ * detects that the queue is being drained, it blocks until the draining is done.
+ *
+ * The protocol must guarantee that entries in the queue are causally ordered, otherwise two
+ * entries for the same location might get switched, resulting in the earlier one being
+ * committed and the later one ignored.
+ *
+ * `next_entry` is the index of the next entry to be filled, or `-1` if the queue is
+ * currently being drained. Each entry has a state:
+ *
+ * `STAGE_ENTRY_FREE`: The entry is free. Its data fields must be `NULL`.
+ *
+ * `STAGE_ENTRY_BUSY`: The entry is currently being filled in.
+ *
+ * `STAGE_ENTRY_USED`: The entry is completely filled in and must be processed in the next
+ * draining round.
+ *
+ * `STAGE_ENTRY_INVALID`: The entry was busy during queue draining and therefore
+ * invalidated. Entries that are `BUSY` can obviously not be processed during a drain, but
+ * we can't leave them in place because new entries might be inserted before them, including
+ * from the same thread, violating causality. An alternative would be not to reset
+ * `next_entry` to `0` after a drain, but to the index of the last `BUSY` entry plus one,
+ * but that can potentially waste the whole queue.
+ *
+ * State transitions:
+ *
+ * | from | to | filler? | drainer? |
+ * +---------+---------+---------+----------+
+ * | FREE | BUSY | X | |
+ * | BUSY | FREE | X | |
+ * | BUSY | USED | X | |
+ * | BUSY | INVALID | | X |
+ * | USED | FREE | | X |
+ * | INVALID | FREE | X | |
+ *
+ * `next_entry` can be incremented either by the filler thread that set the corresponding
+ * entry to `BUSY`, or by another filler thread that's trying to get a `FREE` slot. If that
+ * other thread wasn't allowed to increment, it would block on the first filler thread.
+ *
+ * An entry's state, once it's set from `FREE` to `BUSY` by a filler thread, can only be
+ * changed by that same thread or by the drained. The drainer can only set a `BUSY` thread
+ * to `INVALID`, so it needs to be set to `FREE` again by the original filler thread.
+ */
+
#define STAGE_ENTRY_FREE 0
#define STAGE_ENTRY_BUSY 1
#define STAGE_ENTRY_USED 2
+#define STAGE_ENTRY_INVALID 3
typedef struct {
- gint32 state;
+ volatile gint32 state;
MonoObject *obj;
void *user_data;
} StageEntry;
static volatile gint32 next_fin_stage_entry = 0;
static StageEntry fin_stage_entries [NUM_FIN_STAGE_ENTRIES];
+/*
+ * This is used to lock the stage when processing is forced, i.e. when it's triggered by a
+ * garbage collection. In that case, the world is already stopped and there's only one
+ * thread operating on the queue.
+ */
+static void
+lock_stage_for_processing (volatile gint32 *next_entry)
+{
+ *next_entry = -1;
+}
+
+/*
+ * When processing is triggered by an overflow, we don't want to take the GC lock
+ * immediately, and then set `next_index` to `-1`, because another thread might have drained
+ * the queue in the mean time. Instead, we make sure the overflow is still there, we
+ * atomically set `next_index`, and only once that happened do we take the GC lock.
+ */
+static gboolean
+try_lock_stage_for_processing (int num_entries, volatile gint32 *next_entry)
+{
+ gint32 old = *next_entry;
+ if (old < num_entries)
+ return FALSE;
+ return InterlockedCompareExchange (next_entry, -1, old) == old;
+}
+
/* LOCKING: requires that the GC lock is held */
static void
-process_stage_entries (int num_entries, volatile gint32 *next_entry, StageEntry *entries, void (*process_func) (MonoObject*, void*))
+process_stage_entries (int num_entries, volatile gint32 *next_entry, StageEntry *entries, void (*process_func) (MonoObject*, void*, int))
{
int i;
- int num_registered = 0;
- int num_busy = 0;
+
+ /*
+ * This can happen if after setting `next_index` to `-1` in
+ * `try_lock_stage_for_processing()`, a GC was triggered, which then drained the
+ * queue and reset `next_entry`.
+ *
+ * We have the GC lock now, so if it's still `-1`, we can't be interrupted by a GC.
+ */
+ if (*next_entry != -1)
+ return;
for (i = 0; i < num_entries; ++i) {
- gint32 state = entries [i].state;
+ gint32 state;
- if (state == STAGE_ENTRY_BUSY)
- ++num_busy;
+ retry:
+ state = entries [i].state;
- if (state != STAGE_ENTRY_USED ||
- InterlockedCompareExchange (&entries [i].state, STAGE_ENTRY_BUSY, STAGE_ENTRY_USED) != STAGE_ENTRY_USED) {
+ switch (state) {
+ case STAGE_ENTRY_FREE:
+ case STAGE_ENTRY_INVALID:
+ continue;
+ case STAGE_ENTRY_BUSY:
+ /* BUSY -> INVALID */
+ /*
+ * This must be done atomically, because the filler thread can set
+ * the entry to `USED`, in which case we must process it, so we must
+ * detect that eventuality.
+ */
+ if (InterlockedCompareExchange (&entries [i].state, STAGE_ENTRY_INVALID, STAGE_ENTRY_BUSY) != STAGE_ENTRY_BUSY)
+ goto retry;
continue;
+ case STAGE_ENTRY_USED:
+ break;
+ default:
+ SGEN_ASSERT (0, FALSE, "Invalid stage entry state");
+ break;
}
- process_func (entries [i].obj, entries [i].user_data);
+ /* state is USED */
+
+ process_func (entries [i].obj, entries [i].user_data, i);
entries [i].obj = NULL;
entries [i].user_data = NULL;
mono_memory_write_barrier ();
+ /* USED -> FREE */
+ /*
+ * This transition only happens here, so we don't have to do it atomically.
+ */
entries [i].state = STAGE_ENTRY_FREE;
-
- ++num_registered;
}
- *next_entry = 0;
+ mono_memory_write_barrier ();
- /* g_print ("stage busy %d reg %d\n", num_busy, num_registered); */
+ *next_entry = 0;
}
-static gboolean
+#ifdef HEAVY_STATISTICS
+static long long stat_overflow_abort = 0;
+static long long stat_wait_for_processing = 0;
+static long long stat_increment_other_thread = 0;
+static long long stat_index_decremented = 0;
+static long long stat_entry_invalidated = 0;
+static long long stat_success = 0;
+#endif
+
+static int
add_stage_entry (int num_entries, volatile gint32 *next_entry, StageEntry *entries, MonoObject *obj, void *user_data)
{
- gint32 index;
-
- do {
- do {
- index = *next_entry;
- if (index >= num_entries)
- return FALSE;
- } while (InterlockedCompareExchange (next_entry, index + 1, index) != index);
-
+ gint32 index, new_next_entry, old_next_entry;
+ gint32 previous_state;
+
+ retry:
+ for (;;) {
+ index = *next_entry;
+ if (index >= num_entries) {
+ HEAVY_STAT (++stat_overflow_abort);
+ return -1;
+ }
+ if (index < 0) {
+ /*
+ * Backed-off waiting is way more efficient than even using a
+ * dedicated lock for this.
+ */
+ while ((index = *next_entry) < 0) {
+ /*
+ * This seems like a good value. Determined by timing
+ * sgen-weakref-stress.exe.
+ */
+ g_usleep (200);
+ HEAVY_STAT (++stat_wait_for_processing);
+ }
+ continue;
+ }
+ /* FREE -> BUSY */
+ if (entries [index].state != STAGE_ENTRY_FREE ||
+ InterlockedCompareExchange (&entries [index].state, STAGE_ENTRY_BUSY, STAGE_ENTRY_FREE) != STAGE_ENTRY_FREE) {
+ /*
+ * If we can't get the entry it must be because another thread got
+ * it first. We don't want to wait for that thread to increment
+ * `next_entry`, so we try to do it ourselves. Whether we succeed
+ * or not, we start over.
+ */
+ if (*next_entry == index) {
+ InterlockedCompareExchange (next_entry, index + 1, index);
+ //g_print ("tried increment for other thread\n");
+ HEAVY_STAT (++stat_increment_other_thread);
+ }
+ continue;
+ }
+ /* state is BUSY now */
+ mono_memory_write_barrier ();
/*
- * We don't need a write barrier here. *next_entry is just a
- * help for finding an index, its value is irrelevant for
- * correctness.
+ * Incrementing `next_entry` must happen after setting the state to `BUSY`.
+ * If it were the other way around, it would be possible that after a filler
+ * incremented the index, other threads fill up the queue, the queue is
+ * drained, the original filler finally fills in the slot, but `next_entry`
+ * ends up at the start of the queue, and new entries are written in the
+ * queue in front of, not behind, the original filler's entry.
+ *
+ * We don't actually require that the CAS succeeds, but we do require that
+ * the value of `next_entry` is not lower than our index. Since the drainer
+ * sets it to `-1`, that also takes care of the case that the drainer is
+ * currently running.
*/
- } while (entries [index].state != STAGE_ENTRY_FREE ||
- InterlockedCompareExchange (&entries [index].state, STAGE_ENTRY_BUSY, STAGE_ENTRY_FREE) != STAGE_ENTRY_FREE);
+ old_next_entry = InterlockedCompareExchange (next_entry, index + 1, index);
+ if (old_next_entry < index) {
+ /* BUSY -> FREE */
+ /* INVALID -> FREE */
+ /*
+ * The state might still be `BUSY`, or the drainer could have set it
+ * to `INVALID`. In either case, there's no point in CASing. Set
+ * it to `FREE` and start over.
+ */
+ entries [index].state = STAGE_ENTRY_FREE;
+ HEAVY_STAT (++stat_index_decremented);
+ continue;
+ }
+ break;
+ }
+
+ SGEN_ASSERT (0, index >= 0 && index < num_entries, "Invalid index");
entries [index].obj = obj;
entries [index].user_data = user_data;
mono_memory_write_barrier ();
- entries [index].state = STAGE_ENTRY_USED;
+ new_next_entry = *next_entry;
+ mono_memory_read_barrier ();
+ /* BUSY -> USED */
+ /*
+ * A `BUSY` entry will either still be `BUSY` or the drainer will have set it to
+ * `INVALID`. In the former case, we set it to `USED` and we're finished. In the
+ * latter case, we reset it to `FREE` and start over.
+ */
+ previous_state = InterlockedCompareExchange (&entries [index].state, STAGE_ENTRY_USED, STAGE_ENTRY_BUSY);
+ if (previous_state == STAGE_ENTRY_BUSY) {
+ SGEN_ASSERT (0, new_next_entry >= index || new_next_entry < 0, "Invalid next entry index - as long as we're busy, other thread can only increment or invalidate it");
+ HEAVY_STAT (++stat_success);
+ return index;
+ }
+
+ SGEN_ASSERT (0, previous_state == STAGE_ENTRY_INVALID, "Invalid state transition - other thread can only make busy state invalid");
+ entries [index].obj = NULL;
+ entries [index].user_data = NULL;
+ mono_memory_write_barrier ();
+ /* INVALID -> FREE */
+ entries [index].state = STAGE_ENTRY_FREE;
- return TRUE;
+ HEAVY_STAT (++stat_entry_invalidated);
+
+ goto retry;
}
/* LOCKING: requires that the GC lock is held */
static void
-process_fin_stage_entry (MonoObject *obj, void *user_data)
+process_fin_stage_entry (MonoObject *obj, void *user_data, int index)
{
if (ptr_in_nursery (obj))
register_for_finalization (obj, user_data, GENERATION_NURSERY);
void
sgen_process_fin_stage_entries (void)
{
+ lock_stage_for_processing (&next_fin_stage_entry);
process_stage_entries (NUM_FIN_STAGE_ENTRIES, &next_fin_stage_entry, fin_stage_entries, process_fin_stage_entry);
}
void
mono_gc_register_for_finalization (MonoObject *obj, void *user_data)
{
- while (!add_stage_entry (NUM_FIN_STAGE_ENTRIES, &next_fin_stage_entry, fin_stage_entries, obj, user_data)) {
- LOCK_GC;
- sgen_process_fin_stage_entries ();
- UNLOCK_GC;
+ while (add_stage_entry (NUM_FIN_STAGE_ENTRIES, &next_fin_stage_entry, fin_stage_entries, obj, user_data) == -1) {
+ if (try_lock_stage_for_processing (NUM_FIN_STAGE_ENTRIES, &next_fin_stage_entry)) {
+ LOCK_GC;
+ process_stage_entries (NUM_FIN_STAGE_ENTRIES, &next_fin_stage_entry, fin_stage_entries, process_fin_stage_entry);
+ UNLOCK_GC;
+ }
}
}
if (!major_collector.is_object_live (object)) {
if (sgen_gc_is_object_ready_for_finalization (object)) {
*link = NULL;
- binary_protocol_dislink_update (link, NULL, 0);
+ binary_protocol_dislink_update (link, NULL, 0, 0);
SGEN_LOG (5, "Dislink nullified at %p to GCed object %p", link, object);
SGEN_HASH_TABLE_FOREACH_REMOVE (TRUE);
continue;
g_assert (copy);
*link = HIDE_POINTER (copy, track);
add_or_remove_disappearing_link ((MonoObject*)copy, link, GENERATION_OLD);
- binary_protocol_dislink_update (link, copy, track);
+ binary_protocol_dislink_update (link, copy, track, 0);
SGEN_LOG (5, "Upgraded dislink at %p to major because object %p moved to %p", link, object, copy);
continue;
} else {
*link = HIDE_POINTER (copy, track);
- binary_protocol_dislink_update (link, copy, track);
+ binary_protocol_dislink_update (link, copy, track, 0);
SGEN_LOG (5, "Updated dislink at %p to %p", link, DISLINK_OBJECT (link));
}
}
if (*link) {
*link = NULL;
- binary_protocol_dislink_update (link, NULL, 0);
+ binary_protocol_dislink_update (link, NULL, 0, 0);
free = FALSE;
/*
* This can happen if finalizers are not ran, i.e. Environment.Exit ()
if (!is_alive) {
*link = NULL;
- binary_protocol_dislink_update (link, NULL, 0);
+ binary_protocol_dislink_update (link, NULL, 0, 0);
SGEN_LOG (5, "Dislink nullified by predicate at %p to GCed object %p", link, object);
SGEN_HASH_TABLE_FOREACH_REMOVE (TRUE);
continue;
/* LOCKING: requires that the GC lock is held */
static void
-process_dislink_stage_entry (MonoObject *obj, void *_link)
+process_dislink_stage_entry (MonoObject *obj, void *_link, int index)
{
void **link = _link;
+ if (index >= 0)
+ binary_protocol_dislink_process_staged (link, obj, index);
+
add_or_remove_disappearing_link (NULL, link, GENERATION_NURSERY);
add_or_remove_disappearing_link (NULL, link, GENERATION_OLD);
if (obj) {
void
sgen_process_dislink_stage_entries (void)
{
+ lock_stage_for_processing (&next_dislink_stage_entry);
process_stage_entries (NUM_DISLINK_STAGE_ENTRIES, &next_dislink_stage_entry, dislink_stage_entries, process_dislink_stage_entry);
}
else
*link = NULL;
- binary_protocol_dislink_update (link, obj, track);
-
#if 1
if (in_gc) {
- process_dislink_stage_entry (obj, link);
+ binary_protocol_dislink_update (link, obj, track, 0);
+ process_dislink_stage_entry (obj, link, -1);
} else {
- while (!add_stage_entry (NUM_DISLINK_STAGE_ENTRIES, &next_dislink_stage_entry, dislink_stage_entries, obj, link)) {
- LOCK_GC;
- sgen_process_dislink_stage_entries ();
- UNLOCK_GC;
+ int index;
+ binary_protocol_dislink_update (link, obj, track, 1);
+ while ((index = add_stage_entry (NUM_DISLINK_STAGE_ENTRIES, &next_dislink_stage_entry, dislink_stage_entries, obj, link)) == -1) {
+ if (try_lock_stage_for_processing (NUM_DISLINK_STAGE_ENTRIES, &next_dislink_stage_entry)) {
+ LOCK_GC;
+ process_stage_entries (NUM_DISLINK_STAGE_ENTRIES, &next_dislink_stage_entry, dislink_stage_entries, process_dislink_stage_entry);
+ UNLOCK_GC;
+ }
}
+ binary_protocol_dislink_update_staged (link, obj, track, index);
}
#else
if (!in_gc)
LOCK_GC;
- process_dislink_stage_entry (obj, link);
+ binary_protocol_dislink_update (link, obj, track, 0);
+ process_dislink_stage_entry (obj, link, -1);
if (!in_gc)
UNLOCK_GC;
#endif
}
+void
+sgen_init_fin_weak_hash (void)
+{
+#ifdef HEAVY_STATISTICS
+ mono_counters_register ("FinWeak Successes", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_success);
+ mono_counters_register ("FinWeak Overflow aborts", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_overflow_abort);
+ mono_counters_register ("FinWeak Wait for processing", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_wait_for_processing);
+ mono_counters_register ("FinWeak Increment other thread", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_increment_other_thread);
+ mono_counters_register ("FinWeak Index decremented", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_index_decremented);
+ mono_counters_register ("FinWeak Entry invalidated", MONO_COUNTER_GC | MONO_COUNTER_LONG, &stat_entry_invalidated);
+#endif
+}
+
#endif /* HAVE_SGEN_GC */
LOCK_GC;
+ binary_protocol_domain_unload_begin (domain);
+
sgen_stop_world (0);
if (concurrent_collection_in_progress)
sgen_restart_world (0, NULL);
+ binary_protocol_domain_unload_end (domain);
+
UNLOCK_GC;
}
TV_DECLARE (all_btv);
int old_next_pin_slot;
+ if (disable_major_collections)
+ return FALSE;
+
if (major_collector.get_and_reset_num_major_objects_marked) {
long long num_marked = major_collector.get_and_reset_num_major_objects_marked ();
g_assert (!num_marked);
return bytes_pinned_from_failed_allocation > 0;
}
-static gboolean major_do_collection (const char *reason);
-
static void
major_start_concurrent_collection (const char *reason)
{
- long long num_objects_marked = major_collector.get_and_reset_num_major_objects_marked ();
+ long long num_objects_marked;
+ if (disable_major_collections)
+ return;
+
+ num_objects_marked = major_collector.get_and_reset_num_major_objects_marked ();
g_assert (num_objects_marked == 0);
MONO_GC_CONCURRENT_START_BEGIN (GENERATION_OLD);
sgen_perform_collection (size, generation_to_collect, reason, FALSE);
}
+/*
+ * LOCKING: Assumes the GC lock is held.
+ */
void
sgen_perform_collection (size_t requested_size, int generation_to_collect, const char *reason, gboolean wait_to_finish)
{
init_stats ();
sgen_init_internal_allocator ();
sgen_init_nursery_allocator ();
+ sgen_init_fin_weak_hash ();
sgen_register_fixed_internal_mem_type (INTERNAL_MEM_SECTION, SGEN_SIZEOF_GC_MEM_SECTION);
sgen_register_fixed_internal_mem_type (INTERNAL_MEM_FINALIZE_READY_ENTRY, sizeof (FinalizeReadyEntry));
gboolean sgen_object_is_live (void *obj) MONO_INTERNAL;
+void sgen_init_fin_weak_hash (void) MONO_INTERNAL;
+
gboolean sgen_need_bridge_processing (void) MONO_INTERNAL;
void sgen_bridge_reset_data (void) MONO_INTERNAL;
void sgen_bridge_processing_stw_step (void) MONO_INTERNAL;
}
void
-binary_protocol_dislink_update (gpointer link, gpointer obj, int track)
+binary_protocol_dislink_update (gpointer link, gpointer obj, int track, int staged)
{
- SGenProtocolDislinkUpdate entry = { link, obj, track };
+ SGenProtocolDislinkUpdate entry = { link, obj, track, staged };
protocol_entry (SGEN_PROTOCOL_DISLINK_UPDATE, &entry, sizeof (SGenProtocolDislinkUpdate));
}
+void
+binary_protocol_dislink_update_staged (gpointer link, gpointer obj, int track, int index)
+{
+ SGenProtocolDislinkUpdateStaged entry = { link, obj, track, index };
+ protocol_entry (SGEN_PROTOCOL_DISLINK_UPDATE_STAGED, &entry, sizeof (SGenProtocolDislinkUpdateStaged));
+}
+
+void
+binary_protocol_dislink_process_staged (gpointer link, gpointer obj, int index)
+{
+ SGenProtocolDislinkProcessStaged entry = { link, obj, index };
+ protocol_entry (SGEN_PROTOCOL_DISLINK_PROCESS_STAGED, &entry, sizeof (SGenProtocolDislinkProcessStaged));
+}
+
+void
+binary_protocol_domain_unload_begin (gpointer domain)
+{
+ SGenProtocolDomainUnload entry = { domain };
+ protocol_entry (SGEN_PROTOCOL_DOMAIN_UNLOAD_BEGIN, &entry, sizeof (SGenProtocolDomainUnload));
+}
+
+void
+binary_protocol_domain_unload_end (gpointer domain)
+{
+ SGenProtocolDomainUnload entry = { domain };
+ protocol_entry (SGEN_PROTOCOL_DOMAIN_UNLOAD_END, &entry, sizeof (SGenProtocolDomainUnload));
+}
+
#endif
#endif /* HAVE_SGEN_GC */
SGEN_PROTOCOL_CARD_SCAN,
SGEN_PROTOCOL_CEMENT,
SGEN_PROTOCOL_CEMENT_RESET,
- SGEN_PROTOCOL_DISLINK_UPDATE
+ SGEN_PROTOCOL_DISLINK_UPDATE,
+ SGEN_PROTOCOL_DISLINK_UPDATE_STAGED,
+ SGEN_PROTOCOL_DISLINK_PROCESS_STAGED,
+ SGEN_PROTOCOL_DOMAIN_UNLOAD_BEGIN,
+ SGEN_PROTOCOL_DOMAIN_UNLOAD_END
};
typedef struct {
gpointer link;
gpointer obj;
int track;
+ int staged;
} SGenProtocolDislinkUpdate;
+typedef struct {
+ gpointer link;
+ gpointer obj;
+ int track;
+ int index;
+} SGenProtocolDislinkUpdateStaged;
+
+typedef struct {
+ gpointer link;
+ gpointer obj;
+ int index;
+} SGenProtocolDislinkProcessStaged;
+
+typedef struct {
+ gpointer domain;
+} SGenProtocolDomainUnload;
+
/* missing: finalizers, dislinks, roots, non-store wbarriers */
void binary_protocol_init (const char *filename) MONO_INTERNAL;
void binary_protocol_card_scan (gpointer start, int size) MONO_INTERNAL;
void binary_protocol_cement (gpointer ptr, gpointer vtable, int size) MONO_INTERNAL;
void binary_protocol_cement_reset (void) MONO_INTERNAL;
-void binary_protocol_dislink_update (gpointer link, gpointer obj, int track) MONO_INTERNAL;
+void binary_protocol_dislink_update (gpointer link, gpointer obj, int track, int staged) MONO_INTERNAL;
+void binary_protocol_dislink_update_staged (gpointer link, gpointer obj, int track, int index) MONO_INTERNAL;
+void binary_protocol_dislink_process_staged (gpointer link, gpointer obj, int index) MONO_INTERNAL;
+void binary_protocol_domain_unload_begin (gpointer domain) MONO_INTERNAL;
+void binary_protocol_domain_unload_end (gpointer domain) MONO_INTERNAL;
#else
#define binary_protocol_card_scan(start, size)
#define binary_protocol_cement(ptr, vtable, size)
#define binary_protocol_cement_reset()
-#define binary_protocol_dislink_update(link,obj,track)
+#define binary_protocol_dislink_update(link,obj,track,staged)
+#define binary_protocol_dislink_update_staged(link,obj,track,index)
+#define binary_protocol_dislink_process_staged(link,obj,index)
+#define binary_protocol_domain_unload_begin(domain)
+#define binary_protocol_domain_unload_end(domain)
#endif
#include <errno.h>
#include <sys/types.h>
-#ifndef HOST_WIN32
+#ifdef HOST_WIN32
+#include <ws2tcpip.h>
+#else
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
struct sockaddr_in6 saddr6;
struct addrinfo *info = NULL, hints;
gint32 family;
- char hostname[1024] = {0};
+ char hostname[NI_MAXHOST] = {0};
int flags = 0;
#else
struct in_addr inaddr;
gint event_system;
gpointer event_data;
- void (*modify) (gpointer event_data, int fd, int operation, int events, gboolean is_new);
+ void (*modify) (gpointer p, int fd, int operation, int events, gboolean is_new);
void (*wait) (gpointer sock_data);
void (*shutdown) (gpointer event_data);
} SocketIOData;
mono_g_hash_table_replace (data->sock_to_state, state->handle, list);
ievt = get_events_from_list (list);
- LeaveCriticalSection (&data->io_lock);
- data->modify (data->event_data, fd, state->operation, ievt, is_new);
+ data->modify (data, fd, state->operation, ievt, is_new);
}
#ifndef DISABLE_SOCKETS
void
mono_thread_get_stack_bounds (guint8 **staddr, size_t *stsize)
{
-#if defined(HAVE_PTHREAD_GET_STACKSIZE_NP) && defined(HAVE_PTHREAD_GET_STACKADDR_NP)
- *staddr = (guint8*)pthread_get_stackaddr_np (pthread_self ());
- *stsize = pthread_get_stacksize_np (pthread_self ());
-
- /* staddr points to the start of the stack, not the end */
- *staddr -= *stsize;
- *staddr = (guint8*)((gssize)*staddr & ~(mono_pagesize () - 1));
- return;
- /* FIXME: simplify the mess below */
-#elif defined(HOST_WIN32)
+#if defined(HOST_WIN32)
+ /* Windows */
/* http://en.wikipedia.org/wiki/Win32_Thread_Information_Block */
void* tib = (void*)__readfsdword(0x18);
guint8 *stackTop = (guint8*)*(int*)((char*)tib + 4);
*staddr = stackBottom;
*stsize = stackTop - stackBottom;
return;
-#else
+
+#elif defined(HAVE_PTHREAD_GET_STACKSIZE_NP) && defined(HAVE_PTHREAD_GET_STACKADDR_NP)
+ /* Mac OS X */
+ *staddr = (guint8*)pthread_get_stackaddr_np (pthread_self());
+ *stsize = pthread_get_stacksize_np (pthread_self());
+
+ /* staddr points to the start of the stack, not the end */
+ *staddr -= *stsize;
+
+ /* When running under emacs, sometimes staddr is not aligned to a page size */
+ *staddr = (guint8*)((gssize)*staddr & ~(mono_pagesize() - 1));
+ return;
+
+#elif (defined(HAVE_PTHREAD_GETATTR_NP) || defined(HAVE_PTHREAD_ATTR_GET_NP)) && defined(HAVE_PTHREAD_ATTR_GETSTACK)
+ /* Linux, BSD */
+
pthread_attr_t attr;
guint8 *current = (guint8*)&attr;
*stsize = (size_t)-1;
pthread_attr_init (&attr);
-# ifdef HAVE_PTHREAD_GETATTR_NP
+
+#if defined(HAVE_PTHREAD_GETATTR_NP)
+ /* Linux */
pthread_getattr_np (pthread_self(), &attr);
-# else
-# ifdef HAVE_PTHREAD_ATTR_GET_NP
+
+#elif defined(HAVE_PTHREAD_ATTR_GET_NP)
+ /* BSD */
pthread_attr_get_np (pthread_self(), &attr);
-# elif defined(sun)
+
+#else
+#error Cannot determine which API is needed to retrieve pthread attributes.
+#endif
+
+ pthread_attr_getstack (&attr, (void**)staddr, stsize);
+ pthread_attr_destroy (&attr);
+
+ if (*staddr)
+ g_assert ((current > *staddr) && (current < *staddr + *stsize));
+
+ /* When running under emacs, sometimes staddr is not aligned to a page size */
+ *staddr = (guint8*)((gssize)*staddr & ~(mono_pagesize () - 1));
+ return;
+
+#elif defined(__OpenBSD__)
+ /* OpenBSD */
+ /* TODO : Determine if this code is actually still needed. It may already be covered by the case above. */
+
+ pthread_attr_t attr;
+ guint8 *current = (guint8*)&attr;
+
*staddr = NULL;
- pthread_attr_getstacksize (&attr, &stsize);
-# elif defined(__OpenBSD__)
+ *stsize = (size_t)-1;
+
+ pthread_attr_init (&attr);
+
stack_t ss;
int rslt;
*staddr = (guint8*)((size_t)ss.ss_sp - ss.ss_size);
*stsize = ss.ss_size;
-# else
- *staddr = NULL;
- *stsize = 0;
- return;
-# endif
-# endif
-# if !defined(sun)
-# if defined(__native_client__)
- *staddr = NULL;
- pthread_attr_getstacksize (&attr, &stsize);
-# elif !defined(__OpenBSD__)
- pthread_attr_getstack (&attr, (void**)staddr, stsize);
-# endif
+ pthread_attr_destroy (&attr);
+
if (*staddr)
g_assert ((current > *staddr) && (current < *staddr + *stsize));
-# endif
-
- pthread_attr_destroy (&attr);
-#endif
/* When running under emacs, sometimes staddr is not aligned to a page size */
*staddr = (guint8*)((gssize)*staddr & ~(mono_pagesize () - 1));
+ return;
+
+#elif defined(sun) || defined(__native_client__)
+ /* Solaris/Illumos, NaCl */
+ pthread_attr_t attr;
+ pthread_attr_init (&attr);
+ pthread_attr_getstacksize (&attr, &stsize);
+ pthread_attr_destroy (&attr);
+ *staddr = NULL;
+ return;
+
+#else
+ /* FIXME: It'd be better to use the 'error' preprocessor macro here so we know
+ at compile-time if the target platform isn't supported. */
+#warning "Unable to determine how to retrieve a thread's stack-bounds for this platform in 'mono_thread_get_stack_bounds()'."
+ *staddr = NULL;
+ *stsize = 0;
+ return;
+#endif
}
MonoThread *
};
typedef struct _tp_epoll_data tp_epoll_data;
-static void tp_epoll_modify (gpointer event_data, int fd, int operation, int events, gboolean is_new);
+static void tp_epoll_modify (gpointer p, int fd, int operation, int events, gboolean is_new);
static void tp_epoll_shutdown (gpointer event_data);
static void tp_epoll_wait (gpointer event_data);
}
static void
-tp_epoll_modify (gpointer event_data, int fd, int operation, int events, gboolean is_new)
+tp_epoll_modify (gpointer p, int fd, int operation, int events, gboolean is_new)
{
- tp_epoll_data *data = event_data;
+ SocketIOData *socket_io_data;
+ socket_io_data = p;
+ tp_epoll_data *data = socket_io_data->event_data;
struct epoll_event evt;
int epoll_op;
}
}
}
+ LeaveCriticalSection (&socket_io_data->io_lock);
}
static void
};
typedef struct _tp_kqueue_data tp_kqueue_data;
-static void tp_kqueue_modify (gpointer event_data, int fd, int operation, int events, gboolean is_new);
+static void tp_kqueue_modify (gpointer p, int fd, int operation, int events, gboolean is_new);
static void tp_kqueue_shutdown (gpointer event_data);
static void tp_kqueue_wait (gpointer event_data);
}
static void
-tp_kqueue_modify (gpointer event_data, int fd, int operation, int events, gboolean is_new)
+tp_kqueue_modify (gpointer p, int fd, int operation, int events, gboolean is_new)
{
- tp_kqueue_data *data = event_data;
+ SocketIOData *socket_io_data;
+ socket_io_data = p;
+ tp_kqueue_data *data = socket_io_data->event_data;
struct kevent evt;
memset (&evt, 0, sizeof (evt));
EV_SET (&evt, fd, EVFILT_WRITE, EV_ADD | EV_ENABLE | EV_ONESHOT, 0, 0, 0);
kevent_change (data->fd, &evt, "ADD write");
}
+ LeaveCriticalSection (&socket_io_data->io_lock);
}
static void
typedef struct _tp_poll_data tp_poll_data;
static void tp_poll_shutdown (gpointer event_data);
-static void tp_poll_modify (gpointer event_data, int fd, int operation, int events, gboolean is_new);
+static void tp_poll_modify (gpointer p, int fd, int operation, int events, gboolean is_new);
static void tp_poll_wait (gpointer p);
static gpointer
}
static void
-tp_poll_modify (gpointer event_data, int fd, int operation, int events, gboolean is_new)
+tp_poll_modify (gpointer p, int fd, int operation, int events, gboolean is_new)
{
- tp_poll_data *data = event_data;
+ SocketIOData *socket_io_data;
+ tp_poll_data *data;
char msg [1];
int unused;
+ socket_io_data = p;
+ data = socket_io_data->event_data;
+
+ LeaveCriticalSection (&socket_io_data->io_lock);
+
MONO_SEM_WAIT (&data->new_sem);
INIT_POLLFD (&data->newpfd, GPOINTER_TO_INT (fd), events);
*msg = (char) operation;
/buildver.h
/TAGS
/mono-sgen
+/mono-boehm
/buildver-sgen.h
-
+/buildver-boehm.h
ln -sf $< $@
install-exec-hook:
- ln -sf $(DESTDIR)$(bindir)/mono-$(libmono_suffix) $(DESTDIR)$(bindir)/mono
+ (cd $(DESTDIR)$(bindir) && ln -sf mono-$(mono_bin_suffix) mono)
(cd $(DESTDIR)$(libdir); for i in libmono$(libmono_suffix)*; do ln -sf $$i `echo $$i | sed s/$(libmono_suffix)//` ; done)
endif
arch_define=__sparc__
endif
-if S390x
+if S390X
arch_sources = $(s390x_sources)
arch_built=cpu-s390x.h
arch_define=__s390__
tags:
etags -o TAGS `find .. -name "*.h" -o -name "*.c"`
+
+if HAS_EXTENSION_MODULE
+else
+Makefile.am: Makefile.am.in
+ cp $< $@
+endif
encode_klass_ref (acfg, method->klass, p, &p);
else if (info->subtype == WRAPPER_SUBTYPE_SYNCHRONIZED_INNER)
encode_method_ref (acfg, info->d.synchronized_inner.method, p, &p);
+ else if (info->subtype == WRAPPER_SUBTYPE_ARRAY_ACCESSOR)
+ encode_method_ref (acfg, info->d.array_accessor.method, p, &p);
break;
}
case MONO_WRAPPER_MANAGED_TO_NATIVE: {
}
}
+#define MONO_TYPE_IS_PRIMITIVE(t) ((!(t)->byref && ((((t)->type >= MONO_TYPE_BOOLEAN && (t)->type <= MONO_TYPE_R8) || ((t)->type >= MONO_TYPE_I && (t)->type <= MONO_TYPE_U)))))
+
static void
add_wrappers (MonoAotCompile *acfg)
{
}
}
+ /* array access wrappers */
+ for (i = 0; i < acfg->image->tables [MONO_TABLE_TYPESPEC].rows; ++i) {
+ MonoClass *klass;
+
+ token = MONO_TOKEN_TYPE_SPEC | (i + 1);
+ klass = mono_class_get (acfg->image, token);
+
+ if (!klass) {
+ mono_loader_clear_error ();
+ continue;
+ }
+
+ if (klass->rank && MONO_TYPE_IS_PRIMITIVE (&klass->element_class->byval_arg)) {
+ MonoMethod *m, *wrapper;
+
+ /* Add runtime-invoke wrappers too */
+
+ m = mono_class_get_method_from_name (klass, "Get", -1);
+ g_assert (m);
+ wrapper = mono_marshal_get_array_accessor_wrapper (m);
+ add_extra_method (acfg, wrapper);
+ add_extra_method (acfg, mono_marshal_get_runtime_invoke (wrapper, FALSE));
+
+ m = mono_class_get_method_from_name (klass, "Set", -1);
+ g_assert (m);
+ wrapper = mono_marshal_get_array_accessor_wrapper (m);
+ add_extra_method (acfg, wrapper);
+ add_extra_method (acfg, mono_marshal_get_runtime_invoke (wrapper, FALSE));
+ }
+ }
+
/* Synchronized wrappers */
for (i = 0; i < acfg->image->tables [MONO_TABLE_METHOD].rows; ++i) {
token = MONO_TOKEN_METHOD_DEF | (i + 1);
method = mono_get_method (acfg->image, token, NULL);
- if (method->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED && !method->is_generic)
- add_method (acfg, mono_marshal_get_synchronized_wrapper (method));
+ if (method->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED) {
+ if (method->is_generic) {
+ // FIXME:
+ } else if (method->klass->generic_container) {
+ MonoGenericContext ctx;
+ MonoMethod *inst, *gshared, *m;
+
+ /*
+ * Create a generic wrapper for a generic instance, and AOT that.
+ */
+ create_gsharedvt_inst (acfg, method, &ctx);
+ inst = mono_class_inflate_generic_method (method, &ctx);
+ m = mono_marshal_get_synchronized_wrapper (inst);
+ g_assert (m->is_inflated);
+ gshared = mini_get_shared_method_full (m, FALSE, TRUE);
+ add_method (acfg, gshared);
+ } else {
+ add_method (acfg, mono_marshal_get_synchronized_wrapper (method));
+ }
+ }
}
/* pinvoke wrappers */
findex = g_hash_table_size (acfg->dwarf_ln_filenames) + 1;
g_hash_table_insert (acfg->dwarf_ln_filenames, g_strdup (source_file), GINT_TO_POINTER (findex));
emit_unset_mode (acfg);
- fprintf (acfg->fp, ".file %d \"%s\"\n", findex, source_file);
+ fprintf (acfg->fp, ".file %d \"%s\"\n", findex, mono_dwarf_escape_path (source_file));
}
return findex;
}
*/
for (tramp_type = 0; tramp_type < MONO_TRAMPOLINE_NUM; ++tramp_type) {
/* we overload the boolean here to indicate the slightly different trampoline needed, see mono_arch_create_generic_trampoline() */
+#ifdef DISABLE_REMOTING
+ if (tramp_type == MONO_TRAMPOLINE_GENERIC_VIRTUAL_REMOTING)
+ continue;
+#endif
+#ifndef MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD
+ if (tramp_type == MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD)
+ continue;
+#endif
mono_arch_create_generic_trampoline (tramp_type, &info, acfg->aot_opts.use_trampolines_page? 2: TRUE);
emit_trampoline (acfg, acfg->got_offset, info);
}
case MONO_WRAPPER_DELEGATE_INVOKE:
case MONO_WRAPPER_DELEGATE_BEGIN_INVOKE:
case MONO_WRAPPER_DELEGATE_END_INVOKE:
+ case MONO_WRAPPER_SYNCHRONIZED:
break;
case MONO_WRAPPER_MANAGED_TO_MANAGED:
case MONO_WRAPPER_CASTCLASS: {
opts = g_strdup ("-instcombine -simplifycfg");
opts = g_strdup ("-simplifycfg -domtree -domfrontier -scalarrepl -instcombine -simplifycfg -domtree -domfrontier -scalarrepl -simplify-libcalls -instcombine -simplifycfg -instcombine -simplifycfg -reassociate -domtree -loops -loop-simplify -domfrontier -loop-simplify -lcssa -loop-rotate -licm -lcssa -loop-unswitch -instcombine -scalar-evolution -loop-simplify -lcssa -iv-users -indvars -loop-deletion -loop-simplify -lcssa -loop-unroll -instcombine -memdep -gvn -memdep -memcpyopt -sccp -instcombine -domtree -memdep -dse -adce -simplifycfg -preverify -domtree -verify");
#if 1
- command = g_strdup_printf ("%sopt -f %s -o %s.opt.bc %s.bc", acfg->aot_opts.llvm_path, opts, acfg->tmpfname, acfg->tmpfname);
+ command = g_strdup_printf ("%sopt -f %s -o \"%s.opt.bc\" \"%s.bc\"", acfg->aot_opts.llvm_path, opts, acfg->tmpfname, acfg->tmpfname);
printf ("Executing opt: %s\n", command);
if (system (command) != 0) {
exit (1);
#endif
unlink (acfg->tmpfname);
- command = g_strdup_printf ("%sllc %s -disable-gnu-eh-frame -enable-mono-eh-frame -o %s %s.opt.bc", acfg->aot_opts.llvm_path, acfg->llc_args->str, acfg->tmpfname, acfg->tmpfname);
+ command = g_strdup_printf ("%sllc %s -disable-gnu-eh-frame -enable-mono-eh-frame -o \"%s\" \"%s.opt.bc\"", acfg->aot_opts.llvm_path, acfg->llc_args->str, acfg->tmpfname, acfg->tmpfname);
printf ("Executing llc: %s\n", command);
* This is PIE code, and the linker can update it if needed.
*/
sprintf (symbol, "method_addresses");
- emit_section_change (acfg, RODATA_SECT, 1);
+ emit_section_change (acfg, ".text", 1);
emit_alignment (acfg, 8);
emit_label (acfg, symbol);
emit_local_symbol (acfg, symbol, "method_addresses_end", TRUE);
/* Emit a sorted table mapping methods to their unbox trampolines */
sprintf (symbol, "unbox_trampolines");
- emit_section_change (acfg, RODATA_SECT, 1);
+ if (acfg->direct_method_addresses)
+ emit_section_change (acfg, ".text", 0);
+ else
+ emit_section_change (acfg, RODATA_SECT, 0);
emit_alignment (acfg, 8);
emit_label (acfg, symbol);
value = get_method_index (acfg, method);
hash = mono_aot_method_hash (method) % table_size;
+ //printf ("X: %s %d\n", mono_method_full_name (method, 1), hash);
chain_lengths [hash] ++;
max_chain_length = MAX (max_chain_length, chain_lengths [hash]);
emit_int32 (acfg, __alignof__ (double));
emit_int32 (acfg, __alignof__ (gint64));
#endif
+ emit_int32 (acfg, MONO_TRAMPOLINE_NUM);
if (acfg->aot_opts.static_link) {
char *p;
if (!m)
return FALSE;
ref->method = mono_marshal_get_synchronized_inner_wrapper (m);
+ } else if (subtype == WRAPPER_SUBTYPE_ARRAY_ACCESSOR) {
+ MonoMethod *m = decode_resolve_method_ref (module, p, &p);
+
+ if (!m)
+ return FALSE;
+ ref->method = mono_marshal_get_array_accessor_wrapper (m);
} else if (subtype == WRAPPER_SUBTYPE_GSHAREDVT_IN) {
ref->method = mono_marshal_get_gsharedvt_in_wrapper ();
} else if (subtype == WRAPPER_SUBTYPE_GSHAREDVT_OUT) {
/* Sanity check */
g_assert (info->double_align == align_double);
g_assert (info->long_align == align_int64);
+ g_assert (info->generic_tramp_num == MONO_TRAMPOLINE_NUM);
blob = info->blob;
}
code_start = amodule->code + amodule->code_offsets [table [(pos * 2)]];
- if (pos + 1 == fde_count)
- /* End of table */
- code_end = amodule->code_end;
- else
+ if (pos + 1 == fde_count) {
+ /* The +1 entry in the table contains the length of the last method */
+ int len = table [(pos + 1) * 2];
+ code_end = code_start + len;
+ } else {
code_end = amodule->code + amodule->code_offsets [table [(pos + 1) * 2]];
+ }
code_len = code_end - code_start;
g_assert (code >= code_start && code < code_end);
test[x+100,y+100] = true;
}
return 0;
- }
+ }
+
+ static bool alloc_long (long l) {
+ try {
+ var arr = new byte[l];
+ return false;
+ } catch (Exception e) {
+ return true;
+ }
+ }
+
+ // #13544
+ public static int test_0_newarr_ovf () {
+ if (!alloc_long (5000000000))
+ return 1;
+ if (!alloc_long (4000000000))
+ return 2;
+ if (!alloc_long (-1))
+ return 3;
+ if (!alloc_long (-4000000000))
+ return 4;
+ if (!alloc_long (-6000000000))
+ return 5;
+ return 0;
+ }
}
# 32 bit opcodes
int_add: dest:i src1:i src2:i len:4
int_sub: dest:i src1:i src2:i len:4
-int_mul: dest:i src1:i src2:i len:4
+int_mul: dest:i src1:i src2:i len:16
int_div: dest:i src1:i src2:i len:84
int_div_un: dest:i src1:i src2:i len:40
int_rem: dest:i src1:i src2:i len:84
# 64 bit opcodes
long_add: dest:i src1:i src2:i len:4
long_sub: dest:i src1:i src2:i len:4
-long_mul: dest:i src1:i src2:i len:8
+long_mul: dest:i src1:i src2:i len:32
long_mul_imm: dest:i src1:i len:4
long_div: dest:i src1:i src2:i len:40
long_div_un: dest:i src1:i src2:i len:16
static inline MonoClass*
decode_typeid (guint8 *buf, guint8 **endbuf, guint8 *limit, MonoDomain **domain, int *err)
{
- return decode_ptr_id (buf, endbuf, limit, ID_TYPE, domain, err);
+ MonoClass *klass;
+
+ klass = decode_ptr_id (buf, endbuf, limit, ID_TYPE, domain, err);
+ if (G_UNLIKELY (log_level >= 2) && klass) {
+ char *s;
+
+ s = mono_type_full_name (&klass->byval_arg);
+ DEBUG(2, fprintf (log_file, "[dbg] recv class [%s]\n", s));
+ g_free (s);
+ }
+ return klass;
}
static inline MonoAssembly*
buffer_add_typeid (Buffer *buf, MonoDomain *domain, MonoClass *klass)
{
buffer_add_ptr_id (buf, domain, ID_TYPE, klass);
+ if (G_UNLIKELY (log_level >= 2) && klass) {
+ char *s;
+
+ s = mono_type_full_name (&klass->byval_arg);
+ if (GetCurrentThreadId () == debugger_thread_id)
+ DEBUG(2, fprintf (log_file, "[dbg] send class [%s]\n", s));
+ else
+ DEBUG(2, fprintf (log_file, "[%p] send class [%s]\n", (gpointer)GetCurrentThreadId (), s));
+ g_free (s);
+ }
}
static inline void
buffer_add_methodid (Buffer *buf, MonoDomain *domain, MonoMethod *method)
{
buffer_add_ptr_id (buf, domain, ID_METHOD, method);
+ if (G_UNLIKELY (log_level >= 2) && method) {
+ char *s;
+
+ s = mono_method_full_name (method, 1);
+ DEBUG(2, fprintf (log_file, "[dbg] send method [%s]\n", s));
+ g_free (s);
+ }
}
static inline void
mono_loader_unlock ();
}
+/*
+ * ss_update:
+ *
+ * Return FALSE if single stepping needs to continue because we are at the same line.
+ */
+static gboolean
+ss_update (SingleStepReq *req, MonoJitInfo *ji, SeqPoint *sp)
+{
+ MonoDebugMethodInfo *minfo;
+ MonoDebugSourceLocation *loc = NULL;
+ gboolean hit = TRUE;
+
+ if (req->size != STEP_SIZE_LINE)
+ return TRUE;
+
+ /* Have to check whenever a different source line was reached */
+ minfo = mono_debug_lookup_method (ji->method);
+
+ if (minfo)
+ loc = mono_debug_symfile_lookup_location (minfo, sp->il_offset);
+
+ if (!loc || (loc && ji->method == ss_req->last_method && loc->row == ss_req->last_line)) {
+ /* Have to continue single stepping */
+ if (!loc)
+ DEBUG(1, fprintf (log_file, "[%p] No line number info for il offset %x, continuing single stepping.\n", (gpointer)GetCurrentThreadId (), sp->il_offset));
+ else
+ DEBUG(1, fprintf (log_file, "[%p] Same source line (%d), continuing single stepping.\n", (gpointer)GetCurrentThreadId (), loc->row));
+ hit = FALSE;
+ }
+
+ if (loc) {
+ ss_req->last_method = ji->method;
+ ss_req->last_line = loc->row;
+ mono_debug_free_source_location (loc);
+ }
+
+ return hit;
+}
+
static gboolean
breakpoint_matches_assembly (MonoBreakpoint *bp, MonoAssembly *assembly)
{
for (i = 0; i < ss_reqs_orig->len; ++i) {
EventRequest *req = g_ptr_array_index (ss_reqs_orig, i);
SingleStepReq *ss_req = req->info;
- gboolean hit = TRUE;
-
- if (ss_req->size == STEP_SIZE_LINE) {
- /* Have to check whenever a different source line was reached */
- MonoDebugMethodInfo *minfo;
- MonoDebugSourceLocation *loc = NULL;
-
- minfo = mono_debug_lookup_method (ji->method);
-
- if (minfo)
- loc = mono_debug_symfile_lookup_location (minfo, sp->il_offset);
-
- if (!loc || (loc && ji->method == ss_req->last_method && loc->row == ss_req->last_line)) {
- /* Have to continue single stepping */
- DEBUG(1, fprintf (log_file, "[%p] Same source line, continuing single stepping.\n", (gpointer)GetCurrentThreadId ()));
- hit = FALSE;
- }
-
- if (loc) {
- ss_req->last_method = ji->method;
- ss_req->last_line = loc->row;
- mono_debug_free_source_location (loc);
- }
- }
+ gboolean hit;
+ hit = ss_update (ss_req, ji, sp);
if (hit)
g_ptr_array_add (ss_reqs, req);
return;
il_offset = sp->il_offset;
- // FIXME: No tests fail if this is disabled
-#if 0
- if (ss_req->size == STEP_SIZE_LINE) {
- // FIXME:
- NOT_IMPLEMENTED;
-
- /* Step until a different source line is reached */
- MonoDebugMethodInfo *minfo;
-
- minfo = mono_debug_lookup_method (ji->method);
-
- if (minfo) {
- MonoDebugSourceLocation *loc = mono_debug_symfile_lookup_location (minfo, il_offset);
-
- if (loc && ji->method == ss_req->last_method && loc->row == ss_req->last_line) {
- mono_debug_free_source_location (loc);
- return;
- }
- if (!loc)
- /*
- * Step until we reach a location with line number info,
- * otherwise the client can't show a location.
- * This can happen for example with statics initialized inline
- * outside of a cctor.
- */
- return;
-
- if (loc) {
- ss_req->last_method = ji->method;
- ss_req->last_line = loc->row;
- mono_debug_free_source_location (loc);
- }
- }
- }
-#endif
+ if (!ss_update (ss_req, ji, sp))
+ return;
/* Start single stepping again from the current sequence point */
ss_start (ss_req, ji->method, sp, info, ctx, tls, FALSE);
static ErrorCode
decode_value (MonoType *t, MonoDomain *domain, guint8 *addr, guint8 *buf, guint8 **endbuf, guint8 *limit);
+static ErrorCode
+decode_vtype (MonoType *t, MonoDomain *domain, guint8 *addr, guint8 *buf, guint8 **endbuf, guint8 *limit)
+{
+ gboolean is_enum;
+ MonoClass *klass;
+ MonoClassField *f;
+ int nfields;
+ gpointer iter = NULL;
+ MonoDomain *d;
+ int err;
+
+ is_enum = decode_byte (buf, &buf, limit);
+ /* Enums are sent as a normal vtype */
+ if (is_enum)
+ return ERR_NOT_IMPLEMENTED;
+ klass = decode_typeid (buf, &buf, limit, &d, &err);
+ if (err)
+ return err;
+
+ if (t && klass != mono_class_from_mono_type (t)) {
+ char *name = mono_type_full_name (t);
+ char *name2 = mono_type_full_name (&klass->byval_arg);
+ DEBUG(1, fprintf (log_file, "[%p] Expected value of type %s, got %s.\n", (gpointer)GetCurrentThreadId (), name, name2));
+ g_free (name);
+ g_free (name2);
+ return ERR_INVALID_ARGUMENT;
+ }
+
+ nfields = decode_int (buf, &buf, limit);
+ while ((f = mono_class_get_fields (klass, &iter))) {
+ if (f->type->attrs & FIELD_ATTRIBUTE_STATIC)
+ continue;
+ if (mono_field_is_deleted (f))
+ continue;
+ err = decode_value (f->type, domain, (guint8*)addr + f->offset - sizeof (MonoObject), buf, &buf, limit);
+ if (err)
+ return err;
+ nfields --;
+ }
+ g_assert (nfields == 0);
+ return 0;
+}
+
static ErrorCode
decode_value_internal (MonoType *t, int type, MonoDomain *domain, guint8 *addr, guint8 *buf, guint8 **endbuf, guint8 *limit)
{
g_assert (type == MONO_TYPE_VALUETYPE);
/* Fall through */
handle_vtype:
- case MONO_TYPE_VALUETYPE: {
- gboolean is_enum = decode_byte (buf, &buf, limit);
- MonoClass *klass;
- MonoClassField *f;
- int nfields;
- gpointer iter = NULL;
- MonoDomain *d;
-
- /* Enums are sent as a normal vtype */
- if (is_enum)
- return ERR_NOT_IMPLEMENTED;
- klass = decode_typeid (buf, &buf, limit, &d, &err);
+ case MONO_TYPE_VALUETYPE:
+ err = decode_vtype (t, domain, addr,buf, &buf, limit);
if (err)
return err;
-
- if (klass != mono_class_from_mono_type (t))
- return ERR_INVALID_ARGUMENT;
-
- nfields = decode_int (buf, &buf, limit);
- while ((f = mono_class_get_fields (klass, &iter))) {
- if (f->type->attrs & FIELD_ATTRIBUTE_STATIC)
- continue;
- if (mono_field_is_deleted (f))
- continue;
- err = decode_value (f->type, domain, (guint8*)addr + f->offset - sizeof (MonoObject), buf, &buf, limit);
- if (err)
- return err;
- nfields --;
- }
- g_assert (nfields == 0);
break;
- }
handle_ref:
default:
if (MONO_TYPE_IS_REFERENCE (t)) {
mono_gc_wbarrier_generic_store (addr, obj);
} else if (type == VALUE_TYPE_ID_NULL) {
*(MonoObject**)addr = NULL;
+ } else if (type == MONO_TYPE_VALUETYPE) {
+ guint8 *buf2;
+ gboolean is_enum;
+ MonoClass *klass;
+ MonoDomain *d;
+ guint8 *vtype_buf;
+ int vtype_buf_size;
+
+ /* This can happen when round-tripping boxed vtypes */
+ /*
+ * Obtain vtype class.
+ * Same as the beginning of the handle_vtype case above.
+ */
+ buf2 = buf;
+ is_enum = decode_byte (buf, &buf, limit);
+ if (is_enum)
+ return ERR_NOT_IMPLEMENTED;
+ klass = decode_typeid (buf, &buf, limit, &d, &err);
+ if (err)
+ return err;
+
+ /* Decode the vtype into a temporary buffer, then box it. */
+ vtype_buf_size = mono_class_value_size (klass, NULL);
+ vtype_buf = g_malloc0 (vtype_buf_size);
+ g_assert (vtype_buf);
+
+ buf = buf2;
+ err = decode_vtype (NULL, domain, vtype_buf, buf, &buf, limit);
+ if (err) {
+ g_free (vtype_buf);
+ return err;
+ }
+ *(MonoObject**)addr = mono_value_box (d, klass, vtype_buf);
+ g_free (vtype_buf);
} else {
+ char *name = mono_type_full_name (t);
+ DEBUG(1, fprintf (log_file, "[%p] Expected value of type %s, got 0x%0x.\n", (gpointer)GetCurrentThreadId (), name, type));
+ g_free (name);
return ERR_INVALID_ARGUMENT;
}
} else {
if (m->klass->valuetype && (m->flags & METHOD_ATTRIBUTE_STATIC)) {
/* Should be null */
int type = decode_byte (p, &p, end);
- if (type != VALUE_TYPE_ID_NULL)
+ if (type != VALUE_TYPE_ID_NULL) {
+ DEBUG (1, fprintf (log_file, "[%p] Error: Static vtype method invoked with this argument.\n", (gpointer)GetCurrentThreadId ()));
return ERR_INVALID_ARGUMENT;
+ }
memset (this_buf, 0, mono_class_instance_size (m->klass));
} else {
err = decode_value (&m->klass->byval_arg, domain, this_buf, p, &p, end);
tls->resume_count -= invoke->suspend_count;
}
- DEBUG (1, fprintf (log_file, "[%p] Invoke finished, resume_count = %d.\n", (gpointer)GetCurrentThreadId (), tls->resume_count));
+ DEBUG (1, fprintf (log_file, "[%p] Invoke finished (%d), resume_count = %d.\n", (gpointer)GetCurrentThreadId (), err, tls->resume_count));
/*
* Take the loader lock to avoid race conditions with CMD_VM_ABORT_INVOKE:
MonoArray *typed_args, *named_args;
MonoType *t;
CattrNamedArg *arginfo;
+ MonoError error;
- mono_reflection_create_custom_attr_data_args (image, attr->ctor, attr->data, attr->data_size, &typed_args, &named_args, &arginfo);
+ mono_reflection_create_custom_attr_data_args (image, attr->ctor, attr->data, attr->data_size, &typed_args, &named_args, &arginfo, &error);
+ g_assert (mono_error_ok (&error));
buffer_add_methodid (buf, domain, attr->ctor);
}
}
+static const char* vm_cmds_str [] = {
+ "VERSION",
+ "ALL_THREADS",
+ "SUSPEND",
+ "RESUME",
+ "EXIT",
+ "DISPOSE",
+ "INVOKE_METHOD",
+ "SET_PROTOCOL_VERSION",
+ "ABORT_INVOKE",
+ "SET_KEEPALIVE"
+ "GET_TYPES_FOR_SOURCE_FILE",
+ "GET_TYPES",
+ "INVOKE_METHODS"
+};
+
+static const char* thread_cmds_str[] = {
+ "GET_FRAME_INFO",
+ "GET_NAME",
+ "GET_STATE",
+ "GET_INFO",
+ "GET_ID",
+ "GET_TID"
+};
+
+static const char* event_cmds_str[] = {
+ "REQUEST_SET",
+ "REQUEST_CLEAR",
+ "REQUEST_CLEAR_ALL_BREAKPOINTS"
+};
+
+static const char* appdomain_cmds_str[] = {
+ "GET_ROOT_DOMAIN",
+ "GET_FRIENDLY_NAME",
+ "GET_ASSEMBLIES",
+ "GET_ENTRY_ASSEMBLY",
+ "CREATE_STRING",
+ "GET_CORLIB",
+ "CREATE_BOXED_VALUE"
+};
+
+static const char* assembly_cmds_str[] = {
+ "GET_LOCATION",
+ "GET_ENTRY_POINT",
+ "GET_MANIFEST_MODULE",
+ "GET_OBJECT",
+ "GET_TYPE",
+ "GET_NAME"
+};
+
+static const char* module_cmds_str[] = {
+ "GET_INFO",
+};
+
+static const char* method_cmds_str[] = {
+ "GET_NAME",
+ "GET_DECLARING_TYPE",
+ "GET_DEBUG_INFO",
+ "GET_PARAM_INFO",
+ "GET_LOCALS_INFO",
+ "GET_INFO",
+ "GET_BODY",
+ "RESOLVE_TOKEN",
+ "GET_CATTRS ",
+ "MAKE_GENERIC_METHOD"
+};
+
+static const char* type_cmds_str[] = {
+ "GET_INFO",
+ "GET_METHODS",
+ "GET_FIELDS",
+ "GET_VALUES",
+ "GET_OBJECT",
+ "GET_SOURCE_FILES",
+ "SET_VALUES",
+ "IS_ASSIGNABLE_FROM",
+ "GET_PROPERTIES ",
+ "GET_CATTRS",
+ "GET_FIELD_CATTRS",
+ "GET_PROPERTY_CATTRS",
+ "GET_SOURCE_FILES_2",
+ "GET_VALUES_2",
+ "GET_METHODS_BY_NAME_FLAGS",
+ "GET_INTERFACES",
+ "GET_INTERFACE_MAP",
+ "IS_INITIALIZED"
+};
+
+static const char* stack_frame_cmds_str[] = {
+ "GET_VALUES",
+ "GET_THIS",
+ "SET_VALUES"
+};
+
+static const char* array_cmds_str[] = {
+ "GET_LENGTH",
+ "GET_VALUES",
+ "SET_VALUES",
+};
+
+static const char* string_cmds_str[] = {
+ "GET_VALUE",
+ "GET_LENGTH",
+ "GET_CHARS"
+};
+
+static const char* object_cmds_str[] = {
+ "GET_TYPE",
+ "GET_VALUES",
+ "IS_COLLECTED",
+ "GET_ADDRESS",
+ "GET_DOMAIN",
+ "SET_VALUES",
+ "GET_INFO",
+};
+
static const char*
cmd_to_string (CommandSet set, int command)
{
+ const char **cmds;
+ int cmds_len = 0;
+
switch (set) {
- case CMD_SET_VM: {
- switch (command) {
- case CMD_VM_VERSION:
- return "VERSION";
- case CMD_VM_ALL_THREADS:
- return "ALL_THREADS";
- case CMD_VM_SUSPEND:
- return "SUSPEND";
- case CMD_VM_RESUME:
- return "RESUME";
- case CMD_VM_EXIT:
- return "EXIT";
- case CMD_VM_DISPOSE:
- return "DISPOSE";
- case CMD_VM_INVOKE_METHOD:
- return "INVOKE_METHOD";
- case CMD_VM_SET_PROTOCOL_VERSION:
- return "SET_PROTOCOL_VERSION";
- case CMD_VM_ABORT_INVOKE:
- return "ABORT_INVOKE";
- case CMD_VM_SET_KEEPALIVE:
- return "SET_KEEPALIVE";
- default:
- break;
- }
+ case CMD_SET_VM:
+ cmds = vm_cmds_str;
+ cmds_len = G_N_ELEMENTS (vm_cmds_str);
+ break;
+ case CMD_SET_OBJECT_REF:
+ cmds = object_cmds_str;
+ cmds_len = G_N_ELEMENTS (object_cmds_str);
+ break;
+ case CMD_SET_STRING_REF:
+ cmds = string_cmds_str;
+ cmds_len = G_N_ELEMENTS (string_cmds_str);
+ break;
+ case CMD_SET_THREAD:
+ cmds = thread_cmds_str;
+ cmds_len = G_N_ELEMENTS (thread_cmds_str);
+ break;
+ case CMD_SET_ARRAY_REF:
+ cmds = array_cmds_str;
+ cmds_len = G_N_ELEMENTS (array_cmds_str);
+ break;
+ case CMD_SET_EVENT_REQUEST:
+ cmds = event_cmds_str;
+ cmds_len = G_N_ELEMENTS (event_cmds_str);
+ break;
+ case CMD_SET_STACK_FRAME:
+ cmds = stack_frame_cmds_str;
+ cmds_len = G_N_ELEMENTS (stack_frame_cmds_str);
+ break;
+ case CMD_SET_APPDOMAIN:
+ cmds = appdomain_cmds_str;
+ cmds_len = G_N_ELEMENTS (appdomain_cmds_str);
+ break;
+ case CMD_SET_ASSEMBLY:
+ cmds = assembly_cmds_str;
+ cmds_len = G_N_ELEMENTS (assembly_cmds_str);
+ break;
+ case CMD_SET_METHOD:
+ cmds = method_cmds_str;
+ cmds_len = G_N_ELEMENTS (method_cmds_str);
+ break;
+ case CMD_SET_TYPE:
+ cmds = type_cmds_str;
+ cmds_len = G_N_ELEMENTS (type_cmds_str);
+ break;
+ case CMD_SET_MODULE:
+ cmds = module_cmds_str;
+ cmds_len = G_N_ELEMENTS (module_cmds_str);
+ break;
+ case CMD_SET_EVENT:
+ cmds = event_cmds_str;
+ cmds_len = G_N_ELEMENTS (event_cmds_str);
break;
- }
default:
break;
}
- return NULL;
+ if (command > 0 && command <= cmds_len)
+ return cmds [command - 1];
+ else
+ return NULL;
}
static gboolean
cmd_str = cmd_num;
}
- DEBUG (1, fprintf (log_file, "[dbg] Received command %s(%s), id=%d.\n", command_set_to_string (command_set), cmd_str, id));
+ DEBUG (1, fprintf (log_file, "[dbg] Command %s(%s) [%d].\n", command_set_to_string (command_set), cmd_str, id));
}
data = g_malloc (len - HEADER_LENGTH);
double vald;
} DVal;
-#ifdef MONO_ARCH_SOFT_FLOAT
+#ifdef MONO_ARCH_SOFT_FLOAT_FALLBACK
/**
* mono_decompose_soft_float:
#include <mono/metadata/coree.h>
#include <mono/metadata/attach.h>
#include "mono/utils/mono-counters.h"
+#include "mono/utils/mono-hwcap.h"
#include "mini.h"
#include "jit.h"
const char *n;
int i, invert, len;
+ /* Initialize the hwcap module if necessary. */
+ mono_hwcap_init ();
+
/* call out to cpu detection code here that sets the defaults ... */
opt |= mono_arch_cpu_optimizations (&exclude);
opt &= ~exclude;
MonoDomain *domain = mono_domain_get ();
guint32 exclude = 0;
+ /* Note: mono_hwcap_init () called in mono_init () before we get here. */
mono_arch_cpu_optimizations (&exclude);
if (mini_stats_fd) {
emit_label (w, ".Ldebug_line_end");
}
-static char *
-escape_path (char *name)
+char *
+mono_dwarf_escape_path (const char *name)
{
if (strchr (name, '\\')) {
- char *s = g_malloc (strlen (name) * 2);
+ char *s;
int len, i, j;
len = strlen (name);
+ s = g_malloc0 ((len + 1) * 2);
j = 0;
for (i = 0; i < len; ++i) {
if (name [i] == '\\') {
}
return s;
}
- return name;
+ return g_strdup (name);
}
static void
for (i = 0; i < w->line_number_dir_index; ++i) {
char *dir = g_hash_table_lookup (index_to_dir, GUINT_TO_POINTER (i + 1));
- emit_string (w, escape_path (dir));
+ emit_string (w, mono_dwarf_escape_path (dir));
}
/* End of Includes */
emit_byte (w, 0);
if (basename)
emit_string (w, basename);
else
- emit_string (w, escape_path (name));
+ emit_string (w, mono_dwarf_escape_path (name));
emit_uleb128 (w, dir_index);
emit_byte (w, 0);
emit_byte (w, 0);
void
mono_dwarf_writer_emit_method (MonoDwarfWriter *w, MonoCompile *cfg, MonoMethod *method, char *start_symbol, char *end_symbol, guint8 *code, guint32 code_size, MonoInst **args, MonoInst **locals, GSList *unwind_info, MonoDebugMethodJitInfo *debug_info) MONO_INTERNAL;
+char *
+mono_dwarf_escape_path (const char *name);
+
#endif
mono_arch_flush_icache (start, code - start);
if (info)
- *info = mono_tramp_info_create (g_strdup_printf ("restore_context"), start, code - start, ji, unwind_ops);
+ *info = mono_tramp_info_create ("restore_context", start, code - start, ji, unwind_ops);
return start;
}
mono_arch_flush_icache (start, code - start);
if (info)
- *info = mono_tramp_info_create (g_strdup_printf ("call_filter"), start, code - start, ji, unwind_ops);
+ *info = mono_tramp_info_create ("call_filter", start, code - start, ji, unwind_ops);
return start;
}
nacl_global_codeman_validate(&start, kMaxCodeSize, &code);
if (info)
- *info = mono_tramp_info_create (g_strdup (tramp_name), start, code - start, ji, unwind_ops);
+ *info = mono_tramp_info_create (tramp_name, start, code - start, ji, unwind_ops);
return start;
}
nacl_global_codeman_validate(&start, kMaxCodeSize, &code);
if (info)
- *info = mono_tramp_info_create (g_strdup_printf ("throw_pending_exception"), start, code - start, ji, unwind_ops);
+ *info = mono_tramp_info_create ("throw_pending_exception", start, code - start, ji, unwind_ops);
return start;
}
mono_arch_flush_icache (start, code - start);
if (info)
- *info = mono_tramp_info_create (g_strdup_printf ("restore_context"), start, code - start, ji, unwind_ops);
+ *info = mono_tramp_info_create ("restore_context", start, code - start, ji, unwind_ops);
return start;
}
mono_arch_flush_icache (start, code - start);
if (info)
- *info = mono_tramp_info_create (g_strdup_printf ("call_filter"), start, code - start, ji, unwind_ops);
+ *info = mono_tramp_info_create ("call_filter", start, code - start, ji, unwind_ops);
return start;
}
mono_arch_flush_icache (start, code - start);
if (info)
- *info = mono_tramp_info_create (g_strdup_printf (tramp_name), start, code - start, ji, unwind_ops);
+ *info = mono_tramp_info_create (tramp_name, start, code - start, ji, unwind_ops);
return start;
}
mono_arch_flush_icache (start, code - start);
if (info)
- *info = mono_tramp_info_create (g_strdup_printf ("restore_context"), start, code - start, ji, unwind_ops);
+ *info = mono_tramp_info_create ("restore_context", start, code - start, ji, unwind_ops);
return start;
}
mono_arch_flush_icache (start, code - start);
if (info)
- *info = mono_tramp_info_create (g_strdup_printf ("call_filter"), start, code - start, ji, unwind_ops);
+ *info = mono_tramp_info_create ("call_filter", start, code - start, ji, unwind_ops);
return start;
}
mono_arch_flush_icache (start, code - start);
if (info)
- *info = mono_tramp_info_create (g_strdup_printf (corlib ? "throw_corlib_exception" : (rethrow ? "rethrow_exception" : "throw_exception")), start, code - start, ji, unwind_ops);
+ *info = mono_tramp_info_create (corlib ? "throw_corlib_exception" : (rethrow ? "rethrow_exception" : "throw_exception"), start, code - start, ji, unwind_ops);
return start;
}
g_assert ((code - start) < SZ_THROW);
if (info)
- *info = mono_tramp_info_create (g_strdup_printf("call_filter"),
+ *info = mono_tramp_info_create ("call_filter",
start, code - start, ji,
unwind_ops);
g_assert ((code - start) < size);
if (info)
- *info = mono_tramp_info_create (g_strdup_printf(corlib ? "throw_corlib_exception"
+ *info = mono_tramp_info_create (corlib ? "throw_corlib_exception"
: (rethrow ? "rethrow_exception"
- : "throw_exception")),
+ : "throw_exception"),
start, code - start, ji, unwind_ops);
return start;
nacl_global_codeman_validate(&start, 128, &code);
if (info)
- *info = mono_tramp_info_create (g_strdup_printf ("restore_context"), start, code - start, ji, unwind_ops);
+ *info = mono_tramp_info_create ("restore_context", start, code - start, ji, unwind_ops);
else {
GSList *l;
nacl_global_codeman_validate(&start, kMaxCodeSize, &code);
if (info)
- *info = mono_tramp_info_create (g_strdup_printf ("call_filter"), start, code - start, ji, unwind_ops);
+ *info = mono_tramp_info_create ("call_filter", start, code - start, ji, unwind_ops);
else {
GSList *l;
g_assert ((code - start) < kMaxCodeSize);
if (info)
- *info = mono_tramp_info_create (g_strdup (name), start, code - start, ji, unwind_ops);
+ *info = mono_tramp_info_create (name, start, code - start, ji, unwind_ops);
else {
GSList *l;
g_assert ((code - start) < 128);
if (info)
- *info = mono_tramp_info_create (g_strdup ("x86_signal_exception_trampoline"), start, code - start, ji, unwind_ops);
+ *info = mono_tramp_info_create ("x86_signal_exception_trampoline", start, code - start, ji, unwind_ops);
else {
GSList *l;
return result;
}
+ class SyncClass<T> {
+ [MethodImpl(MethodImplOptions.Synchronized)]
+ public Type getInstance() {
+ return typeof (T);
+ }
+ }
+
+ static int test_0_synchronized_gshared () {
+ var c = new SyncClass<string> ();
+ if (c.getInstance () != typeof (string))
+ return 1;
+ return 0;
+ }
+
class Response {
}
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
+using System.Threading.Tasks;
struct Foo {
public int i, j, k, l, m, n;
return 0;
}
+ public static int test_0_unbox_any_enum () {
+ IFaceUnbox iface = new ClassUnbox ();
+ AnEnum res = iface.Unbox<AnEnum, int> (AnEnum.One, 0, 1);
+ return res == AnEnum.Two ? 0 : 1;
+ }
+
[MethodImplAttribute (MethodImplOptions.NoInlining)]
static void ldfld_nongeneric<T> (GFoo<T>[] foo, int[] arr) {
arr [0] = foo [0].i;
}
enum AnEnum {
- One
+ One,
+ Two
};
public static int test_0_constrained_tostring () {
return 2;
return 0;
}
+
+ interface IConstrained {
+ void foo ();
+ void foo_ref_arg (string s);
+ }
+
+ static object constrained_res;
+
+ struct ConsStruct : IConstrained {
+ public int i;
+
+ public void foo () {
+ constrained_res = i;
+ }
+
+ public void foo_ref_arg (string s) {
+ constrained_res = s == "A" ? 42 : 0;
+ }
+ }
+
+ class ConsClass : IConstrained {
+ public int i;
+
+ public void foo () {
+ constrained_res = i;
+ }
+
+ public void foo_ref_arg (string s) {
+ constrained_res = s == "A" ? 43 : 0;
+ }
+ }
+
+ interface IFaceConstrained {
+ void constrained_void_iface_call<T, T2>(T t, T2 t2) where T2 : IConstrained;
+ void constrained_void_iface_call_ref_arg<T, T2>(T t, T2 t2) where T2 : IConstrained;
+ }
+
+ class ClassConstrained : IFaceConstrained {
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public void constrained_void_iface_call<T, T2>(T t, T2 t2) where T2 : IConstrained {
+ t2.foo ();
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public void constrained_void_iface_call_ref_arg<T, T2>(T t, T2 t2) where T2 : IConstrained {
+ t2.foo_ref_arg ("A");
+ }
+ }
+
+ public static int test_0_constrained_void_iface_call () {
+ IFaceConstrained c = new ClassConstrained ();
+ var s = new ConsStruct () { i = 42 };
+ constrained_res = null;
+ c.constrained_void_iface_call<int, ConsStruct> (1, s);
+ if (!(constrained_res is int) || ((int)constrained_res) != 42)
+ return 1;
+ constrained_res = null;
+ c.constrained_void_iface_call_ref_arg<int, ConsStruct> (1, s);
+ if (!(constrained_res is int) || ((int)constrained_res) != 42)
+ return 2;
+ var s2 = new ConsClass () { i = 43 };
+ constrained_res = null;
+ c.constrained_void_iface_call<int, ConsClass> (1, s2);
+ if (!(constrained_res is int) || ((int)constrained_res) != 43)
+ return 3;
+ constrained_res = null;
+ c.constrained_void_iface_call_ref_arg<int, ConsClass> (1, s2);
+ if (!(constrained_res is int) || ((int)constrained_res) != 43)
+ return 4;
+ return 0;
+ }
+
+ public static async Task<T> FooAsync<T> (int i, int j) {
+ Task<int> t = new Task<int> (delegate () { return 42; });
+ var response = await t;
+ return default(T);
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static void call_async<T> (int i, int j) {
+ Task<T> t = FooAsync<T> (1, 2);
+ t.RunSynchronously ();
+ }
+
+ // In AOT mode, the async infrastructure depends on gsharedvt methods
+ public static int test_0_async_call_from_generic () {
+ call_async<string> (1, 2);
+ return 0;
+ }
}
#if !MOBILE
static inline guint32
alloc_freg (MonoCompile *cfg)
{
-#ifdef MONO_ARCH_SOFT_FLOAT
- /* Allocate an lvreg so float ops can be decomposed into long ops */
- return alloc_lreg (cfg);
-#else
- /* Allocate these from the same pool as the int regs */
- return cfg->next_vreg ++;
-#endif
+ if (mono_arch_is_soft_float ()) {
+ /* Allocate an lvreg so float ops can be decomposed into long ops */
+ return alloc_lreg (cfg);
+ } else {
+ /* Allocate these from the same pool as the int regs */
+ return cfg->next_vreg ++;
+ }
}
static inline guint32
if ((dest)->opcode == OP_VMOVE) (dest)->klass = mono_class_from_mono_type ((vartype)); \
} while (0)
-#ifdef MONO_ARCH_SOFT_FLOAT
-#define DECOMPOSE_INTO_REGPAIR(stack_type) ((stack_type) == STACK_I8 || (stack_type) == STACK_R8)
-#else
-#define DECOMPOSE_INTO_REGPAIR(stack_type) ((stack_type) == STACK_I8)
-#endif
+#define DECOMPOSE_INTO_REGPAIR(stack_type) (mono_arch_is_soft_float () ? ((stack_type) == STACK_I8 || (stack_type) == STACK_R8) : ((stack_type) == STACK_I8))
static inline void
handle_gsharedvt_ldaddr (MonoCompile *cfg)
#define EMIT_NEW_VARLOADA(cfg,dest,var,vartype) do { NEW_VARLOADA ((cfg), (dest), (var), (vartype)); MONO_ADD_INS ((cfg)->cbb, (dest)); } while (0)
-#ifdef MONO_ARCH_SOFT_FLOAT
+#ifdef MONO_ARCH_SOFT_FLOAT_FALLBACK
/*
* Since the IL stack (and our vregs) contain double values, we have to do a conversion
*/
#define EMIT_NEW_VARLOAD_SFLOAT(cfg,dest,var,vartype) do { \
- if (COMPILE_SOFT_FLOAT ((cfg)) && !(vartype)->byref && (vartype)->type == MONO_TYPE_R4) { \
- MonoInst *iargs [1]; \
- EMIT_NEW_VARLOADA (cfg, iargs [0], (var), (vartype)); \
- (dest) = mono_emit_jit_icall (cfg, mono_fload_r4, iargs); \
- } else { \
- EMIT_NEW_VARLOAD ((cfg), (dest), (var), (vartype)); \
- } \
- } while (0)
+ if (!COMPILE_LLVM ((cfg)) && !(vartype)->byref && (vartype)->type == MONO_TYPE_R4) { \
+ MonoInst *iargs [1]; \
+ EMIT_NEW_VARLOADA (cfg, iargs [0], (var), (vartype)); \
+ (dest) = mono_emit_jit_icall (cfg, mono_fload_r4, iargs); \
+ } else { \
+ EMIT_NEW_VARLOAD ((cfg), (dest), (var), (vartype)); \
+ } \
+ } while (0)
#define EMIT_NEW_VARSTORE_SFLOAT(cfg,dest,var,vartype,inst) do { \
if (COMPILE_SOFT_FLOAT ((cfg)) && !(vartype)->byref && (vartype)->type == MONO_TYPE_R4) { \
- MonoInst *iargs [2]; \
- iargs [0] = (inst); \
- EMIT_NEW_VARLOADA (cfg, iargs [1], (var), (vartype)); \
- mono_emit_jit_icall (cfg, mono_fstore_r4, iargs); \
- } else { \
- EMIT_NEW_VARSTORE ((cfg), (dest), (var), (vartype), (inst)); \
- } \
- } while (0)
+ MonoInst *iargs [2]; \
+ iargs [0] = (inst); \
+ EMIT_NEW_VARLOADA (cfg, iargs [1], (var), (vartype)); \
+ mono_emit_jit_icall (cfg, mono_fstore_r4, iargs); \
+ } else { \
+ EMIT_NEW_VARSTORE ((cfg), (dest), (var), (vartype), (inst)); \
+ } \
+ } while (0)
-#define EMIT_NEW_ARGLOAD(cfg,dest,num) EMIT_NEW_VARLOAD_SFLOAT ((cfg), (dest), cfg->args [(num)], cfg->arg_types [(num)])
+#define EMIT_NEW_ARGLOAD(cfg,dest,num) do { \
+ if (mono_arch_is_soft_float ()) { \
+ EMIT_NEW_VARLOAD_SFLOAT ((cfg), (dest), cfg->args [(num)], cfg->arg_types [(num)]); \
+ } else { \
+ NEW_ARGLOAD ((cfg), (dest), (num)); \
+ MONO_ADD_INS ((cfg)->cbb, (dest)); \
+ } \
+ } while (0)
-#define EMIT_NEW_LOCLOAD(cfg,dest,num) EMIT_NEW_VARLOAD_SFLOAT ((cfg), (dest), cfg->locals [(num)], header->locals [(num)])
+#define EMIT_NEW_LOCLOAD(cfg,dest,num) do { \
+ if (mono_arch_is_soft_float ()) { \
+ EMIT_NEW_VARLOAD_SFLOAT ((cfg), (dest), cfg->locals [(num)], header->locals [(num)]); \
+ } else { \
+ NEW_LOCLOAD ((cfg), (dest), (num)); \
+ MONO_ADD_INS ((cfg)->cbb, (dest)); \
+ } \
+ } while (0)
-#define EMIT_NEW_LOCSTORE(cfg,dest,num,inst) EMIT_NEW_VARSTORE_SFLOAT ((cfg), (dest), (cfg)->locals [(num)], (cfg)->locals [(num)]->inst_vtype, (inst))
+#define EMIT_NEW_LOCSTORE(cfg,dest,num,inst) do { \
+ if (mono_arch_is_soft_float ()) { \
+ EMIT_NEW_VARSTORE_SFLOAT ((cfg), (dest), (cfg)->locals [(num)], (cfg)->locals [(num)]->inst_vtype, (inst)); \
+ } else { \
+ NEW_LOCSTORE ((cfg), (dest), (num), (inst)); \
+ MONO_ADD_INS ((cfg)->cbb, (dest)); \
+ } \
+ } while (0)
-#define EMIT_NEW_ARGSTORE(cfg,dest,num,inst) EMIT_NEW_VARSTORE_SFLOAT ((cfg), (dest), cfg->args [(num)], cfg->arg_types [(num)], (inst))
+#define EMIT_NEW_ARGSTORE(cfg,dest,num,inst) do { \
+ if (mono_arch_is_soft_float ()) { \
+ EMIT_NEW_VARSTORE_SFLOAT ((cfg), (dest), cfg->args [(num)], cfg->arg_types [(num)], (inst)); \
+ } else { \
+ NEW_ARGSTORE ((cfg), (dest), (num), (inst)); \
+ MONO_ADD_INS ((cfg)->cbb, (dest)); \
+ } \
+ } while (0)
#else
}
#endif
-#if defined(MONO_ARCH_EMULATE_MUL_DIV) || defined(MONO_ARCH_SOFT_FLOAT)
+#if defined(MONO_ARCH_EMULATE_MUL_DIV) || defined(MONO_ARCH_SOFT_FLOAT_FALLBACK)
double
mono_fdiv (double a, double b)
{
}
#endif
-#ifdef MONO_ARCH_SOFT_FLOAT
+#ifdef MONO_ARCH_SOFT_FLOAT_FALLBACK
double
mono_fsub (double a, double b)
*
* To work around this issue we test for value boundaries instead.
*/
-#if defined(__arm__) && MONO_ARCH_SOFT_FLOAT
+#if defined(__arm__) && defined(MONO_ARCH_SOFT_FLOAT_FALLBACK)
if (isnan (v) || !(v >= -0.5 && v <= ULLONG_MAX+0.5)) {
mono_raise_exception (mono_get_exception_overflow ());
}
}
MonoObject*
-mono_object_castclass (MonoObject *obj, MonoClass *klass)
+mono_object_castclass_unbox (MonoObject *obj, MonoClass *klass)
{
MonoJitTlsData *jit_tls = NULL;
if (!obj)
return NULL;
- if (mono_object_isinst (obj, klass))
+ if (klass->enumtype) {
+ if (obj->vtable->klass == klass->element_class)
+ return obj;
+ } else if (mono_object_isinst (obj, klass)) {
return obj;
+ }
if (mini_get_debug_options ()->better_cast_details) {
jit_tls->class_cast_from = obj->vtable->klass;
mono_class_setup_vtable (klass);
g_assert (klass->vtable);
vt_slot = mono_method_get_vtable_slot (cmethod);
+ if (cmethod->klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
+ int iface_offset;
+
+ iface_offset = mono_class_interface_offset (klass, cmethod->klass);
+ g_assert (iface_offset != -1);
+ vt_slot += iface_offset;
+ }
m = klass->vtable [vt_slot];
if (klass->valuetype && (m->klass == mono_defaults.object_class || m->klass == mono_defaults.enum_class->parent || m->klass == mono_defaults.enum_class))
/*
return m;
}
+/*
+ * mono_gsharedvt_constrained_call:
+ *
+ * Make a call to CMETHOD using the receiver MP, which is assumed to be of type KLASS. ARGS contains
+ * the arguments to the method in the format used by mono_runtime_invoke ().
+ */
MonoObject*
-mono_object_tostring_gsharedvt (gpointer mp, MonoMethod *cmethod, MonoClass *klass)
-{
- MonoMethod *m;
- gpointer this_arg;
-
- m = constrained_gsharedvt_call_setup (mp, cmethod, klass, &this_arg);
- return mono_runtime_invoke (m, this_arg, NULL, NULL);
-}
-
-int
-mono_object_gethashcode_gsharedvt (gpointer mp, MonoMethod *cmethod, MonoClass *klass)
-{
- MonoMethod *m;
- gpointer this_arg;
- MonoObject *res;
- gpointer p;
-
- m = constrained_gsharedvt_call_setup (mp, cmethod, klass, &this_arg);
- // FIXME: This boxes the result
- res = mono_runtime_invoke (m, this_arg, NULL, NULL);
- p = mono_object_unbox (res);
- return *(int*)p;
-}
-
-MonoBoolean
-mono_object_equals_gsharedvt (gpointer mp, MonoMethod *cmethod, MonoClass *klass, MonoObject *arg)
+mono_gsharedvt_constrained_call (gpointer mp, MonoMethod *cmethod, MonoClass *klass, gpointer *args)
{
MonoMethod *m;
gpointer this_arg;
- MonoObject *res;
- gpointer p;
- void **args;
m = constrained_gsharedvt_call_setup (mp, cmethod, klass, &this_arg);
- // FIXME: This boxes the result
- args = (void**)&arg;
- res = mono_runtime_invoke (m, this_arg, args, NULL);
- p = mono_object_unbox (res);
- return *(MonoBoolean*)p;
+ return mono_runtime_invoke (m, this_arg, args, NULL);
}
void
MonoException *mono_create_corlib_exception_2 (guint32 token, MonoString *arg1, MonoString *arg2) MONO_INTERNAL;
-MonoObject* mono_object_castclass (MonoObject *obj, MonoClass *klass) MONO_INTERNAL;
+MonoObject* mono_object_castclass_unbox (MonoObject *obj, MonoClass *klass) MONO_INTERNAL;
gpointer mono_get_native_calli_wrapper (MonoImage *image, MonoMethodSignature *sig, gpointer func) MONO_INTERNAL;
MonoObject*
mono_object_castclass_with_cache (MonoObject *obj, MonoClass *klass, gpointer *cache);
-MonoObject* mono_object_tostring_gsharedvt (gpointer mp, MonoMethod *cmethod, MonoClass *klass) MONO_INTERNAL;
-
-int mono_object_gethashcode_gsharedvt (gpointer mp, MonoMethod *cmethod, MonoClass *klass) MONO_INTERNAL;
-
-MonoBoolean mono_object_equals_gsharedvt (gpointer mp, MonoMethod *cmethod, MonoClass *klass, MonoObject *arg) MONO_INTERNAL;
+MonoObject*
+mono_gsharedvt_constrained_call (gpointer mp, MonoMethod *cmethod, MonoClass *klass, gpointer *args) MONO_INTERNAL;
void mono_gsharedvt_value_copy (gpointer dest, gpointer src, MonoClass *klass) MONO_INTERNAL;
MonoInst **args, int calli, int virtual, int tail, int rgctx, int unbox_trampoline)
{
MonoCallInst *call;
-#ifdef MONO_ARCH_SOFT_FLOAT
+#ifdef MONO_ARCH_SOFT_FLOAT_FALLBACK
int i;
#endif
} else if (!MONO_TYPE_IS_VOID (sig->ret))
call->inst.dreg = alloc_dreg (cfg, call->inst.type);
-#ifdef MONO_ARCH_SOFT_FLOAT
+#ifdef MONO_ARCH_SOFT_FLOAT_FALLBACK
if (COMPILE_SOFT_FLOAT (cfg)) {
/*
* If the call has a float argument, we would need to do an r8->r4 conversion using
}
static void
-emit_write_barrier (MonoCompile *cfg, MonoInst *ptr, MonoInst *value, int value_reg)
+emit_write_barrier (MonoCompile *cfg, MonoInst *ptr, MonoInst *value)
{
int card_table_shift_bits;
gpointer card_table_mask;
MONO_INST_NEW (cfg, wbarrier, OP_CARD_TABLE_WBARRIER);
wbarrier->sreg1 = ptr->dreg;
- if (value)
- wbarrier->sreg2 = value->dreg;
- else
- wbarrier->sreg2 = value_reg;
+ wbarrier->sreg2 = value->dreg;
MONO_ADD_INS (cfg->cbb, wbarrier);
} else if (card_table) {
int offset_reg = alloc_preg (cfg);
mono_emit_method_call (cfg, write_barrier, &ptr, NULL);
}
- if (value) {
- EMIT_NEW_DUMMY_USE (cfg, dummy_use, value);
- } else {
- MONO_INST_NEW (cfg, dummy_use, OP_DUMMY_USE);
- dummy_use->sreg1 = value_reg;
- MONO_ADD_INS (cfg->cbb, dummy_use);
- }
+ EMIT_NEW_DUMMY_USE (cfg, dummy_use, value);
}
static gboolean
EMIT_NEW_UNALU (cfg, iargs [0], OP_MOVE, dest_ptr_reg, destreg);
while (size >= SIZEOF_VOID_P) {
- MONO_EMIT_NEW_LOAD_MEMBASE_OP (cfg, OP_LOAD_MEMBASE, tmp_reg, srcreg, offset);
+ MonoInst *load_inst;
+ MONO_INST_NEW (cfg, load_inst, OP_LOAD_MEMBASE);
+ load_inst->dreg = tmp_reg;
+ load_inst->inst_basereg = srcreg;
+ load_inst->inst_offset = offset;
+ MONO_ADD_INS (cfg->cbb, load_inst);
+
MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STOREP_MEMBASE_REG, dest_ptr_reg, 0, tmp_reg);
if (need_wb & 0x1)
- emit_write_barrier (cfg, iargs [0], NULL, tmp_reg);
+ emit_write_barrier (cfg, iargs [0], load_inst);
offset += SIZEOF_VOID_P;
size -= SIZEOF_VOID_P;
args [1] = klass_inst;
/* CASTCLASS */
- obj = mono_emit_jit_icall (cfg, mono_object_castclass, args);
+ obj = mono_emit_jit_icall (cfg, mono_object_castclass_unbox, args);
NEW_BBLOCK (cfg, is_ref_bb);
NEW_BBLOCK (cfg, is_nullable_bb);
if (cfg->gen_write_barriers) {
dreg = alloc_preg (cfg);
EMIT_NEW_BIALU_IMM (cfg, ptr, OP_PADD_IMM, dreg, obj->dreg, G_STRUCT_OFFSET (MonoDelegate, target));
- emit_write_barrier (cfg, ptr, target, 0);
+ emit_write_barrier (cfg, ptr, target);
}
}
if (cfg->gen_write_barriers) {
dreg = alloc_preg (cfg);
EMIT_NEW_BIALU_IMM (cfg, ptr, OP_PADD_IMM, dreg, obj->dreg, G_STRUCT_OFFSET (MonoDelegate, method));
- emit_write_barrier (cfg, ptr, method_ins, 0);
+ emit_write_barrier (cfg, ptr, method_ins);
}
/*
* To avoid looking up the compiled code belonging to the target method
{
MonoMethodHeaderSummary header;
MonoVTable *vtable;
-#ifdef MONO_ARCH_SOFT_FLOAT
+#ifdef MONO_ARCH_SOFT_FLOAT_FALLBACK
MonoMethodSignature *sig = mono_method_signature (method);
int i;
#endif
if (mono_security_method_has_declsec (method))
return FALSE;
-#ifdef MONO_ARCH_SOFT_FLOAT
- /* FIXME: */
- if (sig->ret && sig->ret->type == MONO_TYPE_R4)
- return FALSE;
- for (i = 0; i < sig->param_count; ++i)
- if (!sig->params [i]->byref && sig->params [i]->type == MONO_TYPE_R4)
+#ifdef MONO_ARCH_SOFT_FLOAT_FALLBACK
+ if (mono_arch_is_soft_float ()) {
+ /* FIXME: */
+ if (sig->ret && sig->ret->type == MONO_TYPE_R4)
return FALSE;
+ for (i = 0; i < sig->param_count; ++i)
+ if (!sig->params [i]->byref && sig->params [i]->type == MONO_TYPE_R4)
+ return FALSE;
+ }
#endif
return TRUE;
EMIT_NEW_LOAD_MEMBASE_TYPE (cfg, load, &eklass->byval_arg, args [2]->dreg, 0);
EMIT_NEW_STORE_MEMBASE_TYPE (cfg, store, &eklass->byval_arg, addr->dreg, 0, load->dreg);
if (mini_type_is_reference (cfg, fsig->params [2]))
- emit_write_barrier (cfg, addr, load, -1);
+ emit_write_barrier (cfg, addr, load);
} else {
EMIT_NEW_LOAD_MEMBASE_TYPE (cfg, load, &eklass->byval_arg, addr->dreg, 0);
EMIT_NEW_STORE_MEMBASE_TYPE (cfg, store, &eklass->byval_arg, args [2]->dreg, 0, load->dreg);
MonoInst *addr = mini_emit_ldelema_1_ins (cfg, klass, sp [0], sp [1], safety_checks);
EMIT_NEW_STORE_MEMBASE_TYPE (cfg, ins, &klass->byval_arg, addr->dreg, 0, sp [2]->dreg);
if (generic_class_is_reference_type (cfg, klass))
- emit_write_barrier (cfg, addr, sp [2], -1);
+ emit_write_barrier (cfg, addr, sp [2]);
}
return ins;
}
}
if (cfg->gen_write_barriers && is_ref)
- emit_write_barrier (cfg, args [0], args [1], -1);
+ emit_write_barrier (cfg, args [0], args [1]);
}
#endif /* MONO_ARCH_HAVE_ATOMIC_EXCHANGE */
/* g_assert_not_reached (); */
}
if (cfg->gen_write_barriers && is_ref)
- emit_write_barrier (cfg, args [0], args [1], -1);
+ emit_write_barrier (cfg, args [0], args [1]);
}
#endif /* MONO_ARCH_HAVE_ATOMIC_CAS */
/*
* Constrained calls need to behave differently at runtime dependending on whenever the receiver is instantiated as ref type or as a vtype.
*/
- /* Special case Object methods as they are easy to implement */
- if (cmethod->klass == mono_defaults.object_class) {
+ if ((cmethod->klass != mono_defaults.object_class) && constrained_call->valuetype && cmethod->klass->valuetype) {
+ /* The 'Own method' case below */
+ } else if (((cmethod->klass == mono_defaults.object_class) || (cmethod->klass->flags & TYPE_ATTRIBUTE_INTERFACE)) &&
+ (MONO_TYPE_IS_VOID (fsig->ret) || fsig->ret->type == MONO_TYPE_I4 || fsig->ret->type == MONO_TYPE_BOOLEAN || fsig->ret->type == MONO_TYPE_STRING) &&
+ (fsig->param_count == 0 || (fsig->param_count == 1 && MONO_TYPE_IS_REFERENCE (fsig->params [0])))) {
MonoInst *args [16];
+ /*
+ * This case handles calls to object:ToString()/Equals()/GetHashCode(), plus some simple interface calls enough to support
+ * AsyncTaskMethodBuilder.
+ */
+
args [0] = sp [0];
EMIT_NEW_METHODCONST (cfg, args [1], cmethod);
args [2] = emit_get_rgctx_klass (cfg, mono_class_check_context_used (constrained_call), constrained_call, MONO_RGCTX_INFO_KLASS);
- if (!strcmp (cmethod->name, "ToString")) {
- ins = mono_emit_jit_icall (cfg, mono_object_tostring_gsharedvt, args);
- } else if (!strcmp (cmethod->name, "Equals")) {
- args [3] = sp [1];
- ins = mono_emit_jit_icall (cfg, mono_object_equals_gsharedvt, args);
- } else if (!strcmp (cmethod->name, "GetHashCode")) {
- ins = mono_emit_jit_icall (cfg, mono_object_gethashcode_gsharedvt, args);
+ if (fsig->param_count) {
+ /* Pass the arguments using a localloc-ed array using the format expected by runtime_invoke () */
+ MONO_INST_NEW (cfg, ins, OP_LOCALLOC_IMM);
+ ins->dreg = alloc_preg (cfg);
+ ins->inst_imm = fsig->param_count * sizeof (mgreg_t);
+ MONO_ADD_INS (cfg->cbb, ins);
+ args [3] = ins;
+
+ EMIT_NEW_STORE_MEMBASE (cfg, ins, OP_STORE_MEMBASE_REG, args [3]->dreg, 0, sp [1]->dreg);
} else {
- GSHAREDVT_FAILURE (*ip);
+ EMIT_NEW_ICONST (cfg, args [3], 0);
}
+ ins = mono_emit_jit_icall (cfg, mono_gsharedvt_constrained_call, args);
+ emit_widen = FALSE;
+
+ if (fsig->ret->type == MONO_TYPE_I4 || fsig->ret->type == MONO_TYPE_BOOLEAN) {
+ MonoInst *add;
+ int dreg;
+
+ /* Unbox */
+ NEW_BIALU_IMM (cfg, add, OP_ADD_IMM, alloc_dreg (cfg, STACK_MP), ins->dreg, sizeof (MonoObject));
+ MONO_ADD_INS (cfg->cbb, add);
+ dreg = alloc_ireg (cfg);
+ /* Load value */
+ if (fsig->ret->type == MONO_TYPE_BOOLEAN)
+ NEW_LOAD_MEMBASE (cfg, ins, OP_LOADU1_MEMBASE, dreg, add->dreg, 0);
+ else
+ NEW_LOAD_MEMBASE (cfg, ins, OP_LOADI4_MEMBASE, dreg, add->dreg, 0);
+ MONO_ADD_INS (cfg->cbb, ins);
+ /* ins represents the call result */
+ }
+
goto call_end;
- } else if (constrained_call->valuetype && cmethod->klass->valuetype) {
- /* The 'Own method' case below */
} else {
GSHAREDVT_FAILURE (*ip);
}
addr = mini_emit_ldelema_ins (cfg, cmethod, sp, ip, TRUE);
EMIT_NEW_STORE_MEMBASE_TYPE (cfg, ins, fsig->params [fsig->param_count - 1], addr->dreg, 0, val->dreg);
if (cfg->gen_write_barriers && val->type == STACK_OBJ && !(val->opcode == OP_PCONST && val->inst_c0 == 0))
- emit_write_barrier (cfg, addr, val, 0);
+ emit_write_barrier (cfg, addr, val);
} else if (strcmp (cmethod->name, "Get") == 0) { /* array Get */
addr = mini_emit_ldelema_ins (cfg, cmethod, sp, ip, FALSE);
* change the called method to a dummy wrapper, and resolve that wrapper
* to the real method in mono_jit_compile_method ().
*/
- if (cfg->method->wrapper_type == MONO_WRAPPER_SYNCHRONIZED && mono_marshal_method_from_wrapper (cfg->method) == cmethod)
- cmethod = mono_marshal_get_synchronized_inner_wrapper (cmethod);
+ if (cfg->method->wrapper_type == MONO_WRAPPER_SYNCHRONIZED) {
+ MonoMethod *orig = mono_marshal_method_from_wrapper (cfg->method);
+ if (cmethod == orig || (cmethod->is_inflated && mono_method_get_declaring_generic_method (cmethod) == orig))
+ cmethod = mono_marshal_get_synchronized_inner_wrapper (cmethod);
+ }
/* Common call */
INLINE_FAILURE ("call");
ins->klass = mono_class_from_mono_type (ret_type);
}
} else {
-#ifdef MONO_ARCH_SOFT_FLOAT
+#ifdef MONO_ARCH_SOFT_FLOAT_FALLBACK
if (COMPILE_SOFT_FLOAT (cfg) && !ret_type->byref && ret_type->type == MONO_TYPE_R4) {
MonoInst *iargs [1];
MonoInst *conv;
MONO_ADD_INS (bblock, ins);
if (cfg->gen_write_barriers && *ip == CEE_STIND_REF && method->wrapper_type != MONO_WRAPPER_WRITE_BARRIER && !((sp [1]->opcode == OP_PCONST) && (sp [1]->inst_p0 == 0)))
- emit_write_barrier (cfg, sp [0], sp [1], -1);
+ emit_write_barrier (cfg, sp [0], sp [1]);
inline_costs += 1;
++ip;
MONO_ADD_INS (cfg->cbb, store);
if (cfg->gen_write_barriers && cfg->method->wrapper_type != MONO_WRAPPER_WRITE_BARRIER)
- emit_write_barrier (cfg, sp [0], sp [1], -1);
+ emit_write_barrier (cfg, sp [0], sp [1]);
} else {
mini_emit_stobj (cfg, sp [0], sp [1], klass, FALSE);
}
EMIT_NEW_PCONST (cfg, args [2], mono_domain_alloc0 (cfg->domain, sizeof (gpointer)));
/*The wrapper doesn't inline well so the bloat of inlining doesn't pay off.*/
+ save_cast_details (cfg, klass, sp [0]->dreg);
*sp++ = mono_emit_method_call (cfg, mono_castclass, args, NULL);
+ reset_cast_details (cfg);
ip += 5;
inline_costs += 2;
} else if (!context_used && (mono_class_is_marshalbyref (klass) || klass->flags & TYPE_ATTRIBUTE_INTERFACE)) {
mono_castclass = mono_marshal_get_castclass (klass);
iargs [0] = sp [0];
+ save_cast_details (cfg, klass, sp [0]->dreg);
costs = inline_method (cfg, mono_castclass, mono_method_signature (mono_castclass),
iargs, ip, cfg->real_offset, dont_inline, TRUE);
+ reset_cast_details (cfg);
CHECK_CFG_EXCEPTION;
g_assert (costs > 0);
dreg = alloc_ireg_mp (cfg);
EMIT_NEW_BIALU_IMM (cfg, ptr, OP_PADD_IMM, dreg, sp [0]->dreg, foffset);
- emit_write_barrier (cfg, ptr, sp [1], -1);
+ emit_write_barrier (cfg, ptr, sp [1]);
}
store->flags |= ins_flag;
if (cfg->gen_write_barriers && cfg->method->wrapper_type != MONO_WRAPPER_WRITE_BARRIER &&
generic_class_is_reference_type (cfg, klass)) {
/* insert call to write barrier */
- emit_write_barrier (cfg, sp [0], sp [1], -1);
+ emit_write_barrier (cfg, sp [0], sp [1]);
}
ins_flag = 0;
ip += 5;
context_used = mini_class_check_context_used (cfg, klass);
if (sp [0]->type == STACK_I8 || (SIZEOF_VOID_P == 8 && sp [0]->type == STACK_PTR)) {
- MONO_INST_NEW (cfg, ins, OP_LCONV_TO_I4);
+ MONO_INST_NEW (cfg, ins, OP_LCONV_TO_OVF_U4);
ins->sreg1 = sp [0]->dreg;
ins->type = STACK_I4;
ins->dreg = alloc_ireg (cfg);
#if SIZEOF_REGISTER == 8
case STACK_I8:
#endif
-#if !defined(TARGET_X86) && !defined(MONO_ARCH_SOFT_FLOAT)
+#if !defined(TARGET_X86)
/* Enabling this screws up the fp stack on x86 */
case STACK_R8:
#endif
+ if (mono_arch_is_soft_float ())
+ break;
+
/* Arguments are implicitly global */
/* Putting R4 vars into registers doesn't work currently */
/* The gsharedvt vars are implicitly referenced by ldaddr opcodes, but those opcodes are only generated later */
#include <mono/utils/mono-mmap.h>
#include <mono/utils/mono-memory-model.h>
#include <mono/utils/mono-tls.h>
+#include <mono/utils/mono-hwcap-x86.h>
#include "trace.h"
#include "ir-emit.h"
return res;
}
-static int
-cpuid (int id, int* p_eax, int* p_ebx, int* p_ecx, int* p_edx)
-{
-#if defined(MONO_CROSS_COMPILE)
- return 0;
-#else
-#ifndef _MSC_VER
- __asm__ __volatile__ ("cpuid"
- : "=a" (*p_eax), "=b" (*p_ebx), "=c" (*p_ecx), "=d" (*p_edx)
- : "a" (id));
-#else
- int info[4];
- __cpuid(info, id);
- *p_eax = info[0];
- *p_ebx = info[1];
- *p_ecx = info[2];
- *p_edx = info[3];
-#endif
- return 1;
-#endif
-}
-
/*
* Initialize the cpu to execute managed code.
*/
guint32
mono_arch_cpu_optimizations (guint32 *exclude_mask)
{
- int eax, ebx, ecx, edx;
guint32 opts = 0;
*exclude_mask = 0;
- /* Feature Flags function, flags returned in EDX. */
- if (cpuid (1, &eax, &ebx, &ecx, &edx)) {
- if (edx & (1 << 15)) {
- opts |= MONO_OPT_CMOV;
- if (edx & 1)
- opts |= MONO_OPT_FCMOV;
- else
- *exclude_mask |= MONO_OPT_FCMOV;
- } else
- *exclude_mask |= MONO_OPT_CMOV;
+
+ if (mono_hwcap_x86_has_cmov) {
+ opts |= MONO_OPT_CMOV;
+
+ if (mono_hwcap_x86_has_fcmov)
+ opts |= MONO_OPT_FCMOV;
+ else
+ *exclude_mask |= MONO_OPT_FCMOV;
+ } else {
+ *exclude_mask |= MONO_OPT_CMOV;
}
return opts;
guint32
mono_arch_cpu_enumerate_simd_versions (void)
{
- int eax, ebx, ecx, edx;
guint32 sse_opts = 0;
- if (cpuid (1, &eax, &ebx, &ecx, &edx)) {
- if (edx & (1 << 25))
- sse_opts |= SIMD_VERSION_SSE1;
- if (edx & (1 << 26))
- sse_opts |= SIMD_VERSION_SSE2;
- if (ecx & (1 << 0))
- sse_opts |= SIMD_VERSION_SSE3;
- if (ecx & (1 << 9))
- sse_opts |= SIMD_VERSION_SSSE3;
- if (ecx & (1 << 19))
- sse_opts |= SIMD_VERSION_SSE41;
- if (ecx & (1 << 20))
- sse_opts |= SIMD_VERSION_SSE42;
- }
-
- /* Yes, all this needs to be done to check for sse4a.
- See: "Amd: CPUID Specification"
- */
- if (cpuid (0x80000000, &eax, &ebx, &ecx, &edx)) {
- /* eax greater or equal than 0x80000001, ebx = 'htuA', ecx = DMAc', edx = 'itne'*/
- if ((((unsigned int) eax) >= 0x80000001) && (ebx == 0x68747541) && (ecx == 0x444D4163) && (edx == 0x69746E65)) {
- cpuid (0x80000001, &eax, &ebx, &ecx, &edx);
- if (ecx & (1 << 6))
- sse_opts |= SIMD_VERSION_SSE4a;
- }
- }
+ if (mono_hwcap_x86_has_sse1)
+ sse_opts |= SIMD_VERSION_SSE1;
+
+ if (mono_hwcap_x86_has_sse2)
+ sse_opts |= SIMD_VERSION_SSE2;
+
+ if (mono_hwcap_x86_has_sse3)
+ sse_opts |= SIMD_VERSION_SSE3;
+
+ if (mono_hwcap_x86_has_ssse3)
+ sse_opts |= SIMD_VERSION_SSSE3;
+
+ if (mono_hwcap_x86_has_sse41)
+ sse_opts |= SIMD_VERSION_SSE41;
+
+ if (mono_hwcap_x86_has_sse42)
+ sse_opts |= SIMD_VERSION_SSE42;
+
+ if (mono_hwcap_x86_has_sse4a)
+ sse_opts |= SIMD_VERSION_SSE4a;
- return sse_opts;
+ return sse_opts;
}
#ifndef DISABLE_JIT
guint8 *code;
guint32 code_len;
int i;
+ char *tramp_name;
code = get_delegate_invoke_impl (TRUE, 0, &code_len);
- res = g_slist_prepend (res, mono_tramp_info_create (g_strdup ("delegate_invoke_impl_has_target"), code, code_len, NULL, NULL));
+ res = g_slist_prepend (res, mono_tramp_info_create ("delegate_invoke_impl_has_target", code, code_len, NULL, NULL));
for (i = 0; i < MAX_ARCH_DELEGATE_PARAMS; ++i) {
code = get_delegate_invoke_impl (FALSE, i, &code_len);
- res = g_slist_prepend (res, mono_tramp_info_create (g_strdup_printf ("delegate_invoke_impl_target_%d", i), code, code_len, NULL, NULL));
+ tramp_name = g_strdup_printf ("delegate_invoke_impl_target_%d", i);
+ res = g_slist_prepend (res, mono_tramp_info_create (tramp_name, code, code_len, NULL, NULL));
+ g_free (tramp_name);
}
return res;
#include "mini.h"
#include <string.h>
-#if !defined(__APPLE__) && !defined(PLATFORM_ANDROID)
-#include <sys/auxv.h>
-#endif
-
#include <mono/metadata/appdomain.h>
#include <mono/metadata/debug-helpers.h>
#include <mono/utils/mono-mmap.h>
+#include <mono/utils/mono-hwcap-arm.h>
#include "mini-arm.h"
#include "cpu-arm.h"
#error "ARM_FPU_NONE is defined while one of ARM_FPU_VFP/ARM_FPU_VFP_HARD is defined"
#endif
-#if defined(__ARM_EABI__) && defined(__linux__) && !defined(PLATFORM_ANDROID) && !defined(__native_client__)
-#define HAVE_AEABI_READ_TP 1
-#endif
-
-#ifdef ARM_FPU_VFP_HARD
-#define ARM_FPU_VFP 1
-#endif
-
-#ifdef ARM_FPU_VFP
-#define IS_VFP 1
+#if defined(MONO_ARCH_SOFT_FLOAT_FALLBACK)
+#define IS_SOFT_FLOAT (mono_arch_is_soft_float ())
+#define IS_VFP (!mono_arch_is_soft_float ())
#else
-#define IS_VFP 0
+#define IS_SOFT_FLOAT (FALSE)
+#define IS_VFP (TRUE)
#endif
-#ifdef MONO_ARCH_SOFT_FLOAT
-#define IS_SOFT_FLOAT 1
-#else
-#define IS_SOFT_FLOAT 0
+#if defined(__ARM_EABI__) && defined(__linux__) && !defined(PLATFORM_ANDROID) && !defined(__native_client__)
+#define HAVE_AEABI_READ_TP 1
#endif
#ifdef __native_client_codegen__
*/
static gboolean eabi_supported = FALSE;
-/*
- * Whenever we are on arm/darwin aka the iphone.
- */
-static gboolean darwin = FALSE;
/*
* Whenever to use the iphone ABI extensions:
* http://developer.apple.com/library/ios/documentation/Xcode/Conceptual/iPhoneOSABIReference/index.html
guint8 *code;
guint32 code_len;
int i;
+ char *tramp_name;
code = get_delegate_invoke_impl (TRUE, 0, &code_len);
- res = g_slist_prepend (res, mono_tramp_info_create (g_strdup ("delegate_invoke_impl_has_target"), code, code_len, NULL, NULL));
+ res = g_slist_prepend (res, mono_tramp_info_create ("delegate_invoke_impl_has_target", code, code_len, NULL, NULL));
for (i = 0; i <= MAX_ARCH_DELEGATE_PARAMS; ++i) {
code = get_delegate_invoke_impl (FALSE, i, &code_len);
- res = g_slist_prepend (res, mono_tramp_info_create (g_strdup_printf ("delegate_invoke_impl_target_%d", i), code, code_len, NULL, NULL));
+ tramp_name = g_strdup_printf ("delegate_invoke_impl_target_%d", i);
+ res = g_slist_prepend (res, mono_tramp_info_create (tramp_name, code, code_len, NULL, NULL));
+ g_free (tramp_name);
}
return res;
void
mono_arch_cpu_init (void)
{
-#if defined(__ARM_EABI__)
- eabi_supported = TRUE;
-#endif
#if defined(__APPLE__)
- i8_align = 4;
+ i8_align = 4;
#else
- i8_align = __alignof__ (gint64);
+ i8_align = __alignof__ (gint64);
#endif
}
void
mono_arch_init (void)
{
+ const char *cpu_arch;
+
InitializeCriticalSection (&mini_arch_mutex);
#ifdef MONO_ARCH_SOFT_DEBUG_SUPPORTED
if (mini_get_debug_options ()->soft_breakpoints) {
mono_aot_register_jit_icall ("mono_arm_start_gsharedvt_call", mono_arm_start_gsharedvt_call);
#endif
+#if defined(__ARM_EABI__)
+ eabi_supported = TRUE;
+#endif
+
#if defined(ARM_FPU_VFP_HARD)
arm_fpu = MONO_ARM_FPU_VFP_HARD;
-#elif defined(ARM_FPU_VFP)
+#else
arm_fpu = MONO_ARM_FPU_VFP;
+
+#if defined(ARM_FPU_NONE) && !defined(__APPLE__)
+ /* If we're compiling with a soft float fallback and it
+ turns out that no VFP unit is available, we need to
+ switch to soft float. We don't do this for iOS, since
+ iOS devices always have a VFP unit. */
+ if (!mono_hwcap_arm_has_vfp)
+ arm_fpu = MONO_ARM_FPU_NONE;
+#endif
+#endif
+
+ v5_supported = mono_hwcap_arm_is_v5;
+ v6_supported = mono_hwcap_arm_is_v6;
+ v7_supported = mono_hwcap_arm_is_v7;
+ v7s_supported = mono_hwcap_arm_is_v7s;
+
+#if defined(__APPLE__)
+ /* iOS is special-cased here because we don't yet
+ have a way to properly detect CPU features on it. */
+ thumb_supported = TRUE;
+ iphone_abi = TRUE;
#else
- arm_fpu = MONO_ARM_FPU_NONE;
+ thumb_supported = mono_hwcap_arm_has_thumb;
+ thumb2_supported = mono_hwcap_arm_has_thumb2;
#endif
+
+ /* Format: armv(5|6|7[s])[-thumb[2]] */
+ cpu_arch = getenv ("MONO_CPU_ARCH");
+
+ /* Do this here so it overrides any detection. */
+ if (cpu_arch) {
+ if (strncmp (cpu_arch, "armv", 4) == 0) {
+ v5_supported = cpu_arch [4] >= '5';
+ v6_supported = cpu_arch [4] >= '6';
+ v7_supported = cpu_arch [4] >= '7';
+ v7s_supported = strncmp (cpu_arch, "armv7s", 6) == 0;
+ }
+
+ thumb_supported = strstr (cpu_arch, "thumb") != NULL;
+ thumb2_supported = strstr (cpu_arch, "thumb2") != NULL;
+ }
}
/*
guint32
mono_arch_cpu_optimizations (guint32 *exclude_mask)
{
- guint32 opts = 0;
-
- /* Format: armv(5|6|7[s])[-thumb[2]] */
- const char *cpu_arch = getenv ("MONO_CPU_ARCH");
- if (cpu_arch != NULL) {
- if (strncmp (cpu_arch, "armv", 4) == 0) {
- v5_supported = cpu_arch [4] >= '5';
- v6_supported = cpu_arch [4] >= '6';
- v7_supported = cpu_arch [4] >= '7';
- v7s_supported = strncmp (cpu_arch, "armv7s", 6) == 0;
- }
- thumb_supported = strstr (cpu_arch, "thumb") != NULL;
- thumb2_supported = strstr (cpu_arch, "thumb2") != NULL;
- } else {
-#if __APPLE__
- thumb_supported = TRUE;
- v5_supported = TRUE;
- darwin = TRUE;
- iphone_abi = TRUE;
-#elif defined(PLATFORM_ANDROID)
- /* Android is awesome and doesn't make most of /proc (including
- * /proc/self/auxv) available to regular processes. So we use
- * /proc/cpuinfo instead.... */
- char buf [512];
- char *line;
- FILE *file = fopen ("/proc/cpuinfo", "r");
- if (file) {
- while ((line = fgets (buf, 512, file))) {
- if (strncmp (line, "Processor", 9) == 0) {
- char *ver = strstr (line, "(v");
- if (ver) {
- if (ver [2] >= '5')
- v5_supported = TRUE;
- if (ver [2] >= '6')
- v6_supported = TRUE;
- if (ver [2] >= '7')
- v7_supported = TRUE;
- /* TODO: Find a way to detect v7s. */
- }
- continue;
- }
- if (strncmp (line, "Features", 8) == 0) {
- /* TODO: Find a way to detect Thumb 2. */
- char *th = strstr (line, "thumb");
- if (th) {
- thumb_supported = TRUE;
- if (v5_supported)
- break;
- }
- continue;
- }
- }
-
- fclose (file);
- /*printf ("features: v5: %d, thumb: %d\n", v5_supported, thumb_supported);*/
- }
-#else
- /* This solution is neat because it uses the dynamic linker
- * instead of the kernel. Thus, it works in QEMU chroots. */
- unsigned long int hwcap;
- unsigned long int platform;
-
- if ((hwcap = getauxval(AT_HWCAP))) {
- /* We use hardcoded values to avoid depending on a
- * specific version of the hwcap.h header. */
-
- /* HWCAP_ARM_THUMB */
- if ((hwcap & 4) != 0)
- /* TODO: Find a way to detect Thumb 2. */
- thumb_supported = TRUE;
- }
-
- if ((platform = getauxval(AT_PLATFORM))) {
- /* Actually a pointer to the platform string. */
- const char *str = (const char *) platform;
-
- /* Possible CPU name values (from kernel sources):
- *
- * - v4
- * - v5
- * - v5t
- * - v6
- * - v7
- *
- * Value is suffixed with the endianness ('b' or 'l').
- * We only support little endian anyway.
- */
-
- if (str [1] >= '5')
- v5_supported = TRUE;
-
- if (str [1] >= '6')
- v6_supported = TRUE;
-
- if (str [1] >= '7')
- v7_supported = TRUE;
-
- /* TODO: Find a way to detect v7s. */
- }
-
- /*printf ("hwcap = %i, platform = %s\n", (int) hwcap, (const char *) platform);
- printf ("thumb = %i, thumb2 = %i, v5 = %i, v6 = %i, v7 = %i, v7s = %i\n",
- thumb_supported, thumb2_supported, v5_supported, v6_supported, v7_supported, v7s_supported);*/
-#endif
- }
-
/* no arm-specific optimizations yet */
*exclude_mask = 0;
- return opts;
+ return 0;
}
/*
return TRUE;
}
+#ifdef MONO_ARCH_SOFT_FLOAT_FALLBACK
+gboolean
+mono_arch_is_soft_float (void)
+{
+ return arm_fpu == MONO_ARM_FPU_NONE;
+}
+#endif
+
static gboolean
is_regsize_var (MonoGenericSharingContext *gsctx, MonoType *t) {
if (t->byref)
regs = g_list_prepend (regs, GUINT_TO_POINTER (ARMREG_V1));
regs = g_list_prepend (regs, GUINT_TO_POINTER (ARMREG_V2));
regs = g_list_prepend (regs, GUINT_TO_POINTER (ARMREG_V3));
- if (darwin)
+ if (iphone_abi)
/* V4=R7 is used as a frame pointer, but V7=R10 is preserved */
regs = g_list_prepend (regs, GUINT_TO_POINTER (ARMREG_V7));
else
break;
/* floating point opcodes */
-#if defined(ARM_FPU_VFP)
-
case OP_R8CONST:
if (cfg->compile_aot) {
ARM_FLDD (code, ins->dreg, ARMREG_PC, 0);
ARM_FMRRD (code, ARMREG_R0, ARMREG_R1, ins->sreg1);
}
break;
-
-#endif
-
case OP_FCONV_TO_I1:
code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 1, TRUE);
break;
ARM_MOV_REG_REG (code, ins->dreg, ins->sreg1);
break;
}
-#if defined(ARM_FPU_VFP)
case OP_FADD:
ARM_VFP_ADDD (code, ins->dreg, ins->sreg1, ins->sreg2);
break;
case OP_FNEG:
ARM_NEGD (code, ins->dreg, ins->sreg1);
break;
-#endif
case OP_FREM:
/* emulated */
g_assert_not_reached ();
* the frame, so we keep using our own frame pointer.
* FIXME: Optimize this.
*/
- g_assert (darwin);
ARM_PUSH (code, (1 << ARMREG_R7) | (1 << ARMREG_LR));
ARM_MOV_REG_REG (code, ARMREG_R7, ARMREG_SP);
prev_sp_offset += 8; /* r7 and lr */
{
/* The GNU target triple format is not very well documented */
if (strstr (mtriple, "armv7")) {
+ v5_supported = TRUE;
v6_supported = TRUE;
v7_supported = TRUE;
}
if (strstr (mtriple, "armv6")) {
+ v5_supported = TRUE;
v6_supported = TRUE;
}
if (strstr (mtriple, "armv7s")) {
v7s_supported = TRUE;
}
if (strstr (mtriple, "thumbv7s")) {
+ v5_supported = TRUE;
+ v6_supported = TRUE;
+ v7_supported = TRUE;
v7s_supported = TRUE;
+ thumb_supported = TRUE;
thumb2_supported = TRUE;
}
if (strstr (mtriple, "darwin") || strstr (mtriple, "ios")) {
v5_supported = TRUE;
+ v6_supported = TRUE;
thumb_supported = TRUE;
- darwin = TRUE;
iphone_abi = TRUE;
}
if (strstr (mtriple, "gnueabi"))
#define kNaClLengthOfCallImm 4
#endif
-#if defined(ARM_FPU_NONE) || (defined(__ARM_EABI__) && !defined(ARM_FPU_VFP) && !defined(ARM_FPU_VFP_HARD))
-#define MONO_ARCH_SOFT_FLOAT 1
+#if defined(ARM_FPU_NONE)
+#define MONO_ARCH_SOFT_FLOAT_FALLBACK 1
#endif
#ifdef ARM_FPU_VFP_HARD
#if defined(ARM_FPU_VFP)
#define ARM_FP_MODEL "vfp"
#elif defined(ARM_FPU_NONE)
-#define ARM_FP_MODEL "soft-float"
+#define ARM_FP_MODEL "vfp+fallback"
#elif defined(ARM_FPU_VFP_HARD)
-#define ARM_FP_MODEL "vfp(hardfp-abi)"
+#define ARM_FP_MODEL "vfp+hard"
#else
#error "At least one of ARM_FPU_NONE, ARM_FPU_VFP or ARM_FPU_VFP_HARD must be defined."
#endif
#define MONO_ARCH_CALLEE_REGS ((1<<ARMREG_R0) | (1<<ARMREG_R1) | (1<<ARMREG_R2) | (1<<ARMREG_R3) | (1<<ARMREG_IP))
#define MONO_ARCH_CALLEE_SAVED_REGS ((1<<ARMREG_V1) | (1<<ARMREG_V2) | (1<<ARMREG_V3) | (1<<ARMREG_V4) | (1<<ARMREG_V5) | (1<<ARMREG_V6) | (1<<ARMREG_V7))
-#if defined(ARM_FPU_VFP) || defined(ARM_FPU_VFP_HARD)
/* Every double precision vfp register, d0/d1 is reserved for a scratch reg */
#define MONO_ARCH_CALLEE_FREGS 0x55555550
-#else
-#define MONO_ARCH_CALLEE_FREGS 0xf
-#endif
#define MONO_ARCH_CALLEE_SAVED_FREGS 0
#define MONO_ARCH_USE_FPSTACK FALSE
#define MONO_ARCH_INST_SREG2_MASK(ins) (0)
-#ifdef MONO_ARCH_SOFT_FLOAT
-#define MONO_ARCH_INST_FIXED_REG(desc) (((desc) == 'l' || (desc == 'f') || (desc == 'g')) ? ARM_LSW_REG: (((desc) == 'a') ? ARMREG_R0 : -1))
-#define MONO_ARCH_INST_IS_REGPAIR(desc) ((desc) == 'l' || (desc) == 'L' || (desc) == 'f' || (desc) == 'g')
-#define MONO_ARCH_INST_IS_FLOAT(desc) (FALSE)
-#else
-#define MONO_ARCH_INST_FIXED_REG(desc) (((desc) == 'l')? ARM_LSW_REG: (((desc) == 'a') ? ARMREG_R0 : -1))
-#define MONO_ARCH_INST_IS_REGPAIR(desc) (desc == 'l' || desc == 'L')
-#define MONO_ARCH_INST_IS_FLOAT(desc) ((desc == 'f') || (desc == 'g'))
-#endif
-#define MONO_ARCH_INST_REGPAIR_REG2(desc,hreg1) (desc == 'l' || (desc == 'f') || (desc == 'g')? ARM_MSW_REG : -1)
+#define MONO_ARCH_INST_FIXED_REG(desc) \
+ (mono_arch_is_soft_float () ? \
+ ((desc) == 'l' || (desc) == 'f' || (desc) == 'g' ? ARM_LSW_REG : (desc) == 'a' ? ARMREG_R0 : -1) : \
+ ((desc) == 'l' ? ARM_LSW_REG : (desc) == 'a' ? ARMREG_R0 : -1))
+
+#define MONO_ARCH_INST_IS_REGPAIR(desc) \
+ (mono_arch_is_soft_float () ? \
+ ((desc) == 'l' || (desc) == 'L' || (desc) == 'f' || (desc) == 'g') : \
+ ((desc) == 'l' || (desc) == 'L'))
+
+#define MONO_ARCH_INST_IS_FLOAT(desc) \
+ (mono_arch_is_soft_float () ? \
+ (FALSE) : \
+ ((desc) == 'f' || (desc) == 'g'))
+
+#define MONO_ARCH_INST_REGPAIR_REG2(desc,hreg1) ((desc) == 'l' || (desc) == 'f' || (desc) == 'g' ? ARM_MSW_REG : -1)
#define MONO_ARCH_FRAME_ALIGNMENT 8
if (!tls) {
/* Happens during startup */
- tls->unwind_state.valid = FALSE;
return;
}
static MonoClass *iclass;
static gboolean iclass_set;
+ return FALSE;
+
if (!iclass_set) {
iclass = mono_class_from_name (mono_defaults.corlib, "System.Runtime.CompilerServices", "IAsyncStateMachine");
mono_memory_barrier ();
static MonoClass *attr_class;
static gboolean attr_class_set;
+ return FALSE;
+
if (!attr_class_set) {
attr_class = mono_class_from_name (mono_defaults.corlib, "System.Runtime.CompilerServices", "AsyncStateMachineAttribute");
mono_memory_barrier ();
#include <mono/metadata/threads.h>
#include <mono/metadata/profiler-private.h>
#include <mono/utils/mono-math.h>
+#include <mono/utils/mono-hwcap-ia64.h>
#include "trace.h"
#include "mini-ia64.h"
using namespace llvm;
+#ifndef MONO_CROSS_COMPILE
+
class MonoJITMemoryManager : public JITMemoryManager
{
private:
{
}
+#endif /* !MONO_CROSS_COMPILE */
+
class MonoJITEventListener : public JITEventListener {
public:
}
};
+#ifndef MONO_CROSS_COMPILE
static MonoJITMemoryManager *mono_mm;
+#endif
static MonoJITEventListener *mono_event_listener;
static FunctionPassManager *fpm;
(void) llvm::createSinkingPass();
}
+#ifndef MONO_CROSS_COMPILE
+
LLVMExecutionEngineRef
mono_llvm_create_ee (LLVMModuleProviderRef MP, AllocCodeMemoryCb *alloc_cb, FunctionEmittedCb *emitted_cb, ExceptionTableCb *exception_cb, DlSymCb *dlsym_cb)
{
delete fpm;
}
+
+#else
+
+LLVMExecutionEngineRef
+mono_llvm_create_ee (LLVMModuleProviderRef MP, AllocCodeMemoryCb *alloc_cb, FunctionEmittedCb *emitted_cb, ExceptionTableCb *exception_cb, DlSymCb *dlsym_cb)
+{
+ g_assert_not_reached ();
+ return NULL;
+}
+
+void
+mono_llvm_dispose_ee (LLVMExecutionEngineRef ee)
+{
+ g_assert_not_reached ();
+}
+
+/* Not linked in */
+void
+LLVMAddGlobalMapping(LLVMExecutionEngineRef EE, LLVMValueRef Global,
+ void* Addr)
+{
+ g_assert_not_reached ();
+}
+
+void*
+LLVMGetPointerToGlobal(LLVMExecutionEngineRef EE, LLVMValueRef Global)
+{
+ g_assert_not_reached ();
+ return NULL;
+}
+
+#endif /* !MONO_CROSS_COMPILE */
if (LLVMGetTypeKind (stype) == LLVMPointerTypeKind)
return LLVMBuildPtrToInt (ctx->builder, v, dtype, "");
-#ifdef MONO_ARCH_SOFT_FLOAT
- if (stype == LLVMInt32Type () && dtype == LLVMFloatType ())
- return LLVMBuildBitCast (ctx->builder, v, dtype, "");
- if (stype == LLVMInt32Type () && dtype == LLVMDoubleType ())
- return LLVMBuildBitCast (ctx->builder, LLVMBuildZExt (ctx->builder, v, LLVMInt64Type (), ""), dtype, "");
-#endif
+ if (mono_arch_is_soft_float ()) {
+ if (stype == LLVMInt32Type () && dtype == LLVMFloatType ())
+ return LLVMBuildBitCast (ctx->builder, v, dtype, "");
+ if (stype == LLVMInt32Type () && dtype == LLVMDoubleType ())
+ return LLVMBuildBitCast (ctx->builder, LLVMBuildZExt (ctx->builder, v, LLVMInt64Type (), ""), dtype, "");
+ }
if (LLVMGetTypeKind (stype) == LLVMVectorTypeKind && LLVMGetTypeKind (dtype) == LLVMVectorTypeKind)
return LLVMBuildBitCast (ctx->builder, v, dtype, "");
#include <mono/metadata/appdomain.h>
#include <mono/metadata/debug-helpers.h>
#include <mono/utils/mono-mmap.h>
+#include <mono/utils/mono-hwcap-mips.h>
#include <mono/arch/mips/mips-codegen.h>
#define ALWAYS_SAVE_RA 1 /* call-handler & switch currently clobber ra */
#define PROMOTE_R4_TO_R8 1 /* promote single values in registers to doubles */
-#define USE_MUL 1 /* use mul instead of mult/mflo for multiply */
+#define USE_MUL 0 /* use mul instead of mult/mflo for multiply
+ remember to update cpu-mips.md if you change this */
/* Emit a call sequence to 'v', using 'D' as a scratch register if necessary */
#define mips_call(c,D,v) do { \
guint8 *code;
guint32 code_len;
int i;
+ char *tramp_name;
code = get_delegate_invoke_impl (TRUE, 0, &code_len);
- res = g_slist_prepend (res, mono_tramp_info_create (g_strdup ("delegate_invoke_impl_has_target"), code, code_len, NULL, NULL));
+ res = g_slist_prepend (res, mono_tramp_info_create ("delegate_invoke_impl_has_target", code, code_len, NULL, NULL));
for (i = 0; i <= MAX_ARCH_DELEGATE_PARAMS; ++i) {
code = get_delegate_invoke_impl (FALSE, i, &code_len);
- res = g_slist_prepend (res, mono_tramp_info_create (g_strdup_printf ("delegate_invoke_impl_target_%d", i), code, code_len, NULL, NULL));
+ tramp_name = g_strdup_printf ("delegate_invoke_impl_target_%d", i);
+ res = g_slist_prepend (res, mono_tramp_info_create (tramp_name, code, code_len, NULL, NULL));
+ g_free (tramp_name);
}
return res;
#include <mono/metadata/debug-helpers.h>
#include <mono/utils/mono-proclib.h>
#include <mono/utils/mono-mmap.h>
+#include <mono/utils/mono-hwcap-ppc.h>
#include "mini-ppc.h"
#ifdef TARGET_POWERPC64
guint8 *code;
guint32 code_len;
int i;
+ char *tramp_name;
code = get_delegate_invoke_impl (TRUE, 0, &code_len, TRUE);
- res = g_slist_prepend (res, mono_tramp_info_create (g_strdup ("delegate_invoke_impl_has_target"), code, code_len, NULL, NULL));
+ res = g_slist_prepend (res, mono_tramp_info_create ("delegate_invoke_impl_has_target", code, code_len, NULL, NULL));
for (i = 0; i < MAX_ARCH_DELEGATE_PARAMS; ++i) {
code = get_delegate_invoke_impl (FALSE, i, &code_len, TRUE);
- res = g_slist_prepend (res, mono_tramp_info_create (g_strdup_printf ("delegate_invoke_impl_target_%d", i), code, code_len, NULL, NULL));
+ tramp_name = g_strdup_printf ("delegate_invoke_impl_target_%d", i);
+ res = g_slist_prepend (res, mono_tramp_info_create (tramp_name, code, code_len, NULL, NULL));
+ g_free (tramp_name);
}
return res;
long int value;
} AuxVec;
-#ifdef USE_ENVIRON_HACK
-static AuxVec*
-linux_find_auxv (int *count)
-{
- AuxVec *vec;
- int c = 0;
- char **result = __environ;
- /* Scan over the env vector looking for the ending NULL */
- for (; *result != NULL; ++result) {
- }
- /* Bump the pointer one more step, which should be the auxv. */
- ++result;
- vec = (AuxVec *)result;
- if (vec->type != 22 /*AT_IGNOREPPC*/) {
- *count = 0;
- return NULL;
- }
- while (vec->type != 0 /*AT_NULL*/) {
- vec++;
- c++;
- }
- *count = c;
- return (AuxVec *)result;
-}
-#endif
-
#define MAX_AUX_ENTRIES 128
/*
* PPC_FEATURE_POWER4, PPC_FEATURE_POWER5, PPC_FEATURE_POWER5_PLUS, PPC_FEATURE_CELL,
#if defined(MONO_CROSS_COMPILE)
#elif defined(__APPLE__)
int mib [3];
- size_t len;
+ size_t len = sizeof (cachelinesize);
+
mib [0] = CTL_HW;
mib [1] = HW_CACHELINE;
- len = sizeof (cachelinesize);
- if (sysctl (mib, 2, &cachelinesize, (size_t*)&len, NULL, 0) == -1) {
+
+ if (sysctl (mib, 2, &cachelinesize, &len, NULL, 0) == -1) {
perror ("sysctl");
cachelinesize = 128;
} else {
int i, vec_entries = 0;
/* sadly this will work only with 2.6 kernels... */
FILE* f = fopen ("/proc/self/auxv", "rb");
+
if (f) {
vec_entries = fread (&vec, sizeof (AuxVec), MAX_AUX_ENTRIES, f);
fclose (f);
-#ifdef USE_ENVIRON_HACK
- } else {
- AuxVec *evec = linux_find_auxv (&vec_entries);
- if (vec_entries)
- memcpy (&vec, evec, sizeof (AuxVec) * MIN (vec_entries, MAX_AUX_ENTRIES));
-#endif
}
+
for (i = 0; i < vec_entries; i++) {
int type = vec [i].type;
+
if (type == 19) { /* AT_DCACHEBSIZE */
cachelinesize = vec [i].value;
continue;
- } else if (type == 16) { /* AT_HWCAP */
- if (vec [i].value & 0x00002000 /*PPC_FEATURE_ICACHE_SNOOP*/)
- cpu_hw_caps |= PPC_ICACHE_SNOOP;
- if (vec [i].value & ISA_2X)
- cpu_hw_caps |= PPC_ISA_2X;
- if (vec [i].value & ISA_64)
- cpu_hw_caps |= PPC_ISA_64;
- if (vec [i].value & ISA_MOVE_FPR_GPR)
- cpu_hw_caps |= PPC_MOVE_FPR_GPR;
- continue;
- } else if (type == 15) { /* AT_PLATFORM */
- const char *arch = (char*)vec [i].value;
- if (strcmp (arch, "ppc970") == 0 ||
- (strncmp (arch, "power", 5) == 0 && arch [5] >= '4' && arch [5] <= '7'))
- cpu_hw_caps |= PPC_MULTIPLE_LS_UNITS;
- /*printf ("cpu: %s\n", (char*)vec [i].value);*/
- continue;
}
}
#elif defined(G_COMPILER_CODEWARRIOR)
#else
//#error Need a way to get cache line size
#endif
+
+ if (mono_hwcap_ppc_has_icache_snoop)
+ cpu_hw_caps |= PPC_ICACHE_SNOOP;
+
+ if (mono_hwcap_ppc_is_isa_2x)
+ cpu_hw_caps |= PPC_ISA_2X;
+
+ if (mono_hwcap_ppc_is_isa_64)
+ cpu_hw_caps |= PPC_ISA_64;
+
+ if (mono_hwcap_ppc_has_move_fpr_gpr)
+ cpu_hw_caps |= PPC_MOVE_FPR_GPR;
+
+ if (mono_hwcap_ppc_has_multiple_ls_units)
+ cpu_hw_caps |= PPC_MULTIPLE_LS_UNITS;
+
if (!cachelinesize)
cachelinesize = 32;
+
if (!cachelineinc)
cachelineinc = cachelinesize;
if (mono_cpu_count () > 1)
cpu_hw_caps |= PPC_SMP_CAPABLE;
+
InitializeCriticalSection (&mini_arch_mutex);
ss_trigger_page = mono_valloc (NULL, mono_pagesize (), MONO_MMAP_READ|MONO_MMAP_32BIT);
#include <mono/metadata/profiler-private.h>
#include <mono/utils/mono-math.h>
#include <mono/utils/mono-mmap.h>
+#include <mono/utils/mono-hwcap-s390x.h>
#include "mini-s390x.h"
#include "cpu-s390x.h"
static int indent_level = 0;
-int has_ld = 0;
-
static gint appdomain_tls_offset = -1,
lmf_tls_offset = -1,
lmf_addr_tls_offset = -1;
/*========================= End of Function ========================*/
-/*------------------------------------------------------------------*/
-/* */
-/* Name - catch_SIGILL */
-/* */
-/* Function - Catch SIGILL as a result of testing for long */
-/* displacement facility. */
-/* */
-/*------------------------------------------------------------------*/
-
-void
-catch_SIGILL(int sigNo, siginfo_t *info, void *act) {
-
- has_ld = 0;
-
-}
-
-/*========================= End of Function ========================*/
-
/*------------------------------------------------------------------*/
/* */
/* Name - mono_arch_cpu_init */
void
mono_arch_cpu_init (void)
{
- struct sigaction sa,
- *oldSa = NULL;
- guint mode = 1;
-
- /*--------------------------------------*/
- /* Set default rounding mode for FP */
- /*--------------------------------------*/
- __asm__ ("SRNM\t%0\n\t"
- : : "m" (mode));
-
- /*--------------------------------------*/
- /* Determine if we have long displace- */
- /* ment facility on this processor */
- /*--------------------------------------*/
- sa.sa_sigaction = catch_SIGILL;
- sigemptyset (&sa.sa_mask);
- sa.sa_flags = SA_SIGINFO;
-
- sigaction (SIGILL, &sa, oldSa);
-
- /*--------------------------------------*/
- /* We test by executing the STY inst */
- /*--------------------------------------*/
- __asm__ ("LGHI\t0,1\n\t"
- "LA\t1,%0\n\t"
- ".byte\t0xe3,0x00,0x10,0x00,0x00,0x50\n\t"
- : "=m" (has_ld) : : "0", "1");
-
- sigaction (SIGILL, oldSa, NULL);
}
/*========================= End of Function ========================*/
if (cfg->method->save_lmf)
parmOffset -= sizeof(MonoLMF);
fpOffset = parmOffset + (5*sizeof(gpointer));
- if ((!has_ld) && (fpOffset > 4096)) {
+ if ((!mono_hwcap_s390x_has_ld) && (fpOffset > 4096)) {
s390_lgr (code, s390_r12, STK_BASE);
baseReg = s390_r12;
while (fpOffset > 4096) {
}
s390_stmg (code, s390_r2, s390_r6, STK_BASE, parmOffset);
- if (has_ld) {
+ if (mono_hwcap_s390x_has_ld) {
s390_stdy (code, s390_f0, 0, STK_BASE, fpOffset);
s390_stdy (code, s390_f2, 0, STK_BASE, fpOffset+sizeof(gdouble));
s390_stdy (code, s390_f4, 0, STK_BASE, fpOffset+2*sizeof(gdouble));
s390_llong(code, cfg->method);
s390_llong(code, func);
s390_lg (code, s390_r2, 0, s390_r13, 4);
- if (has_ld)
+ if (mono_hwcap_s390x_has_ld)
s390_lay (code, s390_r3, 0, STK_BASE, parmOffset);
else
s390_la (code, s390_r3, 0, baseReg, parmOffset);
s390_aghi (code, s390_r4, cfg->stack_usage);
s390_lg (code, s390_r1, 0, s390_r13, 12);
s390_basr (code, s390_r14, s390_r1);
- if (has_ld) {
+ if (mono_hwcap_s390x_has_ld) {
s390_ldy (code, s390_f6, 0, STK_BASE, fpOffset+3*sizeof(gdouble));
s390_ldy (code, s390_f4, 0, STK_BASE, fpOffset+2*sizeof(gdouble));
s390_ldy (code, s390_f2, 0, STK_BASE, fpOffset+sizeof(gdouble));
guint8 *code;
guint32 code_len;
int i;
+ char *tramp_name;
code = get_delegate_invoke_impl (TRUE, 0, &code_len, TRUE);
- res = g_slist_prepend (res, mono_tramp_info_create (g_strdup ("delegate_invoke_impl_has_target"), code, code_len, NULL, NULL));
+ res = g_slist_prepend (res, mono_tramp_info_create ("delegate_invoke_impl_has_target", code, code_len, NULL, NULL));
for (i = 0; i < MAX_ARCH_DELEGATE_PARAMS; ++i) {
code = get_delegate_invoke_impl (FALSE, i, &code_len, TRUE);
- res = g_slist_prepend (res, mono_tramp_info_create (g_strdup_printf ("delegate_invoke_impl_target_%d", i), code, code_len, NULL, NULL));
+ tramp_name = g_strdup_printf ("delegate_invoke_impl_target_%d", i);
+ res = g_slist_prepend (res, mono_tramp_info_create (tramp_name, code, code_len, NULL, NULL));
+ g_free (tramp_name);
}
return res;
#include <unistd.h>
#ifndef __linux__
-#include <sys/systeminfo.h>
#include <thread.h>
#endif
#include <mono/metadata/debug-helpers.h>
#include <mono/metadata/tokentype.h>
#include <mono/utils/mono-math.h>
+#include <mono/utils/mono-hwcap-sparc.h>
#include "mini-sparc.h"
#include "trace.h"
#endif
-/* Whenever the CPU supports v9 instructions */
-static gboolean sparcv9 = FALSE;
-
/* Whenever this is a 64bit executable */
#if SPARCV9
static gboolean v64 = TRUE;
void
mono_arch_cpu_init (void)
{
- guint32 dummy;
- /* make sure sparcv9 is initialized for embedded use */
- mono_arch_cpu_optimizations(&dummy);
}
/*
guint32
mono_arch_cpu_optimizations (guint32 *exclude_mask)
{
- char buf [1024];
guint32 opts = 0;
*exclude_mask = 0;
-#ifndef __linux__
- if (!sysinfo (SI_ISALIST, buf, 1024))
- g_assert_not_reached ();
-#else
- /* From glibc. If the getpagesize is 8192, we're on sparc64, which
- * (in)directly implies that we're a v9 or better.
- * Improvements to this are greatly accepted...
- * Also, we don't differentiate between v7 and v8. I sense SIGILL
- * sniffing in my future.
- */
- if (getpagesize() == 8192)
- strcpy (buf, "sparcv9");
- else
- strcpy (buf, "sparcv8");
-#endif
-
- /*
+ /*
* On some processors, the cmov instructions are even slower than the
* normal ones...
*/
- if (strstr (buf, "sparcv9")) {
+ if (mono_hwcap_sparc_is_v9)
opts |= MONO_OPT_CMOV | MONO_OPT_FCMOV;
- sparcv9 = TRUE;
- }
else
*exclude_mask |= MONO_OPT_CMOV | MONO_OPT_FCMOV;
*
* Sparcv8 needs a flush every 8 bytes.
*/
- align = (sparcv9 ? 32 : 8);
+ align = (mono_hwcap_sparc_is_v9 ? 32 : 8);
start &= ~(align - 1);
end = (end + (align - 1)) & ~(align - 1);
gboolean
mono_sparc_is_v9 (void) {
- return sparcv9;
+ return mono_hwcap_sparc_is_v9;
}
gboolean
#define EMIT_COND_SYSTEM_EXCEPTION_GENERAL(ins,cond,sexc_name,filldelay,icc) do { \
mono_add_patch_info (cfg, (guint8*)(code) - (cfg)->native_code, \
MONO_PATCH_INFO_EXC, sexc_name); \
- if (sparcv9 && ((icc) != sparc_icc_short)) { \
+ if (mono_hwcap_sparc_is_v9 && ((icc) != sparc_icc_short)) { \
sparc_branchp (code, 0, (cond), (icc), 0, 0); \
} \
else { \
((ins->inst_offset == last_ins->inst_offset - 4)) &&
(ins->inst_imm == 0) &&
(last_ins->inst_imm == 0)) {
- if (sparcv9) {
+ if (mono_hwcap_sparc_is_v9) {
last_ins->opcode = OP_STOREI8_MEMBASE_IMM;
last_ins->inst_offset = ins->inst_offset;
MONO_DELETE_INS (bb, ins);
sparc_branch (code, 0, sparc_be, 0);
/* delay slot */
sparc_set (code, 0, sparc_o7);
- sparc_sub_imm (code, 0, size_reg, sparcv9 ? 8 : 4, size_reg);
+ sparc_sub_imm (code, 0, size_reg, mono_hwcap_sparc_is_v9 ? 8 : 4, size_reg);
/* start of loop */
br [1] = code;
- if (sparcv9)
+ if (mono_hwcap_sparc_is_v9)
sparc_stx (code, sparc_g0, ins->dreg, sparc_o7);
else
sparc_st (code, sparc_g0, ins->dreg, sparc_o7);
sparc_branch (code, 0, sparc_bl, 0);
sparc_patch (br [2], br [1]);
/* delay slot */
- sparc_add_imm (code, 0, sparc_o7, sparcv9 ? 8 : 4, sparc_o7);
+ sparc_add_imm (code, 0, sparc_o7, mono_hwcap_sparc_is_v9 ? 8 : 4, sparc_o7);
sparc_patch (br [0], code);
}
break;
if (offset <= 16) {
i = 0;
while (i < offset) {
- if (sparcv9) {
+ if (mono_hwcap_sparc_is_v9) {
sparc_stx_imm (code, sparc_g0, ins->dreg, i);
i += 8;
}
}
else {
sparc_set (code, offset, sparc_o7);
- sparc_sub_imm (code, 0, sparc_o7, sparcv9 ? 8 : 4, sparc_o7);
+ sparc_sub_imm (code, 0, sparc_o7, mono_hwcap_sparc_is_v9 ? 8 : 4, sparc_o7);
/* beginning of loop */
br [0] = code;
- if (sparcv9)
+ if (mono_hwcap_sparc_is_v9)
sparc_stx (code, sparc_g0, ins->dreg, sparc_o7);
else
sparc_st (code, sparc_g0, ins->dreg, sparc_o7);
br [1] = code;
sparc_branch (code, 0, sparc_bne, 0);
/* delay slot */
- sparc_sub_imm (code, 0, sparc_o7, sparcv9 ? 8 : 4, sparc_o7);
+ sparc_sub_imm (code, 0, sparc_o7, mono_hwcap_sparc_is_v9 ? 8 : 4, sparc_o7);
sparc_patch (br [1], br [0]);
}
}
case OP_IBGE_UN:
case OP_IBLE:
case OP_IBLE_UN: {
- if (sparcv9)
+ if (mono_hwcap_sparc_is_v9)
EMIT_COND_BRANCH_PREDICTED (ins, opcode_to_sparc_cond (ins->opcode), 1, 1);
else
EMIT_COND_BRANCH (ins, opcode_to_sparc_cond (ins->opcode), 1, 1);
actual_method = vt->klass->vtable [displacement];
}
- if (method_inst) {
+ if (method_inst || m->wrapper_type) {
MonoGenericContext context = { NULL, NULL };
if (m->is_inflated)
"aot_plt",
"delegate",
"restore_stack_prot",
-#ifndef DISABLE_REMOTING
"generic_virtual_remoting",
-#endif
"monitor_enter",
"monitor_exit",
"vcall",
-#ifdef MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD
"handler_block_guard"
-#endif
};
/*
#include <mono/utils/mono-counters.h>
#include <mono/utils/mono-mmap.h>
#include <mono/utils/mono-memory-model.h>
+#include <mono/utils/mono-hwcap-x86.h>
#include "trace.h"
#include "mini-x86.h"
return res;
}
-#if !defined(__native_client__)
-static const guchar cpuid_impl [] = {
- 0x55, /* push %ebp */
- 0x89, 0xe5, /* mov %esp,%ebp */
- 0x53, /* push %ebx */
- 0x8b, 0x45, 0x08, /* mov 0x8(%ebp),%eax */
- 0x0f, 0xa2, /* cpuid */
- 0x50, /* push %eax */
- 0x8b, 0x45, 0x10, /* mov 0x10(%ebp),%eax */
- 0x89, 0x18, /* mov %ebx,(%eax) */
- 0x8b, 0x45, 0x14, /* mov 0x14(%ebp),%eax */
- 0x89, 0x08, /* mov %ecx,(%eax) */
- 0x8b, 0x45, 0x18, /* mov 0x18(%ebp),%eax */
- 0x89, 0x10, /* mov %edx,(%eax) */
- 0x58, /* pop %eax */
- 0x8b, 0x55, 0x0c, /* mov 0xc(%ebp),%edx */
- 0x89, 0x02, /* mov %eax,(%edx) */
- 0x5b, /* pop %ebx */
- 0xc9, /* leave */
- 0xc3, /* ret */
-};
-#else
-static const guchar cpuid_impl [] = {
- 0x55, /* push %ebp */
- 0x89, 0xe5, /* mov %esp,%ebp */
- 0x53, /* push %ebx */
- 0x8b, 0x45, 0x08, /* mov 0x8(%ebp),%eax */
- 0x0f, 0xa2, /* cpuid */
- 0x50, /* push %eax */
- 0x8b, 0x45, 0x10, /* mov 0x10(%ebp),%eax */
- 0x89, 0x18, /* mov %ebx,(%eax) */
- 0x8b, 0x45, 0x14, /* mov 0x14(%ebp),%eax */
- 0x89, 0x08, /* mov %ecx,(%eax) */
- 0x8b, 0x45, 0x18, /* mov 0x18(%ebp),%eax */
- 0x89, 0x10, /* mov %edx,(%eax) */
- 0x58, /* pop %eax */
- 0x8b, 0x55, 0x0c, /* mov 0xc(%ebp),%edx */
- 0x89, 0x02, /* mov %eax,(%edx) */
- 0x5b, /* pop %ebx */
- 0xc9, /* leave */
- 0x59, 0x83, 0xe1, 0xe0, 0xff, 0xe1, /* naclret */
- 0xf4, 0xf4, 0xf4, 0xf4, 0xf4, 0xf4, /* padding, to provide bundle aligned version */
- 0xf4, 0xf4, 0xf4, 0xf4, 0xf4, 0xf4,
- 0xf4, 0xf4, 0xf4, 0xf4, 0xf4, 0xf4,
- 0xf4, 0xf4, 0xf4, 0xf4, 0xf4, 0xf4,
- 0xf4
-};
-#endif
-
-typedef void (*CpuidFunc) (int id, int* p_eax, int* p_ebx, int* p_ecx, int* p_edx);
-
-static int
-cpuid (int id, int* p_eax, int* p_ebx, int* p_ecx, int* p_edx)
-{
-#if defined(__native_client__)
- static CpuidFunc func = NULL;
- void *ptr, *end_ptr;
- if (!func) {
- ptr = mono_global_codeman_reserve (sizeof (cpuid_impl));
- memcpy(ptr, cpuid_impl, sizeof(cpuid_impl));
- end_ptr = ptr + sizeof(cpuid_impl);
- nacl_global_codeman_validate (&ptr, sizeof(cpuid_impl), &end_ptr);
- func = (CpuidFunc)ptr;
- }
- func (id, p_eax, p_ebx, p_ecx, p_edx);
-#else
- int have_cpuid = 0;
-#ifndef _MSC_VER
- __asm__ __volatile__ (
- "pushfl\n"
- "popl %%eax\n"
- "movl %%eax, %%edx\n"
- "xorl $0x200000, %%eax\n"
- "pushl %%eax\n"
- "popfl\n"
- "pushfl\n"
- "popl %%eax\n"
- "xorl %%edx, %%eax\n"
- "andl $0x200000, %%eax\n"
- "movl %%eax, %0"
- : "=r" (have_cpuid)
- :
- : "%eax", "%edx"
- );
-#else
- __asm {
- pushfd
- pop eax
- mov edx, eax
- xor eax, 0x200000
- push eax
- popfd
- pushfd
- pop eax
- xor eax, edx
- and eax, 0x200000
- mov have_cpuid, eax
- }
-#endif
- if (have_cpuid) {
- /* Have to use the code manager to get around WinXP DEP */
- static CpuidFunc func = NULL;
- void *ptr;
- if (!func) {
- ptr = mono_global_codeman_reserve (sizeof (cpuid_impl));
- memcpy (ptr, cpuid_impl, sizeof (cpuid_impl));
- func = (CpuidFunc)ptr;
- }
- func (id, p_eax, p_ebx, p_ecx, p_edx);
-
- /*
- * We use this approach because of issues with gcc and pic code, see:
- * http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7329
- __asm__ __volatile__ ("cpuid"
- : "=a" (*p_eax), "=b" (*p_ebx), "=c" (*p_ecx), "=d" (*p_edx)
- : "a" (id));
- */
- return 1;
- }
- return 0;
-#endif
-}
-
/*
* Initialize the cpu to execute managed code.
*/
mono_arch_cpu_optimizations (guint32 *exclude_mask)
{
#if !defined(__native_client__)
- int eax, ebx, ecx, edx;
guint32 opts = 0;
-
+
*exclude_mask = 0;
- if (mono_aot_only)
- /* The cpuid function allocates from the global codeman */
- return opts;
+ if (mono_hwcap_x86_has_cmov) {
+ opts |= MONO_OPT_CMOV;
- /* Feature Flags function, flags returned in EDX. */
- if (cpuid (1, &eax, &ebx, &ecx, &edx)) {
- if (edx & (1 << 15)) {
- opts |= MONO_OPT_CMOV;
- if (edx & 1)
- opts |= MONO_OPT_FCMOV;
- else
- *exclude_mask |= MONO_OPT_FCMOV;
- } else
- *exclude_mask |= MONO_OPT_CMOV;
- if (edx & (1 << 26))
- opts |= MONO_OPT_SSE2;
+ if (mono_hwcap_x86_has_fcmov)
+ opts |= MONO_OPT_FCMOV;
else
- *exclude_mask |= MONO_OPT_SSE2;
+ *exclude_mask |= MONO_OPT_FCMOV;
+ } else {
+ *exclude_mask |= MONO_OPT_CMOV;
+ }
+
+ if (mono_hwcap_x86_has_sse2)
+ opts |= MONO_OPT_SSE2;
+ else
+ *exclude_mask |= MONO_OPT_SSE2;
#ifdef MONO_ARCH_SIMD_INTRINSICS
/*SIMD intrinsics require at least SSE2.*/
- if (!(opts & MONO_OPT_SSE2))
+ if (!mono_hwcap_x86_has_sse2)
*exclude_mask |= MONO_OPT_SIMD;
#endif
- }
+
return opts;
#else
return MONO_OPT_CMOV | MONO_OPT_FCMOV | MONO_OPT_SSE2;
guint32
mono_arch_cpu_enumerate_simd_versions (void)
{
- int eax, ebx, ecx, edx;
guint32 sse_opts = 0;
- if (mono_aot_only)
- /* The cpuid function allocates from the global codeman */
- return sse_opts;
-
- if (cpuid (1, &eax, &ebx, &ecx, &edx)) {
- if (edx & (1 << 25))
- sse_opts |= SIMD_VERSION_SSE1;
- if (edx & (1 << 26))
- sse_opts |= SIMD_VERSION_SSE2;
- if (ecx & (1 << 0))
- sse_opts |= SIMD_VERSION_SSE3;
- if (ecx & (1 << 9))
- sse_opts |= SIMD_VERSION_SSSE3;
- if (ecx & (1 << 19))
- sse_opts |= SIMD_VERSION_SSE41;
- if (ecx & (1 << 20))
- sse_opts |= SIMD_VERSION_SSE42;
- }
+ if (mono_hwcap_x86_has_sse1)
+ sse_opts |= SIMD_VERSION_SSE1;
- /* Yes, all this needs to be done to check for sse4a.
- See: "Amd: CPUID Specification"
- */
- if (cpuid (0x80000000, &eax, &ebx, &ecx, &edx)) {
- /* eax greater or equal than 0x80000001, ebx = 'htuA', ecx = DMAc', edx = 'itne'*/
- if ((((unsigned int) eax) >= 0x80000001) && (ebx == 0x68747541) && (ecx == 0x444D4163) && (edx == 0x69746E65)) {
- cpuid (0x80000001, &eax, &ebx, &ecx, &edx);
- if (ecx & (1 << 6))
- sse_opts |= SIMD_VERSION_SSE4a;
- }
- }
+ if (mono_hwcap_x86_has_sse2)
+ sse_opts |= SIMD_VERSION_SSE2;
+
+ if (mono_hwcap_x86_has_sse3)
+ sse_opts |= SIMD_VERSION_SSE3;
+
+ if (mono_hwcap_x86_has_ssse3)
+ sse_opts |= SIMD_VERSION_SSSE3;
+
+ if (mono_hwcap_x86_has_sse41)
+ sse_opts |= SIMD_VERSION_SSE41;
+
+ if (mono_hwcap_x86_has_sse42)
+ sse_opts |= SIMD_VERSION_SSE42;
+ if (mono_hwcap_x86_has_sse4a)
+ sse_opts |= SIMD_VERSION_SSE4a;
- return sse_opts;
+ return sse_opts;
}
/*
guint8 *code;
guint32 code_len;
int i;
+ char *tramp_name;
code = get_delegate_invoke_impl (TRUE, 0, &code_len);
- res = g_slist_prepend (res, mono_tramp_info_create (g_strdup ("delegate_invoke_impl_has_target"), code, code_len, NULL, NULL));
+ res = g_slist_prepend (res, mono_tramp_info_create ("delegate_invoke_impl_has_target", code, code_len, NULL, NULL));
for (i = 0; i < MAX_ARCH_DELEGATE_PARAMS; ++i) {
code = get_delegate_invoke_impl (FALSE, i, &code_len);
- res = g_slist_prepend (res, mono_tramp_info_create (g_strdup_printf ("delegate_invoke_impl_target_%d", i), code, code_len, NULL, NULL));
+ tramp_name = g_strdup_printf ("delegate_invoke_impl_target_%d", i);
+ res = g_slist_prepend (res, mono_tramp_info_create (tramp_name, code, code_len, NULL, NULL));
+ g_free (tramp_name);
}
return res;
#include <mono/utils/mono-mmap.h>
#include <mono/utils/mono-path.h>
#include <mono/utils/mono-tls.h>
+#include <mono/utils/mono-hwcap.h>
#include <mono/utils/dtrace.h>
#include "mini.h"
#include "mini-gc.h"
#include "debugger-agent.h"
+/* this macro is used for a runtime check done in mini_init () */
+#ifdef MONO_ARCH_EMULATE_MUL_DIV
+#define EMUL_MUL_DIV 1
+#else
+#define EMUL_MUL_DIV 0
+#endif
+
static gpointer mono_jit_compile_method_with_opt (MonoMethod *method, guint32 opt, MonoException **ex);
set_vreg_to_inst (cfg, vreg, inst);
#if SIZEOF_REGISTER == 4
-#ifdef MONO_ARCH_SOFT_FLOAT
- regpair = mono_type_is_long (type) || mono_type_is_float (type);
-#else
- regpair = mono_type_is_long (type);
-#endif
+ if (mono_arch_is_soft_float ()) {
+ regpair = mono_type_is_long (type) || mono_type_is_float (type);
+ } else {
+ regpair = mono_type_is_long (type);
+ }
#else
regpair = FALSE;
#endif
printf (" Create LVAR R%d (R%d, R%d)\n", inst->dreg, inst->dreg + 1, inst->dreg + 2);
}
-#ifdef MONO_ARCH_SOFT_FLOAT
- if (cfg->opt & MONO_OPT_SSA) {
+ if (mono_arch_is_soft_float () && cfg->opt & MONO_OPT_SSA) {
if (mono_type_is_float (type))
inst->flags = MONO_INST_VOLATILE;
}
-#endif
/* Allocate a dummy MonoInst for the first vreg */
MONO_INST_NEW (cfg, tree, OP_LOCAL);
if (mono_type_is_long (type))
dreg = mono_alloc_dreg (cfg, STACK_I8);
-#ifdef MONO_ARCH_SOFT_FLOAT
- else if (mono_type_is_float (type))
+ else if (mono_arch_is_soft_float () && mono_type_is_float (type))
dreg = mono_alloc_dreg (cfg, STACK_R8);
-#endif
else
/* All the others are unified */
dreg = mono_alloc_preg (cfg);
if (!cfg->seq_points)
return;
- info = g_malloc0 (sizeof (MonoSeqPointInfo) + (cfg->seq_points->len - MONO_ZERO_LEN_ARRAY) * sizeof (SeqPoint));
+ info = g_malloc0 (sizeof (MonoSeqPointInfo) + (cfg->seq_points->len * sizeof (SeqPoint)));
info->len = cfg->seq_points->len;
for (i = 0; i < cfg->seq_points->len; ++i) {
SeqPoint *sp = &info->seq_points [i];
last = ins;
}
- if (bb->last_ins && bb->last_ins->opcode == OP_ENDFINALLY) {
+ if (bb->last_ins && bb->last_ins->opcode == OP_ENDFINALLY && bb->seq_points) {
MonoBasicBlock *bb2;
MonoInst *endfinally_seq_point = NULL;
* The ENDFINALLY branches are not represented in the cfg, so link it with all seq points starting bbs.
*/
l = g_slist_last (bb->seq_points);
- g_assert (l);
- endfinally_seq_point = l->data;
+ if (l) {
+ endfinally_seq_point = l->data;
- for (bb2 = cfg->bb_entry; bb2; bb2 = bb2->next_bb) {
- GSList *l = g_slist_last (bb2->seq_points);
+ for (bb2 = cfg->bb_entry; bb2; bb2 = bb2->next_bb) {
+ GSList *l = g_slist_last (bb2->seq_points);
- if (l) {
- MonoInst *ins = l->data;
+ if (l) {
+ MonoInst *ins = l->data;
- if (!(ins->inst_imm == METHOD_ENTRY_IL_OFFSET || ins->inst_imm == METHOD_EXIT_IL_OFFSET) && ins != endfinally_seq_point)
- next [endfinally_seq_point->backend.size] = g_slist_append (next [endfinally_seq_point->backend.size], GUINT_TO_POINTER (ins->backend.size));
+ if (!(ins->inst_imm == METHOD_ENTRY_IL_OFFSET || ins->inst_imm == METHOD_EXIT_IL_OFFSET) && ins != endfinally_seq_point)
+ next [endfinally_seq_point->backend.size] = g_slist_append (next [endfinally_seq_point->backend.size], GUINT_TO_POINTER (ins->backend.size));
+ }
}
}
}
return FALSE;
}
-static gboolean
-has_ref_constraint (MonoGenericParamInfo *info)
-{
- MonoClass **constraints;
-
- //return FALSE;
-
- if (info && info->constraints) {
- constraints = info->constraints;
-
- while (*constraints) {
- MonoClass *cklass = *constraints;
- if (!(cklass == mono_defaults.object_class || (cklass->image == mono_defaults.corlib && !strcmp (cklass->name, "ValueType")) || MONO_CLASS_IS_INTERFACE (cklass)))
- return TRUE;
- constraints ++;
- }
- }
- return FALSE;
-}
-
static MonoGenericInst*
get_shared_inst (MonoGenericInst *inst, MonoGenericInst *shared_inst, MonoGenericContainer *container, gboolean all_vt, gboolean gsharedvt)
{
if (!all_vt && (MONO_TYPE_IS_REFERENCE (inst->type_argv [i]) || inst->type_argv [i]->type == MONO_TYPE_VAR || inst->type_argv [i]->type == MONO_TYPE_MVAR)) {
type_argv [i] = shared_inst->type_argv [i];
} else if (all_vt) {
- if (container && has_ref_constraint (&container->type_params [i].info))
- type_argv [i] = shared_inst->type_argv [i];
- else
- type_argv [i] = get_gsharedvt_type (shared_inst->type_argv [i]);
+ type_argv [i] = get_gsharedvt_type (shared_inst->type_argv [i]);
} else if (gsharedvt) {
type_argv [i] = get_gsharedvt_type (shared_inst->type_argv [i]);
} else {
return cfg;
}
-#ifdef MONO_ARCH_SOFT_FLOAT
- if (!COMPILE_LLVM (cfg))
+#ifdef MONO_ARCH_SOFT_FLOAT_FALLBACK
+ if (COMPILE_SOFT_FLOAT (cfg))
mono_decompose_soft_float (cfg);
#endif
if (!COMPILE_LLVM (cfg))
WrapperInfo *info = mono_marshal_get_wrapper_info (method);
g_assert (info);
- if (info->subtype == WRAPPER_SUBTYPE_SYNCHRONIZED_INNER)
+ if (info->subtype == WRAPPER_SUBTYPE_SYNCHRONIZED_INNER) {
+ MonoGenericContext *ctx = NULL;
+ if (method->is_inflated)
+ ctx = mono_method_get_context (method);
method = info->d.synchronized_inner.method;
+ if (ctx)
+ method = mono_class_inflate_generic_method (method, ctx);
+ }
}
info = lookup_method (target_domain, method);
static MonoObject*
mono_jit_runtime_invoke (MonoMethod *method, void *obj, void **params, MonoObject **exc)
{
- MonoMethod *invoke;
+ MonoMethod *invoke, *callee;
MonoObject *(*runtime_invoke) (MonoObject *this, void **params, MonoObject **exc, void* compiled_method);
MonoDomain *domain = mono_domain_get ();
MonoJitDomainInfo *domain_info;
info->vtable = mono_class_vtable_full (domain, method->klass, TRUE);
g_assert (info->vtable);
+ callee = method;
if (method->klass->rank && (method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) &&
(method->iflags & METHOD_IMPL_ATTRIBUTE_NATIVE)) {
/*
* Array Get/Set/Address methods. The JIT implements them using inline code
* inside the runtime invoke wrappers, so no need to compile them.
*/
- info->compiled_method = NULL;
- } else {
+ if (mono_aot_only) {
+ /*
+ * Call a wrapper, since the runtime invoke wrapper was not generated.
+ */
+ MonoMethod *wrapper;
+
+ wrapper = mono_marshal_get_array_accessor_wrapper (method);
+ invoke = mono_marshal_get_runtime_invoke (wrapper, FALSE);
+ callee = wrapper;
+ } else {
+ callee = NULL;
+ }
+ }
+
+ if (callee) {
MonoException *jit_ex = NULL;
- info->compiled_method = mono_jit_compile_method_with_opt (method, default_opt, &jit_ex);
+ info->compiled_method = mono_jit_compile_method_with_opt (callee, default_opt, &jit_ex);
if (!info->compiled_method) {
g_free (info);
g_assert (jit_ex);
}
}
- info->compiled_method = mini_add_method_trampoline (NULL, method, info->compiled_method, mono_method_needs_static_rgctx_invoke (method, FALSE), FALSE);
+ info->compiled_method = mini_add_method_trampoline (NULL, callee, info->compiled_method, mono_method_needs_static_rgctx_invoke (callee, FALSE), FALSE);
+ } else {
+ info->compiled_method = NULL;
}
/*
mono_code_manager_init ();
+ mono_hwcap_init ();
+
mono_arch_cpu_init ();
mono_arch_init ();
register_opcode_emulation (OP_IMUL_OVF_UN, "__emul_op_imul_ovf_un", "int32 int32 int32", mono_imul_ovf_un, "mono_imul_ovf_un", FALSE);
#endif
-#if defined(MONO_ARCH_EMULATE_MUL_DIV) || defined(MONO_ARCH_SOFT_FLOAT)
- register_opcode_emulation (OP_FDIV, "__emul_fdiv", "double double double", mono_fdiv, "mono_fdiv", FALSE);
+#if defined(MONO_ARCH_EMULATE_MUL_DIV) || defined(MONO_ARCH_SOFT_FLOAT_FALLBACK)
+ if (EMUL_MUL_DIV || mono_arch_is_soft_float ()) {
+ register_opcode_emulation (OP_FDIV, "__emul_fdiv", "double double double", mono_fdiv, "mono_fdiv", FALSE);
+ }
#endif
register_opcode_emulation (OP_FCONV_TO_U8, "__emul_fconv_to_u8", "ulong double", mono_fconv_u8, "mono_fconv_u8", FALSE);
#endif
#endif
-#ifdef MONO_ARCH_SOFT_FLOAT
- register_opcode_emulation (OP_FSUB, "__emul_fsub", "double double double", mono_fsub, "mono_fsub", FALSE);
- register_opcode_emulation (OP_FADD, "__emul_fadd", "double double double", mono_fadd, "mono_fadd", FALSE);
- register_opcode_emulation (OP_FMUL, "__emul_fmul", "double double double", mono_fmul, "mono_fmul", FALSE);
- register_opcode_emulation (OP_FNEG, "__emul_fneg", "double double", mono_fneg, "mono_fneg", FALSE);
- register_opcode_emulation (OP_ICONV_TO_R8, "__emul_iconv_to_r8", "double int32", mono_conv_to_r8, "mono_conv_to_r8", FALSE);
- register_opcode_emulation (OP_ICONV_TO_R4, "__emul_iconv_to_r4", "double int32", mono_conv_to_r4, "mono_conv_to_r4", FALSE);
- register_opcode_emulation (OP_FCONV_TO_R4, "__emul_fconv_to_r4", "double double", mono_fconv_r4, "mono_fconv_r4", FALSE);
- register_opcode_emulation (OP_FCONV_TO_I1, "__emul_fconv_to_i1", "int8 double", mono_fconv_i1, "mono_fconv_i1", FALSE);
- register_opcode_emulation (OP_FCONV_TO_I2, "__emul_fconv_to_i2", "int16 double", mono_fconv_i2, "mono_fconv_i2", FALSE);
- register_opcode_emulation (OP_FCONV_TO_I4, "__emul_fconv_to_i4", "int32 double", mono_fconv_i4, "mono_fconv_i4", FALSE);
- register_opcode_emulation (OP_FCONV_TO_U1, "__emul_fconv_to_u1", "uint8 double", mono_fconv_u1, "mono_fconv_u1", FALSE);
- register_opcode_emulation (OP_FCONV_TO_U2, "__emul_fconv_to_u2", "uint16 double", mono_fconv_u2, "mono_fconv_u2", FALSE);
+#ifdef MONO_ARCH_SOFT_FLOAT_FALLBACK
+ if (mono_arch_is_soft_float ()) {
+ register_opcode_emulation (OP_FSUB, "__emul_fsub", "double double double", mono_fsub, "mono_fsub", FALSE);
+ register_opcode_emulation (OP_FADD, "__emul_fadd", "double double double", mono_fadd, "mono_fadd", FALSE);
+ register_opcode_emulation (OP_FMUL, "__emul_fmul", "double double double", mono_fmul, "mono_fmul", FALSE);
+ register_opcode_emulation (OP_FNEG, "__emul_fneg", "double double", mono_fneg, "mono_fneg", FALSE);
+ register_opcode_emulation (OP_ICONV_TO_R8, "__emul_iconv_to_r8", "double int32", mono_conv_to_r8, "mono_conv_to_r8", FALSE);
+ register_opcode_emulation (OP_ICONV_TO_R4, "__emul_iconv_to_r4", "double int32", mono_conv_to_r4, "mono_conv_to_r4", FALSE);
+ register_opcode_emulation (OP_FCONV_TO_R4, "__emul_fconv_to_r4", "double double", mono_fconv_r4, "mono_fconv_r4", FALSE);
+ register_opcode_emulation (OP_FCONV_TO_I1, "__emul_fconv_to_i1", "int8 double", mono_fconv_i1, "mono_fconv_i1", FALSE);
+ register_opcode_emulation (OP_FCONV_TO_I2, "__emul_fconv_to_i2", "int16 double", mono_fconv_i2, "mono_fconv_i2", FALSE);
+ register_opcode_emulation (OP_FCONV_TO_I4, "__emul_fconv_to_i4", "int32 double", mono_fconv_i4, "mono_fconv_i4", FALSE);
+ register_opcode_emulation (OP_FCONV_TO_U1, "__emul_fconv_to_u1", "uint8 double", mono_fconv_u1, "mono_fconv_u1", FALSE);
+ register_opcode_emulation (OP_FCONV_TO_U2, "__emul_fconv_to_u2", "uint16 double", mono_fconv_u2, "mono_fconv_u2", FALSE);
+
#if SIZEOF_VOID_P == 4
- register_opcode_emulation (OP_FCONV_TO_I, "__emul_fconv_to_i", "int32 double", mono_fconv_i4, "mono_fconv_i4", FALSE);
+ register_opcode_emulation (OP_FCONV_TO_I, "__emul_fconv_to_i", "int32 double", mono_fconv_i4, "mono_fconv_i4", FALSE);
#endif
- register_opcode_emulation (OP_FBEQ, "__emul_fcmp_eq", "uint32 double double", mono_fcmp_eq, "mono_fcmp_eq", FALSE);
- register_opcode_emulation (OP_FBLT, "__emul_fcmp_lt", "uint32 double double", mono_fcmp_lt, "mono_fcmp_lt", FALSE);
- register_opcode_emulation (OP_FBGT, "__emul_fcmp_gt", "uint32 double double", mono_fcmp_gt, "mono_fcmp_gt", FALSE);
- register_opcode_emulation (OP_FBLE, "__emul_fcmp_le", "uint32 double double", mono_fcmp_le, "mono_fcmp_le", FALSE);
- register_opcode_emulation (OP_FBGE, "__emul_fcmp_ge", "uint32 double double", mono_fcmp_ge, "mono_fcmp_ge", FALSE);
- register_opcode_emulation (OP_FBNE_UN, "__emul_fcmp_ne_un", "uint32 double double", mono_fcmp_ne_un, "mono_fcmp_ne_un", FALSE);
- register_opcode_emulation (OP_FBLT_UN, "__emul_fcmp_lt_un", "uint32 double double", mono_fcmp_lt_un, "mono_fcmp_lt_un", FALSE);
- register_opcode_emulation (OP_FBGT_UN, "__emul_fcmp_gt_un", "uint32 double double", mono_fcmp_gt_un, "mono_fcmp_gt_un", FALSE);
- register_opcode_emulation (OP_FBLE_UN, "__emul_fcmp_le_un", "uint32 double double", mono_fcmp_le_un, "mono_fcmp_le_un", FALSE);
- register_opcode_emulation (OP_FBGE_UN, "__emul_fcmp_ge_un", "uint32 double double", mono_fcmp_ge_un, "mono_fcmp_ge_un", FALSE);
+ register_opcode_emulation (OP_FBEQ, "__emul_fcmp_eq", "uint32 double double", mono_fcmp_eq, "mono_fcmp_eq", FALSE);
+ register_opcode_emulation (OP_FBLT, "__emul_fcmp_lt", "uint32 double double", mono_fcmp_lt, "mono_fcmp_lt", FALSE);
+ register_opcode_emulation (OP_FBGT, "__emul_fcmp_gt", "uint32 double double", mono_fcmp_gt, "mono_fcmp_gt", FALSE);
+ register_opcode_emulation (OP_FBLE, "__emul_fcmp_le", "uint32 double double", mono_fcmp_le, "mono_fcmp_le", FALSE);
+ register_opcode_emulation (OP_FBGE, "__emul_fcmp_ge", "uint32 double double", mono_fcmp_ge, "mono_fcmp_ge", FALSE);
+ register_opcode_emulation (OP_FBNE_UN, "__emul_fcmp_ne_un", "uint32 double double", mono_fcmp_ne_un, "mono_fcmp_ne_un", FALSE);
+ register_opcode_emulation (OP_FBLT_UN, "__emul_fcmp_lt_un", "uint32 double double", mono_fcmp_lt_un, "mono_fcmp_lt_un", FALSE);
+ register_opcode_emulation (OP_FBGT_UN, "__emul_fcmp_gt_un", "uint32 double double", mono_fcmp_gt_un, "mono_fcmp_gt_un", FALSE);
+ register_opcode_emulation (OP_FBLE_UN, "__emul_fcmp_le_un", "uint32 double double", mono_fcmp_le_un, "mono_fcmp_le_un", FALSE);
+ register_opcode_emulation (OP_FBGE_UN, "__emul_fcmp_ge_un", "uint32 double double", mono_fcmp_ge_un, "mono_fcmp_ge_un", FALSE);
- register_opcode_emulation (OP_FCEQ, "__emul_fcmp_ceq", "uint32 double double", mono_fceq, "mono_fceq", FALSE);
- register_opcode_emulation (OP_FCGT, "__emul_fcmp_cgt", "uint32 double double", mono_fcgt, "mono_fcgt", FALSE);
- register_opcode_emulation (OP_FCGT_UN, "__emul_fcmp_cgt_un", "uint32 double double", mono_fcgt_un, "mono_fcgt_un", FALSE);
- register_opcode_emulation (OP_FCLT, "__emul_fcmp_clt", "uint32 double double", mono_fclt, "mono_fclt", FALSE);
- register_opcode_emulation (OP_FCLT_UN, "__emul_fcmp_clt_un", "uint32 double double", mono_fclt_un, "mono_fclt_un", FALSE);
+ register_opcode_emulation (OP_FCEQ, "__emul_fcmp_ceq", "uint32 double double", mono_fceq, "mono_fceq", FALSE);
+ register_opcode_emulation (OP_FCGT, "__emul_fcmp_cgt", "uint32 double double", mono_fcgt, "mono_fcgt", FALSE);
+ register_opcode_emulation (OP_FCGT_UN, "__emul_fcmp_cgt_un", "uint32 double double", mono_fcgt_un, "mono_fcgt_un", FALSE);
+ register_opcode_emulation (OP_FCLT, "__emul_fcmp_clt", "uint32 double double", mono_fclt, "mono_fclt", FALSE);
+ register_opcode_emulation (OP_FCLT_UN, "__emul_fcmp_clt_un", "uint32 double double", mono_fclt_un, "mono_fclt_un", FALSE);
- register_icall (mono_fload_r4, "mono_fload_r4", "double ptr", FALSE);
- register_icall (mono_fstore_r4, "mono_fstore_r4", "void double ptr", FALSE);
- register_icall (mono_fload_r4_arg, "mono_fload_r4_arg", "uint32 double", FALSE);
- register_icall (mono_isfinite, "mono_isfinite", "uint32 double", FALSE);
+ register_icall (mono_fload_r4, "mono_fload_r4", "double ptr", FALSE);
+ register_icall (mono_fstore_r4, "mono_fstore_r4", "void double ptr", FALSE);
+ register_icall (mono_fload_r4_arg, "mono_fload_r4_arg", "uint32 double", FALSE);
+ register_icall (mono_isfinite, "mono_isfinite", "uint32 double", FALSE);
+ }
#endif
#ifdef COMPRESSED_INTERFACE_BITMAP
register_icall (mono_helper_ldstr_mscorlib, "mono_helper_ldstr_mscorlib", "object int", FALSE);
register_icall (mono_helper_newobj_mscorlib, "mono_helper_newobj_mscorlib", "object int", FALSE);
register_icall (mono_value_copy, "mono_value_copy", "void ptr ptr ptr", FALSE);
- register_icall (mono_object_castclass, "mono_object_castclass", "object object ptr", FALSE);
+ register_icall (mono_object_castclass_unbox, "mono_object_castclass_unbox", "object object ptr", FALSE);
register_icall (mono_break, "mono_break", NULL, TRUE);
register_icall (mono_create_corlib_exception_0, "mono_create_corlib_exception_0", "object int", TRUE);
register_icall (mono_create_corlib_exception_1, "mono_create_corlib_exception_1", "object int object", TRUE);
register_icall (mono_array_new_4, "mono_array_new_4", "object ptr int int int int", FALSE);
register_icall (mono_get_native_calli_wrapper, "mono_get_native_calli_wrapper", "ptr ptr ptr ptr", FALSE);
register_icall (mono_resume_unwind, "mono_resume_unwind", "void", TRUE);
- register_icall (mono_object_tostring_gsharedvt, "mono_object_tostring_gsharedvt", "object ptr ptr ptr", TRUE);
- register_icall (mono_object_gethashcode_gsharedvt, "mono_object_gethashcode_gsharedvt", "int ptr ptr ptr", TRUE);
- register_icall (mono_object_equals_gsharedvt, "mono_object_equals_gsharedvt", "int ptr ptr ptr object", TRUE);
+ register_icall (mono_gsharedvt_constrained_call, "mono_gsharedvt_constrained_call", "object ptr ptr ptr ptr", TRUE);
register_icall (mono_gsharedvt_value_copy, "mono_gsharedvt_value_copy", "void ptr ptr ptr", TRUE);
register_icall (mono_gc_wbarrier_value_copy_bitmap, "mono_gc_wbarrier_value_copy_bitmap", "void ptr ptr int int", FALSE);
mono_runtime_cleanup_handlers ();
+#ifndef MONO_CROSS_COMPILE
mono_domain_free (domain, TRUE);
+#endif
mono_debugger_cleanup ();
#define LLVM_ENABLED FALSE
#endif
-#ifdef MONO_ARCH_SOFT_FLOAT
-#define COMPILE_SOFT_FLOAT(cfg) (!COMPILE_LLVM ((cfg)))
+#ifdef MONO_ARCH_SOFT_FLOAT_FALLBACK
+#define COMPILE_SOFT_FLOAT(cfg) (!COMPILE_LLVM ((cfg)) && mono_arch_is_soft_float ())
#else
-#define COMPILE_SOFT_FLOAT(cfg) 0
+#define COMPILE_SOFT_FLOAT(cfg) (0)
#endif
#ifdef ENABLE_LLVM
#endif
/* Version number of the AOT file format */
-#define MONO_AOT_FILE_VERSION 90
+#define MONO_AOT_FILE_VERSION 92
//TODO: This is x86/amd64 specific.
#define mono_simd_shuffle_mask(a,b,c,d) ((a) | ((b) << 2) | ((c) << 4) | ((d) << 6))
guint32 num_rgctx_fetch_trampolines;
/* These are used for sanity checking object layout problems when cross-compiling */
- guint32 double_align, long_align;
+ guint32 double_align, long_align, generic_tramp_num;
} MonoAotFileInfo;
/* Per-domain information maintained by the JIT */
MONO_TRAMPOLINE_AOT_PLT,
MONO_TRAMPOLINE_DELEGATE,
MONO_TRAMPOLINE_RESTORE_STACK_PROT,
-#ifndef DISABLE_REMOTING
MONO_TRAMPOLINE_GENERIC_VIRTUAL_REMOTING,
-#endif
MONO_TRAMPOLINE_MONITOR_ENTER,
MONO_TRAMPOLINE_MONITOR_EXIT,
MONO_TRAMPOLINE_VCALL,
-#ifdef MONO_ARCH_HAVE_HANDLER_BLOCK_GUARD
MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD,
-#endif
MONO_TRAMPOLINE_NUM
} MonoTrampolineType;
gpointer mono_arch_get_gsharedvt_call_info (gpointer addr, MonoMethodSignature *normal_sig, MonoMethodSignature *gsharedvt_sig, MonoGenericSharingContext *gsctx, gboolean gsharedvt_in, gint32 vcall_offset, gboolean calli) MONO_INTERNAL;
gboolean mono_arch_opcode_needs_emulation (MonoCompile *cfg, int opcode) MONO_INTERNAL;
+#ifdef MONO_ARCH_SOFT_FLOAT_FALLBACK
+gboolean mono_arch_is_soft_float (void) MONO_INTERNAL;
+#else
+static inline MONO_ALWAYS_INLINE gboolean
+mono_arch_is_soft_float (void)
+{
+ return FALSE;
+}
+#endif
+
/* Soft Debug support */
#ifdef MONO_ARCH_SOFT_DEBUG_SUPPORTED
void mono_arch_set_breakpoint (MonoJitInfo *ji, guint8 *ip) MONO_INTERNAL;
public static int test_0_llvm_inline_throw () {
try {
empty ();
- } catch (Exception ex) {
+ } catch (Exception) {
do_throw ();
}
#include "mini.h"
#include "ir-emit.h"
+#include "mono/utils/bsearch.h"
/*
General notes on SIMD intrinsics
static MonoInst*
emit_intrinsics (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **args, const SimdIntrinsc *intrinsics, guint32 size)
{
- const SimdIntrinsc * result = bsearch (cmethod->name, intrinsics, size, sizeof (SimdIntrinsc), &simd_intrinsic_compare_by_name);
+ const SimdIntrinsc * result = mono_binary_search (cmethod->name, intrinsics, size, sizeof (SimdIntrinsc), &simd_intrinsic_compare_by_name);
if (!result) {
DEBUG (printf ("function doesn't have a simd intrinsic %s::%s/%d\n", cmethod->klass->name, cmethod->name, fsig->param_count));
return NULL;
case MONO_TYPE_R4:
case MONO_TYPE_R8: {
double f = va_arg (ap, double);
- printf ("FP=%f\n", f);
+ printf ("FP=%f", f);
break;
}
case MONO_TYPE_VALUETYPE:
#if defined(__native_client_codegen__) && defined(__native_client__)
#include <malloc.h>
-#include <sys/nacl_syscalls.h>
+#include <nacl/nacl_dyncode.h>
#endif
#define IS_REX(inst) (((inst) >= 0x40) && ((inst) <= 0x4f))
guchar*
mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInfo **info, gboolean aot)
{
+ char *tramp_name;
guint8 *buf, *code, *tramp, *br [2], *r11_save_code, *after_r11_save_code;
int i, lmf_offset, offset, res_offset, arg_offset, rax_offset, tramp_offset, saved_regs_offset;
int saved_fpregs_offset, rbp_offset, framesize, orig_rsp_to_rbp_offset, cfa_offset;
nullified_class_init_trampoline = mono_arch_get_nullified_class_init_trampoline (NULL);
}
- if (info)
- *info = mono_tramp_info_create (mono_get_generic_trampoline_name (tramp_type), buf, code - buf, ji, unwind_ops);
+ if (info) {
+ tramp_name = mono_get_generic_trampoline_name (tramp_type);
+ *info = mono_tramp_info_create (tramp_name, buf, code - buf, ji, unwind_ops);
+ g_free (tramp_name);
+ }
return buf;
}
guchar*
mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInfo **info, gboolean aot)
{
+ char *tramp_name;
guint8 *buf, *code = NULL;
#ifdef USE_JUMP_TABLES
gpointer *load_get_lmf_addr = NULL, *load_trampoline = NULL;
/* Initialize the nullified class init trampoline used in the AOT case */
nullified_class_init_trampoline = mono_arch_get_nullified_class_init_trampoline (NULL);
- if (info)
- *info = mono_tramp_info_create (mono_get_generic_trampoline_name (tramp_type), buf, code - buf, ji, unwind_ops);
+ if (info) {
+ tramp_name = mono_get_generic_trampoline_name (tramp_type);
+ *info = mono_tramp_info_create (tramp_name, buf, code - buf, ji, unwind_ops);
+ g_free (tramp_name);
+ }
return buf;
}
guchar*
mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInfo **info, gboolean aot)
{
+ char *tramp_name;
guint8 *buf, *tramp, *code = NULL;
int i, lmf;
GSList *unwind_ops = NULL;
/* Initialize the nullified class init trampoline used in the AOT case */
nullified_class_init_trampoline = mono_arch_get_nullified_class_init_trampoline (NULL);
- if (info)
- *info = mono_tramp_info_create (mono_get_generic_trampoline_name (tramp_type), buf, code - buf, ji, unwind_ops);
+ if (info) {
+ tramp_name = mono_get_generic_trampoline_name (tramp_type);
+ *info = mono_tramp_info_create (tramp_name, buf, code - buf, ji, unwind_ops);
+ g_free (tramp_name);
+ }
return buf;
}
guchar*
mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInfo **info, gboolean aot)
{
-
+ char *tramp_name;
guint8 *buf, *code = NULL;
int i, offset;
gconstpointer tramp_handler;
nullified_class_init_trampoline = mono_ppc_create_ftnptr (mono_arch_get_nullified_class_init_trampoline (NULL));
}
- if (info)
- *info = mono_tramp_info_create (mono_get_generic_trampoline_name (tramp_type), buf, code - buf, ji, unwind_ops);
+ if (info) {
+ tramp_name = mono_get_generic_trampoline_name (tramp_type);
+ *info = mono_tramp_info_create (tramp_name, buf, code - buf, ji, unwind_ops);
+ g_free (tramp_name);
+ }
return buf;
}
guchar*
mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInfo **info, gboolean aot)
{
+ char *tramp_name;
guint8 *buf, *tramp, *code;
int i, offset, lmfOffset;
GSList *unwind_ops = NULL;
/* Flush instruction cache, since we've generated code */
mono_arch_flush_icache (code, buf - code);
- if (info)
- *info = mono_tramp_info_create (mono_get_generic_trampoline_name(tramp_type),
- buf, buf - code, ji, unwind_ops);
+ if (info) {
+ tramp_name = mono_get_generic_trampoline_name (tramp_type);
+ *info = mono_tramp_info_create (tramp_name, buf, buf - code, ji, unwind_ops);
+ g_free (tramp_name);
+ }
/* Sanity check */
g_assert ((buf - code) <= 512);
guchar*
mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInfo **info, gboolean aot)
{
+ char *tramp_name;
guint8 *buf, *code, *tramp;
int pushed_args, pushed_args_caller_saved;
GSList *unwind_ops = NULL;
nacl_global_codeman_validate (&buf, 256, &code);
g_assert ((code - buf) <= 256);
- if (info)
- *info = mono_tramp_info_create (mono_get_generic_trampoline_name (tramp_type), buf, code - buf, ji, unwind_ops);
+ if (info) {
+ tramp_name = mono_get_generic_trampoline_name (tramp_type);
+ *info = mono_tramp_info_create (tramp_name, buf, code - buf, ji, unwind_ops);
+ g_free (tramp_name);
+ }
if (tramp_type == MONO_TRAMPOLINE_CLASS_INIT) {
/* Initialize the nullified class init trampoline used in the AOT case */
/* GDB puts a breakpoint in this function. */
void MONO_NOINLINE __jit_debug_register_code(void);
-#if !defined(MONO_LLVM_LOADED) && defined(ENABLE_LLVM)
+#if !defined(MONO_LLVM_LOADED) && defined(ENABLE_LLVM) && !defined(MONO_CROSS_COMPILE)
/* LLVM already defines these */
PLATFORM_DISABLED_TESTS=filter-stack.exe monitor.exe
endif
-if S390x
+if S390X
PLATFORM_DISABLED_TESTS=dynamic-method-resurrection.exe
#PLATFORM_DISABLED_TESTS=dynamic-method-resurrection.exe exception17.exe
endif
if ARM
test-sgen : sgen-tests
else
-if S390x
+if S390X
test-sgen : sgen-regular-tests
endif
endif
endif
endif
-test: assemblyresolve/test/asm.dll testjit test-generic-sharing test-type-load test_platform test_2_1 test-process-exit test-sgen test-messages rm-empty-logs
+test: assemblyresolve/test/asm.dll testjit test-generic-sharing test-type-load test_platform test_2_1 test-process-exit test-messages rm-empty-logs
test-wrench: assemblyresolve/test/asm.dll testjit-wrench test-generic-sharing test-type-load test_platform test_2_1 test-process-exit test-sgen test-messages rm-empty-logs
# Remove empty .stdout and .stderr files for wrench
@echo "Testing load-exception.exe..."
@$(RUNTIME) load-exceptions.exe > load-exceptions.exe.stdout 2> load-exceptions.exe.stderr
+EXTRA_DIST += debug-casts.cs
+# This depends on TLS, so its not ran by default
+debug-casts:
+ @$(MCS) -r:TestDriver.dll $(srcdir)/debug-casts.cs
+ @$(RUNTIME) --debug=casts debug-casts.exe
EXTRA_DIST += sgen-bridge.cs sgen-descriptors.cs sgen-gshared-vtype.cs sgen-bridge-major-fragmentation.cs sgen-domain-unload.cs sgen-weakref-stress.cs sgen-cementing-stress.cs sgen-case-23400.cs finalizer-wait.cs critical-finalizers.cs sgen-domain-unload-2.cs sgen-suspend.cs
--- /dev/null
+using System;
+using System.Collections.Generic;
+
+public class Tests
+{
+ public static int Main (string[] args) {
+ return TestDriver.RunTests (typeof (Tests), args);
+ }
+
+ public static int test_0_simple () {
+ object o = new object ();
+ try {
+ string s = (string)o;
+ return 1;
+ } catch (InvalidCastException ex) {
+ if (!ex.Message.Contains ("System.Object") || !ex.Message.Contains ("System.String"))
+ return 2;
+ }
+ return 0;
+ }
+
+ public static int test_0_complex_1 () {
+ object o = new object ();
+ try {
+ IEnumerable<object> ie = (IEnumerable<object>)o;
+ return 1;
+ } catch (InvalidCastException ex) {
+ if (!ex.Message.Contains ("System.Object") || !ex.Message.Contains ("System.Collections.Generic.IEnumerable`1[System.Object]"))
+ return 2;
+ }
+ return 0;
+ }
+}
* We allocate the exception object deep down the stack so
* that it doesn't get pinned.
*/
- public static void MakeException (int depth) {
+ public static unsafe void MakeException (int depth) {
+ // Avoid tail calls
+ int* values = stackalloc int [20];
if (depth <= 0) {
new FinalizerException ();
return;
Environment.Exit (0);
};
- MakeException (100);
+ MakeException (1024);
GC.Collect ();
GC.WaitForPendingFinalizers ();
[MarshalAs (UnmanagedType.ByValTStr, SizeConst=4)] public string s1;
public int i;
}
+
+ [StructLayout (LayoutKind.Sequential, Pack=1)]
+ public struct PackStruct1 {
+ float f;
+ }
+
+ [StructLayout (LayoutKind.Sequential)]
+ public struct PackStruct2 {
+ byte b;
+ PackStruct1 s;
+ }
public unsafe static int Main (String[] args) {
if (TestDriver.RunTests (typeof (Tests), args) != 0)
return 3;
return 0;
}
+
+ // Check that the 'Pack' directive on a struct changes the min alignment of the struct as well (#12110)
+ public static int test_0_struct_pack () {
+ if (Marshal.OffsetOf (typeof (PackStruct2), "s") != new IntPtr (1))
+ return 1;
+ return 0;
+ }
}
var res = typeof (Tests).GetMethod ("pack_i1").Invoke (null, new object [] { (sbyte)-0x40 });
return (bool)res ? 0 : 1;
}
+
+ struct Point {
+ public int x, y;
+ }
+
+ struct Foo2 {
+ public Point Location {
+ get {
+ return new Point () { x = 10, y = 20 };
+ }
+ }
+ }
+
+ public static int test_0_vtype_method_vtype_ret () {
+ var f = new Foo2 ();
+ var p = (Point)typeof (Foo2).GetMethod ("get_Location").Invoke (f, null);
+ if (p.x != 10 || p.y != 20)
+ return 1;
+ return 0;
+ }
+
+ public static int test_0_array_get_set () {
+ int[,,] arr = new int [10, 10, 10];
+ arr [0, 1, 2] = 42;
+ var gm = arr.GetType ().GetMethod ("Get");
+ int i = (int) gm.Invoke (arr, new object [] { 0, 1, 2 });
+ if (i != 42)
+ return 1;
+ var sm = arr.GetType ().GetMethod ("Set");
+ sm.Invoke (arr, new object [] { 0, 1, 2, 33 });
+ if (arr [0, 1, 2] != 33)
+ return 2;
+ return 0;
+ }
}
linux_magic.h \
mono-memory-model.h \
atomic.h \
- atomic.c
+ atomic.c \
+ mono-hwcap.h \
+ mono-hwcap.c \
+ bsearch.h \
+ bsearch.c
arch_sources =
endif
+if X86
+arch_sources += mono-hwcap-x86.c mono-hwcap-x86.h
+endif
+
+if AMD64
+arch_sources += mono-hwcap-x86.c mono-hwcap-x86.h
+endif
+
+if ARM
+arch_sources += mono-hwcap-arm.c mono-hwcap-arm.h
+endif
+
+if MIPS
+arch_sources += mono-hwcap-mips.c mono-hwcap-mips.h
+endif
+
+if POWERPC
+arch_sources += mono-hwcap-ppc.c mono-hwcap-ppc.h
+endif
+
+if POWERPC64
+arch_sources += mono-hwcap-ppc.c mono-hwcap-ppc.h
+endif
+
+if SPARC
+arch_sources += mono-hwcap-sparc.c mono-hwcap-sparc.h
+endif
+
+if SPARC64
+arch_sources += mono-hwcap-sparc.c mono-hwcap-sparc.h
+endif
+
+if IA64
+arch_sources += mono-hwcap-ia64.c mono-hwcap-ia64.h
+endif
+
+if S390X
+arch_sources += mono-hwcap-s390x.c mono-hwcap-s390x.h
+endif
+
libmonoutils_la_SOURCES = $(monoutils_sources) $(arch_sources)
libmonoutilsincludedir = $(includedir)/mono-$(API_VER)/mono/utils
#include <config.h>
#include <glib.h>
-#include <pthread.h>
#include <mono/utils/atomic.h>
#ifdef WAPI_NO_ATOMIC_ASM
+#include <pthread.h>
+
static pthread_mutex_t spin = PTHREAD_MUTEX_INITIALIZER;
static mono_once_t spin_once=MONO_ONCE_INIT;
#endif
+#include "config.h"
#include <glib.h>
+/* On Windows, we always use the functions provided by the Windows API. */
#if defined(__WIN32__) || defined(_WIN32)
#include <windows.h>
-#elif defined(__NetBSD__) && defined(HAVE_ATOMIC_OPS)
+/* Prefer GCC atomic ops if the target supports it (see configure.in). */
+#elif defined(USE_GCC_ATOMIC_OPS)
static inline gint32 InterlockedCompareExchange(volatile gint32 *dest,
- gint32 exch, gint32 comp)
+ gint32 exch, gint32 comp)
{
- return atomic_cas_32((uint32_t*)dest, comp, exch);
+ return __sync_val_compare_and_swap (dest, comp, exch);
}
static inline gpointer InterlockedCompareExchangePointer(volatile gpointer *dest, gpointer exch, gpointer comp)
{
- return atomic_cas_ptr(dest, comp, exch);
+ return __sync_val_compare_and_swap (dest, comp, exch);
}
static inline gint32 InterlockedIncrement(volatile gint32 *val)
{
- return atomic_inc_32_nv((uint32_t*)val);
+ return __sync_add_and_fetch (val, 1);
}
static inline gint32 InterlockedDecrement(volatile gint32 *val)
{
- return atomic_dec_32_nv((uint32_t*)val);
+ return __sync_add_and_fetch (val, -1);
}
static inline gint32 InterlockedExchange(volatile gint32 *val, gint32 new_val)
{
- return atomic_swap_32((uint32_t*)val, new_val);
+ gint32 old_val;
+ do {
+ old_val = *val;
+ } while (__sync_val_compare_and_swap (val, old_val, new_val) != old_val);
+ return old_val;
}
static inline gpointer InterlockedExchangePointer(volatile gpointer *val,
- gpointer new_val)
+ gpointer new_val)
{
- return atomic_swap_ptr(val, new_val);
+ gpointer old_val;
+ do {
+ old_val = *val;
+ } while (__sync_val_compare_and_swap (val, old_val, new_val) != old_val);
+ return old_val;
}
static inline gint32 InterlockedExchangeAdd(volatile gint32 *val, gint32 add)
{
- return atomic_add_32_nv((uint32_t*)val, add) - add;
+ return __sync_fetch_and_add (val, add);
}
-#elif defined(__i386__) || defined(__x86_64__)
-
-/*
- * NB: The *Pointer() functions here assume that
- * sizeof(pointer)==sizeof(gint32)
- *
- * NB2: These asm functions assume 486+ (some of the opcodes dont
- * exist on 386). If this becomes an issue, we can get configure to
- * fall back to the non-atomic C versions of these calls.
- */
+#elif defined(__NetBSD__) && defined(HAVE_ATOMIC_OPS)
static inline gint32 InterlockedCompareExchange(volatile gint32 *dest,
- gint32 exch, gint32 comp)
+ gint32 exch, gint32 comp)
{
- gint32 old;
-
- __asm__ __volatile__ ("lock; cmpxchgl %2, %0"
- : "=m" (*dest), "=a" (old)
- : "r" (exch), "m" (*dest), "a" (comp));
- return(old);
+ return atomic_cas_32((uint32_t*)dest, comp, exch);
}
static inline gpointer InterlockedCompareExchangePointer(volatile gpointer *dest, gpointer exch, gpointer comp)
{
- gpointer old;
-
- __asm__ __volatile__ ("lock; "
-#if defined(__x86_64__) && !defined(__native_client__)
- "cmpxchgq"
-#else
- "cmpxchgl"
-#endif
- " %2, %0"
- : "=m" (*dest), "=a" (old)
- : "r" (exch), "m" (*dest), "a" (comp));
-
- return(old);
+ return atomic_cas_ptr(dest, comp, exch);
}
static inline gint32 InterlockedIncrement(volatile gint32 *val)
{
- gint32 tmp;
-
- __asm__ __volatile__ ("lock; xaddl %0, %1"
- : "=r" (tmp), "=m" (*val)
- : "0" (1), "m" (*val));
-
- return(tmp+1);
+ return atomic_inc_32_nv((uint32_t*)val);
}
static inline gint32 InterlockedDecrement(volatile gint32 *val)
{
- gint32 tmp;
-
- __asm__ __volatile__ ("lock; xaddl %0, %1"
- : "=r" (tmp), "=m" (*val)
- : "0" (-1), "m" (*val));
-
- return(tmp-1);
+ return atomic_dec_32_nv((uint32_t*)val);
}
-/*
- * See
- * http://msdn.microsoft.com/msdnmag/issues/0700/Win32/
- * for the reasons for using cmpxchg and a loop here.
- */
static inline gint32 InterlockedExchange(volatile gint32 *val, gint32 new_val)
{
- gint32 ret;
-
- __asm__ __volatile__ ("1:; lock; cmpxchgl %2, %0; jne 1b"
- : "=m" (*val), "=a" (ret)
- : "r" (new_val), "m" (*val), "a" (*val));
- return(ret);
+ return atomic_swap_32((uint32_t*)val, new_val);
}
static inline gpointer InterlockedExchangePointer(volatile gpointer *val,
- gpointer new_val)
+ gpointer new_val)
{
- gpointer ret;
-
- __asm__ __volatile__ ("1:; lock; "
-#if defined(__x86_64__) && !defined(__native_client__)
- "cmpxchgq"
-#else
- "cmpxchgl"
-#endif
- " %2, %0; jne 1b"
- : "=m" (*val), "=a" (ret)
- : "r" (new_val), "m" (*val), "a" (*val));
-
- return(ret);
+ return atomic_swap_ptr(val, new_val);
}
static inline gint32 InterlockedExchangeAdd(volatile gint32 *val, gint32 add)
{
- gint32 ret;
-
- __asm__ __volatile__ ("lock; xaddl %0, %1"
- : "=r" (ret), "=m" (*val)
- : "0" (add), "m" (*val));
-
- return(ret);
+ return atomic_add_32_nv((uint32_t*)val, add) - add;
}
#elif (defined(sparc) || defined (__sparc__)) && defined(__GNUC__)
return(ret);
}
-#elif defined(__mono_ppc__)
-
-#ifdef G_COMPILER_CODEWARRIOR
-static inline gint32 InterlockedIncrement(volatile register gint32 *val)
-{
- gint32 result = 0, tmp;
- register gint32 result = 0;
- register gint32 tmp;
-
- asm
- {
- @1:
- lwarx tmp, 0, val
- addi result, tmp, 1
- stwcx. result, 0, val
- bne- @1
- }
-
- return result;
-}
-
-static inline gint32 InterlockedDecrement(register volatile gint32 *val)
-{
- register gint32 result = 0;
- register gint32 tmp;
-
- asm
- {
- @1:
- lwarx tmp, 0, val
- addi result, tmp, -1
- stwcx. result, 0, val
- bne- @1
- }
-
- return result;
-}
-#define InterlockedCompareExchangePointer(dest,exch,comp) (void*)InterlockedCompareExchange((volatile gint32 *)(dest), (gint32)(exch), (gint32)(comp))
-
-static inline gint32 InterlockedCompareExchange(volatile register gint32 *dest, register gint32 exch, register gint32 comp)
-{
- register gint32 tmp = 0;
-
- asm
- {
- @1:
- lwarx tmp, 0, dest
- cmpw tmp, comp
- bne- @2
- stwcx. exch, 0, dest
- bne- @1
- @2:
- }
-
- return tmp;
-}
-static inline gint32 InterlockedExchange(register volatile gint32 *dest, register gint32 exch)
-{
- register gint32 tmp = 0;
-
- asm
- {
- @1:
- lwarx tmp, 0, dest
- stwcx. exch, 0, dest
- bne- @1
- }
-
- return tmp;
-}
-#define InterlockedExchangePointer(dest,exch) (void*)InterlockedExchange((volatile gint32 *)(dest), (gint32)(exch))
-#else
-
-#if defined(__mono_ppc64__) && !defined(__mono_ilp32__)
-#define LDREGX "ldarx"
-#define STREGCXD "stdcx."
-#define CMPREG "cmpd"
-#else
-#define LDREGX "lwarx"
-#define STREGCXD "stwcx."
-#define CMPREG "cmpw"
-#endif
-
-static inline gint32 InterlockedIncrement(volatile gint32 *val)
-{
- gint32 result = 0, tmp;
-
- __asm__ __volatile__ ("\n1:\n\t"
- "lwarx %0, 0, %2\n\t"
- "addi %1, %0, 1\n\t"
- "stwcx. %1, 0, %2\n\t"
- "bne- 1b"
- : "=&b" (result), "=&b" (tmp): "r" (val): "cc", "memory");
- return result + 1;
-}
-
-static inline gint32 InterlockedDecrement(volatile gint32 *val)
-{
- gint32 result = 0, tmp;
-
- __asm__ __volatile__ ("\n1:\n\t"
- "lwarx %0, 0, %2\n\t"
- "addi %1, %0, -1\n\t"
- "stwcx. %1, 0, %2\n\t"
- "bne- 1b"
- : "=&b" (result), "=&b" (tmp): "r" (val): "cc", "memory");
- return result - 1;
-}
-
-static inline gpointer InterlockedCompareExchangePointer (volatile gpointer *dest,
- gpointer exch, gpointer comp)
-{
- gpointer tmp = NULL;
-
- __asm__ __volatile__ ("\n1:\n\t"
- LDREGX " %0, 0, %1\n\t"
- CMPREG " %0, %2\n\t"
- "bne- 2f\n\t"
- STREGCXD " %3, 0, %1\n\t"
- "bne- 1b\n"
- "2:"
- : "=&r" (tmp)
- : "b" (dest), "r" (comp), "r" (exch): "cc", "memory");
- return(tmp);
-}
-
-static inline gint32 InterlockedCompareExchange(volatile gint32 *dest,
- gint32 exch, gint32 comp) {
- gint32 tmp = 0;
-
- __asm__ __volatile__ ("\n1:\n\t"
- "lwarx %0, 0, %1\n\t"
- "cmpw %0, %2\n\t"
- "bne- 2f\n\t"
- "stwcx. %3, 0, %1\n\t"
- "bne- 1b\n"
- "2:"
- : "=&r" (tmp)
- : "b" (dest), "r" (comp), "r" (exch): "cc", "memory");
- return(tmp);
-}
-
-static inline gint32 InterlockedExchange(volatile gint32 *dest, gint32 exch)
-{
- gint32 tmp = 0;
-
- __asm__ __volatile__ ("\n1:\n\t"
- "lwarx %0, 0, %2\n\t"
- "stwcx. %3, 0, %2\n\t"
- "bne 1b"
- : "=r" (tmp) : "0" (tmp), "b" (dest), "r" (exch): "cc", "memory");
- return(tmp);
-}
-
-static inline gpointer InterlockedExchangePointer (volatile gpointer *dest, gpointer exch)
-{
- gpointer tmp = NULL;
-
- __asm__ __volatile__ ("\n1:\n\t"
- LDREGX " %0, 0, %2\n\t"
- STREGCXD " %3, 0, %2\n\t"
- "bne 1b"
- : "=r" (tmp) : "0" (tmp), "b" (dest), "r" (exch): "cc", "memory");
- return(tmp);
-}
-
-static inline gint32 InterlockedExchangeAdd(volatile gint32 *dest, gint32 add)
-{
- gint32 result, tmp;
- __asm__ __volatile__ ("\n1:\n\t"
- "lwarx %0, 0, %2\n\t"
- "add %1, %0, %3\n\t"
- "stwcx. %1, 0, %2\n\t"
- "bne 1b"
- : "=&r" (result), "=&r" (tmp)
- : "r" (dest), "r" (add) : "cc", "memory");
- return(result);
-}
-
-#undef LDREGX
-#undef STREGCXD
-#undef CMPREG
-
-#endif /* !G_COMPILER_CODEWARRIOR */
-
-#elif defined(__arm__)
-
-#ifdef __native_client__
-#define MASK_REGISTER(reg, cond) "bic" cond " " reg ", " reg ", #0xc0000000\n"
-#define NACL_ALIGN() ".align 4\n"
-#else
-#define MASK_REGISTER(reg, cond)
-#define NACL_ALIGN()
-#endif
-
-/*
- * Atomic operations on ARM doesn't contain memory barriers, and the runtime code
- * depends on this, so we add them explicitly.
- */
-
-static inline gint32 InterlockedCompareExchange(volatile gint32 *dest, gint32 exch, gint32 comp)
-{
-#if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7S__)
- gint32 ret, tmp;
- __asm__ __volatile__ ( "1:\n"
- NACL_ALIGN()
- "dmb\n"
- "mov %0, #0\n"
- NACL_ALIGN()
- MASK_REGISTER("%2", "al")
- "ldrex %1, [%2]\n"
- "teq %1, %3\n"
- "it eq\n"
- NACL_ALIGN()
- MASK_REGISTER("%2", "eq")
- "strexeq %0, %4, [%2]\n"
- "teq %0, #0\n"
- "bne 1b\n"
- "dmb\n"
- : "=&r" (tmp), "=&r" (ret)
- : "r" (dest), "r" (comp), "r" (exch)
- : "memory", "cc");
-
- return ret;
-#else
- gint32 a, b;
-
- __asm__ __volatile__ ( "0:\n\t"
- NACL_ALIGN()
- MASK_REGISTER("%2", "al")
- "ldr %1, [%2]\n\t"
- "cmp %1, %4\n\t"
- "mov %0, %1\n\t"
- "bne 1f\n\t"
- NACL_ALIGN()
- MASK_REGISTER("%2", "al")
- "swp %0, %3, [%2]\n\t"
- "cmp %0, %1\n\t"
- NACL_ALIGN()
- MASK_REGISTER("%2", "ne")
- "swpne %3, %0, [%2]\n\t"
- "bne 0b\n\t"
- "1:"
- : "=&r" (a), "=&r" (b)
- : "r" (dest), "r" (exch), "r" (comp)
- : "cc", "memory");
-
- return a;
-#endif
-}
-
-static inline gpointer InterlockedCompareExchangePointer(volatile gpointer *dest, gpointer exch, gpointer comp)
-{
-#if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7S__)
- gpointer ret, tmp;
- __asm__ __volatile__ (
- "dmb\n"
- "1:\n"
- NACL_ALIGN()
- "mov %0, #0\n"
- NACL_ALIGN()
- MASK_REGISTER("%2", "al")
- "ldrex %1, [%2]\n"
- "teq %1, %3\n"
- "it eq\n"
- NACL_ALIGN()
- MASK_REGISTER("%2", "eq")
- "strexeq %0, %4, [%2]\n"
- "teq %0, #0\n"
- "bne 1b\n"
- "dmb\n"
- : "=&r" (tmp), "=&r" (ret)
- : "r" (dest), "r" (comp), "r" (exch)
- : "memory", "cc");
-
- return ret;
-#else
- gpointer a, b;
-
- __asm__ __volatile__ ( "0:\n\t"
- NACL_ALIGN()
- MASK_REGISTER("%2", "al")
- "ldr %1, [%2]\n\t"
- "cmp %1, %4\n\t"
- "mov %0, %1\n\t"
- "bne 1f\n\t"
- NACL_ALIGN()
- MASK_REGISTER("%2", "eq")
- "swpeq %0, %3, [%2]\n\t"
- "cmp %0, %1\n\t"
- NACL_ALIGN()
- MASK_REGISTER("%2", "ne")
- "swpne %3, %0, [%2]\n\t"
- "bne 0b\n\t"
- "1:"
- : "=&r" (a), "=&r" (b)
- : "r" (dest), "r" (exch), "r" (comp)
- : "cc", "memory");
-
- return a;
-#endif
-}
-
-static inline gint32 InterlockedIncrement(volatile gint32 *dest)
-{
-#if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7S__)
- gint32 ret, flag;
- __asm__ __volatile__ (
- "dmb\n"
- "1:\n"
- NACL_ALIGN()
- MASK_REGISTER("%2", "al")
- "ldrex %0, [%2]\n"
- "add %0, %0, %3\n"
- NACL_ALIGN()
- MASK_REGISTER("%2", "al")
- "strex %1, %0, [%2]\n"
- "teq %1, #0\n"
- "bne 1b\n"
- "dmb\n"
- : "=&r" (ret), "=&r" (flag)
- : "r" (dest), "r" (1)
- : "memory", "cc");
-
- return ret;
-#else
- gint32 a, b, c;
-
- __asm__ __volatile__ ( "0:\n\t"
- NACL_ALIGN()
- MASK_REGISTER("%3", "al")
- "ldr %0, [%3]\n\t"
- "add %1, %0, %4\n\t"
- NACL_ALIGN()
- MASK_REGISTER("%3", "al")
- "swp %2, %1, [%3]\n\t"
- "cmp %0, %2\n\t"
- NACL_ALIGN()
- MASK_REGISTER("%3", "ne")
- "swpne %1, %2, [%3]\n\t"
- "bne 0b"
- : "=&r" (a), "=&r" (b), "=&r" (c)
- : "r" (dest), "r" (1)
- : "cc", "memory");
-
- return b;
-#endif
-}
-
-static inline gint32 InterlockedDecrement(volatile gint32 *dest)
-{
-#if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7S__)
- gint32 ret, flag;
- __asm__ __volatile__ (
- "dmb\n"
- "1:\n"
- NACL_ALIGN()
- MASK_REGISTER("%2", "al")
- "ldrex %0, [%2]\n"
- "sub %0, %0, %3\n"
- NACL_ALIGN()
- MASK_REGISTER("%2", "al")
- "strex %1, %0, [%2]\n"
- "teq %1, #0\n"
- "bne 1b\n"
- "dmb\n"
- : "=&r" (ret), "=&r" (flag)
- : "r" (dest), "r" (1)
- : "memory", "cc");
-
- return ret;
-#else
- gint32 a, b, c;
-
- __asm__ __volatile__ ( "0:\n\t"
- NACL_ALIGN()
- MASK_REGISTER("%3", "al")
- "ldr %0, [%3]\n\t"
- "add %1, %0, %4\n\t"
- NACL_ALIGN()
- MASK_REGISTER("%3", "al")
- "swp %2, %1, [%3]\n\t"
- "cmp %0, %2\n\t"
- NACL_ALIGN()
- MASK_REGISTER("%3", "ne")
- "swpne %1, %2, [%3]\n\t"
- "bne 0b"
- : "=&r" (a), "=&r" (b), "=&r" (c)
- : "r" (dest), "r" (-1)
- : "cc", "memory");
-
- return b;
-#endif
-}
-
-static inline gint32 InterlockedExchange(volatile gint32 *dest, gint32 exch)
-{
-#if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7S__)
- gint32 ret, flag;
- __asm__ __volatile__ (
- "dmb\n"
- "1:\n"
- NACL_ALIGN()
- MASK_REGISTER("%3", "al")
- "ldrex %0, [%3]\n"
- NACL_ALIGN()
- MASK_REGISTER("%3", "al")
- "strex %1, %2, [%3]\n"
- "teq %1, #0\n"
- "bne 1b\n"
- "dmb\n"
- : "=&r" (ret), "=&r" (flag)
- : "r" (exch), "r" (dest)
- : "memory", "cc");
- return ret;
-#else
- gint32 a;
-
- __asm__ __volatile__ ( NACL_ALIGN()
- MASK_REGISTER("%1", "al")
- "swp %0, %2, [%1]"
- : "=&r" (a)
- : "r" (dest), "r" (exch));
-
- return a;
-#endif
-}
-
-static inline gpointer InterlockedExchangePointer(volatile gpointer *dest, gpointer exch)
-{
-#if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7S__)
- gpointer ret, flag;
- __asm__ __volatile__ (
- "dmb\n"
- "1:\n"
- NACL_ALIGN()
- MASK_REGISTER("%3", "al")
- "ldrex %0, [%3]\n"
- NACL_ALIGN()
- MASK_REGISTER("%3", "al")
- "strex %1, %2, [%3]\n"
- "teq %1, #0\n"
- "bne 1b\n"
- "dmb\n"
- : "=&r" (ret), "=&r" (flag)
- : "r" (exch), "r" (dest)
- : "memory", "cc");
- return ret;
-#else
- gpointer a;
-
- __asm__ __volatile__ ( NACL_ALIGN()
- MASK_REGISTER("%1", "al")
- "swp %0, %2, [%1]"
- : "=&r" (a)
- : "r" (dest), "r" (exch));
-
- return a;
-#endif
-}
-
-static inline gint32 InterlockedExchangeAdd(volatile gint32 *dest, gint32 add)
-{
-#if defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7S__)
- gint32 ret, tmp, flag;
- __asm__ __volatile__ (
- "dmb\n"
- "1:\n"
- NACL_ALIGN()
- MASK_REGISTER("%3", "al")
- "ldrex %0, [%3]\n"
- "add %1, %0, %4\n"
- NACL_ALIGN()
- MASK_REGISTER("%3", "al")
- "strex %2, %1, [%3]\n"
- "teq %2, #0\n"
- "bne 1b\n"
- "dmb\n"
- : "=&r" (ret), "=&r" (tmp), "=&r" (flag)
- : "r" (dest), "r" (add)
- : "memory", "cc");
-
- return ret;
-#else
- int a, b, c;
-
- __asm__ __volatile__ ( "0:\n\t"
- NACL_ALIGN()
- MASK_REGISTER("%3", "al")
- "ldr %0, [%3]\n\t"
- "add %1, %0, %4\n\t"
- NACL_ALIGN()
- MASK_REGISTER("%3", "al")
- "swp %2, %1, [%3]\n\t"
- "cmp %0, %2\n\t"
- NACL_ALIGN()
- MASK_REGISTER("%3", "ne")
- "swpne %1, %2, [%3]\n\t"
- "bne 0b"
- : "=&r" (a), "=&r" (b), "=&r" (c)
- : "r" (dest), "r" (add)
- : "cc", "memory");
-
- return a;
-#endif
-}
-
-#undef NACL_ALIGN
-#undef MASK_REGISTER
-
#elif defined(__ia64__)
#ifdef __INTEL_COMPILER
#endif
}
-#elif defined(__mips__)
-
-#if SIZEOF_REGISTER == 8
-#error "Not implemented."
-#endif
-
-static inline gint32 InterlockedIncrement(volatile gint32 *val)
-{
- gint32 tmp, result = 0;
-
- __asm__ __volatile__ (" .set mips32\n"
- "1: ll %0, %2\n"
- " addu %1, %0, 1\n"
- " sc %1, %2\n"
- " beqz %1, 1b\n"
- " .set mips0\n"
- : "=&r" (result), "=&r" (tmp), "=m" (*val)
- : "m" (*val));
- return result + 1;
-}
-
-static inline gint32 InterlockedDecrement(volatile gint32 *val)
-{
- gint32 tmp, result = 0;
-
- __asm__ __volatile__ (" .set mips32\n"
- "1: ll %0, %2\n"
- " subu %1, %0, 1\n"
- " sc %1, %2\n"
- " beqz %1, 1b\n"
- " .set mips0\n"
- : "=&r" (result), "=&r" (tmp), "=m" (*val)
- : "m" (*val));
- return result - 1;
-}
-
-static inline gint32 InterlockedCompareExchange(volatile gint32 *dest,
- gint32 exch, gint32 comp) {
- gint32 old, tmp;
-
- __asm__ __volatile__ (" .set mips32\n"
- "1: ll %0, %2\n"
- " bne %0, %5, 2f\n"
- " move %1, %4\n"
- " sc %1, %2\n"
- " beqz %1, 1b\n"
- "2: .set mips0\n"
- : "=&r" (old), "=&r" (tmp), "=m" (*dest)
- : "m" (*dest), "r" (exch), "r" (comp));
- return(old);
-}
-
-static inline gpointer InterlockedCompareExchangePointer(volatile gpointer *dest, gpointer exch, gpointer comp)
-{
- return (gpointer)(InterlockedCompareExchange((volatile gint32 *)(dest), (gint32)(exch), (gint32)(comp)));
-}
-
-static inline gint32 InterlockedExchange(volatile gint32 *dest, gint32 exch)
-{
- gint32 result, tmp;
-
- __asm__ __volatile__ (" .set mips32\n"
- "1: ll %0, %2\n"
- " move %1, %4\n"
- " sc %1, %2\n"
- " beqz %1, 1b\n"
- " .set mips0\n"
- : "=&r" (result), "=&r" (tmp), "=m" (*dest)
- : "m" (*dest), "r" (exch));
- return(result);
-}
-
-static inline gpointer InterlockedExchangePointer(volatile gpointer *dest, gpointer exch)
-{
- return (gpointer)InterlockedExchange((volatile gint32 *)(dest), (gint32)(exch));
-}
-
-static inline gint32 InterlockedExchangeAdd(volatile gint32 *dest, gint32 add)
-{
- gint32 result, tmp;
-
- __asm__ __volatile__ (" .set mips32\n"
- "1: ll %0, %2\n"
- " addu %1, %0, %4\n"
- " sc %1, %2\n"
- " beqz %1, 1b\n"
- " .set mips0\n"
- : "=&r" (result), "=&r" (tmp), "=m" (*dest)
- : "m" (*dest), "r" (add));
- return result;
-}
-
#else
#define WAPI_NO_ATOMIC_ASM
#endif
-/* Not yet used */
-#ifdef USE_GCC_ATOMIC_OPS
-
-static inline gint32 InterlockedCompareExchange(volatile gint32 *dest,
- gint32 exch, gint32 comp)
-{
- return __sync_val_compare_and_swap (dest, comp, exch);
-}
-
-static inline gpointer InterlockedCompareExchangePointer(volatile gpointer *dest, gpointer exch, gpointer comp)
-{
- return __sync_val_compare_and_swap (dest, comp, exch);
-}
-
-static inline gint32 InterlockedIncrement(volatile gint32 *val)
-{
- return __sync_add_and_fetch (val, 1);
-}
-
-static inline gint32 InterlockedDecrement(volatile gint32 *val)
-{
- return __sync_add_and_fetch (val, -1);
-}
-
-static inline gint32 InterlockedExchange(volatile gint32 *val, gint32 new_val)
-{
- gint32 old_val;
- do {
- old_val = *val;
- } while (__sync_val_compare_and_swap (val, old_val, new_val) != old_val);
- return old_val;
-}
-
-static inline gpointer InterlockedExchangePointer(volatile gpointer *val,
- gpointer new_val)
-{
- gpointer old_val;
- do {
- old_val = *val;
- } while (__sync_val_compare_and_swap (val, old_val, new_val) != old_val);
- return old_val;
-}
-
-static inline gint32 InterlockedExchangeAdd(volatile gint32 *val, gint32 add)
-{
- return __sync_fetch_and_add (val, add);
-}
-#endif
-
#endif /* _WAPI_ATOMIC_H_ */
--- /dev/null
+/*
+ * bsearch () implementation. Needed because some broken platforms
+ * have implementations that have unreasonable, non-standard
+ * requirements (e.g. "key must not be null"). Taken from NetBSD
+ * with some minor modifications.
+ *
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include "mono/utils/bsearch.h"
+
+void *
+mono_binary_search (
+ const void *key,
+ const void *array,
+ size_t array_length,
+ size_t member_size,
+ BinarySearchComparer comparer)
+{
+ const char *base = array;
+ size_t lim;
+ int cmp;
+ const void *p;
+
+ for (lim = array_length; lim; lim >>= 1) {
+ p = base + (lim >> 1) * member_size;
+ cmp = (* comparer) (key, p);
+
+ if (!cmp)
+ return (void *) p;
+ else if (cmp > 0) {
+ base = (const char *) p + member_size;
+ lim--;
+ }
+ }
+
+ return NULL;
+}
--- /dev/null
+#ifndef __MONO_BSEARCH_H__
+#define __MONO_BSEARCH_H__
+
+#include <stdlib.h>
+
+#include "mono/utils/mono-compiler.h"
+
+typedef int (* BinarySearchComparer) (const void *key, const void *member);
+
+void *
+mono_binary_search (
+ const void *key,
+ const void *array,
+ size_t array_length,
+ size_t member_size,
+ BinarySearchComparer comparer);
+
+#endif
#include <glib.h>
#include <pthread.h>
#include "utils/mono-sigcontext.h"
+#include "utils/mono-compiler.h"
#include "mach-support.h"
/* Known offsets used for TLS storage*/
-/*Found on iOS 6 */
-#define TLS_VECTOR_OFFSET_0 0x48
-#define TLS_VECTOR_OFFSET_1 0xA8
+
+static const int known_tls_offsets[] = {
+ 0x48, /*Found on iOS 6 */
+ 0xA4,
+ 0xA8,
+};
+
+#define TLS_PROBE_COUNT (sizeof (known_tls_offsets) / sizeof (int))
+
+/* This is 2 slots less than the known low */
+#define TLS_PROBE_LOW_WATERMARK 0x40
+/* This is 24 slots above the know high, which is the same diff as the knowns high-low*/
+#define TLS_PROBE_HIGH_WATERMARK 0x108
static int tls_vector_offset;
void
mono_mach_init (pthread_key_t key)
{
+ int i;
void *old_value = pthread_getspecific (key);
void *canary = (void*)0xDEADBEEFu;
pthread_setspecific (key, canary);
/*First we probe for cats*/
- tls_vector_offset = TLS_VECTOR_OFFSET_0;
- if (mono_mach_arch_get_tls_value_from_thread (pthread_self (), key) == canary)
- goto ok;
-
- tls_vector_offset = TLS_VECTOR_OFFSET_1;
- if (mono_mach_arch_get_tls_value_from_thread (pthread_self (), key) == canary)
- goto ok;
+ for (i = 0; i < TLS_PROBE_COUNT; ++i) {
+ tls_vector_offset = known_tls_offsets [i];
+ if (mono_mach_arch_get_tls_value_from_thread (pthread_self (), key) == canary)
+ goto ok;
+ }
+
+ /*Fallback to scanning a large range of offsets*/
+ for (i = TLS_PROBE_LOW_WATERMARK; i <= TLS_PROBE_HIGH_WATERMARK; i += 4) {
+ tls_vector_offset = i;
+ if (mono_mach_arch_get_tls_value_from_thread (pthread_self (), key) == canary) {
+ g_warning ("Found new TLS offset at %d", i);
+ goto ok;
+ }
+ }
g_error ("could not discover the mach TLS offset");
ok:
#ifdef __GNUC__
#define MONO_ALWAYS_INLINE __attribute__((always_inline))
+#elif defined(_MSC_VER)
+#define MONO_ALWAYS_INLINE __forceinline
#else
#define MONO_ALWAYS_INLINE
#endif
--- /dev/null
+/*
+ * mono-hwcap-arm.c: ARM hardware feature detection
+ *
+ * Authors:
+ * Alex Rønne Petersen (alexrp@xamarin.com)
+ * Elijah Taylor (elijahtaylor@google.com)
+ * Miguel de Icaza (miguel@xamarin.com)
+ * Neale Ferguson (Neale.Ferguson@SoftwareAG-usa.com)
+ * Paolo Molaro (lupus@xamarin.com)
+ * Rodrigo Kumpera (kumpera@gmail.com)
+ * Sebastien Pouliot (sebastien@xamarin.com)
+ * Zoltan Varga (vargaz@xamarin.com)
+ *
+ * Copyright 2003 Ximian, Inc.
+ * Copyright 2003-2011 Novell, Inc
+ * Copyright 2006 Broadcom
+ * Copyright 2007-2008 Andreas Faerber
+ * Copyright 2011-2013 Xamarin Inc
+ */
+
+#include "mono/utils/mono-hwcap-arm.h"
+
+#if defined(HAVE_SYS_AUXV_H) && !defined(PLATFORM_ANDROID)
+#include <sys/auxv.h>
+#elif defined(__APPLE__)
+#include <mach/machine.h>
+#include <sys/sysctl.h>
+#include <sys/types.h>
+#else
+#include <stdio.h>
+#endif
+
+gboolean mono_hwcap_arm_is_v5 = FALSE;
+gboolean mono_hwcap_arm_is_v6 = FALSE;
+gboolean mono_hwcap_arm_is_v7 = FALSE;
+gboolean mono_hwcap_arm_is_v7s = FALSE;
+gboolean mono_hwcap_arm_has_vfp = FALSE;
+gboolean mono_hwcap_arm_has_thumb = FALSE;
+gboolean mono_hwcap_arm_has_thumb2 = FALSE;
+
+#if defined(MONO_CROSS_COMPILE)
+void
+mono_hwcap_arch_init (void)
+{
+}
+#else
+void
+mono_hwcap_arch_init (void)
+{
+#if defined(HAVE_SYS_AUXV_H) && !defined(PLATFORM_ANDROID)
+ unsigned long hwcap;
+ unsigned long platform;
+
+ if ((hwcap = getauxval(AT_HWCAP))) {
+ /* HWCAP_ARM_THUMB */
+ if (hwcap & 0x00000004)
+ mono_hwcap_arm_has_thumb = TRUE;
+
+ /* HWCAP_ARM_VFP */
+ if (hwcap & 0x00000064)
+ mono_hwcap_arm_has_vfp = TRUE;
+
+ /* TODO: Find a way to detect Thumb 2. */
+ }
+
+ if ((platform = getauxval(AT_PLATFORM))) {
+ const char *str = (const char *) platform;
+
+ if (str [1] >= '5')
+ mono_hwcap_arm_is_v5 = TRUE;
+
+ if (str [1] >= '6')
+ mono_hwcap_arm_is_v6 = TRUE;
+
+ if (str [1] >= '7')
+ mono_hwcap_arm_is_v7 = TRUE;
+
+ /* TODO: Find a way to detect v7s. */
+ }
+#elif defined(__APPLE__)
+ cpu_subtype_t sub_type;
+ size_t length = sizeof (sub_type);
+
+ sysctlbyname ("hw.cpusubtype", &sub_type, &length, NULL, 0);
+
+ if (sub_type == CPU_SUBTYPE_ARM_V5TEJ || sub_type == CPU_SUBTYPE_ARM_XSCALE) {
+ mono_hwcap_arm_is_v5 = TRUE;
+ } else if (sub_type == CPU_SUBTYPE_ARM_V6) {
+ mono_hwcap_arm_is_v5 = TRUE;
+ mono_hwcap_arm_is_v6 = TRUE;
+ } else if (sub_type == CPU_SUBTYPE_ARM_V7 || sub_type == CPU_SUBTYPE_ARM_V7F || sub_type == CPU_SUBTYPE_ARM_V7K) {
+ mono_hwcap_arm_is_v5 = TRUE;
+ mono_hwcap_arm_is_v6 = TRUE;
+ mono_hwcap_arm_is_v7 = TRUE;
+ }
+
+ /* TODO: Find a way to detect features like Thumb and VFP. */
+#else
+ /* We can't use the auxiliary vector on Android due to
+ * permissions, so fall back to /proc/cpuinfo. We also
+ * hit this path if the target doesn't have sys/auxv.h.
+ */
+
+ char buf [512];
+ char *line;
+
+ FILE *file = fopen ("/proc/cpuinfo", "r");
+
+ if (file) {
+ while ((line = fgets (buf, 512, file))) {
+ if (!strncmp (line, "Processor", 9)) {
+ char *ver = strstr (line, "(v");
+
+ if (ver) {
+ if (ver [2] >= '5')
+ mono_hwcap_arm_is_v5 = TRUE;
+
+ if (ver [2] >= '6')
+ mono_hwcap_arm_is_v6 = TRUE;
+
+ if (ver [2] >= '7')
+ mono_hwcap_arm_is_v7 = TRUE;
+
+ /* TODO: Find a way to detect v7s. */
+ }
+
+ continue;
+ }
+
+ if (!strncmp (line, "Features", 8)) {
+ if (strstr (line, "thumb"))
+ mono_hwcap_arm_has_thumb = TRUE;
+
+ /* TODO: Find a way to detect Thumb 2. */
+
+ if (strstr (line, "vfp"))
+ mono_hwcap_arm_has_vfp = TRUE;
+
+ continue;
+ }
+ }
+
+ fclose (file);
+ }
+#endif
+}
+#endif
+
+void
+mono_hwcap_print(FILE *f)
+{
+ g_fprintf (f, "mono_hwcap_arm_is_v5 = %i\n", mono_hwcap_arm_is_v5);
+ g_fprintf (f, "mono_hwcap_arm_is_v6 = %i\n", mono_hwcap_arm_is_v6);
+ g_fprintf (f, "mono_hwcap_arm_is_v7 = %i\n", mono_hwcap_arm_is_v7);
+ g_fprintf (f, "mono_hwcap_arm_is_v7s = %i\n", mono_hwcap_arm_is_v7s);
+ g_fprintf (f, "mono_hwcap_arm_has_vfp = %i\n", mono_hwcap_arm_has_vfp);
+ g_fprintf (f, "mono_hwcap_arm_has_thumb = %i\n", mono_hwcap_arm_has_thumb);
+ g_fprintf (f, "mono_hwcap_arm_has_thumb2 = %i\n", mono_hwcap_arm_has_thumb2);
+}
--- /dev/null
+#ifndef __MONO_UTILS_HWCAP_ARM_H__
+#define __MONO_UTILS_HWCAP_ARM_H__
+
+#include "mono/utils/mono-hwcap.h"
+
+extern gboolean mono_hwcap_arm_is_v5;
+extern gboolean mono_hwcap_arm_is_v6;
+extern gboolean mono_hwcap_arm_is_v7;
+extern gboolean mono_hwcap_arm_is_v7s;
+extern gboolean mono_hwcap_arm_has_vfp;
+extern gboolean mono_hwcap_arm_has_thumb;
+extern gboolean mono_hwcap_arm_has_thumb2;
+
+#endif /* __MONO_UTILS_HWCAP_ARM_H__ */
--- /dev/null
+/*
+ * mono-hwcap-ia64.c: Itanium hardware feature detection
+ *
+ * Authors:
+ * Alex Rønne Petersen (alexrp@xamarin.com)
+ * Elijah Taylor (elijahtaylor@google.com)
+ * Miguel de Icaza (miguel@xamarin.com)
+ * Neale Ferguson (Neale.Ferguson@SoftwareAG-usa.com)
+ * Paolo Molaro (lupus@xamarin.com)
+ * Rodrigo Kumpera (kumpera@gmail.com)
+ * Sebastien Pouliot (sebastien@xamarin.com)
+ * Zoltan Varga (vargaz@xamarin.com)
+ *
+ * Copyright 2003 Ximian, Inc.
+ * Copyright 2003-2011 Novell, Inc
+ * Copyright 2006 Broadcom
+ * Copyright 2007-2008 Andreas Faerber
+ * Copyright 2011-2013 Xamarin Inc
+ */
+
+#include "mono/utils/mono-hwcap-ia64.h"
+
+#if defined(MONO_CROSS_COMPILE)
+void
+mono_hwcap_arch_init (void)
+{
+}
+#else
+void
+mono_hwcap_arch_init (void)
+{
+ /* Nothing needed here yet. */
+}
+#endif
+
+void
+mono_hwcap_print (FILE *f)
+{
+}
--- /dev/null
+#ifndef __MONO_UTILS_HWCAP_IA64_H__
+#define __MONO_UTILS_HWCAP_IA64_H__
+
+#include "mono/utils/mono-hwcap.h"
+
+/* Nothing needed here yet. */
+
+#endif /* __MONO_UTILS_HWCAP_IA64_H__ */
--- /dev/null
+/*
+ * mono-hwcap-mips.c: MIPS hardware feature detection
+ *
+ * Authors:
+ * Alex Rønne Petersen (alexrp@xamarin.com)
+ * Elijah Taylor (elijahtaylor@google.com)
+ * Miguel de Icaza (miguel@xamarin.com)
+ * Neale Ferguson (Neale.Ferguson@SoftwareAG-usa.com)
+ * Paolo Molaro (lupus@xamarin.com)
+ * Rodrigo Kumpera (kumpera@gmail.com)
+ * Sebastien Pouliot (sebastien@xamarin.com)
+ * Zoltan Varga (vargaz@xamarin.com)
+ *
+ * Copyright 2003 Ximian, Inc.
+ * Copyright 2003-2011 Novell, Inc
+ * Copyright 2006 Broadcom
+ * Copyright 2007-2008 Andreas Faerber
+ * Copyright 2011-2013 Xamarin Inc
+ */
+
+#include "mono/utils/mono-hwcap-mips.h"
+
+#if defined(MONO_CROSS_COMPILE)
+void
+mono_hwcap_arch_init (void)
+{
+}
+#else
+void
+mono_hwcap_arch_init (void)
+{
+ /* Nothing needed here yet. */
+}
+#endif
+
+void
+mono_hwcap_print (FILE *f)
+{
+}
--- /dev/null
+#ifndef __MONO_UTILS_HWCAP_MIPS_H__
+#define __MONO_UTILS_HWCAP_MIPS_H__
+
+#include "mono/utils/mono-hwcap.h"
+
+/* Nothing needed here yet. */
+
+#endif /* __MONO_UTILS_HWCAP_MIPS_H__ */
--- /dev/null
+/*
+ * mono-hwcap-ppc.c: PowerPC hardware feature detection
+ *
+ * Authors:
+ * Alex Rønne Petersen (alexrp@xamarin.com)
+ * Elijah Taylor (elijahtaylor@google.com)
+ * Miguel de Icaza (miguel@xamarin.com)
+ * Neale Ferguson (Neale.Ferguson@SoftwareAG-usa.com)
+ * Paolo Molaro (lupus@xamarin.com)
+ * Rodrigo Kumpera (kumpera@gmail.com)
+ * Sebastien Pouliot (sebastien@xamarin.com)
+ * Zoltan Varga (vargaz@xamarin.com)
+ *
+ * Copyright 2003 Ximian, Inc.
+ * Copyright 2003-2011 Novell, Inc
+ * Copyright 2006 Broadcom
+ * Copyright 2007-2008 Andreas Faerber
+ * Copyright 2011-2013 Xamarin Inc
+ */
+
+#include "mono/utils/mono-hwcap-ppc.h"
+
+#if defined(__linux__) && defined(HAVE_SYS_AUXV_H)
+#include <string.h>
+#include <sys/auxv.h>
+#endif
+
+gboolean mono_hwcap_ppc_has_icache_snoop = FALSE;
+gboolean mono_hwcap_ppc_is_isa_2x = FALSE;
+gboolean mono_hwcap_ppc_is_isa_64 = FALSE;
+gboolean mono_hwcap_ppc_has_move_fpr_gpr = FALSE;
+gboolean mono_hwcap_ppc_has_multiple_ls_units = FALSE;
+
+#if defined(MONO_CROSS_COMPILE)
+void
+mono_hwcap_arch_init (void)
+{
+}
+#else
+void
+mono_hwcap_arch_init (void)
+{
+#if defined(__linux__) && defined(HAVE_SYS_AUXV_H)
+ unsigned long hwcap;
+ unsigned long platform;
+
+ if ((hwcap = getauxval(AT_HWCAP))) {
+ /* PPC_FEATURE_ICACHE_SNOOP */
+ if (hwcap & 0x00002000)
+ mono_hwcap_ppc_has_icache_snoop = TRUE;
+
+ /* PPC_FEATURE_POWER4, PPC_FEATURE_POWER5, PPC_FEATURE_POWER5_PLUS,
+ PPC_FEATURE_CELL_BE, PPC_FEATURE_PA6T, PPC_FEATURE_ARCH_2_05 */
+ if (hwcap & (0x00080000 | 0x00040000 | 0x00020000 | 0x00010000 | 0x00000800 | 0x00001000))
+ mono_hwcap_ppc_is_isa_2x = TRUE;
+
+ /* PPC_FEATURE_64 */
+ if (hwcap & 0x40000000)
+ mono_hwcap_ppc_is_isa_64 = TRUE;
+
+ /* PPC_FEATURE_POWER6_EXT */
+ if (hwcap & 0x00000200)
+ mono_hwcap_ppc_has_move_fpr_gpr = TRUE;
+ }
+
+ if ((platform = getauxval(AT_PLATFORM))) {
+ const char *str = (const char *) platform;
+
+ if (!strcmp (str, "ppc970") || (!strncmp (str, "power", 5) && str [5] >= '4' && str [5] <= '7'))
+ mono_hwcap_ppc_has_multiple_ls_units = TRUE;
+ }
+#endif
+}
+#endif
+
+void
+mono_hwcap_print (FILE* f)
+{
+ g_fprintf (f, "mono_hwcap_ppc_has_icache_snoop = %i\n", mono_hwcap_ppc_has_icache_snoop);
+ g_fprintf (f, "mono_hwcap_ppc_is_isa_2x = %i\n", mono_hwcap_ppc_is_isa_2x);
+ g_fprintf (f, "mono_hwcap_ppc_is_isa_64 = %i\n", mono_hwcap_ppc_is_isa_64);
+ g_fprintf (f, "mono_hwcap_ppc_has_move_fpr_gpr = %i\n", mono_hwcap_ppc_has_move_fpr_gpr);
+ g_fprintf (f, "mono_hwcap_ppc_has_multiple_ls_units = %i\n", mono_hwcap_ppc_has_multiple_ls_units);
+}
--- /dev/null
+#ifndef __MONO_UTILS_HWCAP_PPC_H__
+#define __MONO_UTILS_HWCAP_PPC_H__
+
+#include "mono/utils/mono-hwcap.h"
+
+extern gboolean mono_hwcap_ppc_has_icache_snoop;
+extern gboolean mono_hwcap_ppc_is_isa_2x;
+extern gboolean mono_hwcap_ppc_is_isa_64;
+extern gboolean mono_hwcap_ppc_has_move_fpr_gpr;
+extern gboolean mono_hwcap_ppc_has_multiple_ls_units;
+
+#endif /* __MONO_UTILS_HWCAP_PPC_H__ */
--- /dev/null
+/*
+ * mono-hwcap-s390x.c: S/390x hardware feature detection
+ *
+ * Authors:
+ * Alex Rønne Petersen (alexrp@xamarin.com)
+ * Elijah Taylor (elijahtaylor@google.com)
+ * Miguel de Icaza (miguel@xamarin.com)
+ * Neale Ferguson (Neale.Ferguson@SoftwareAG-usa.com)
+ * Paolo Molaro (lupus@xamarin.com)
+ * Rodrigo Kumpera (kumpera@gmail.com)
+ * Sebastien Pouliot (sebastien@xamarin.com)
+ * Zoltan Varga (vargaz@xamarin.com)
+ *
+ * Copyright 2003 Ximian, Inc.
+ * Copyright 2003-2011 Novell, Inc
+ * Copyright 2006 Broadcom
+ * Copyright 2007-2008 Andreas Faerber
+ * Copyright 2011-2013 Xamarin Inc
+ */
+
+#include "mono/utils/mono-hwcap-s390x.h"
+
+#include <signal.h>
+
+gboolean mono_hwcap_s390x_has_ld = FALSE;
+
+#if defined(MONO_CROSS_COMPILE)
+void
+mono_hwcap_arch_init (void)
+{
+}
+#else
+static void
+catch_sigill (int sig_no, siginfo_t *info, gpointer act)
+{
+ mono_hwcap_s390x_has_ld = FALSE;
+}
+
+void
+mono_hwcap_arch_init (void)
+{
+ mono_hwcap_s390x_has_ld = TRUE;
+
+ struct sigaction sa, *old_sa;
+
+ /* Determine if we have a long displacement facility
+ * by executing the STY instruction. If it fails, we
+ * catch the SIGILL and assume the answer is no.
+ */
+ sa.sa_sigaction = catch_sigill;
+ sigemptyset (&sa.sa_mask);
+ sa.sa_flags = SA_SIGINFO;
+
+ sigaction (SIGILL, &sa, old_sa);
+
+ __asm__ __volatile__ (
+ "LGHI\t0,1\n\t"
+ "LA\t1,%0\n\t"
+ ".byte\t0xe3,0x00,0x10,0x00,0x00,0x50\n\t"
+ : "=m" (mono_hwcap_s390x_has_ld)
+ :
+ : "0", "1"
+ );
+
+ sigaction (SIGILL, old_sa, NULL);
+}
+#endif
+
+void
+mono_hwcap_print (FILE *f)
+{
+ g_fprintf (f, "mono_hwcap_s390x_has_ld = %i\n", mono_hwcap_s390x_has_ld);
+}
--- /dev/null
+#ifndef __MONO_UTILS_HWCAP_S390X_H__
+#define __MONO_UTILS_HWCAP_S390X_H__
+
+#include "mono/utils/mono-hwcap.h"
+
+extern gboolean mono_hwcap_s390x_has_ld;
+
+#endif /* __MONO_UTILS_HWCAP_S390X_H__ */
--- /dev/null
+/*
+ * mono-hwcap-sparc.c: SPARC hardware feature detection
+ *
+ * Authors:
+ * Alex Rønne Petersen (alexrp@xamarin.com)
+ * Elijah Taylor (elijahtaylor@google.com)
+ * Miguel de Icaza (miguel@xamarin.com)
+ * Neale Ferguson (Neale.Ferguson@SoftwareAG-usa.com)
+ * Paolo Molaro (lupus@xamarin.com)
+ * Rodrigo Kumpera (kumpera@gmail.com)
+ * Sebastien Pouliot (sebastien@xamarin.com)
+ * Zoltan Varga (vargaz@xamarin.com)
+ *
+ * Copyright 2003 Ximian, Inc.
+ * Copyright 2003-2011 Novell, Inc
+ * Copyright 2006 Broadcom
+ * Copyright 2007-2008 Andreas Faerber
+ * Copyright 2011-2013 Xamarin Inc
+ */
+
+#include "mono/utils/mono-hwcap-sparc.h"
+
+#include <string.h>
+
+#if !defined(__linux__)
+#include <sys/systeminfo.h>
+#else
+#include <unistd.h>
+#endif
+
+gboolean mono_hwcap_sparc_is_v9 = FALSE;
+
+#if defined(MONO_CROSS_COMPILE)
+void
+mono_hwcap_arch_init (void)
+{
+}
+#else
+void
+mono_hwcap_arch_init (void)
+{
+ char buf [1024];
+
+#if !defined(__linux__)
+ if (!sysinfo (SI_ISALIST, buf, 1024))
+ g_assert_not_reached ();
+#else
+ /* If the page size is 8192, we're on a 64-bit SPARC, which
+ * in turn means a v9 or better.
+ */
+ if (getpagesize () == 8192)
+ strcpy (buf, "sparcv9")
+ else
+ strcpy (buf, "sparcv8")
+#endif
+
+ mono_hwcap_sparc_is_v9 = strstr (buf, "sparcv9");
+}
+#endif
+
+void
+mono_hwcap_print (FILE *f)
+{
+ g_fprintf (f, "mono_hwcap_sparc_is_v9 = %i\n", mono_hwcap_sparc_is_v9);
+}
--- /dev/null
+#ifndef __MONO_UTILS_HWCAP_SPARC_H__
+#define __MONO_UTILS_HWCAP_SPARC_H__
+
+#include "mono/utils/mono-hwcap.h"
+
+extern gboolean mono_hwcap_sparc_is_v9;
+
+#endif /* __MONO_UTILS_HWCAP_SPARC_H__ */
--- /dev/null
+/*
+ * mono-hwcap-x86.c: x86 hardware feature detection
+ *
+ * Authors:
+ * Alex Rønne Petersen (alexrp@xamarin.com)
+ * Elijah Taylor (elijahtaylor@google.com)
+ * Miguel de Icaza (miguel@xamarin.com)
+ * Neale Ferguson (Neale.Ferguson@SoftwareAG-usa.com)
+ * Paolo Molaro (lupus@xamarin.com)
+ * Rodrigo Kumpera (kumpera@gmail.com)
+ * Sebastien Pouliot (sebastien@xamarin.com)
+ * Zoltan Varga (vargaz@xamarin.com)
+ *
+ * Copyright 2003 Ximian, Inc.
+ * Copyright 2003-2011 Novell, Inc
+ * Copyright 2006 Broadcom
+ * Copyright 2007-2008 Andreas Faerber
+ * Copyright 2011-2013 Xamarin Inc
+ */
+
+#include "mono/utils/mono-hwcap-x86.h"
+
+#if defined(HAVE_UNISTD_H)
+#include <unistd.h>
+#endif
+
+#if defined(_MSC_VER)
+#include <intrin.h>
+#endif
+
+gboolean mono_hwcap_x86_is_xen = FALSE;
+gboolean mono_hwcap_x86_has_cmov = FALSE;
+gboolean mono_hwcap_x86_has_fcmov = FALSE;
+gboolean mono_hwcap_x86_has_sse1 = FALSE;
+gboolean mono_hwcap_x86_has_sse2 = FALSE;
+gboolean mono_hwcap_x86_has_sse3 = FALSE;
+gboolean mono_hwcap_x86_has_ssse3 = FALSE;
+gboolean mono_hwcap_x86_has_sse41 = FALSE;
+gboolean mono_hwcap_x86_has_sse42 = FALSE;
+gboolean mono_hwcap_x86_has_sse4a = FALSE;
+
+#if defined(MONO_CROSS_COMPILE)
+void
+mono_hwcap_arch_init (void)
+{
+}
+#else
+static gboolean
+cpuid (int id, int *p_eax, int *p_ebx, int *p_ecx, int *p_edx)
+{
+#if defined(_MSC_VER)
+ int info [4];
+#endif
+
+ /* First, make sure we can use cpuid if we're on 32-bit. */
+#if defined(TARGET_X86)
+ gboolean have_cpuid = FALSE;
+
+#if defined(_MSC_VER)
+ __asm {
+ pushfd
+ pop eax
+ mov edx, eax
+ xor eax, 0x200000
+ push eax
+ popfd
+ pushfd
+ pop eax
+ xor eax, edx
+ and eax, 0x200000
+ mov have_cpuid, eax
+ }
+#else
+ __asm__ __volatile__ (
+ "pushfl\n\t"
+ "popl\t%%eax\n\t"
+ "movl\t%%eax, %%edx\n\t"
+ "xorl\t$0x200000, %%eax\n\t"
+ "pushl\t%%eax\n\t"
+ "popfl\n\t"
+ "pushfl\n\t"
+ "popl\t%%eax\n\t"
+ "xorl\t%%edx, %%eax\n\t"
+ "andl\t$0x200000, %%eax\n\t"
+ "movl\t%%eax, %0\n\t"
+ : "=r" (have_cpuid)
+ :
+ : "%eax", "%edx"
+ );
+#endif
+
+ if (!have_cpuid)
+ return FALSE;
+#endif
+
+ /* Now issue the actual cpuid instruction. We can use
+ MSVC's __cpuid on both 32-bit and 64-bit. */
+#if defined(_MSC_VER)
+ __cpuid (info, id);
+ *p_eax = info [0];
+ *p_ebx = info [1];
+ *p_ecx = info [2];
+ *p_edx = info [3];
+#elif defined(TARGET_X86)
+ /* This complicated stuff is necessary because EBX
+ may be used by the compiler in PIC mode. */
+ __asm__ __volatile__ (
+ "xchgl\t%%ebx, %k1\n\t"
+ "cpuid\n\t"
+ "xchgl\t%%ebx, %k1\n\t"
+ : "=a" (*p_eax), "=&r" (*p_ebx), "=c" (*p_ecx), "=d" (*p_edx)
+ : "0" (id)
+ );
+#else
+ __asm__ __volatile__ (
+ "cpuid\n\t"
+ : "=a" (*p_eax), "=b" (*p_ebx), "=c" (*p_ecx), "=d" (*p_edx)
+ : "a" (id)
+ );
+#endif
+
+ return TRUE;
+}
+
+void
+mono_hwcap_arch_init (void)
+{
+ int eax, ebx, ecx, edx;
+
+ if (cpuid (1, &eax, &ebx, &ecx, &edx)) {
+ if (edx & (1 << 15)) {
+ mono_hwcap_x86_has_cmov = TRUE;
+
+ if (edx & 1)
+ mono_hwcap_x86_has_fcmov = TRUE;
+ }
+
+ if (edx & (1 << 25))
+ mono_hwcap_x86_has_sse1 = TRUE;
+
+ if (edx & (1 << 26))
+ mono_hwcap_x86_has_sse2 = TRUE;
+
+ if (ecx & (1 << 0))
+ mono_hwcap_x86_has_sse3 = TRUE;
+
+ if (ecx & (1 << 9))
+ mono_hwcap_x86_has_ssse3 = TRUE;
+
+ if (ecx & (1 << 19))
+ mono_hwcap_x86_has_sse41 = TRUE;
+
+ if (ecx & (1 << 20))
+ mono_hwcap_x86_has_sse42 = TRUE;
+ }
+
+ if (cpuid (0x80000000, &eax, &ebx, &ecx, &edx)) {
+ if ((unsigned int) eax >= 0x80000001 && ebx == 0x68747541 && ecx == 0x444D4163 && edx == 0x69746E65) {
+ if (cpuid (0x80000001, &eax, &ebx, &ecx, &edx)) {
+ if (ecx & (1 << 6))
+ mono_hwcap_x86_has_sse4a = TRUE;
+ }
+ }
+ }
+
+#if defined(HAVE_UNISTD_H)
+ mono_hwcap_x86_is_xen = !access ("/proc/xen", F_OK);
+#endif
+}
+#endif
+
+void
+mono_hwcap_print (FILE *f)
+{
+ g_fprintf (f, "mono_hwcap_x86_is_xen = %i\n", mono_hwcap_x86_is_xen);
+ g_fprintf (f, "mono_hwcap_x86_has_cmov = %i\n", mono_hwcap_x86_has_cmov);
+ g_fprintf (f, "mono_hwcap_x86_has_fcmov = %i\n", mono_hwcap_x86_has_fcmov);
+ g_fprintf (f, "mono_hwcap_x86_has_sse1 = %i\n", mono_hwcap_x86_has_sse1);
+ g_fprintf (f, "mono_hwcap_x86_has_sse2 = %i\n", mono_hwcap_x86_has_sse2);
+ g_fprintf (f, "mono_hwcap_x86_has_sse3 = %i\n", mono_hwcap_x86_has_sse3);
+ g_fprintf (f, "mono_hwcap_x86_has_ssse3 = %i\n", mono_hwcap_x86_has_ssse3);
+ g_fprintf (f, "mono_hwcap_x86_has_sse41 = %i\n", mono_hwcap_x86_has_sse41);
+ g_fprintf (f, "mono_hwcap_x86_has_sse42 = %i\n", mono_hwcap_x86_has_sse42);
+ g_fprintf (f, "mono_hwcap_x86_has_sse4a = %i\n", mono_hwcap_x86_has_sse4a);
+}
--- /dev/null
+#ifndef __MONO_UTILS_HWCAP_X86_H__
+#define __MONO_UTILS_HWCAP_X86_H__
+
+#include "mono/utils/mono-hwcap.h"
+
+extern gboolean mono_hwcap_x86_is_xen;
+extern gboolean mono_hwcap_x86_has_cmov;
+extern gboolean mono_hwcap_x86_has_fcmov;
+extern gboolean mono_hwcap_x86_has_sse1;
+extern gboolean mono_hwcap_x86_has_sse2;
+extern gboolean mono_hwcap_x86_has_sse3;
+extern gboolean mono_hwcap_x86_has_ssse3;
+extern gboolean mono_hwcap_x86_has_sse41;
+extern gboolean mono_hwcap_x86_has_sse42;
+extern gboolean mono_hwcap_x86_has_sse4a;
+
+#endif /* __MONO_UTILS_HWCAP_X86_H__ */
--- /dev/null
+/*
+ * mono-hwcap.c: Hardware feature detection
+ *
+ * Authors:
+ * Alex Rønne Petersen (alexrp@xamarin.com)
+ * Elijah Taylor (elijahtaylor@google.com)
+ * Miguel de Icaza (miguel@xamarin.com)
+ * Neale Ferguson (Neale.Ferguson@SoftwareAG-usa.com)
+ * Paolo Molaro (lupus@xamarin.com)
+ * Rodrigo Kumpera (kumpera@gmail.com)
+ * Sebastien Pouliot (sebastien@xamarin.com)
+ * Zoltan Varga (vargaz@xamarin.com)
+ *
+ * Copyright 2003 Ximian, Inc.
+ * Copyright 2003-2011 Novell, Inc
+ * Copyright 2006 Broadcom
+ * Copyright 2007-2008 Andreas Faerber
+ * Copyright 2011-2013 Xamarin Inc
+ */
+
+#include <stdlib.h>
+
+#include "mono/utils/mono-hwcap.h"
+
+static gboolean hwcap_inited = FALSE;
+
+void
+mono_hwcap_init (void)
+{
+ const char *verbose = getenv ("MONO_VERBOSE_HWCAP");
+
+ if (hwcap_inited)
+ return;
+
+ mono_hwcap_arch_init ();
+
+ if (verbose)
+ mono_hwcap_print (stdout);
+}
--- /dev/null
+#ifndef __MONO_UTILS_HWCAP_H__
+#define __MONO_UTILS_HWCAP_H__
+
+#include <stdio.h>
+#include <glib.h>
+
+#include "config.h"
+
+#include "mono/utils/mono-compiler.h"
+
+/* Call this function to perform hardware feature detection. Until
+ * this function has been called, all feature variables will be
+ * FALSE as a default.
+ *
+ * While this function can be called multiple times, doing so from
+ * several threads at the same time is not supported as it will
+ * result in an inconsistent state of the variables. Further,
+ * feature variables should not be read *while* this function is
+ * executing.
+ *
+ * To get at feature variables, include the appropriate header,
+ * e.g. mono-hwcap-x86.h for x86(-64).
+ */
+void mono_hwcap_init (void) MONO_INTERNAL;
+
+/* Implemented in mono-hwcap-$TARGET.c. Do not call. */
+void mono_hwcap_arch_init (void) MONO_INTERNAL;
+
+/* Print detected features to the given file. */
+void mono_hwcap_print (FILE *f) MONO_INTERNAL;
+
+/* Please note: If you're going to use the Linux auxiliary vector
+ * to detect CPU features, don't use any of the constant names in
+ * the hwcap.h header. This ties us to a particular version of the
+ * header, and since the values are guaranteed to be stable, hard-
+ * coding them is not that terrible.
+ *
+ * Also, please do not add assumptions to mono-hwcap. The code here
+ * is meant to *discover* facts about the hardware, not assume that
+ * some feature exists because of $arbitrary_preprocessor_define.
+ * If you have to make assumptions, do so elsewhere, e.g. in the
+ * Mini back end you're modifying.
+ *
+ * Finally, be conservative. If you can't determine precisely if a
+ * feature is present, assume that it isn't. In the rare cases where
+ * the hardware or operating system are lying, work around that in
+ * a different place, as with the rule above.
+ */
+
+#endif /* __MONO_UTILS_HWCAP_H__ */
#include <glib.h>
-#if defined(__x86_64__) || defined(TARGET_AMD64)
-#ifndef _MSC_VER
-static inline void mono_memory_barrier (void)
-{
- __asm__ __volatile__ ("mfence" : : : "memory");
-}
-
-static inline void mono_memory_read_barrier (void)
-{
- __asm__ __volatile__ ("lfence" : : : "memory");
-}
-
-static inline void mono_memory_write_barrier (void)
-{
- __asm__ __volatile__ ("sfence" : : : "memory");
-}
-#else
+#ifdef _MSC_VER
+#include <Windows.h>
#include <intrin.h>
static inline void mono_memory_barrier (void)
{
+ /* NOTE: _ReadWriteBarrier and friends only prevent the
+ compiler from reordering loads and stores. To prevent
+ the CPU from doing the same, we have to use the
+ MemoryBarrier macro which expands to e.g. a serializing
+ XCHG instruction on x86. Also note that the MemoryBarrier
+ macro does *not* imply _ReadWriteBarrier, so that call
+ cannot be eliminated. */
_ReadWriteBarrier ();
+ MemoryBarrier ();
}
static inline void mono_memory_read_barrier (void)
{
_ReadBarrier ();
+ MemoryBarrier ();
}
static inline void mono_memory_write_barrier (void)
{
_WriteBarrier ();
+ MemoryBarrier ();
}
-#endif
-#elif defined(__i386__) || defined(TARGET_X86)
-#ifndef _MSC_VER
+#elif defined(__WIN32__) || defined(_WIN32)
+#include <Windows.h>
+
+/* Since we only support GCC 3.x in Cygwin for
+ some arcane reason, we have to use inline
+ assembly to get fences (__sync_synchronize
+ is not available). */
+
static inline void mono_memory_barrier (void)
{
- __asm__ __volatile__ ("lock; addl $0,0(%%esp)" : : : "memory");
+ __asm__ __volatile__ (
+ "lock\n\t"
+ "addl\t$0,0(%%esp)\n\t"
+ :
+ :
+ : "memory"
+ );
}
static inline void mono_memory_read_barrier (void)
{
mono_memory_barrier ();
}
-#else
-#include <intrin.h>
-
+#elif defined(USE_GCC_ATOMIC_OPS)
static inline void mono_memory_barrier (void)
{
- _ReadWriteBarrier ();
+ __sync_synchronize ();
}
static inline void mono_memory_read_barrier (void)
{
- _ReadBarrier ();
+ mono_memory_barrier ();
}
static inline void mono_memory_write_barrier (void)
{
- _WriteBarrier ();
+ mono_memory_barrier ();
}
-#endif
#elif defined(sparc) || defined(__sparc__)
static inline void mono_memory_barrier (void)
{
mono_memory_barrier ();
}
-static inline void mono_memory_write_barrier (void)
-{
- mono_memory_barrier ();
-}
-#elif defined(__ppc__) || defined(__powerpc__) || defined(__ppc64__)
-static inline void mono_memory_barrier (void)
-{
- __asm__ __volatile__ ("sync" : : : "memory");
-}
-
-static inline void mono_memory_read_barrier (void)
-{
- mono_memory_barrier ();
-}
-
-static inline void mono_memory_write_barrier (void)
-{
- __asm__ __volatile__ ("eieio" : : : "memory");
-}
-
-#elif defined(__arm__)
-static inline void mono_memory_barrier (void)
-{
-#ifdef HAVE_ARMV6
-#ifdef __native_client__
- /* NaCl requires ARMv7 CPUs. */
- __asm__ __volatile__("dsb" : : : "memory");
-#else
- __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r" (0) : "memory");
-#endif
-#endif
-}
-
-static inline void mono_memory_read_barrier (void)
-{
- mono_memory_barrier ();
-}
-
static inline void mono_memory_write_barrier (void)
{
mono_memory_barrier ();
{
mono_memory_barrier ();
}
-#elif defined(__mips__)
-static inline void mono_memory_barrier (void)
-{
- __asm__ __volatile__ ("" : : : "memory");
-}
-
-static inline void mono_memory_read_barrier (void)
-{
- mono_memory_barrier ();
-}
-
-static inline void mono_memory_write_barrier (void)
-{
- mono_memory_barrier ();
-}
#elif defined(MONO_CROSS_COMPILE)
static inline void mono_memory_barrier (void)
{
*(target) = (value); \
} while (0)
-#define mono_atomic_load_release(target) ({ \
- typeof (*target) __tmp; \
+#define mono_atomic_load_release(_type,target) ({ \
+ _type __tmp; \
LOAD_RELEASE_FENCE; \
__tmp = *target; \
__tmp; })
-#define mono_atomic_load_acquire(target) ({ \
- typeof (*target) __tmp = *target; \
+#define mono_atomic_load_acquire(var,_type,target) do { \
+ _type __tmp = *target; \
LOAD_ACQUIRE_FENCE; \
- __tmp; })
+ (var) = __tmp; \
+} while (0)
#define mono_atomic_store_acquire(target,value) { \
*target = value; \
#include <string.h>
#include <errno.h>
#include <assert.h>
-#include <sys/time.h>
#include <mono/utils/mono-memory-model.h>
+#ifndef HOST_WIN32
+#include <sys/time.h>
+#endif
+
#include "mono-mutex.h"
#ifndef HOST_WIN32
/* thread_state_init_from_sigctx return FALSE if the current thread is detaching and suspend can't continue. */
current->suspend_can_continue = ret;
- MONO_SEM_POST (¤t->suspend_semaphore);
+ MONO_SEM_POST (¤t->begin_suspend_semaphore);
/* This thread is doomed, all we can do is give up and let the suspender recover. */
if (!ret)
{
/*FIXME, check return value*/
mono_threads_pthread_kill (info, mono_thread_get_abort_signal ());
- while (MONO_SEM_WAIT (&info->suspend_semaphore) != 0) {
+ while (MONO_SEM_WAIT (&info->begin_suspend_semaphore) != 0) {
/* g_assert (errno == EINTR); */
}
return info->suspend_can_continue;
void
mono_threads_platform_register (MonoThreadInfo *info)
{
- MONO_SEM_INIT (&info->suspend_semaphore, 0);
+ MONO_SEM_INIT (&info->begin_suspend_semaphore, 0);
#if defined (PLATFORM_ANDROID)
info->native_handle = (gpointer) gettid ();
void
mono_threads_platform_free (MonoThreadInfo *info)
{
- MONO_SEM_DESTROY (&info->suspend_semaphore);
+ MONO_SEM_DESTROY (&info->begin_suspend_semaphore);
}
MonoNativeThreadId
/* only needed by the posix backend */
#if (defined(_POSIX_VERSION) || defined(__native_client__)) && !defined (__MACH__)
- MonoSemType suspend_semaphore;
+ MonoSemType begin_suspend_semaphore;
gboolean syscall_break_signal;
gboolean suspend_can_continue;
#endif
<ClCompile Include="..\mono\metadata\sgen-split-nursery.c" />\r
<ClCompile Include="..\mono\metadata\sgen-toggleref.c" />\r
<ClCompile Include="..\mono\metadata\sgen-workers.c" />\r
+ <ClCompile Include="..\mono\metadata\sgen-fin-weak-hash.c" />\r
+ <ClCompile Include="..\mono\metadata\sgen-bridge.c" />\r
+ <ClCompile Include="..\mono\metadata\sgen-stw.c" />\r
<ClCompile Include="..\mono\metadata\socket-io.c" />\r
<ClCompile Include="..\mono\metadata\string-icalls.c" />\r
<ClCompile Include="..\mono\metadata\sysmath.c" />\r
<ClCompile Include="..\mono\utils\mono-math.c" />\r
<ClCompile Include="..\mono\utils\mono-md5.c" />\r
<ClCompile Include="..\mono\utils\mono-mmap.c" />\r
+ <ClCompile Include="..\mono\utils\mono-mutex.c" />\r
<ClCompile Include="..\mono\utils\mono-networkinterfaces.c" />\r
<ClCompile Include="..\mono\utils\mono-path.c" />\r
<ClCompile Include="..\mono\utils\mono-poll.c" />\r
<ClCompile Include="..\mono\utils\monobitset.c" />\r
<ClCompile Include="..\mono\utils\strenc.c" />\r
<ClCompile Include="..\mono\utils\strtod.c" />\r
+ <ClCompile Include="..\mono\utils\atomic.c" />\r
+ <ClCompile Include="..\mono\utils\mono-hwcap.c" />\r
+ <ClCompile Include="..\mono\utils\mono-hwcap-x86.c" />\r
+ <ClCompile Include="..\mono\utils\bsearch.c" />\r
</ItemGroup>\r
<ItemGroup>\r
<ClInclude Include="..\mono\utils\dlmalloc.h" />\r
<ClInclude Include="..\mono\utils\mono-membar.h" />\r
<ClInclude Include="..\mono\utils\mono-memory-model.h" />\r
<ClInclude Include="..\mono\utils\mono-mmap.h" />\r
+ <ClInclude Include="..\mono\utils\mono-mutex.h" />\r
<ClInclude Include="..\mono\utils\mono-networkinterfaces.h" />\r
<ClInclude Include="..\mono\utils\mono-path.h" />\r
<ClInclude Include="..\mono\utils\mono-poll.h" />\r
<ClInclude Include="..\mono\utils\strenc.h" />\r
<ClInclude Include="..\mono\utils\strtod.h" />\r
<ClInclude Include="..\mono\utils\valgrind.h" />\r
+ <ClInclude Include="..\mono\utils\atomic.h" />\r
+ <ClInclude Include="..\mono\utils\mono-hwcap.h" />\r
+ <ClInclude Include="..\mono\utils\mono-hwcap-x86.h" />\r
+ <ClInclude Include="..\mono\utils\bsearch.h" />\r
</ItemGroup>\r
<PropertyGroup Label="Globals">\r
<ProjectGuid>{8FC2B0C8-51AD-49DF-851F-5D01A77A75E4}</ProjectGuid>\r
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
<ImportGroup Label="ExtensionTargets">\r
</ImportGroup>\r
-</Project>
\ No newline at end of file
+</Project>\r
gint64 Mono_Posix_Syscall_read (int fd, void* buf, guint64 count);
int Mono_Posix_Syscall_readdir (void* dir, struct Mono_Posix_Syscall__Dirent* dentry);
int Mono_Posix_Syscall_readdir_r (void* dirp, struct Mono_Posix_Syscall__Dirent* entry, void** result);
-int Mono_Posix_Syscall_readlink (const char* path, char* buf, guint64 bufsiz);
-int Mono_Posix_Syscall_readlinkat (int dirfd, const char* pathname, char* buf, guint64 bufsiz);
+gint64 Mono_Posix_Syscall_readlink (const char* path, unsigned char* buf, guint64 bufsiz);
+gint64 Mono_Posix_Syscall_readlinkat (int dirfd, const char* pathname, unsigned char* buf, guint64 bufsiz);
gint64 Mono_Posix_Syscall_readv (int fd, struct Mono_Posix_Iovec* iov, int iovcnt);
int Mono_Posix_Syscall_remap_file_pages (void* start, guint64 size, int prot, gint64 pgoff, int flags);
int Mono_Posix_Syscall_removexattr (const char* path, const char* name);
}
#endif /* ndef HAVE_TTYNAME_R */
-gint32
-Mono_Posix_Syscall_readlink (const char *path, char *buf, mph_size_t len)
+gint64
+Mono_Posix_Syscall_readlink (const char *path, unsigned char *buf, mph_size_t len)
{
- int r;
+ gint64 r;
mph_return_if_size_t_overflow (len);
- r = readlink (path, buf, (size_t) len);
+ r = readlink (path, (char*) buf, (size_t) len);
if (r >= 0 && r < len)
buf [r] = '\0';
return r;
}
#ifdef HAVE_READLINKAT
-gint32
-Mono_Posix_Syscall_readlinkat (int dirfd, const char *path, char *buf, mph_size_t len)
+gint64
+Mono_Posix_Syscall_readlinkat (int dirfd, const char *path, unsigned char *buf, mph_size_t len)
{
- int r;
+ gint64 r;
mph_return_if_size_t_overflow (len);
- r = readlinkat (dirfd, path, buf, (size_t) len);
+ r = readlinkat (dirfd, path, (char*) buf, (size_t) len);
if (r >= 0 && r < len)
buf [r] = '\0';
return r;
case SGEN_PROTOCOL_CEMENT: size = sizeof (SGenProtocolCement); break;
case SGEN_PROTOCOL_CEMENT_RESET: size = 0; break;
case SGEN_PROTOCOL_DISLINK_UPDATE: size = sizeof (SGenProtocolDislinkUpdate); break;
+ case SGEN_PROTOCOL_DISLINK_UPDATE_STAGED: size = sizeof (SGenProtocolDislinkUpdateStaged); break;
+ case SGEN_PROTOCOL_DISLINK_PROCESS_STAGED: size = sizeof (SGenProtocolDislinkProcessStaged); break;
+ case SGEN_PROTOCOL_DOMAIN_UNLOAD_BEGIN: size = sizeof (SGenProtocolDomainUnload); break;
+ case SGEN_PROTOCOL_DOMAIN_UNLOAD_END: size = sizeof (SGenProtocolDomainUnload); break;
default: assert (0);
}
}
case SGEN_PROTOCOL_DISLINK_UPDATE: {
SGenProtocolDislinkUpdate *entry = data;
- printf ("dislink_update link %p obj %p", entry->link, entry->obj);
+ printf ("dislink_update link %p obj %p staged %d", entry->link, entry->obj, entry->staged);
if (entry->obj)
printf (" track %d\n", entry->track);
else
printf ("\n");
break;
}
+ case SGEN_PROTOCOL_DISLINK_UPDATE_STAGED: {
+ SGenProtocolDislinkUpdateStaged *entry = data;
+ printf ("dislink_update_staged link %p obj %p index %d", entry->link, entry->obj, entry->index);
+ if (entry->obj)
+ printf (" track %d\n", entry->track);
+ else
+ printf ("\n");
+ break;
+ }
+ case SGEN_PROTOCOL_DISLINK_PROCESS_STAGED: {
+ SGenProtocolDislinkProcessStaged *entry = data;
+ printf ("dislink_process_staged link %p obj %p index %d\n", entry->link, entry->obj, entry->index);
+ break;
+ }
+ case SGEN_PROTOCOL_DOMAIN_UNLOAD_BEGIN: {
+ SGenProtocolDomainUnload *entry = data;
+ printf ("dislink_unload_begin domain %p\n", entry->domain);
+ break;
+ }
+ case SGEN_PROTOCOL_DOMAIN_UNLOAD_END: {
+ SGenProtocolDomainUnload *entry = data;
+ printf ("dislink_unload_end domain %p\n", entry->domain);
+ break;
+ }
default:
assert (0);
}
case SGEN_PROTOCOL_THREAD_REGISTER:
case SGEN_PROTOCOL_THREAD_UNREGISTER:
case SGEN_PROTOCOL_CEMENT_RESET:
+ case SGEN_PROTOCOL_DOMAIN_UNLOAD_BEGIN:
+ case SGEN_PROTOCOL_DOMAIN_UNLOAD_END:
return TRUE;
case SGEN_PROTOCOL_ALLOC:
case SGEN_PROTOCOL_ALLOC_PINNED:
SGenProtocolDislinkUpdate *entry = data;
return ptr == entry->obj || ptr == entry->link;
}
+ case SGEN_PROTOCOL_DISLINK_UPDATE_STAGED: {
+ SGenProtocolDislinkUpdateStaged *entry = data;
+ return ptr == entry->obj || ptr == entry->link;
+ }
+ case SGEN_PROTOCOL_DISLINK_PROCESS_STAGED: {
+ SGenProtocolDislinkProcessStaged *entry = data;
+ return ptr == entry->obj || ptr == entry->link;
+ }
default:
assert (0);
}
}
+static gboolean
+is_vtable_match (gpointer ptr, int type, void *data)
+{
+ switch (type) {
+ case SGEN_PROTOCOL_ALLOC:
+ case SGEN_PROTOCOL_ALLOC_PINNED:
+ case SGEN_PROTOCOL_ALLOC_DEGRADED: {
+ SGenProtocolAlloc *entry = data;
+ return ptr == entry->vtable;
+ }
+ case SGEN_PROTOCOL_COPY: {
+ SGenProtocolCopy *entry = data;
+ return ptr == entry->vtable;
+ }
+ case SGEN_PROTOCOL_PIN: {
+ SGenProtocolPin *entry = data;
+ return ptr == entry->vtable;
+ }
+ case SGEN_PROTOCOL_SCAN_BEGIN: {
+ SGenProtocolScanBegin *entry = data;
+ return ptr == entry->vtable;
+ }
+ case SGEN_PROTOCOL_WBARRIER: {
+ SGenProtocolWBarrier *entry = data;
+ return ptr == entry->value_vtable;
+ }
+ case SGEN_PROTOCOL_GLOBAL_REMSET: {
+ SGenProtocolGlobalRemset *entry = data;
+ return ptr == entry->value_vtable;
+ }
+ case SGEN_PROTOCOL_PTR_UPDATE: {
+ SGenProtocolPtrUpdate *entry = data;
+ return ptr == entry->vtable;
+ }
+ case SGEN_PROTOCOL_CLEANUP: {
+ SGenProtocolCleanup *entry = data;
+ return ptr == entry->vtable;
+ }
+ case SGEN_PROTOCOL_MISSING_REMSET: {
+ SGenProtocolMissingRemset *entry = data;
+ return ptr == entry->obj_vtable || ptr == entry->value_vtable;
+ }
+ case SGEN_PROTOCOL_CEMENT: {
+ SGenProtocolCement *entry = data;
+ return ptr == entry->vtable;
+ }
+ default:
+ return FALSE;
+ }
+}
+
static gboolean dump_all = FALSE;
int
void *data;
int num_args = argc - 1;
int num_nums = 0;
+ int num_vtables = 0;
int i;
long nums [num_args];
+ long vtables [num_args];
for (i = 0; i < num_args; ++i) {
char *arg = argv [i + 1];
+ char *next_arg = argv [i + 2];
if (!strcmp (arg, "--all")) {
dump_all = TRUE;
+ } else if (!strcmp (arg, "-v") || !strcmp (arg, "--vtable")) {
+ vtables [num_vtables++] = strtoul (next_arg, NULL, 16);
+ ++i;
} else {
nums [num_nums++] = strtoul (arg, NULL, 16);
}
break;
}
}
+ if (!match) {
+ for (i = 0; i < num_vtables; ++i) {
+ if (is_vtable_match ((gpointer) vtables [i], type, data)) {
+ match = TRUE;
+ break;
+ }
+ }
+ }
if (dump_all)
printf (match ? "* " : " ");
if (match || dump_all)