[submodule "external/ikvm"]
path = external/ikvm
url = git://github.com/mono/ikvm-fork.git
-[submodule "external/Lucene.Net"]
- path = external/Lucene.Net
- url = git://github.com/mono/lucene.net.git
[submodule "external/ikdasm"]
path = external/ikdasm
url = git://github.com/mono/ikdasm.git
[submodule "external/reference-assemblies"]
path = external/binary-reference-assemblies
url = git://github.com/mono/reference-assemblies.git
+[submodule "external/Lucene.Net.Light"]
+ path = external/Lucene.Net.Light
+ url = git://github.com/mono/Lucene.Net.Light.git
X11="libX11.so.6"
;;
*-*-*freebsd*)
- LIBC="libc.so"
+ LIBC="libc.so.7"
INTL="libintl.so"
SQLITE="libsqlite.so"
SQLITE3="libsqlite3.so"
pthread_mutex_unlock (&pw_lock);
return;
}
+
+ home_dir = g_getenv ("HOME");
+ user_name = g_getenv ("USER");
+
#ifdef HAVE_GETPWUID_R
- if (getpwuid_r (getuid (), &pw, buf, 4096, &result) == 0) {
- home_dir = g_strdup (pw.pw_dir);
- user_name = g_strdup (pw.pw_name);
+ if (home_dir == NULL || user_name == NULL) {
+ if (getpwuid_r (getuid (), &pw, buf, 4096, &result) == 0) {
+ if (home_dir == NULL)
+ home_dir = g_strdup (pw.pw_dir);
+ if (user_name == NULL)
+ user_name = g_strdup (pw.pw_name);
+ }
}
#endif
+
+ if (user_name == NULL)
+ user_name = "somebody";
if (home_dir == NULL)
- home_dir = g_getenv ("HOME");
+ home_dir = "/";
- if (user_name == NULL) {
- user_name = g_getenv ("USER");
- if (user_name == NULL)
- user_name = "somebody";
- }
pthread_mutex_unlock (&pw_lock);
}
-/* Give preference to /etc/passwd than HOME */
const gchar *
g_get_home_dir (void)
{
+++ /dev/null
-Subproject commit 88fb67b07621dfed054d8d75fd50672fb26349df
--- /dev/null
+Subproject commit 85978b7eb94738f516824341213d5e94060f5284
-Subproject commit a3de8ec435d47292363b3012e76e2bc05e412d6d
+Subproject commit 3bf7a4b54385a2f3765a85c0bae23190169f5c0a
-Subproject commit 061a13cc772ef15f4d5528eb84fea4d51d4bda1d
+Subproject commit dab43d5cf4bf3b8b9a5b5f8cb175dee38a5fe69f
SearchPath.HintPath, specific_version);
}
- static Dictionary<string, AssemblyName> assemblyNameCache = new Dictionary<string, AssemblyName> ();
+ class CachedAssemblyName
+ {
+ public DateTime Time;
+ public AssemblyName Name;
+ }
+
+ static Dictionary<string, CachedAssemblyName> assemblyNameCache = new Dictionary<string, CachedAssemblyName> ();
public bool TryGetAssemblyNameFromFile (string filename, out AssemblyName aname)
{
- filename = Path.GetFullPath (filename);
- if (assemblyNameCache.TryGetValue (filename, out aname))
+ FileInfo info = new FileInfo (filename);
+ if (!info.Exists) {
+ aname = null;
+ LogSearchMessage ("Considered '{0}' as a file, but the file does not exist",
+ filename);
+ return false;
+ }
+ filename = info.FullName;
+ CachedAssemblyName cachedName;
+ if (assemblyNameCache.TryGetValue (filename, out cachedName) && cachedName.Time == info.LastWriteTime) {
+ aname = cachedName.Name;
return aname != null;
+ }
+ cachedName = new CachedAssemblyName ();
+ cachedName.Time = info.LastWriteTime;
aname = null;
try {
- aname = AssemblyName.GetAssemblyName (filename);
+ cachedName.Name = aname = AssemblyName.GetAssemblyName (filename);
} catch (FileNotFoundException) {
LogSearchMessage ("Considered '{0}' as a file, but the file does not exist",
filename);
+ return false;
} catch (BadImageFormatException) {
LogSearchMessage ("Considered '{0}' as a file, but it is an invalid assembly",
filename);
}
- assemblyNameCache [filename] = aname;
+ assemblyNameCache [filename] = cachedName;
return aname != null;
}
}
}
-public struct AStruct {
+public struct AStruct : ITest2 {
public int i;
public string s;
public byte k;
public void invoke_mutate () {
l = 5;
}
+
+ public int invoke_iface () {
+ return i;
+ }
+
+ public override string ToString () {
+ return i.ToString ();
+ }
}
public class GClass<T> {
e = step_over ();
assert_location (e, "ss_nested");
e = step_into ();
- assert_location (e, "ss_nested_3");
+ assert_location (e, "ss_nested_1");
+ e = step_into ();
+ assert_location (e, "ss_nested_1");
+ e = step_into ();
+ assert_location (e, "ss_nested");
req.Disable ();
// Check DebuggerStepThrough support
AssertValue ("AB", vals [i]);
if (locals [i].Name == "t")
AssertValue ("ABC", vals [i]);
- if (locals [i].Name == "alist")
- ;
+ if (locals [i].Name == "alist") {
+ }
}
// Argument checking
task = s.InvokeMethodAsyncWithResult (e.Thread, m, null);
out_this = task.Result.OutThis as StructMirror;
Assert.AreEqual (null, out_this);
+
+ // interface method
+ var cl1 = frame.Method.DeclaringType.Assembly.GetType ("ITest2");
+ m = cl1.GetMethod ("invoke_iface");
+ v = s.InvokeMethod (e.Thread, m, null);
+ AssertValue (42, v);
+
+ // virtual method
+ m = vm.RootDomain.Corlib.GetType ("System.Object").GetMethod ("ToString");
+ v = s.InvokeMethod (e.Thread, m, null, InvokeOptions.Virtual);
+ AssertValue ("42", v);
#endif
}
public sealed class MemoryMappedViewAccessor : UnmanagedMemoryAccessor, IDisposable {
IntPtr mmap_handle;
SafeMemoryMappedViewHandle safe_handle;
+ long pointerOffset;
internal MemoryMappedViewAccessor (IntPtr handle, long offset, long size, MemoryMappedFileAccess access)
{
+ pointerOffset = offset;
Create (handle, offset, size, access);
}
+ public long PointerOffset
+ {
+ get { return pointerOffset; }
+ }
+
static FileAccess ToFileAccess (MemoryMappedFileAccess access)
{
switch (access){
public sealed class MemoryMappedViewStream : UnmanagedMemoryStream {
IntPtr mmap_handle;
object monitor;
-
+ long pointerOffset;
+
internal MemoryMappedViewStream (IntPtr handle, long offset, long size, MemoryMappedFileAccess access) {
+ pointerOffset = offset;
monitor = new Object ();
CreateStream (handle, offset, size, access);
}
+ public long PointerOffset
+ {
+ get { return pointerOffset; }
+ }
+
public SafeMemoryMappedViewHandle SafeMemoryMappedViewHandle {
get {
throw new NotImplementedException ();
}
}
+ [Test]
+ public unsafe void ViewAccessorReadArrayWithOffset () {
+ var file = MemoryMappedFile.CreateFromFile (fname, FileMode.Open);
+ var offset = 3;
+ var expected = "lo!";
+
+ using (var v = file.CreateViewAccessor (offset, expected.Length)) {
+ Assert.AreEqual (offset, v.PointerOffset);
+
+ var a = new byte [expected.Length];
+ var n = v.ReadArray (0, a, 0, expected.Length);
+ Assert.AreEqual (expected.Length, n);
+ var s = new string (Array.ConvertAll (a, b => (char)b));
+ Assert.AreEqual (expected, s);
+ }
+ }
+
+ [Test]
+ public unsafe void ViewStreamReadWithOffset () {
+ var file = MemoryMappedFile.CreateFromFile (fname, FileMode.Open);
+ var offset = 3;
+ var expected = "lo!";
+
+ using (var v = file.CreateViewStream (offset, expected.Length)) {
+ Assert.AreEqual (offset, v.PointerOffset);
+
+ var a = new byte [expected.Length];
+ var n = v.Read (a, 0, expected.Length);
+ Assert.AreEqual (expected.Length, n);
+ var s = new string (Array.ConvertAll (a, b => (char)b));
+ Assert.AreEqual (expected, s);
+ }
+ }
[Test]
public void NamedMappingToInvalidFile ()
Font f1 = new Font("Arial", 8.25F, GraphicsUnit.Point);
Font f2 = new Font("Courier New", 8.25F, GraphicsUnit.Point);
- Assert.IsFalse(f1.GetHashCode() == f2.GetHashCode(),
- "Hashcodes should differ if _name member differs");
+ if (f1.Name != f2.Name) {
+ Assert.IsFalse(f1.GetHashCode() == f2.GetHashCode(),
+ "Hashcodes should differ if _name member differs");
+ }
}
[Test]
using System.Collections.Generic;
using System.IO;
using System.Linq;
+using System.Text;
using SharpCompress.Common;
namespace SharpCompress.Archive
return false;
}
- public void SaveTo(Stream stream, CompressionInfo compressionType)
+ public void SaveTo(Stream stream, CompressionInfo compressionType, Encoding encoding = null)
{
//reset streams of new entries
newEntries.Cast<IWritableArchiveEntry>().ForEach(x => x.Stream.Seek(0, SeekOrigin.Begin));
- SaveTo(stream, compressionType, OldEntries, newEntries);
+ SaveTo(stream, compressionType, encoding ?? ArchiveEncoding.Default, OldEntries, newEntries);
}
protected TEntry CreateEntry(string key, Stream source, long size, DateTime? modified,
protected abstract TEntry CreateEntryInternal(string key, Stream source, long size, DateTime? modified,
bool closeStream);
- protected abstract void SaveTo(Stream stream, CompressionInfo compressionType,
+ protected abstract void SaveTo(Stream stream, CompressionInfo compressionType, Encoding encoding,
IEnumerable<TEntry> oldEntries, IEnumerable<TEntry> newEntries);
public override void Dispose()
using System.Collections.Generic;
using System.IO;
using System.Linq;
+using System.Text;
using SharpCompress.Common;
using SharpCompress.Common.Zip;
using SharpCompress.Common.Zip.Headers;
}
}
}
- }
+ }
- protected override void SaveTo(Stream stream, CompressionInfo compressionInfo,
+ protected override void SaveTo(Stream stream, CompressionInfo compressionInfo, Encoding encoding,
IEnumerable<ZipArchiveEntry> oldEntries,
IEnumerable<ZipArchiveEntry> newEntries)
{
- using (var writer = new ZipWriter(stream, compressionInfo, string.Empty))
+ using (var writer = new ZipWriter(stream, compressionInfo, string.Empty, encoding))
{
foreach (var entry in oldEntries.Concat(newEntries)
.Where(x => !x.IsDirectory))
private readonly List<ZipCentralDirectoryEntry> entries = new List<ZipCentralDirectoryEntry>();
private readonly string zipComment;
+ private readonly Encoding encoding;
private long streamPosition;
#if PPMd
private readonly PpmdProperties ppmdProperties; // Caching properties to speed up PPMd.
#endif
- public ZipWriter(Stream destination, CompressionInfo compressionInfo, string zipComment)
+ public ZipWriter(Stream destination, CompressionInfo compressionInfo, string zipComment, Encoding encoding = null)
: base(ArchiveType.Zip)
{
this.zipComment = zipComment ?? string.Empty;
+ this.encoding = encoding ?? ArchiveEncoding.Default;
switch (compressionInfo.Type)
{
private int WriteHeader(string filename, DateTime? modificationTime)
{
- byte[] encodedFilename = Encoding.UTF8.GetBytes(filename);
+ byte[] encodedFilename = encoding.GetBytes(filename);
OutputStream.Write(BitConverter.GetBytes(ZipHeaderFactory.ENTRY_HEADER_BYTES), 0, 4);
OutputStream.Write(new byte[] {63, 0}, 0, 2); //version
- HeaderFlags flags = HeaderFlags.UTF8;
+ HeaderFlags flags = encoding == Encoding.UTF8 ? HeaderFlags.UTF8 : (HeaderFlags)0;
if (!OutputStream.CanSeek)
{
flags |= HeaderFlags.UsePostDataDescriptor;
private void WriteEndRecord(uint size)
{
- byte[] encodedComment = Encoding.UTF8.GetBytes(zipComment);
+ byte[] encodedComment = encoding.GetBytes(zipComment);
OutputStream.Write(new byte[] {80, 75, 5, 6, 0, 0, 0, 0}, 0, 8);
OutputStream.Write(BitConverter.GetBytes((ushort) entries.Count), 0, 2);
private void Save()
{
using (var newZip = new MemoryStream()) {
- zipFile.SaveTo(newZip, CompressionType.Deflate);
+ zipFile.SaveTo(newZip, CompressionType.Deflate, entryNameEncoding ?? Encoding.UTF8);
stream.SetLength(0);
stream.Position = 0;
this.HeaderKind = headerKind;
}
- public static HeaderInfo CreateSingle<T> (string name, TryParseDelegate<T> parser, HttpHeaderKind headerKind)
+ public static HeaderInfo CreateSingle<T> (string name, TryParseDelegate<T> parser, HttpHeaderKind headerKind, Func<object, string> toString = null)
{
- return new HeaderTypeInfo<T, object> (name, parser, headerKind);
+ return new HeaderTypeInfo<T, object> (name, parser, headerKind) {
+ CustomToString = toString
+ };
}
//
return CreateCollection (headers, this);
}
+ public Func<object, string> CustomToString {
+ get; private set;
+ }
+
public virtual string Separator {
get {
// Needed for AllowsMany only
public readonly Func<object, string> CustomToString;
- public HeaderBucket (object parsed, Func<object, string> converter = null)
+ public HeaderBucket (object parsed, Func<object, string> converter)
{
this.Parsed = parsed;
this.CustomToString = converter;
HeaderInfo.CreateSingle<byte[]> ("Content-MD5", Parser.MD5.TryParse, HttpHeaderKind.Content),
HeaderInfo.CreateSingle<ContentRangeHeaderValue> ("Content-Range", ContentRangeHeaderValue.TryParse, HttpHeaderKind.Content),
HeaderInfo.CreateSingle<MediaTypeHeaderValue> ("Content-Type", MediaTypeHeaderValue.TryParse, HttpHeaderKind.Content),
- HeaderInfo.CreateSingle<DateTimeOffset> ("Date", Parser.DateTime.TryParse, HttpHeaderKind.Request | HttpHeaderKind.Response),
+ HeaderInfo.CreateSingle<DateTimeOffset> ("Date", Parser.DateTime.TryParse, HttpHeaderKind.Request | HttpHeaderKind.Response, Parser.DateTime.ToString),
HeaderInfo.CreateSingle<EntityTagHeaderValue> ("ETag", EntityTagHeaderValue.TryParse, HttpHeaderKind.Response),
HeaderInfo.CreateMulti<NameValueWithParametersHeaderValue> ("Expect", NameValueWithParametersHeaderValue.TryParse, HttpHeaderKind.Request),
- HeaderInfo.CreateSingle<DateTimeOffset> ("Expires", Parser.DateTime.TryParse, HttpHeaderKind.Content),
+ HeaderInfo.CreateSingle<DateTimeOffset> ("Expires", Parser.DateTime.TryParse, HttpHeaderKind.Content, Parser.DateTime.ToString),
HeaderInfo.CreateSingle<string> ("From", Parser.EmailAddress.TryParse, HttpHeaderKind.Request),
HeaderInfo.CreateSingle<string> ("Host", Parser.Host.TryParse, HttpHeaderKind.Request),
HeaderInfo.CreateMulti<EntityTagHeaderValue> ("If-Match", EntityTagHeaderValue.TryParse, HttpHeaderKind.Request),
- HeaderInfo.CreateSingle<DateTimeOffset> ("If-Modified-Since", Parser.DateTime.TryParse, HttpHeaderKind.Request),
+ HeaderInfo.CreateSingle<DateTimeOffset> ("If-Modified-Since", Parser.DateTime.TryParse, HttpHeaderKind.Request, Parser.DateTime.ToString),
HeaderInfo.CreateMulti<EntityTagHeaderValue> ("If-None-Match", EntityTagHeaderValue.TryParse, HttpHeaderKind.Request),
HeaderInfo.CreateSingle<RangeConditionHeaderValue> ("If-Range", RangeConditionHeaderValue.TryParse, HttpHeaderKind.Request),
- HeaderInfo.CreateSingle<DateTimeOffset> ("If-Unmodified-Since", Parser.DateTime.TryParse, HttpHeaderKind.Request),
- HeaderInfo.CreateSingle<DateTimeOffset> ("Last-Modified", Parser.DateTime.TryParse, HttpHeaderKind.Content),
+ HeaderInfo.CreateSingle<DateTimeOffset> ("If-Unmodified-Since", Parser.DateTime.TryParse, HttpHeaderKind.Request, Parser.DateTime.ToString),
+ HeaderInfo.CreateSingle<DateTimeOffset> ("Last-Modified", Parser.DateTime.TryParse, HttpHeaderKind.Content, Parser.DateTime.ToString),
HeaderInfo.CreateSingle<Uri> ("Location", Parser.Uri.TryParse, HttpHeaderKind.Response),
HeaderInfo.CreateSingle<int> ("Max-Forwards", Parser.Int.TryParse, HttpHeaderKind.Request),
HeaderInfo.CreateMulti<NameValueHeaderValue> ("Pragma", NameValueHeaderValue.TryParsePragma, HttpHeaderKind.Request | HttpHeaderKind.Response),
if (headerInfo.AllowsMany) {
if (bucket == null)
- bucket = new HeaderBucket (headerInfo.CreateCollection (this));
+ bucket = new HeaderBucket (headerInfo.CreateCollection (this), headerInfo.CustomToString);
headerInfo.AddToCollection (bucket.Parsed, parsed_value);
} else {
if (bucket != null)
throw new FormatException ();
- bucket = new HeaderBucket (parsed_value);
+ bucket = new HeaderBucket (parsed_value, headerInfo.CustomToString);
}
} else {
if (bucket == null)
- bucket = new HeaderBucket (null);
+ bucket = new HeaderBucket (null, null);
bucket.Values.Add (value ?? string.Empty);
}
if (!headers.TryGetValue (name, out value)) {
var hinfo = known_headers[name];
- value = new HeaderBucket (new HttpHeaderValueCollection<T> (this, hinfo));
+ value = new HeaderBucket (new HttpHeaderValueCollection<T> (this, hinfo), hinfo.CustomToString);
headers.Add (name, value);
}
wrequest.ContentLength = content.Headers.ContentLength.Value;
}
+ wrequest.ResendContentFactory = content.CopyTo;
+
var stream = await wrequest.GetRequestStreamAsync ().ConfigureAwait (false);
await request.Content.CopyToAsync (stream).ConfigureAwait (false);
} else if (HttpMethod.Post.Equals (request.Method) || HttpMethod.Put.Equals (request.Method) || HttpMethod.Delete.Equals (request.Method)) {
}
}
+ // Only used by HttpWebRequest internals which is not async friendly
+ internal void CopyTo (Stream stream)
+ {
+ CopyToAsync (stream).Wait ();
+ }
+
public Task CopyToAsync (Stream stream)
{
return CopyToAsync (stream, null);
Assert.AreEqual (other, m.First (), "#4");
}
+ [Test]
+ public void Add_ParseCustomToString ()
+ {
+ var m = new MultipartContent ("a", "b");
+
+ m.Headers.Add ("Expires", "Mon, 30 Nov 2020 19:55:22 GMT");
+
+ Assert.AreEqual ("Mon, 30 Nov 2020 19:55:22 GMT", m.Headers.Skip (1).First().Value.First ());
+ }
+
[Test]
public void Add_Resursive ()
{
}
}
+ public bool LowercaseUrls { get; set; }
+ public bool AppendTrailingSlash { get; set; }
public bool RouteExistingFiles { get; set; }
public void Add (string name, RouteBase item)
static ConfigurationProperty encoderTypeProp;
static ConfigurationProperty relaxedUrlToFileSystemMappingProp;
static ConfigurationProperty targetFrameworkProp;
+ static ConfigurationProperty allowDynamicModuleRegistrationProp;
static ConfigurationPropertyCollection properties;
static HttpRuntimeSection ()
PropertyHelper.VersionConverter,
PropertyHelper.DefaultValidator,
ConfigurationPropertyOptions.None);
+ allowDynamicModuleRegistrationProp = new ConfigurationProperty ("allowDynamicModuleRegistration", typeof(bool), true,
+ ConfigurationPropertyOptions.None);
properties = new ConfigurationPropertyCollection();
properties.Add (apartmentThreadingProp);
properties.Add (encoderTypeProp);
properties.Add (relaxedUrlToFileSystemMappingProp);
properties.Add (targetFrameworkProp);
+ properties.Add (allowDynamicModuleRegistrationProp);
}
public HttpRuntimeSection()
protected internal override ConfigurationPropertyCollection Properties {
get { return properties; }
}
+ [ConfigurationProperty ("allowDynamicModuleRegistration", DefaultValue = "True")]
+ public bool AllowDynamicModuleRegistration {
+ get { return (bool) base [allowDynamicModuleRegistrationProp]; }
+ set { base [allowDynamicModuleRegistrationProp] = value; }
+ }
}
}
get { return vpath_provider; }
}
+ public static bool InClientBuildManager {
+ get {
+ // Mono doesn't have a ClientBuildManager, so we can't be in it. Simple as that.
+ return false;
+ }
+ }
+
public static void DecrementBusyCount ()
{
Interlocked.Decrement (ref busy_count);
--- /dev/null
+//
+// DynamicModuleManager.cs: Manager for dynamic Http Modules.
+//
+// Author:
+// Matthias Bogad (bogad@cs.tum.edu)
+//
+// (C) 2015
+//
+
+using System;
+using System.Collections.Generic;
+
+namespace System.Web {
+ sealed class DynamicModuleManager {
+ const string moduleNameFormat = "__Module__{0}_{1}";
+
+ readonly List<DynamicModuleInfo> entries = new List<DynamicModuleInfo> ();
+ bool entriesAreReadOnly = false;
+ readonly object mutex = new object ();
+
+ public void Add (Type moduleType)
+ {
+ if (moduleType == null)
+ throw new ArgumentException ("moduleType");
+
+ if (!typeof (IHttpModule).IsAssignableFrom (moduleType))
+ throw new ArgumentException ("Given object does not implement IHttpModule.", "moduleType");
+
+ lock (mutex) {
+ if (entriesAreReadOnly)
+ throw new InvalidOperationException ("A module was to be added to the dynamic module list, but the list was already initialized. The dynamic module list can only be initialized once.");
+
+ entries.Add (new DynamicModuleInfo (moduleType,
+ string.Format (moduleNameFormat, moduleType.AssemblyQualifiedName, Guid.NewGuid ())));
+ }
+ }
+
+ public ICollection<DynamicModuleInfo> LockAndGetModules ()
+ {
+ lock (mutex) {
+ entriesAreReadOnly = true;
+ return entries;
+ }
+ }
+ }
+
+ struct DynamicModuleInfo {
+ public readonly string Name;
+ public readonly Type Type;
+
+ public DynamicModuleInfo (Type type, string name)
+ {
+ Name = name;
+ Type = type;
+ }
+ }
+}
// Author:
// Miguel de Icaza (miguel@novell.com)
// Gonzalo Paniagua (gonzalo@ximian.com)
-//
+// Matthias Bogad (bogad@cs.tum.edu)
+//
//
// Copyright (C) 2005-2009 Novell, Inc (http://www.novell.com)
//
// Events Disposed
//
+using System;
using System.IO;
using System.Collections;
+using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Diagnostics;
bool removeConfigurationFromCache;
bool fullInitComplete = false;
+ static DynamicModuleManager dynamicModuleManeger = new DynamicModuleManager ();
+
//
// These are used to detect the case where the EndXXX method is invoked
// from within the BeginXXXX delegate, so we detect whether we kick the
if (context == null)
context = HttpContext.Current;
HttpModuleCollection coll = modules.LoadModules (this);
+
+ HttpModuleCollection dynMods = CreateDynamicModules ();
+
+ for (int i = 0; i < dynMods.Count; i++) {
+ coll.AddModule (dynMods.GetKey (i), dynMods.Get (i));
+ }
+
Interlocked.CompareExchange (ref modcoll, coll, null);
HttpContext.Current = saved;
public void AddOnAcquireRequestStateAsync (BeginEventHandler bh, EndEventHandler eh)
{
- AsyncInvoker invoker = new AsyncInvoker (bh, eh);
+ AsyncInvoker invoker = new AsyncInvoker (bh, eh, this);
AcquireRequestState += new EventHandler (invoker.Invoke);
}
public void AddOnAuthenticateRequestAsync (BeginEventHandler bh, EndEventHandler eh)
{
- AsyncInvoker invoker = new AsyncInvoker (bh, eh);
+ AsyncInvoker invoker = new AsyncInvoker (bh, eh, this);
AuthenticateRequest += new EventHandler (invoker.Invoke);
}
public void AddOnAuthorizeRequestAsync (BeginEventHandler bh, EndEventHandler eh)
{
- AsyncInvoker invoker = new AsyncInvoker (bh, eh);
+ AsyncInvoker invoker = new AsyncInvoker (bh, eh, this);
AuthorizeRequest += new EventHandler (invoker.Invoke);
}
public void AddOnBeginRequestAsync (BeginEventHandler bh, EndEventHandler eh)
{
- AsyncInvoker invoker = new AsyncInvoker (bh, eh);
+ AsyncInvoker invoker = new AsyncInvoker (bh, eh, this);
BeginRequest += new EventHandler (invoker.Invoke);
}
public void AddOnEndRequestAsync (BeginEventHandler bh, EndEventHandler eh)
{
- AsyncInvoker invoker = new AsyncInvoker (bh, eh);
+ AsyncInvoker invoker = new AsyncInvoker (bh, eh, this);
EndRequest += new EventHandler (invoker.Invoke);
}
public void AddOnPostRequestHandlerExecuteAsync (BeginEventHandler bh, EndEventHandler eh)
{
- AsyncInvoker invoker = new AsyncInvoker (bh, eh);
+ AsyncInvoker invoker = new AsyncInvoker (bh, eh, this);
PostRequestHandlerExecute += new EventHandler (invoker.Invoke);
}
public void AddOnPreRequestHandlerExecuteAsync (BeginEventHandler bh, EndEventHandler eh)
{
- AsyncInvoker invoker = new AsyncInvoker (bh, eh);
+ AsyncInvoker invoker = new AsyncInvoker (bh, eh, this);
PreRequestHandlerExecute += new EventHandler (invoker.Invoke);
}
public void AddOnReleaseRequestStateAsync (BeginEventHandler bh, EndEventHandler eh)
{
- AsyncInvoker invoker = new AsyncInvoker (bh, eh);
+ AsyncInvoker invoker = new AsyncInvoker (bh, eh, this);
ReleaseRequestState += new EventHandler (invoker.Invoke);
}
public void AddOnResolveRequestCacheAsync (BeginEventHandler bh, EndEventHandler eh)
{
- AsyncInvoker invoker = new AsyncInvoker (bh, eh);
+ AsyncInvoker invoker = new AsyncInvoker (bh, eh, this);
ResolveRequestCache += new EventHandler (invoker.Invoke);
}
public void AddOnUpdateRequestCacheAsync (BeginEventHandler bh, EndEventHandler eh)
{
- AsyncInvoker invoker = new AsyncInvoker (bh, eh);
+ AsyncInvoker invoker = new AsyncInvoker (bh, eh, this);
UpdateRequestCache += new EventHandler (invoker.Invoke);
}
public void AddOnPostAuthenticateRequestAsync (BeginEventHandler bh, EndEventHandler eh, object data)
{
- AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
+ AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
PostAuthenticateRequest += new EventHandler (invoker.Invoke);
}
public void AddOnPostAuthorizeRequestAsync (BeginEventHandler bh, EndEventHandler eh, object data)
{
- AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
+ AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
PostAuthorizeRequest += new EventHandler (invoker.Invoke);
}
public void AddOnPostResolveRequestCacheAsync (BeginEventHandler bh, EndEventHandler eh, object data)
{
- AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
+ AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
PostResolveRequestCache += new EventHandler (invoker.Invoke);
}
public void AddOnPostMapRequestHandlerAsync (BeginEventHandler bh, EndEventHandler eh, object data)
{
- AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
+ AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
PostMapRequestHandler += new EventHandler (invoker.Invoke);
}
public void AddOnPostAcquireRequestStateAsync (BeginEventHandler bh, EndEventHandler eh, object data)
{
- AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
+ AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
PostAcquireRequestState += new EventHandler (invoker.Invoke);
}
public void AddOnPostReleaseRequestStateAsync (BeginEventHandler bh, EndEventHandler eh, object data)
{
- AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
+ AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
PostReleaseRequestState += new EventHandler (invoker.Invoke);
}
public void AddOnPostUpdateRequestCacheAsync (BeginEventHandler bh, EndEventHandler eh, object data)
{
- AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
+ AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
PostUpdateRequestCache += new EventHandler (invoker.Invoke);
}
//
public void AddOnAcquireRequestStateAsync (BeginEventHandler bh, EndEventHandler eh, object data)
{
- AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
+ AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
AcquireRequestState += new EventHandler (invoker.Invoke);
}
public void AddOnAuthenticateRequestAsync (BeginEventHandler bh, EndEventHandler eh, object data)
{
- AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
+ AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
AuthenticateRequest += new EventHandler (invoker.Invoke);
}
public void AddOnAuthorizeRequestAsync (BeginEventHandler bh, EndEventHandler eh, object data)
{
- AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
+ AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
AuthorizeRequest += new EventHandler (invoker.Invoke);
}
public void AddOnBeginRequestAsync (BeginEventHandler bh, EndEventHandler eh, object data)
{
- AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
+ AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
BeginRequest += new EventHandler (invoker.Invoke);
}
public void AddOnEndRequestAsync (BeginEventHandler bh, EndEventHandler eh, object data)
{
- AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
+ AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
EndRequest += new EventHandler (invoker.Invoke);
}
public void AddOnPostRequestHandlerExecuteAsync (BeginEventHandler bh, EndEventHandler eh, object data)
{
- AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
+ AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
PostRequestHandlerExecute += new EventHandler (invoker.Invoke);
}
public void AddOnPreRequestHandlerExecuteAsync (BeginEventHandler bh, EndEventHandler eh, object data)
{
- AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
+ AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
PreRequestHandlerExecute += new EventHandler (invoker.Invoke);
}
public void AddOnReleaseRequestStateAsync (BeginEventHandler bh, EndEventHandler eh, object data)
{
- AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
+ AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
ReleaseRequestState += new EventHandler (invoker.Invoke);
}
public void AddOnResolveRequestCacheAsync (BeginEventHandler bh, EndEventHandler eh, object data)
{
- AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
+ AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
ResolveRequestCache += new EventHandler (invoker.Invoke);
}
public void AddOnUpdateRequestCacheAsync (BeginEventHandler bh, EndEventHandler eh, object data)
{
- AsyncInvoker invoker = new AsyncInvoker (bh, eh, data);
+ AsyncInvoker invoker = new AsyncInvoker (bh, eh, this, data);
UpdateRequestCache += new EventHandler (invoker.Invoke);
}
public void AddOnLogRequestAsync (BeginEventHandler beginHandler, EndEventHandler endHandler, object state)
{
- AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, state);
+ AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, this, state);
LogRequest += new EventHandler (invoker.Invoke);
}
public void AddOnMapRequestHandlerAsync (BeginEventHandler beginHandler, EndEventHandler endHandler, object state)
{
- AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, state);
+ AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, this, state);
MapRequestHandler += new EventHandler (invoker.Invoke);
}
public void AddOnPostLogRequestAsync (BeginEventHandler beginHandler, EndEventHandler endHandler, object state)
{
- AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, state);
+ AsyncInvoker invoker = new AsyncInvoker (beginHandler, endHandler, this, state);
PostLogRequest += new EventHandler (invoker.Invoke);
}
//
// If we catch an error, queue this error
//
- void ProcessError (Exception e)
+ internal void ProcessError (Exception e)
{
bool first = context.Error == null;
context.AddError (e);
return true;
}
}
-
+
+ public static void RegisterModule (Type moduleType)
+ {
+ HttpRuntimeSection config = (HttpRuntimeSection)WebConfigurationManager.GetSection ("system.web/httpRuntime");
+
+ if (!config.AllowDynamicModuleRegistration)
+ throw new InvalidOperationException ("The Application has requested to register a dynamic Module, but dynamic module registration is disabled in web.config.");
+
+ dynamicModuleManeger.Add (moduleType);
+ }
+
+
+ HttpModuleCollection CreateDynamicModules ()
+ {
+ HttpModuleCollection modules = new HttpModuleCollection ();
+
+ foreach (var module in dynamicModuleManeger.LockAndGetModules ()) {
+ IHttpModule httpModule = CreateModuleInstance (module.Type);
+ httpModule.Init (this);
+ modules.AddModule (module.Name, httpModule);
+ }
+ return modules;
+ }
+
+ IHttpModule CreateModuleInstance (Type type)
+ {
+ return (IHttpModule) Activator.CreateInstance (type,
+ BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.CreateInstance,
+ null,
+ null,
+ null);
+ }
+
#region internals
internal void ClearError ()
{
public BeginEventHandler begin;
public EndEventHandler end;
public object data;
+ HttpApplication app;
+ AsyncCallback callback;
- public AsyncInvoker (BeginEventHandler bh, EndEventHandler eh, object d)
+ public AsyncInvoker (BeginEventHandler bh, EndEventHandler eh, HttpApplication a, object d)
{
begin = bh;
end = eh;
data = d;
+ app = a;
+ callback = new AsyncCallback (doAsyncCallback);
}
- public AsyncInvoker (BeginEventHandler bh, EndEventHandler eh)
- {
- begin = bh;
- end = eh;
- }
+ public AsyncInvoker (BeginEventHandler bh, EndEventHandler eh, HttpApplication app) : this(bh, eh, app, null) { }
public void Invoke (object sender, EventArgs e)
{
- throw new Exception ("This is just a dummy");
+ IAsyncResult res;
+ res = begin (app, e, callback, data);
+ }
+
+ void doAsyncCallback (IAsyncResult res)
+ {
+ ThreadPool.QueueUserWorkItem ((object ores) => {
+ IAsyncResult tres = (IAsyncResult) ores;
+ try {
+ end (tres);
+ } catch (Exception ee) {
+ // I tried using ProcessError(), but we only come here frome an Invokation in PipelineDone().
+ // Using ProcessError, I still get a blank screen, this way, we at least log the error to console...
+ Console.Error.WriteLine (ee.ToString ());
+ }
+ }, res);
}
}
#endregion
}
+
System.Web/TaskAsyncResult.cs
System.Web/TaskEventHandler.cs
System.Web.Security/MembershipPasswordAttribute.cs
+System.Web/DynamicModuleManager.cs
#endif
[assembly: ComVisible (false)]
+
+#if !MOBILE
+[assembly: TypeForwardedTo (typeof (System.Windows.Markup.ValueSerializerAttribute))]
+#endif
if (async_error != null)
async_error.Close ();
- if (input_stream != null) {
- input_stream.Close();
- input_stream = null;
- }
-
- if (output_stream != null) {
- output_stream.Close();
- output_stream = null;
- }
-
- if (error_stream != null) {
- error_stream.Close();
- error_stream = null;
- }
+ input_stream = null;
+ output_stream = null;
+ error_stream = null;
}
}
started = false;
inDispatch = false;
fsw.EnableRaisingEvents = false;
- throw exc;
}
if (exc != null)
fsw.DispatchErrorEvents (new ErrorEventArgs (exc));
for (var i = 0; i < numEvents; i++) {
var kevt = eventBuffer [i];
+
+ if (!fdsDict.ContainsKey ((int)kevt.ident))
+ // The event is for a file that was removed
+ continue;
+
var pathData = fdsDict [(int)kevt.ident];
if ((kevt.flags & EventFlags.Error) == EventFlags.Error) {
}
if ((kevt.fflags & FilterFlags.VNodeDelete) == FilterFlags.VNodeDelete || (kevt.fflags & FilterFlags.VNodeRevoke) == FilterFlags.VNodeRevoke) {
+ if (pathData.Path == fullPathNoLastSlash)
+ // The root path is deleted; exit silently
+ return;
+
removeQueue.Add (pathData);
continue;
}
AuthorizationState auth_state, proxy_auth_state;
string host;
+ [NonSerialized]
+ internal Action<Stream> ResendContentFactory;
+
// Constructors
static HttpWebRequest ()
{
internal bool InternalAllowBuffering {
get {
- return (allowBuffering && (method != "HEAD" && method != "GET" &&
- method != "MKCOL" && method != "CONNECT" &&
- method != "TRACE"));
+ return allowBuffering && MethodWithBuffer;
+ }
+ }
+
+ bool MethodWithBuffer {
+ get {
+ return method != "HEAD" && method != "GET" &&
+ method != "MKCOL" && method != "CONNECT" &&
+ method != "TRACE";
}
}
if (e != null)
throw e;
- if (AllowWriteStreamBuffering)
+ if (AllowWriteStreamBuffering || method == "GET")
contentLength = -1;
uriString = webResponse.Headers ["Location"];
bodyBuffer = null;
writeStream.Close ();
}
- } else if (method != "HEAD" && method != "GET" && method != "MKCOL" && method != "CONNECT" &&
- method != "TRACE") {
+ } else if (MethodWithBuffer) {
if (getResponseCalled && !writeStream.RequestWritten)
return writeStream.WriteRequestAsync (result);
}
(ProxyQuery && !proxy_auth_state.IsCompleted && code == HttpStatusCode.ProxyAuthenticationRequired)) {
if (!usedPreAuth && CheckAuthorization (webResponse, code)) {
// Keep the written body, so it can be rewritten in the retry
- if (InternalAllowBuffering) {
- if (writeStream.WriteBufferLength > 0) {
- bodyBuffer = writeStream.WriteBuffer;
- bodyBufferLength = writeStream.WriteBufferLength;
+ if (MethodWithBuffer) {
+ if (AllowWriteStreamBuffering) {
+ if (writeStream.WriteBufferLength > 0) {
+ bodyBuffer = writeStream.WriteBuffer;
+ bodyBufferLength = writeStream.WriteBufferLength;
+ }
+
+ return true;
+ }
+
+ //
+ // Buffering is not allowed but we have alternative way to get same content (we
+ // need to resent it due to NTLM Authentication).
+ //
+ if (ResendContentFactory != null) {
+ using (var ms = new MemoryStream ()) {
+ ResendContentFactory (ms);
+ bodyBuffer = ms.ToArray ();
+ bodyBufferLength = bodyBuffer.Length;
+ }
+ return true;
}
- return true;
} else if (method != "PUT" && method != "POST") {
bodyBuffer = null;
return true;
public void HasExitedCurrent () {
Assert.IsFalse (Process.GetCurrentProcess ().HasExited);
}
+
+ [Test]
+ public void DisposeWithDisposedStreams ()
+ {
+ var psi = GetCrossPlatformStartInfo ();
+ psi.RedirectStandardInput = true;
+ psi.RedirectStandardOutput = true;
+ psi.UseShellExecute = false;
+
+ var p = Process.Start (psi);
+ p.StandardInput.BaseStream.Dispose ();
+ p.StandardOutput.BaseStream.Dispose ();
+ p.Dispose ();
+ }
}
}
System.Windows.Input/ICommand.cs
ReferenceSources/AssertWrapper.cs
-ReferenceSource/HttpSysSettings.cs
+ReferenceSources/HttpSysSettings.cs
ReferenceSources/Logging.cs
ReferenceSources/NativeMethods.cs
ReferenceSources/SettingsSectionInternal.cs
using System.Runtime.InteropServices;
using System.Windows.Markup;
-// General Information about the WindowsBase assembly
-// v3.0 Assembly
-
[assembly: AssemblyCompany (Consts.MonoCompany)]
[assembly: AssemblyProduct (Consts.MonoProduct)]
[assembly: AssemblyCopyright (Consts.MonoCopyright)]
[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/netfx/2007/xaml/presentation", "System.Windows.Input")]
[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/netfx/2007/xaml/presentation", "System.Windows")]
[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/netfx/2007/xaml/presentation", "System.Diagnostics")]
+
+#if !MOBILE
+[assembly: TypeForwardedTo (typeof (ValueSerializerAttribute))]
+#endif
+
#LIBRARY_USE_INTERMEDIATE_FILE = yes
ifeq (2, $(FRAMEWORK_VERSION_MAJOR))
-LIB_MCS_FLAGS += --runtime:v2
+LIB_MCS_FLAGS += --runtime:v4
else
ifeq (4, $(FRAMEWORK_VERSION_MAJOR))
LIB_MCS_FLAGS += --runtime:v4
TMP_FILE1=tzi1.tmp
TMP_FILE2=tzi2.tmp
-
+
+# Remove some code that is protected so we don't have to include all the corlib files.
tzi.exe:System/AndroidPlatform.cs $(wildcard System/TimeZone*.cs) ../../build/common/Consts.cs ../../build/common/Locale.cs ../Mono.Options/Mono.Options/Options.cs
- # Remove some code that is protected so we don't have to include all the corlib files.
trap "rm -f $(TMP_FILE1) $(TMP_FILE2)" EXIT INT QUIT TERM && \
sed 's/Environment\.GetResourceString/string.Format/g' ../../../external/referencesource/mscorlib/system/timezoneinfo.cs > $(TMP_FILE1) && \
sed 's/StringBuilder\.DefaultCapacity/100/g' ../../../external/referencesource/mscorlib/system/text/stringbuildercache.cs > $(TMP_FILE2) && \
+++ /dev/null
-//
-// System.IO.UnmanagedMemoryAccessor.cs
-//
-// Author:
-// Zoltan Varga (vargaz@gmail.com)
-// Marek Safar (marek.safar@gmail.com)
-//
-// Copyright (C) 2009 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-
-using System;
-using System.Runtime.InteropServices;
-using System.Security.Permissions;
-
-namespace System.IO
-{
- [MonoTODO ("Offset is ignored")]
- public class UnmanagedMemoryAccessor : IDisposable {
- SafeBuffer buffer;
-#pragma warning disable 414
- long offset;
-#pragma warning restore
- long capacity;
- bool canwrite, canread;
-
- protected UnmanagedMemoryAccessor ()
- {
- }
-
- public UnmanagedMemoryAccessor (SafeBuffer buffer, long offset, long capacity)
- {
- Initialize (buffer, offset, capacity, FileAccess.ReadWrite);
- }
-
- public UnmanagedMemoryAccessor (SafeBuffer buffer, long offset, long capacity, FileAccess access)
- {
- Initialize (buffer, offset, capacity, access);
- }
-
- [SecurityPermissionAttribute(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)]
- protected void Initialize(SafeBuffer buffer, long offset, long capacity, FileAccess access)
- {
- if (buffer == null)
- throw new ArgumentNullException ("buffer");
- if (offset < 0)
- throw new ArgumentOutOfRangeException ("offset");
- if (capacity < 0)
- throw new ArgumentOutOfRangeException ("capacity");
-
- if (access == FileAccess.Read || access == FileAccess.ReadWrite)
- canread = true;
- if (access == FileAccess.Write || access == FileAccess.ReadWrite)
- canwrite = true;
-
- if (this.buffer != null)
- Dispose (true);
-
- this.buffer = buffer;
- this.offset = offset;
- this.capacity = capacity;
- }
-
- public void Dispose ()
- {
- Dispose (true);
- GC.SuppressFinalize (this);
- }
-
- protected virtual void Dispose (bool disposing)
- {
- if (buffer != null){
- if (disposing){
- buffer.Dispose ();
- }
- }
- buffer = null;
- }
-
- public byte ReadByte (long position)
- {
- if (!canread)
- throw new NotSupportedException ();
- if (buffer == null)
- throw new ObjectDisposedException ("buffer");
- if (position < 0)
- throw new ArgumentOutOfRangeException ();
-
- return buffer.Read<byte> ((ulong) position);
- }
-
- public bool ReadBoolean (long position)
- {
- if (!canread)
- throw new NotSupportedException ();
- if (buffer == null)
- throw new ObjectDisposedException ("buffer");
- if (position < 0)
- throw new ArgumentOutOfRangeException ();
-
- return buffer.Read<bool> ((ulong) position);
- }
-
- public char ReadChar (long position)
- {
- if (!canread)
- throw new NotSupportedException ();
- if (buffer == null)
- throw new ObjectDisposedException ("buffer");
- if (position < 0)
- throw new ArgumentOutOfRangeException ();
-
- return buffer.Read<char> ((ulong) position);
- }
-
- public decimal ReadDecimal (long position)
- {
- if (!canread)
- throw new NotSupportedException ();
- if (buffer == null)
- throw new ObjectDisposedException ("buffer");
- if (position < 0)
- throw new ArgumentOutOfRangeException ();
-
- return buffer.Read<decimal> ((ulong) position);
- }
-
- public double ReadDouble (long position)
- {
- if (!canread)
- throw new NotSupportedException ();
- if (buffer == null)
- throw new ObjectDisposedException ("buffer");
- if (position < 0)
- throw new ArgumentOutOfRangeException ();
-
- return buffer.Read<double> ((ulong) position);
- }
-
- public short ReadInt16 (long position)
- {
- if (!canread)
- throw new NotSupportedException ();
- if (buffer == null)
- throw new ObjectDisposedException ("buffer");
- if (position < 0)
- throw new ArgumentOutOfRangeException ();
-
- return buffer.Read<short> ((ulong) position);
- }
-
- public int ReadInt32 (long position)
- {
- if (!canread)
- throw new NotSupportedException ();
- if (buffer == null)
- throw new ObjectDisposedException ("buffer");
- if (position < 0)
- throw new ArgumentOutOfRangeException ();
-
- return buffer.Read<int> ((ulong) position);
- }
-
- public long ReadInt64 (long position)
- {
- if (!canread)
- throw new NotSupportedException ();
- if (buffer == null)
- throw new ObjectDisposedException ("buffer");
- if (position < 0)
- throw new ArgumentOutOfRangeException ();
-
- return buffer.Read<long> ((ulong) position);
- }
-
- [CLSCompliant (false)]
- public sbyte ReadSByte (long position)
- {
- if (!canread)
- throw new NotSupportedException ();
- if (buffer == null)
- throw new ObjectDisposedException ("buffer");
- if (position < 0)
- throw new ArgumentOutOfRangeException ();
-
- return buffer.Read<sbyte> ((ulong) position);
- }
-
- public float ReadSingle (long position)
- {
- if (!canread)
- throw new NotSupportedException ();
- if (buffer == null)
- throw new ObjectDisposedException ("buffer");
- if (position < 0)
- throw new ArgumentOutOfRangeException ();
-
- return buffer.Read<float> ((ulong) position);
- }
-
- [CLSCompliant (false)]
- public ushort ReadUInt16 (long position)
- {
- if (!canread)
- throw new NotSupportedException ();
- if (buffer == null)
- throw new ObjectDisposedException ("buffer");
- if (position < 0)
- throw new ArgumentOutOfRangeException ();
-
- return buffer.Read<ushort> ((ulong) position);
- }
-
- [CLSCompliant (false)]
- public uint ReadUInt32 (long position)
- {
- if (!canread)
- throw new NotSupportedException ();
- if (buffer == null)
- throw new ObjectDisposedException ("buffer");
- if (position < 0)
- throw new ArgumentOutOfRangeException ();
-
- return buffer.Read<uint> ((ulong) position);
- }
-
- [CLSCompliant (false)]
- public ulong ReadUInt64 (long position)
- {
- if (!canread)
- throw new NotSupportedException ();
- if (buffer == null)
- throw new ObjectDisposedException ("buffer");
- if (position < 0)
- throw new ArgumentOutOfRangeException ();
-
- return buffer.Read<ulong> ((ulong) position);
- }
-
- public void Read<T> (long position, out T structure) where T : struct
- {
- if (!canread)
- throw new NotSupportedException ();
- if (buffer == null)
- throw new ObjectDisposedException ("buffer");
- if (position < 0)
- throw new ArgumentOutOfRangeException ();
-
- structure = buffer.Read<T> ((ulong) position);
- }
-
- public int ReadArray<T> (long position, T [] array, int offset, int count) where T : struct
- {
- if (position < 0)
- throw new ArgumentOutOfRangeException ();
-
- long left = capacity - position;
- var slots = Math.Min (count, (int)(left / Marshal.SizeOf (typeof (T))));
-
- buffer.ReadArray ((ulong) position, array, offset, slots);
- return slots;
- }
-
- public void Write (long position, bool value)
- {
- if (!canwrite)
- throw new NotSupportedException ();
- if (buffer == null)
- throw new ObjectDisposedException ("buffer");
- if (position < 0)
- throw new ArgumentOutOfRangeException ();
-
- buffer.Write ((ulong)position, value);
- }
-
- public void Write (long position, byte value)
- {
- if (!canwrite)
- throw new NotSupportedException ();
- if (buffer == null)
- throw new ObjectDisposedException ("buffer");
- if (position < 0)
- throw new ArgumentOutOfRangeException ();
-
- buffer.Write ((ulong)position, value);
- }
-
- public void Write (long position, char value)
- {
- if (!canwrite)
- throw new NotSupportedException ();
- if (buffer == null)
- throw new ObjectDisposedException ("buffer");
- if (position < 0)
- throw new ArgumentOutOfRangeException ();
-
- buffer.Write ((ulong)position, value);
- }
-
- public void Write (long position, decimal value)
- {
- if (!canwrite)
- throw new NotSupportedException ();
- if (buffer == null)
- throw new ObjectDisposedException ("buffer");
- if (position < 0)
- throw new ArgumentOutOfRangeException ();
-
- buffer.Write ((ulong)position, value);
- }
-
- public void Write (long position, double value)
- {
- if (!canwrite)
- throw new NotSupportedException ();
- if (buffer == null)
- throw new ObjectDisposedException ("buffer");
- if (position < 0)
- throw new ArgumentOutOfRangeException ();
-
- buffer.Write ((ulong)position, value);
- }
-
- public void Write (long position, short value)
- {
- if (!canwrite)
- throw new NotSupportedException ();
- if (buffer == null)
- throw new ObjectDisposedException ("buffer");
- if (position < 0)
- throw new ArgumentOutOfRangeException ();
-
- buffer.Write ((ulong)position, value);
- }
-
- public void Write (long position, int value)
- {
- if (!canwrite)
- throw new NotSupportedException ();
- if (buffer == null)
- throw new ObjectDisposedException ("buffer");
- if (position < 0)
- throw new ArgumentOutOfRangeException ();
-
- buffer.Write ((ulong)position, value);
- }
-
- public void Write (long position, long value)
- {
- if (!canwrite)
- throw new NotSupportedException ();
- if (buffer == null)
- throw new ObjectDisposedException ("buffer");
- if (position < 0)
- throw new ArgumentOutOfRangeException ();
-
- buffer.Write ((ulong)position, value);
- }
-
- [CLSCompliant (false)]
- public void Write (long position, sbyte value)
- {
- if (!canwrite)
- throw new NotSupportedException ();
- if (buffer == null)
- throw new ObjectDisposedException ("buffer");
- if (position < 0)
- throw new ArgumentOutOfRangeException ();
-
- buffer.Write ((ulong)position, value);
- }
-
- public void Write (long position, float value)
- {
- if (!canwrite)
- throw new NotSupportedException ();
- if (buffer == null)
- throw new ObjectDisposedException ("buffer");
- if (position < 0)
- throw new ArgumentOutOfRangeException ();
-
- buffer.Write ((ulong)position, value);
- }
-
- [CLSCompliant (false)]
- public void Write (long position, ushort value)
- {
- if (!canwrite)
- throw new NotSupportedException ();
- if (buffer == null)
- throw new ObjectDisposedException ("buffer");
- if (position < 0)
- throw new ArgumentOutOfRangeException ();
-
- buffer.Write ((ulong)position, value);
- }
-
- [CLSCompliant (false)]
- public void Write (long position, uint value)
- {
- if (!canwrite)
- throw new NotSupportedException ();
- if (buffer == null)
- throw new ObjectDisposedException ("buffer");
- if (position < 0)
- throw new ArgumentOutOfRangeException ();
-
- buffer.Write ((ulong)position, value);
- }
-
- [CLSCompliant (false)]
- public void Write (long position, ulong value)
- {
- if (!canwrite)
- throw new NotSupportedException ();
- if (buffer == null)
- throw new ObjectDisposedException ("buffer");
- if (position < 0)
- throw new ArgumentOutOfRangeException ();
-
- buffer.Write ((ulong)position, value);
- }
-
- public void Write<T> (long position, ref T structure) where T : struct
- {
- if (!canwrite)
- throw new NotSupportedException ();
- if (buffer == null)
- throw new ObjectDisposedException ("buffer");
- if (position < 0)
- throw new ArgumentOutOfRangeException ();
-
- buffer.Write<T> ((ulong)position, structure);
- }
-
- public void WriteArray<T> (long position, T [] array, int offset, int count) where T : struct
- {
- buffer.WriteArray ((ulong)position, array, offset, count);
- }
-
- public bool CanRead {
- get { return canread; }
- }
-
- public bool CanWrite {
- get { return canwrite; }
- }
-
- public long Capacity {
- get { return capacity; }
- }
-
- protected bool IsOpen {
- get { return buffer != null; }
- }
- }
-}
-
internal static RuntimeAssembly LoadWithPartialNameInternal (String partialName, Evidence securityEvidence, ref StackCrawlMark stackMark)
{
- AssemblyName an = new AssemblyName(partialName);
- return LoadWithPartialNameInternal (an, securityEvidence, ref stackMark);
+ // Mono runtime does not support StackCrawlMark
+ //FIXME stackMark should probably change method behavior in some cases.
+ return (RuntimeAssembly) Assembly.LoadWithPartialName (partialName, securityEvidence);
}
internal static RuntimeAssembly LoadWithPartialNameInternal (AssemblyName an, Evidence securityEvidence, ref StackCrawlMark stackMark)
{
- throw new NotImplementedException ("LoadWithPartialNameInternal");
+ return LoadWithPartialNameInternal (an.ToString (), securityEvidence, ref stackMark);
}
+
}
[ComVisible (true)]
ParameterInfo[] pinfo = GetParametersInternal ();
ConvertValues (binder, parameters, pinfo, culture, invokeAttr);
-#if !NET_2_1
- if (SecurityManager.SecurityEnabled) {
- // sadly Attributes doesn't tell us which kind of security action this is so
- // we must do it the hard way - and it also means that we can skip calling
- // Attribute (which is another an icall)
- SecurityManager.ReflectedLinkDemandInvoke (this);
- }
-#endif
-
if (ContainsGenericParameters)
throw new InvalidOperationException ("Late bound operations cannot be performed on types or methods for which ContainsGenericParameters is true.");
MonoMethod.ConvertValues (binder, parameters, pinfo, culture, invokeAttr);
-#if !NET_2_1
- if (SecurityManager.SecurityEnabled) {
- // sadly Attributes doesn't tell us which kind of security action this is so
- // we must do it the hard way - and it also means that we can skip calling
- // Attribute (which is another an icall)
- SecurityManager.ReflectedLinkDemandInvoke (this);
- }
-#endif
-
if (obj == null && DeclaringType.ContainsGenericParameters)
throw new MemberAccessException ("Cannot create an instance of " + DeclaringType + " because Type.ContainsGenericParameters is true.");
return SizeOf (structure.GetType ());
}
+ internal static uint SizeOfType (Type type)
+ {
+ return (uint) SizeOf (type);
+ }
+
+ internal static uint AlignedSizeOf<T> () where T : struct
+ {
+ uint size = SizeOfType (typeof (T));
+ if (size == 1 || size == 2)
+ return size;
+ if (IntPtr.Size == 8 && size == 4)
+ return size;
+ return (size + 3) & (~((uint)3));
+ }
+
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public extern static IntPtr StringToBSTR (string s);
new PermissionSet (this).Assert ();
}
- internal bool CheckAssert (CodeAccessPermission asserted)
- {
- if (asserted == null)
- return false;
- if (asserted.GetType () != this.GetType ())
- return false;
- return IsSubsetOf (asserted);
- }
-
- internal bool CheckDemand (CodeAccessPermission target)
- {
- if (target == null)
- return false;
- if (target.GetType () != this.GetType ())
- return false;
- return IsSubsetOf (target);
- }
-
- internal bool CheckDeny (CodeAccessPermission denied)
- {
- if (denied == null)
- return true;
- Type t = denied.GetType ();
- if (t != this.GetType ())
- return true;
- IPermission inter = Intersect (denied);
- if (inter == null)
- return true;
- // sadly that's not enough :( at this stage we must also check
- // if an empty (PermissionState.None) is a subset of the denied
- // (which is like a empty intersection looks like for flag based
- // permissions, e.g. AspNetHostingPermission).
- return denied.IsSubsetOf (PermissionBuilder.Create (t));
- }
-
- internal bool CheckPermitOnly (CodeAccessPermission target)
- {
- if (target == null)
- return false;
- if (target.GetType () != this.GetType ())
- return false;
- return IsSubsetOf (target);
- }
-
public abstract IPermission Copy ();
public void Demand ()
{
if (!SecurityManager.SecurityEnabled)
return;
-
- SecurityFrame sf = new SecurityFrame (1);
- bool revert = false;
- if ((sf.Assert != null) && !sf.Assert.DeclarativeSecurity) {
- revert = true;
- throw new NotSupportedException ("Currently only declarative Assert are supported.");
- }
- if ((sf.Deny != null) && !sf.Deny.DeclarativeSecurity) {
- revert = true;
- throw new NotSupportedException ("Currently only declarative Deny are supported.");
- }
- if ((sf.PermitOnly != null) && !sf.PermitOnly.DeclarativeSecurity) {
- revert = true;
- throw new NotSupportedException ("Currently only declarative PermitOnly are supported.");
- }
-
- if (!revert) {
- string msg = Locale.GetText ("No stack modifiers are present on the current stack frame.");
- // FIXME: we don't (yet) support imperative stack modifiers
- msg += Environment.NewLine + "Currently only declarative stack modifiers are supported.";
- throw new ExecutionEngineException (msg);
- }
+ throw new NotImplementedException ();
}
[MonoTODO ("CAS support is experimental (and unsupported). Imperative mode is not implemented.")]
{
if (!SecurityManager.SecurityEnabled)
return;
-
- SecurityFrame sf = new SecurityFrame (1);
- if ((sf.Assert != null) && !sf.Assert.DeclarativeSecurity) {
- throw new NotSupportedException ("Currently only declarative Assert are supported.");
- } else {
- // we can't revert declarative security (or an empty frame) imperatively
- ThrowExecutionEngineException (SecurityAction.Assert);
- }
+ throw new NotImplementedException ();
}
[MonoTODO ("CAS support is experimental (and unsupported). Imperative mode is not implemented.")]
{
if (!SecurityManager.SecurityEnabled)
return;
-
- SecurityFrame sf = new SecurityFrame (1);
- if ((sf.Deny != null) && !sf.Deny.DeclarativeSecurity) {
- throw new NotSupportedException ("Currently only declarative Deny are supported.");
- } else {
- // we can't revert declarative security (or an empty frame) imperatively
- ThrowExecutionEngineException (SecurityAction.Deny);
- }
+ throw new NotImplementedException ();
}
[MonoTODO ("CAS support is experimental (and unsupported). Imperative mode is not implemented.")]
{
if (!SecurityManager.SecurityEnabled)
return;
-
- SecurityFrame sf = new SecurityFrame (1);
- if ((sf.PermitOnly != null) && sf.PermitOnly.DeclarativeSecurity) {
- throw new NotSupportedException ("Currently only declarative PermitOnly are supported.");
- } else {
- // we can't revert declarative security (or an empty frame) imperatively
- ThrowExecutionEngineException (SecurityAction.PermitOnly);
- }
+ throw new NotImplementedException ();
}
// Internal helpers methods
return (String.Compare (value, Boolean.TrueString, true, CultureInfo.InvariantCulture) == 0);
}
- internal bool ProcessFrame (SecurityFrame frame)
- {
- // 1. CheckPermitOnly
- if (frame.PermitOnly != null) {
- // the demanded permission must be in one of the permitted...
- bool permit = frame.PermitOnly.IsUnrestricted ();
- if (!permit) {
- // check individual permissions
- foreach (IPermission p in frame.PermitOnly) {
- if (CheckPermitOnly (p as CodeAccessPermission)) {
- permit = true;
- break;
- }
- }
- }
- if (!permit) {
- // ...or else we throw
- ThrowSecurityException (this, "PermitOnly", frame, SecurityAction.Demand, null);
- }
- }
-
- // 2. CheckDeny
- if (frame.Deny != null) {
- // special case where everything is denied (i.e. no child to be processed)
- if (frame.Deny.IsUnrestricted ())
- ThrowSecurityException (this, "Deny", frame, SecurityAction.Demand, null);
- foreach (IPermission p in frame.Deny) {
- if (!CheckDeny (p as CodeAccessPermission))
- ThrowSecurityException (this, "Deny", frame, SecurityAction.Demand, p);
- }
- }
-
- // 3. CheckAssert
- if (frame.Assert != null) {
- if (frame.Assert.IsUnrestricted ())
- return true; // remove permission and continue stack walk
- foreach (IPermission p in frame.Assert) {
- if (CheckAssert (p as CodeAccessPermission)) {
- return true; // remove permission and continue stack walk
- }
- }
- }
-
- // continue the stack walk
- return false;
- }
-
internal static void ThrowInvalidPermission (IPermission target, Type expected)
{
string msg = Locale.GetText ("Invalid permission type '{0}', expected type '{1}'.");
msg = String.Format (msg, target.GetType (), expected);
throw new ArgumentException (msg, "target");
}
-
- internal static void ThrowExecutionEngineException (SecurityAction stackmod)
- {
- string msg = Locale.GetText ("No {0} modifier is present on the current stack frame.");
- // FIXME: we don't (yet) support imperative stack modifiers
- msg += Environment.NewLine + "Currently only declarative stack modifiers are supported.";
- throw new ExecutionEngineException (String.Format (msg, stackmod));
- }
-
- internal static void ThrowSecurityException (object demanded, string message, SecurityFrame frame,
- SecurityAction action, IPermission failed)
- {
-#if NET_2_1
- throw new SecurityException (message);
-#else
- Assembly a = frame.Assembly;
- throw new SecurityException (Locale.GetText (message),
- a.UnprotectedGetName (), a.GrantedPermissionSet,
- a.DeniedPermissionSet, frame.Method, action, demanded,
- failed, a.UnprotectedGetEvidence ());
-#endif
- }
}
}
// special case when directly called from CodeAccessPermission.Demand
_ignored = new bool [list.Count];
}
-
- ArrayList frames = SecurityFrame.GetStack (skip);
- if ((frames != null) && (frames.Count > 0)) {
- SecurityFrame first = ((SecurityFrame) frames [0]);
- current = first.Assembly;
- domain = first.Domain;
- // skip ourself, Demand and other security runtime methods
- foreach (SecurityFrame sf in frames) {
- if (ProcessFrame (sf, ref current, ref domain)) {
- if (AllIgnored ())
- return; // reached Assert
- }
- }
- SecurityFrame last = ((SecurityFrame) frames [frames.Count - 1]);
- CheckAssembly (current, last);
- CheckAppDomain (domain, last);
- }
-#if FEATURE_COMPRESSEDSTACK
- // Is there a CompressedStack to handle ?
- CompressedStack stack = Thread.CurrentThread.GetCompressedStack ();
- if ((stack != null) && !stack.IsEmpty ()) {
- foreach (SecurityFrame frame in stack.List) {
- if (ProcessFrame (frame, ref current, ref domain)) {
- if (AllIgnored ())
- return; // reached Assert
- }
- }
- }
-#endif
}
[MonoTODO ("CAS support is experimental (and unsupported). Imperative mode is not implemented.")]
return true;
}
- internal bool ProcessFrame (SecurityFrame frame, ref Assembly current, ref AppDomain domain)
- {
- if (IsUnrestricted ()) {
- // we request unrestricted
- if (frame.Deny != null) {
- // but have restrictions (some denied permissions)
- CodeAccessPermission.ThrowSecurityException (this, "Deny", frame, SecurityAction.Demand, null);
- } else if ((frame.PermitOnly != null) && !frame.PermitOnly.IsUnrestricted ()) {
- // but have restrictions (only some permitted permissions)
- CodeAccessPermission.ThrowSecurityException (this, "PermitOnly", frame, SecurityAction.Demand, null);
- }
- }
-
- // skip next steps if no Assert, Deny or PermitOnly are present
- if (frame.HasStackModifiers) {
- for (int i = 0; i < list.Count; i++) {
- CodeAccessPermission cap = (CodeAccessPermission) list [i];
- if (cap.ProcessFrame (frame)) {
- _ignored [i] = true; // asserted
- if (AllIgnored ())
- return true; // no more, abort stack walk!
- }
- }
- }
-
- // however the "final" grant set is resolved by assembly, so
- // there's no need to check it every time (just when we're
- // changing assemblies between frames).
- if (frame.Assembly != current) {
- CheckAssembly (current, frame);
- current = frame.Assembly;
- }
-
- if (frame.Domain != domain) {
- CheckAppDomain (domain, frame);
- domain = frame.Domain;
- }
-
- return false;
- }
-
- internal void CheckAssembly (Assembly a, SecurityFrame frame)
- {
- IPermission p = SecurityManager.CheckPermissionSet (a, this, false);
- if (p != null) {
- CodeAccessPermission.ThrowSecurityException (this, "Demand failed assembly permissions checks.",
- frame, SecurityAction.Demand, p);
- }
- }
-
- internal void CheckAppDomain (AppDomain domain, SecurityFrame frame)
- {
- IPermission p = SecurityManager.CheckPermissionSet (domain, this);
- if (p != null) {
- CodeAccessPermission.ThrowSecurityException (this, "Demand failed appdomain permissions checks.",
- frame, SecurityAction.Demand, p);
- }
- }
-
// 2.0 metadata format
internal static PermissionSet CreateFromBinaryFormat (byte[] data)
public int size;
public int index;
}
-
- internal struct SecurityFrame {
-
- private AppDomain _domain;
- private MethodInfo _method;
- private PermissionSet _assert;
- private PermissionSet _deny;
- private PermissionSet _permitonly;
-
- internal SecurityFrame (int skip)
- {
- _domain = null;
- _method = null;
- _assert = null;
- _deny = null;
- _permitonly = null;
-
- throw new NotImplementedException ();
- }
-
- public Assembly Assembly {
- get { return _method.ReflectedType.Assembly; }
- }
-
- public AppDomain Domain {
- get { return _domain; }
- }
-
- public MethodInfo Method {
- get { return _method; }
- }
-
- public PermissionSet Assert {
- get { return _assert; }
- }
-
- public PermissionSet Deny {
- get { return _deny; }
- }
-
- public PermissionSet PermitOnly {
- get { return _permitonly; }
- }
-
- public bool HasStackModifiers {
- get { return ((_assert != null) || (_deny != null) || (_permitonly != null)); }
- }
-
- public bool Equals (SecurityFrame sf)
- {
- if (!Object.ReferenceEquals (_domain, sf.Domain))
- return false;
- if (Assembly.ToString () != sf.Assembly.ToString ())
- return false;
- if (Method.ToString () != sf.Method.ToString ())
- return false;
-
- if ((_assert != null) && !_assert.Equals (sf.Assert))
- return false;
- if ((_deny != null) && !_deny.Equals (sf.Deny))
- return false;
- if ((_permitonly != null) && !_permitonly.Equals (sf.PermitOnly))
- return false;
-
- return true;
- }
-
- public override string ToString ()
- {
- StringBuilder sb = new StringBuilder ();
- sb.AppendFormat ("Frame: {0}{1}", _method, Environment.NewLine);
- sb.AppendFormat ("\tAppDomain: {0}{1}", Domain, Environment.NewLine);
- sb.AppendFormat ("\tAssembly: {0}{1}", Assembly, Environment.NewLine);
- if (_assert != null)
- sb.AppendFormat ("\tAssert: {0}{1}", _assert, Environment.NewLine);
- if (_deny != null)
- sb.AppendFormat ("\tDeny: {0}{1}", _deny, Environment.NewLine);
- if (_permitonly != null)
- sb.AppendFormat ("\tPermitOnly: {0}{1}", _permitonly, Environment.NewLine);
- return sb.ToString ();
- }
-
- static public ArrayList GetStack (int skipFrames)
- {
- return new ArrayList ();
- }
- }
}
// properties
[Obsolete]
- extern public static bool CheckExecutionRights {
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- get;
-
- [MethodImplAttribute (MethodImplOptions.InternalCall)]
- [SecurityPermission (SecurityAction.Demand, ControlPolicy = true)]
- set;
+ public static bool CheckExecutionRights {
+ get {
+ return false;
+ }
+ set {
+ }
}
[Obsolete ("The security manager cannot be turned off on MS runtime")]
return true;
}
- internal static IPermission CheckPermissionSet (Assembly a, PermissionSet ps, bool noncas)
- {
- if (ps.IsEmpty ())
- return null;
-
- foreach (IPermission p in ps) {
- // note: this may contains non CAS permissions
- if ((!noncas) && (p is CodeAccessPermission)) {
- if (!IsGranted (a, p))
- return p;
- } else {
- // but non-CAS will throw on failure...
- try {
- p.Demand ();
- }
- catch (SecurityException) {
- // ... so we catch
- return p;
- }
- }
- }
- return null;
- }
-
- internal static IPermission CheckPermissionSet (AppDomain ad, PermissionSet ps)
- {
- if ((ps == null) || ps.IsEmpty ())
- return null;
-
- PermissionSet granted = ad.GrantedPermissionSet;
- if (granted == null)
- return null;
- if (granted.IsUnrestricted ())
- return null;
- if (ps.IsUnrestricted ())
- return new SecurityPermission (SecurityPermissionFlag.NoFlags);
-
- foreach (IPermission p in ps) {
- if (p is CodeAccessPermission) {
- CodeAccessPermission grant = (CodeAccessPermission) granted.GetPermission (p.GetType ());
- if (grant == null) {
- if (!granted.IsUnrestricted () || !(p is IUnrestrictedPermission)) {
- if (!p.IsSubsetOf (null))
- return p;
- }
- } else if (!p.IsSubsetOf (grant)) {
- return p;
- }
- } else {
- // but non-CAS will throw on failure...
- try {
- p.Demand ();
- }
- catch (SecurityException) {
- // ... so we catch
- return p;
- }
- }
- }
- return null;
- }
-
[Obsolete]
[SecurityPermission (SecurityAction.Demand, ControlPolicy = true)]
public static PolicyLevel LoadPolicyLevelFromFile (string path, PolicyLevelType type)
}
}
- // security check when using reflection
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static unsafe extern bool GetLinkDemandSecurity (MethodBase method, RuntimeDeclSecurityActions *cdecl, RuntimeDeclSecurityActions *mdecl);
-
- // When using reflection LinkDemand are promoted to full Demand (i.e. stack walk)
- internal unsafe static void ReflectedLinkDemandInvoke (MethodBase mb)
- {
- RuntimeDeclSecurityActions klass;
- RuntimeDeclSecurityActions method;
-
- if (!GetLinkDemandSecurity (mb, &klass, &method))
- return;
-
- PermissionSet ps = null;
-
- if (klass.cas.size > 0) {
- ps = Decode (klass.cas.blob, klass.cas.size);
- }
- if (klass.noncas.size > 0) {
- PermissionSet p = Decode (klass.noncas.blob, klass.noncas.size);
- ps = (ps == null) ? p : ps.Union (p);
- }
-
- if (method.cas.size > 0) {
- PermissionSet p = Decode (method.cas.blob, method.cas.size);
- ps = (ps == null) ? p : ps.Union (p);
- }
- if (method.noncas.size > 0) {
- PermissionSet p = Decode (method.noncas.blob, method.noncas.size);
- ps = (ps == null) ? p : ps.Union (p);
- }
-
- // in this case we union-ed the permission sets because we want to do
- // a single stack walk (not up to 4).
- if (ps != null)
- ps.Demand ();
- }
-
- internal unsafe static bool ReflectedLinkDemandQuery (MethodBase mb)
- {
- RuntimeDeclSecurityActions klass;
- RuntimeDeclSecurityActions method;
-
- if (!GetLinkDemandSecurity (mb, &klass, &method))
- return true;
-
- return LinkDemand (mb.ReflectedType.Assembly, &klass, &method);
- }
-
- private unsafe static bool LinkDemand (Assembly a, RuntimeDeclSecurityActions *klass, RuntimeDeclSecurityActions *method)
- {
- try {
- PermissionSet ps = null;
- bool result = true;
- if (klass->cas.size > 0) {
- ps = Decode (klass->cas.blob, klass->cas.size);
- result = (SecurityManager.CheckPermissionSet (a, ps, false) == null);
- }
- if (result && (klass->noncas.size > 0)) {
- ps = Decode (klass->noncas.blob, klass->noncas.size);
- result = (SecurityManager.CheckPermissionSet (a, ps, true) == null);
- }
-
- if (result && (method->cas.size > 0)) {
- ps = Decode (method->cas.blob, method->cas.size);
- result = (SecurityManager.CheckPermissionSet (a, ps, false) == null);
- }
- if (result && (method->noncas.size > 0)) {
- ps = Decode (method->noncas.blob, method->noncas.size);
- result = (SecurityManager.CheckPermissionSet (a, ps, true) == null);
- }
- return result;
- }
- catch (SecurityException) {
- return false;
- }
- }
-
-#pragma warning disable 169
- private static bool LinkDemandFullTrust (Assembly a)
- {
- // FullTrust is immutable (and means Unrestricted)
- // so we can skip the subset operations and jump to IsUnrestricted.
- PermissionSet granted = a.GrantedPermissionSet;
- if ((granted != null) && !granted.IsUnrestricted ())
- return false;
-
- PermissionSet denied = a.DeniedPermissionSet;
- if ((denied != null) && !denied.IsEmpty ())
- return false;
-
- return true;
- }
-
- private static bool LinkDemandUnmanaged (Assembly a)
- {
- // note: we know that UnmanagedCode (SecurityPermission) implements IUnrestrictedPermission
- return IsGranted (a, UnmanagedCode);
- }
-
- // we try to provide as much details as possible to help debugging
- private static void LinkDemandSecurityException (int securityViolation, IntPtr methodHandle)
- {
- RuntimeMethodHandle runtimeHandle = new RuntimeMethodHandle (methodHandle);
- MethodInfo method = (MethodInfo)(MethodBase.GetMethodFromHandle (runtimeHandle));
- Assembly a = method.DeclaringType.Assembly;
-
- string message = null;
- AssemblyName an = null;
- PermissionSet granted = null;
- PermissionSet refused = null;
- object demanded = null;
- IPermission failed = null;
-
- if (a != null) {
- an = a.UnprotectedGetName ();
- granted = a.GrantedPermissionSet;
- refused = a.DeniedPermissionSet;
- }
-
- switch (securityViolation) {
- case 1: // MONO_JIT_LINKDEMAND_PERMISSION
- message = Locale.GetText ("Permissions refused to call this method.");
- break;
- case 2: // MONO_JIT_LINKDEMAND_APTC
- message = Locale.GetText ("Partially trusted callers aren't allowed to call into this assembly.");
- demanded = (object) DefaultPolicies.FullTrust; // immutable
- break;
- case 4: // MONO_JIT_LINKDEMAND_ECMA
- message = Locale.GetText ("Calling internal calls is restricted to ECMA signed assemblies.");
- break;
- case 8: // MONO_JIT_LINKDEMAND_PINVOKE
- message = Locale.GetText ("Calling unmanaged code isn't allowed from this assembly.");
- demanded = (object) _unmanagedCode;
- failed = _unmanagedCode;
- break;
- default:
- message = Locale.GetText ("JIT time LinkDemand failed.");
- break;
- }
-
- throw new SecurityException (message, an, granted, refused, method, SecurityAction.LinkDemand, demanded, failed, null);
- }
-
- private static void InheritanceDemandSecurityException (int securityViolation, Assembly a, Type t, MethodInfo method)
- {
- string message = null;
- AssemblyName an = null;
- PermissionSet granted = null;
- PermissionSet refused = null;
-
- if (a != null) {
- an = a.UnprotectedGetName ();
- granted = a.GrantedPermissionSet;
- refused = a.DeniedPermissionSet;
- }
-
- switch (securityViolation) {
- case 1: // MONO_METADATA_INHERITANCEDEMAND_CLASS
- message = String.Format (Locale.GetText ("Class inheritance refused for {0}."), t);
- break;
- case 2: // MONO_METADATA_INHERITANCEDEMAND_CLASS
- message = Locale.GetText ("Method override refused.");
- break;
- default:
- message = Locale.GetText ("Load time InheritDemand failed.");
- break;
- }
-
- throw new SecurityException (message, an, granted, refused, method, SecurityAction.InheritanceDemand, null, null, null);
- }
-
// called by the runtime when CoreCLR is enabled
private static void ThrowException (Exception ex)
throw ex;
}
- // internal - get called by the class loader
-
- // Called when
- // - class inheritance
- // - method overrides
- private unsafe static bool InheritanceDemand (AppDomain ad, Assembly a, RuntimeDeclSecurityActions *actions)
- {
- try {
- PermissionSet ps = null;
- bool result = true;
- if (actions->cas.size > 0) {
- ps = Decode (actions->cas.blob, actions->cas.size);
- result = (SecurityManager.CheckPermissionSet (a, ps, false) == null);
- if (result) {
- // also check appdomain
- result = (SecurityManager.CheckPermissionSet (ad, ps) == null);
- }
- }
- if (actions->noncas.size > 0) {
- ps = Decode (actions->noncas.blob, actions->noncas.size);
- result = (SecurityManager.CheckPermissionSet (a, ps, true) == null);
- if (result) {
- // also check appdomain
- result = (SecurityManager.CheckPermissionSet (ad, ps) == null);
- }
- }
- return result;
- }
- catch (SecurityException) {
- return false;
- }
- }
-
- // internal - get called at JIT time
-
- private static void DemandUnmanaged ()
- {
- UnmanagedCode.Demand ();
- }
-
- // internal - get called by JIT generated code
-
- private static void InternalDemand (IntPtr permissions, int length)
- {
- PermissionSet ps = Decode (permissions, length);
- ps.Demand ();
- }
-
- private static void InternalDemandChoice (IntPtr permissions, int length)
- {
- throw new SecurityException ("SecurityAction.DemandChoice was removed from 2.0");
- }
#pragma warning restore 169
public static PermissionSet GetStandardSandbox (Evidence evidence)
throw new NotSupportedException ();
}
- internal static void ReflectedLinkDemandInvoke (MethodBase mb)
- {
- throw new NotSupportedException ();
- }
-
- internal static bool ReflectedLinkDemandQuery (MethodBase mb)
- {
- throw new NotSupportedException ();
- }
-
public static PermissionSet GetStandardSandbox (Evidence evidence)
{
if (evidence == null)
[MethodImpl (MethodImplOptions.InternalCall)]
extern internal static string InternalCodePage (ref int code_page);
-#if !(MONOTOUCH || XAMMAC)
+#if !MONOTOUCH
internal static Encoding GetDefaultEncoding ()
{
Encoding enc = null;
throw new NotSupportedException ();
#else
CompressedStack cs = new CompressedStack (0);
- cs._list = SecurityFrame.GetStack (1);
+ cs._list = new ArrayList ();
// include any current CompressedStack inside the new Capture
CompressedStack currentCs = Thread.CurrentThread.ExecutionContext.SecurityContext.CompressedStack;
if (_list.Count != cs._list.Count)
return false;
- for (int i=0; i < _list.Count; i++) {
- SecurityFrame sf1 = (SecurityFrame) _list [i];
- SecurityFrame sf2 = (SecurityFrame) cs._list [i];
- if (!sf1.Equals (sf2))
- return false;
- }
return true;
}
*/
private List<KeyValuePair<DateTime, TimeType>> transitions;
-#if !MOBILE
+#if !MOBILE || MOBILE_STATIC
static TimeZoneInfo CreateLocal ()
{
+#if !MOBILE_STATIC
if (IsWindows && LocalZoneKey != null) {
string name = (string)LocalZoneKey.GetValue ("TimeZoneKeyName");
if (name == null)
if (name != null)
return TimeZoneInfo.FindSystemTimeZoneById (name);
}
+#endif
var tz = Environment.GetEnvironmentVariable ("TZ");
if (tz != null) {
static void GetSystemTimeZones (List<TimeZoneInfo> systemTimeZones)
{
+#if !MOBILE_STATIC
if (TimeZoneKey != null) {
foreach (string id in TimeZoneKey.GetSubKeyNames ()) {
try {
return;
}
+#endif
#if LIBC
string[] continents = new string [] {"Africa", "America", "Antarctica", "Arctic", "Asia", "Atlantic", "Brazil", "Canada", "Chile", "Europe", "Indian", "Mexico", "Mideast", "Pacific", "US"};
#endif
private AdjustmentRule [] adjustmentRules;
-#if !NET_2_1
+#if !NET_2_1 || MOBILE_STATIC
/// <summary>
/// Determine whether windows of not (taken Stephane Delcroix's code)
/// </summary>
return str.Substring (Istart, Iend-Istart+1);
}
+#if !MOBILE_STATIC
static RegistryKey timeZoneKey;
static RegistryKey TimeZoneKey {
get {
"SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation", false);
}
}
+#endif
#endif
private static bool TryAddTicks (DateTime date, long ticks, out DateTime result, DateTimeKind kind = DateTimeKind.Unspecified)
Assert.IsTrue (corlib_test.GetReferencedAssemblies ().Length > 0, "GetReferencedAssemblies");
Assert.AreEqual (0, corlib_test.HostContext, "HostContext");
-#if NET_4_0 && !MOBILE
Assert.AreEqual ("v4.0.30319", corlib_test.ImageRuntimeVersion, "ImageRuntimeVersion");
-#else
- Assert.AreEqual ("v2.0.50727", corlib_test.ImageRuntimeVersion, "ImageRuntimeVersion");
-#endif
Assert.IsNotNull (corlib_test.ManifestModule, "ManifestModule");
Assert.IsFalse (corlib_test.ReflectionOnly, "ReflectionOnly");
System.IO/SeekOrigin.cs
System.IO/UnexceptionalStreamReader.cs
System.IO/UnexceptionalStreamWriter.cs
-System.IO/UnmanagedMemoryAccessor.cs
System.IO.IsolatedStorage/INormalizeForIsolatedStorage.cs
System.IO.IsolatedStorage/IsolatedStorage.cs
System.IO.IsolatedStorage/IsolatedStorageException.cs
../../../external/referencesource/mscorlib/system/int64.cs
../../../external/referencesource/mscorlib/system/iobservable.cs
../../../external/referencesource/mscorlib/system/iobserver.cs
+../../../external/referencesource/mscorlib/system/io/unmanagedmemoryaccessor.cs
../../../external/referencesource/mscorlib/system/iprogress.cs
../../../external/referencesource/mscorlib/system/iserviceobjectprovider.cs
../../../external/referencesource/mscorlib/system/invalidtimezoneexception.cs
if (rightType != typeof(int)) {
throw ContractUtils.Unreachable;
}
+ // Note: If this code is made to handle unsigned
+ // rightType types, emit the following when rightType:
+ // is unsigned
+ //_ilg.EmitInt(0x3f);
+ _ilg.EmitInt(0x1f);
+ _ilg.Emit(OpCodes.And);
_ilg.Emit(OpCodes.Shl);
break;
case ExpressionType.RightShift:
Monodoc.Ecma/EcmaDesc.cs
Mono.Documentation/ManifestResourceResolver.cs
Mono.Documentation/XmlDocUtils.cs
-../../../external/Lucene.Net/src/core/Analysis/Analyzer.cs
-../../../external/Lucene.Net/src/core/Analysis/ASCIIFoldingFilter.cs
-../../../external/Lucene.Net/src/core/Analysis/BaseCharFilter.cs
-../../../external/Lucene.Net/src/core/Analysis/CachingTokenFilter.cs
-../../../external/Lucene.Net/src/core/Analysis/CharArraySet.cs
-../../../external/Lucene.Net/src/core/Analysis/CharFilter.cs
-../../../external/Lucene.Net/src/core/Analysis/CharReader.cs
-../../../external/Lucene.Net/src/core/Analysis/CharStream.cs
-../../../external/Lucene.Net/src/core/Analysis/CharTokenizer.cs
-../../../external/Lucene.Net/src/core/Analysis/ISOLatin1AccentFilter.cs
-../../../external/Lucene.Net/src/core/Analysis/KeywordAnalyzer.cs
-../../../external/Lucene.Net/src/core/Analysis/KeywordTokenizer.cs
-../../../external/Lucene.Net/src/core/Analysis/LengthFilter.cs
-../../../external/Lucene.Net/src/core/Analysis/LetterTokenizer.cs
-../../../external/Lucene.Net/src/core/Analysis/LowerCaseFilter.cs
-../../../external/Lucene.Net/src/core/Analysis/LowerCaseTokenizer.cs
-../../../external/Lucene.Net/src/core/Analysis/MappingCharFilter.cs
-../../../external/Lucene.Net/src/core/Analysis/NormalizeCharMap.cs
-../../../external/Lucene.Net/src/core/Analysis/NumericTokenStream.cs
-../../../external/Lucene.Net/src/core/Analysis/PerFieldAnalyzerWrapper.cs
-../../../external/Lucene.Net/src/core/Analysis/PorterStemFilter.cs
-../../../external/Lucene.Net/src/core/Analysis/PorterStemmer.cs
-../../../external/Lucene.Net/src/core/Analysis/SimpleAnalyzer.cs
-../../../external/Lucene.Net/src/core/Analysis/Standard/StandardAnalyzer.cs
-../../../external/Lucene.Net/src/core/Analysis/Standard/StandardFilter.cs
-../../../external/Lucene.Net/src/core/Analysis/Standard/StandardTokenizer.cs
-../../../external/Lucene.Net/src/core/Analysis/Standard/StandardTokenizerImpl.cs
-../../../external/Lucene.Net/src/core/Analysis/StopAnalyzer.cs
-../../../external/Lucene.Net/src/core/Analysis/StopFilter.cs
-../../../external/Lucene.Net/src/core/Analysis/TeeSinkTokenFilter.cs
-../../../external/Lucene.Net/src/core/Analysis/Token.cs
-../../../external/Lucene.Net/src/core/Analysis/Tokenattributes/FlagsAttribute.cs
-../../../external/Lucene.Net/src/core/Analysis/Tokenattributes/IFlagsAttribute.cs
-../../../external/Lucene.Net/src/core/Analysis/Tokenattributes/IOffsetAttribute.cs
-../../../external/Lucene.Net/src/core/Analysis/Tokenattributes/IPayloadAttribute.cs
-../../../external/Lucene.Net/src/core/Analysis/Tokenattributes/IPositionIncrementAttribute.cs
-../../../external/Lucene.Net/src/core/Analysis/Tokenattributes/ITermAttribute.cs
-../../../external/Lucene.Net/src/core/Analysis/Tokenattributes/ITypeAttribute.cs
-../../../external/Lucene.Net/src/core/Analysis/Tokenattributes/OffsetAttribute.cs
-../../../external/Lucene.Net/src/core/Analysis/Tokenattributes/PayloadAttribute.cs
-../../../external/Lucene.Net/src/core/Analysis/Tokenattributes/PositionIncrementAttribute.cs
-../../../external/Lucene.Net/src/core/Analysis/Tokenattributes/TermAttribute.cs
-../../../external/Lucene.Net/src/core/Analysis/Tokenattributes/TypeAttribute.cs
-../../../external/Lucene.Net/src/core/Analysis/TokenFilter.cs
-../../../external/Lucene.Net/src/core/Analysis/Tokenizer.cs
-../../../external/Lucene.Net/src/core/Analysis/TokenStream.cs
-../../../external/Lucene.Net/src/core/Analysis/WhitespaceAnalyzer.cs
-../../../external/Lucene.Net/src/core/Analysis/WhitespaceTokenizer.cs
-../../../external/Lucene.Net/src/core/Analysis/WordlistLoader.cs
-../../../external/Lucene.Net/src/core/Document/AbstractField.cs
-../../../external/Lucene.Net/src/core/Document/CompressionTools.cs
-../../../external/Lucene.Net/src/core/Document/DateField.cs
-../../../external/Lucene.Net/src/core/Document/DateTools.cs
-../../../external/Lucene.Net/src/core/Document/Document.cs
-../../../external/Lucene.Net/src/core/Document/Field.cs
-../../../external/Lucene.Net/src/core/Document/Fieldable.cs
-../../../external/Lucene.Net/src/core/Document/FieldSelector.cs
-../../../external/Lucene.Net/src/core/Document/FieldSelectorResult.cs
-../../../external/Lucene.Net/src/core/Document/LoadFirstFieldSelector.cs
-../../../external/Lucene.Net/src/core/Document/MapFieldSelector.cs
-../../../external/Lucene.Net/src/core/Document/NumberTools.cs
-../../../external/Lucene.Net/src/core/Document/NumericField.cs
-../../../external/Lucene.Net/src/core/Document/SetBasedFieldSelector.cs
-../../../external/Lucene.Net/src/core/Index/AbstractAllTermDocs.cs
-../../../external/Lucene.Net/src/core/Index/AllTermDocs.cs
-../../../external/Lucene.Net/src/core/Index/BufferedDeletes.cs
-../../../external/Lucene.Net/src/core/Index/ByteBlockPool.cs
-../../../external/Lucene.Net/src/core/Index/ByteSliceReader.cs
-../../../external/Lucene.Net/src/core/Index/ByteSliceWriter.cs
-../../../external/Lucene.Net/src/core/Index/CharBlockPool.cs
-../../../external/Lucene.Net/src/core/Index/CheckIndex.cs
-../../../external/Lucene.Net/src/core/Index/CompoundFileReader.cs
-../../../external/Lucene.Net/src/core/Index/CompoundFileWriter.cs
-../../../external/Lucene.Net/src/core/Index/ConcurrentMergeScheduler.cs
-../../../external/Lucene.Net/src/core/Index/CorruptIndexException.cs
-../../../external/Lucene.Net/src/core/Index/DefaultSkipListReader.cs
-../../../external/Lucene.Net/src/core/Index/DefaultSkipListWriter.cs
-../../../external/Lucene.Net/src/core/Index/DirectoryReader.cs
-../../../external/Lucene.Net/src/core/Index/DocConsumer.cs
-../../../external/Lucene.Net/src/core/Index/DocConsumerPerThread.cs
-../../../external/Lucene.Net/src/core/Index/DocFieldConsumer.cs
-../../../external/Lucene.Net/src/core/Index/DocFieldConsumerPerField.cs
-../../../external/Lucene.Net/src/core/Index/DocFieldConsumerPerThread.cs
-../../../external/Lucene.Net/src/core/Index/DocFieldConsumers.cs
-../../../external/Lucene.Net/src/core/Index/DocFieldConsumersPerField.cs
-../../../external/Lucene.Net/src/core/Index/DocFieldConsumersPerThread.cs
-../../../external/Lucene.Net/src/core/Index/DocFieldProcessor.cs
-../../../external/Lucene.Net/src/core/Index/DocFieldProcessorPerField.cs
-../../../external/Lucene.Net/src/core/Index/DocFieldProcessorPerThread.cs
-../../../external/Lucene.Net/src/core/Index/DocInverter.cs
-../../../external/Lucene.Net/src/core/Index/DocInverterPerField.cs
-../../../external/Lucene.Net/src/core/Index/DocInverterPerThread.cs
-../../../external/Lucene.Net/src/core/Index/DocumentsWriter.cs
-../../../external/Lucene.Net/src/core/Index/DocumentsWriterThreadState.cs
-../../../external/Lucene.Net/src/core/Index/FieldInfo.cs
-../../../external/Lucene.Net/src/core/Index/FieldInfos.cs
-../../../external/Lucene.Net/src/core/Index/FieldInvertState.cs
-../../../external/Lucene.Net/src/core/Index/FieldReaderException.cs
-../../../external/Lucene.Net/src/core/Index/FieldSortedTermVectorMapper.cs
-../../../external/Lucene.Net/src/core/Index/FieldsReader.cs
-../../../external/Lucene.Net/src/core/Index/FieldsWriter.cs
-../../../external/Lucene.Net/src/core/Index/FilterIndexReader.cs
-../../../external/Lucene.Net/src/core/Index/FormatPostingsDocsConsumer.cs
-../../../external/Lucene.Net/src/core/Index/FormatPostingsDocsWriter.cs
-../../../external/Lucene.Net/src/core/Index/FormatPostingsFieldsConsumer.cs
-../../../external/Lucene.Net/src/core/Index/FormatPostingsFieldsWriter.cs
-../../../external/Lucene.Net/src/core/Index/FormatPostingsPositionsConsumer.cs
-../../../external/Lucene.Net/src/core/Index/FormatPostingsPositionsWriter.cs
-../../../external/Lucene.Net/src/core/Index/FormatPostingsTermsConsumer.cs
-../../../external/Lucene.Net/src/core/Index/FormatPostingsTermsWriter.cs
-../../../external/Lucene.Net/src/core/Index/FreqProxFieldMergeState.cs
-../../../external/Lucene.Net/src/core/Index/FreqProxTermsWriter.cs
-../../../external/Lucene.Net/src/core/Index/FreqProxTermsWriterPerField.cs
-../../../external/Lucene.Net/src/core/Index/FreqProxTermsWriterPerThread.cs
-../../../external/Lucene.Net/src/core/Index/IndexCommit.cs
-../../../external/Lucene.Net/src/core/Index/IndexDeletionPolicy.cs
-../../../external/Lucene.Net/src/core/Index/IndexFileDeleter.cs
-../../../external/Lucene.Net/src/core/Index/IndexFileNameFilter.cs
-../../../external/Lucene.Net/src/core/Index/IndexFileNames.cs
-../../../external/Lucene.Net/src/core/Index/IndexReader.cs
-../../../external/Lucene.Net/src/core/Index/IndexWriter.cs
-../../../external/Lucene.Net/src/core/Index/IntBlockPool.cs
-../../../external/Lucene.Net/src/core/Index/InvertedDocConsumer.cs
-../../../external/Lucene.Net/src/core/Index/InvertedDocConsumerPerField.cs
-../../../external/Lucene.Net/src/core/Index/InvertedDocConsumerPerThread.cs
-../../../external/Lucene.Net/src/core/Index/InvertedDocEndConsumer.cs
-../../../external/Lucene.Net/src/core/Index/InvertedDocEndConsumerPerField.cs
-../../../external/Lucene.Net/src/core/Index/InvertedDocEndConsumerPerThread.cs
-../../../external/Lucene.Net/src/core/Index/KeepOnlyLastCommitDeletionPolicy.cs
-../../../external/Lucene.Net/src/core/Index/LogByteSizeMergePolicy.cs
-../../../external/Lucene.Net/src/core/Index/LogDocMergePolicy.cs
-../../../external/Lucene.Net/src/core/Index/LogMergePolicy.cs
-../../../external/Lucene.Net/src/core/Index/MergeDocIDRemapper.cs
-../../../external/Lucene.Net/src/core/Index/MergePolicy.cs
-../../../external/Lucene.Net/src/core/Index/MergeScheduler.cs
-../../../external/Lucene.Net/src/core/Index/MultiLevelSkipListReader.cs
-../../../external/Lucene.Net/src/core/Index/MultiLevelSkipListWriter.cs
-../../../external/Lucene.Net/src/core/Index/MultipleTermPositions.cs
-../../../external/Lucene.Net/src/core/Index/MultiReader.cs
-../../../external/Lucene.Net/src/core/Index/NormsWriter.cs
-../../../external/Lucene.Net/src/core/Index/NormsWriterPerField.cs
-../../../external/Lucene.Net/src/core/Index/NormsWriterPerThread.cs
-../../../external/Lucene.Net/src/core/Index/ParallelReader.cs
-../../../external/Lucene.Net/src/core/Index/Payload.cs
-../../../external/Lucene.Net/src/core/Index/PositionBasedTermVectorMapper.cs
-../../../external/Lucene.Net/src/core/Index/RawPostingList.cs
-../../../external/Lucene.Net/src/core/Index/ReadOnlyDirectoryReader.cs
-../../../external/Lucene.Net/src/core/Index/ReadOnlySegmentReader.cs
-../../../external/Lucene.Net/src/core/Index/ReusableStringReader.cs
-../../../external/Lucene.Net/src/core/Index/SegmentInfo.cs
-../../../external/Lucene.Net/src/core/Index/SegmentInfos.cs
-../../../external/Lucene.Net/src/core/Index/SegmentMergeInfo.cs
-../../../external/Lucene.Net/src/core/Index/SegmentMergeQueue.cs
-../../../external/Lucene.Net/src/core/Index/SegmentMerger.cs
-../../../external/Lucene.Net/src/core/Index/SegmentReader.cs
-../../../external/Lucene.Net/src/core/Index/SegmentTermDocs.cs
-../../../external/Lucene.Net/src/core/Index/SegmentTermEnum.cs
-../../../external/Lucene.Net/src/core/Index/SegmentTermPositions.cs
-../../../external/Lucene.Net/src/core/Index/SegmentTermPositionVector.cs
-../../../external/Lucene.Net/src/core/Index/SegmentTermVector.cs
-../../../external/Lucene.Net/src/core/Index/SegmentWriteState.cs
-../../../external/Lucene.Net/src/core/Index/SerialMergeScheduler.cs
-../../../external/Lucene.Net/src/core/Index/SnapshotDeletionPolicy.cs
-../../../external/Lucene.Net/src/core/Index/SortedTermVectorMapper.cs
-../../../external/Lucene.Net/src/core/Index/StaleReaderException.cs
-../../../external/Lucene.Net/src/core/Index/StoredFieldsWriter.cs
-../../../external/Lucene.Net/src/core/Index/StoredFieldsWriterPerThread.cs
-../../../external/Lucene.Net/src/core/Index/Term.cs
-../../../external/Lucene.Net/src/core/Index/TermBuffer.cs
-../../../external/Lucene.Net/src/core/Index/TermDocs.cs
-../../../external/Lucene.Net/src/core/Index/TermEnum.cs
-../../../external/Lucene.Net/src/core/Index/TermFreqVector.cs
-../../../external/Lucene.Net/src/core/Index/TermInfo.cs
-../../../external/Lucene.Net/src/core/Index/TermInfosReader.cs
-../../../external/Lucene.Net/src/core/Index/TermInfosWriter.cs
-../../../external/Lucene.Net/src/core/Index/TermPositions.cs
-../../../external/Lucene.Net/src/core/Index/TermPositionVector.cs
-../../../external/Lucene.Net/src/core/Index/TermsHash.cs
-../../../external/Lucene.Net/src/core/Index/TermsHashConsumer.cs
-../../../external/Lucene.Net/src/core/Index/TermsHashConsumerPerField.cs
-../../../external/Lucene.Net/src/core/Index/TermsHashConsumerPerThread.cs
-../../../external/Lucene.Net/src/core/Index/TermsHashPerField.cs
-../../../external/Lucene.Net/src/core/Index/TermsHashPerThread.cs
-../../../external/Lucene.Net/src/core/Index/TermVectorEntry.cs
-../../../external/Lucene.Net/src/core/Index/TermVectorEntryFreqSortedComparator.cs
-../../../external/Lucene.Net/src/core/Index/TermVectorMapper.cs
-../../../external/Lucene.Net/src/core/Index/TermVectorOffsetInfo.cs
-../../../external/Lucene.Net/src/core/Index/TermVectorsReader.cs
-../../../external/Lucene.Net/src/core/Index/TermVectorsTermsWriter.cs
-../../../external/Lucene.Net/src/core/Index/TermVectorsTermsWriterPerField.cs
-../../../external/Lucene.Net/src/core/Index/TermVectorsTermsWriterPerThread.cs
-../../../external/Lucene.Net/src/core/Index/TermVectorsWriter.cs
-../../../external/Lucene.Net/src/core/LucenePackage.cs
-../../../external/Lucene.Net/src/core/LZOCompressor.cs
-../../../external/Lucene.Net/src/core/Messages/INLSException.cs
-../../../external/Lucene.Net/src/core/Messages/Message.cs
-../../../external/Lucene.Net/src/core/Messages/MessageImpl.cs
-../../../external/Lucene.Net/src/core/Messages/NLS.cs
-../../../external/Lucene.Net/src/core/QueryParser/CharStream.cs
-../../../external/Lucene.Net/src/core/QueryParser/FastCharStream.cs
-../../../external/Lucene.Net/src/core/QueryParser/MultiFieldQueryParser.cs
-../../../external/Lucene.Net/src/core/QueryParser/ParseException.cs
-../../../external/Lucene.Net/src/core/QueryParser/QueryParser.cs
-../../../external/Lucene.Net/src/core/QueryParser/QueryParserConstants.cs
-../../../external/Lucene.Net/src/core/QueryParser/QueryParserTokenManager.cs
-../../../external/Lucene.Net/src/core/QueryParser/Token.cs
-../../../external/Lucene.Net/src/core/QueryParser/TokenMgrError.cs
-../../../external/Lucene.Net/src/core/Search/BooleanClause.cs
-../../../external/Lucene.Net/src/core/Search/BooleanQuery.cs
-../../../external/Lucene.Net/src/core/Search/BooleanScorer.cs
-../../../external/Lucene.Net/src/core/Search/BooleanScorer2.cs
-../../../external/Lucene.Net/src/core/Search/CachingSpanFilter.cs
-../../../external/Lucene.Net/src/core/Search/CachingWrapperFilter.cs
-../../../external/Lucene.Net/src/core/Search/Collector.cs
-../../../external/Lucene.Net/src/core/Search/ComplexExplanation.cs
-../../../external/Lucene.Net/src/core/Search/ConjunctionScorer.cs
-../../../external/Lucene.Net/src/core/Search/ConstantScoreQuery.cs
-../../../external/Lucene.Net/src/core/Search/DefaultSimilarity.cs
-../../../external/Lucene.Net/src/core/Search/DisjunctionMaxQuery.cs
-../../../external/Lucene.Net/src/core/Search/DisjunctionMaxScorer.cs
-../../../external/Lucene.Net/src/core/Search/DisjunctionSumScorer.cs
-../../../external/Lucene.Net/src/core/Search/DocIdSet.cs
-../../../external/Lucene.Net/src/core/Search/DocIdSetIterator.cs
-../../../external/Lucene.Net/src/core/Search/ExactPhraseScorer.cs
-../../../external/Lucene.Net/src/core/Search/Explanation.cs
-../../../external/Lucene.Net/src/core/Search/FieldCache.cs
-../../../external/Lucene.Net/src/core/Search/FieldCacheImpl.cs
-../../../external/Lucene.Net/src/core/Search/FieldCacheRangeFilter.cs
-../../../external/Lucene.Net/src/core/Search/FieldCacheTermsFilter.cs
-../../../external/Lucene.Net/src/core/Search/FieldComparator.cs
-../../../external/Lucene.Net/src/core/Search/FieldComparatorSource.cs
-../../../external/Lucene.Net/src/core/Search/FieldDoc.cs
-../../../external/Lucene.Net/src/core/Search/FieldDocSortedHitQueue.cs
-../../../external/Lucene.Net/src/core/Search/FieldValueHitQueue.cs
-../../../external/Lucene.Net/src/core/Search/Filter.cs
-../../../external/Lucene.Net/src/core/Search/FilteredDocIdSet.cs
-../../../external/Lucene.Net/src/core/Search/FilteredDocIdSetIterator.cs
-../../../external/Lucene.Net/src/core/Search/FilteredQuery.cs
-../../../external/Lucene.Net/src/core/Search/FilteredTermEnum.cs
-../../../external/Lucene.Net/src/core/Search/FilterManager.cs
-../../../external/Lucene.Net/src/core/Search/Function/ByteFieldSource.cs
-../../../external/Lucene.Net/src/core/Search/Function/CustomScoreProvider.cs
-../../../external/Lucene.Net/src/core/Search/Function/CustomScoreQuery.cs
-../../../external/Lucene.Net/src/core/Search/Function/DocValues.cs
-../../../external/Lucene.Net/src/core/Search/Function/FieldCacheSource.cs
-../../../external/Lucene.Net/src/core/Search/Function/FieldScoreQuery.cs
-../../../external/Lucene.Net/src/core/Search/Function/FloatFieldSource.cs
-../../../external/Lucene.Net/src/core/Search/Function/IntFieldSource.cs
-../../../external/Lucene.Net/src/core/Search/Function/OrdFieldSource.cs
-../../../external/Lucene.Net/src/core/Search/Function/ReverseOrdFieldSource.cs
-../../../external/Lucene.Net/src/core/Search/Function/ShortFieldSource.cs
-../../../external/Lucene.Net/src/core/Search/Function/ValueSource.cs
-../../../external/Lucene.Net/src/core/Search/Function/ValueSourceQuery.cs
-../../../external/Lucene.Net/src/core/Search/FuzzyQuery.cs
-../../../external/Lucene.Net/src/core/Search/FuzzyTermEnum.cs
-../../../external/Lucene.Net/src/core/Search/HitQueue.cs
-../../../external/Lucene.Net/src/core/Search/IndexSearcher.cs
-../../../external/Lucene.Net/src/core/Search/MatchAllDocsQuery.cs
-../../../external/Lucene.Net/src/core/Search/MultiPhraseQuery.cs
-../../../external/Lucene.Net/src/core/Search/MultiSearcher.cs
-../../../external/Lucene.Net/src/core/Search/MultiTermQuery.cs
-../../../external/Lucene.Net/src/core/Search/MultiTermQueryWrapperFilter.cs
-../../../external/Lucene.Net/src/core/Search/NumericRangeFilter.cs
-../../../external/Lucene.Net/src/core/Search/NumericRangeQuery.cs
-../../../external/Lucene.Net/src/core/Search/ParallelMultiSearcher.cs
-../../../external/Lucene.Net/src/core/Search/Payloads/AveragePayloadFunction.cs
-../../../external/Lucene.Net/src/core/Search/Payloads/MaxPayloadFunction.cs
-../../../external/Lucene.Net/src/core/Search/Payloads/MinPayloadFunction.cs
-../../../external/Lucene.Net/src/core/Search/Payloads/PayloadFunction.cs
-../../../external/Lucene.Net/src/core/Search/Payloads/PayloadNearQuery.cs
-../../../external/Lucene.Net/src/core/Search/Payloads/PayloadSpanUtil.cs
-../../../external/Lucene.Net/src/core/Search/Payloads/PayloadTermQuery.cs
-../../../external/Lucene.Net/src/core/Search/PhrasePositions.cs
-../../../external/Lucene.Net/src/core/Search/PhraseQuery.cs
-../../../external/Lucene.Net/src/core/Search/PhraseQueue.cs
-../../../external/Lucene.Net/src/core/Search/PhraseScorer.cs
-../../../external/Lucene.Net/src/core/Search/PositiveScoresOnlyCollector.cs
-../../../external/Lucene.Net/src/core/Search/PrefixFilter.cs
-../../../external/Lucene.Net/src/core/Search/PrefixQuery.cs
-../../../external/Lucene.Net/src/core/Search/PrefixTermEnum.cs
-../../../external/Lucene.Net/src/core/Search/Query.cs
-../../../external/Lucene.Net/src/core/Search/QueryTermVector.cs
-../../../external/Lucene.Net/src/core/Search/QueryWrapperFilter.cs
-../../../external/Lucene.Net/src/core/Search/ReqExclScorer.cs
-../../../external/Lucene.Net/src/core/Search/ReqOptSumScorer.cs
-../../../external/Lucene.Net/src/core/Search/ScoreCachingWrappingScorer.cs
-../../../external/Lucene.Net/src/core/Search/ScoreDoc.cs
-../../../external/Lucene.Net/src/core/Search/Scorer.cs
-../../../external/Lucene.Net/src/core/Search/Searchable.cs
-../../../external/Lucene.Net/src/core/Search/Searcher.cs
-../../../external/Lucene.Net/src/core/Search/Similarity.cs
-../../../external/Lucene.Net/src/core/Search/SimilarityDelegator.cs
-../../../external/Lucene.Net/src/core/Search/SingleTermEnum.cs
-../../../external/Lucene.Net/src/core/Search/SloppyPhraseScorer.cs
-../../../external/Lucene.Net/src/core/Search/Sort.cs
-../../../external/Lucene.Net/src/core/Search/SortField.cs
-../../../external/Lucene.Net/src/core/Search/SpanFilter.cs
-../../../external/Lucene.Net/src/core/Search/SpanFilterResult.cs
-../../../external/Lucene.Net/src/core/Search/SpanQueryFilter.cs
-../../../external/Lucene.Net/src/core/Search/Spans/FieldMaskingSpanQuery.cs
-../../../external/Lucene.Net/src/core/Search/Spans/NearSpansOrdered.cs
-../../../external/Lucene.Net/src/core/Search/Spans/NearSpansUnordered.cs
-../../../external/Lucene.Net/src/core/Search/Spans/SpanFirstQuery.cs
-../../../external/Lucene.Net/src/core/Search/Spans/SpanNearQuery.cs
-../../../external/Lucene.Net/src/core/Search/Spans/SpanNotQuery.cs
-../../../external/Lucene.Net/src/core/Search/Spans/SpanOrQuery.cs
-../../../external/Lucene.Net/src/core/Search/Spans/SpanQuery.cs
-../../../external/Lucene.Net/src/core/Search/Spans/Spans.cs
-../../../external/Lucene.Net/src/core/Search/Spans/SpanScorer.cs
-../../../external/Lucene.Net/src/core/Search/Spans/SpanTermQuery.cs
-../../../external/Lucene.Net/src/core/Search/Spans/SpanWeight.cs
-../../../external/Lucene.Net/src/core/Search/Spans/TermSpans.cs
-../../../external/Lucene.Net/src/core/Search/TermQuery.cs
-../../../external/Lucene.Net/src/core/Search/TermRangeFilter.cs
-../../../external/Lucene.Net/src/core/Search/TermRangeQuery.cs
-../../../external/Lucene.Net/src/core/Search/TermRangeTermEnum.cs
-../../../external/Lucene.Net/src/core/Search/TermScorer.cs
-../../../external/Lucene.Net/src/core/Search/TimeLimitingCollector.cs
-../../../external/Lucene.Net/src/core/Search/TopDocs.cs
-../../../external/Lucene.Net/src/core/Search/TopDocsCollector.cs
-../../../external/Lucene.Net/src/core/Search/TopFieldCollector.cs
-../../../external/Lucene.Net/src/core/Search/TopFieldDocs.cs
-../../../external/Lucene.Net/src/core/Search/TopScoreDocCollector.cs
-../../../external/Lucene.Net/src/core/Search/Weight.cs
-../../../external/Lucene.Net/src/core/Search/WildcardQuery.cs
-../../../external/Lucene.Net/src/core/Search/WildcardTermEnum.cs
-../../../external/Lucene.Net/src/core/Store/AlreadyClosedException.cs
-../../../external/Lucene.Net/src/core/Store/BufferedIndexInput.cs
-../../../external/Lucene.Net/src/core/Store/BufferedIndexOutput.cs
-../../../external/Lucene.Net/src/core/Store/CheckSumIndexInput.cs
-../../../external/Lucene.Net/src/core/Store/CheckSumIndexOutput.cs
-../../../external/Lucene.Net/src/core/Store/Directory.cs
-../../../external/Lucene.Net/src/core/Store/FileSwitchDirectory.cs
-../../../external/Lucene.Net/src/core/Store/FSDirectory.cs
-../../../external/Lucene.Net/src/core/Store/FSLockFactory.cs
-../../../external/Lucene.Net/src/core/Store/IndexInput.cs
-../../../external/Lucene.Net/src/core/Store/IndexOutput.cs
-../../../external/Lucene.Net/src/core/Store/Lock.cs
-../../../external/Lucene.Net/src/core/Store/LockFactory.cs
-../../../external/Lucene.Net/src/core/Store/LockObtainFailedException.cs
-../../../external/Lucene.Net/src/core/Store/LockReleaseFailedException.cs
-../../../external/Lucene.Net/src/core/Store/LockStressTest.cs
-../../../external/Lucene.Net/src/core/Store/LockVerifyServer.cs
-../../../external/Lucene.Net/src/core/Store/MMapDirectory.cs
-../../../external/Lucene.Net/src/core/Store/NativeFSLockFactory.cs
-../../../external/Lucene.Net/src/core/Store/NIOFSDirectory.cs
-../../../external/Lucene.Net/src/core/Store/NoLockFactory.cs
-../../../external/Lucene.Net/src/core/Store/NoSuchDirectoryException.cs
-../../../external/Lucene.Net/src/core/Store/RAMDirectory.cs
-../../../external/Lucene.Net/src/core/Store/RAMFile.cs
-../../../external/Lucene.Net/src/core/Store/RAMInputStream.cs
-../../../external/Lucene.Net/src/core/Store/RAMOutputStream.cs
-../../../external/Lucene.Net/src/core/Store/SimpleFSDirectory.cs
-../../../external/Lucene.Net/src/core/Store/SimpleFSLockFactory.cs
-../../../external/Lucene.Net/src/core/Store/SingleInstanceLockFactory.cs
-../../../external/Lucene.Net/src/core/Store/VerifyingLockFactory.cs
-../../../external/Lucene.Net/src/core/Support/AppSettings.cs
-../../../external/Lucene.Net/src/core/Support/AttributeImplItem.cs
-../../../external/Lucene.Net/src/core/Support/BitSetSupport.cs
-../../../external/Lucene.Net/src/core/Support/BuildType.cs
-../../../external/Lucene.Net/src/core/Support/Character.cs
-../../../external/Lucene.Net/src/core/Support/CloseableThreadLocalProfiler.cs
-../../../external/Lucene.Net/src/core/Support/CollectionsHelper.cs
-../../../external/Lucene.Net/src/core/Support/Compare.cs
-../../../external/Lucene.Net/src/core/Support/Compatibility/ConcurrentDictionary.cs
-../../../external/Lucene.Net/src/core/Support/Compatibility/Func.cs
-../../../external/Lucene.Net/src/core/Support/Compatibility/ISet.cs
-../../../external/Lucene.Net/src/core/Support/Compatibility/SetFactory.cs
-../../../external/Lucene.Net/src/core/Support/Compatibility/SortedSet.cs
-../../../external/Lucene.Net/src/core/Support/Compatibility/ThreadLocal.cs
-../../../external/Lucene.Net/src/core/Support/Compatibility/WrappedHashSet.cs
-../../../external/Lucene.Net/src/core/Support/CRC32.cs
-../../../external/Lucene.Net/src/core/Support/Cryptography.cs
-../../../external/Lucene.Net/src/core/Support/Deflater.cs
-../../../external/Lucene.Net/src/core/Support/Double.cs
-../../../external/Lucene.Net/src/core/Support/EquatableList.cs
-../../../external/Lucene.Net/src/core/Support/FileSupport.cs
-../../../external/Lucene.Net/src/core/Support/GeneralKeyedCollection.cs
-../../../external/Lucene.Net/src/core/Support/HashMap.cs
-../../../external/Lucene.Net/src/core/Support/IChecksum.cs
-../../../external/Lucene.Net/src/core/Support/Inflater.cs
-../../../external/Lucene.Net/src/core/Support/IThreadRunnable.cs
-../../../external/Lucene.Net/src/core/Support/Number.cs
-../../../external/Lucene.Net/src/core/Support/OS.cs
-../../../external/Lucene.Net/src/core/Support/SharpZipLib.cs
-../../../external/Lucene.Net/src/core/Support/Single.cs
-../../../external/Lucene.Net/src/core/Support/TextSupport.cs
-../../../external/Lucene.Net/src/core/Support/ThreadClass.cs
-../../../external/Lucene.Net/src/core/Support/ThreadLock.cs
-../../../external/Lucene.Net/src/core/Support/WeakDictionary.cs
-../../../external/Lucene.Net/src/core/Util/ArrayUtil.cs
-../../../external/Lucene.Net/src/core/Util/Attribute.cs
-../../../external/Lucene.Net/src/core/Util/AttributeSource.cs
-../../../external/Lucene.Net/src/core/Util/AverageGuessMemoryModel.cs
-../../../external/Lucene.Net/src/core/Util/BitUtil.cs
-../../../external/Lucene.Net/src/core/Util/BitVector.cs
-../../../external/Lucene.Net/src/core/Util/Cache/Cache.cs
-../../../external/Lucene.Net/src/core/Util/Cache/SimpleLRUCache.cs
-../../../external/Lucene.Net/src/core/Util/Cache/SimpleMapCache.cs
-../../../external/Lucene.Net/src/core/Util/CloseableThreadLocal.cs
-../../../external/Lucene.Net/src/core/Util/Constants.cs
-../../../external/Lucene.Net/src/core/Util/DocIdBitSet.cs
-../../../external/Lucene.Net/src/core/Util/FieldCacheSanityChecker.cs
-../../../external/Lucene.Net/src/core/Util/IAttribute.cs
-../../../external/Lucene.Net/src/core/Util/IdentityDictionary.cs
-../../../external/Lucene.Net/src/core/Util/IndexableBinaryStringTools.cs
-../../../external/Lucene.Net/src/core/Util/MapOfSets.cs
-../../../external/Lucene.Net/src/core/Util/MemoryModel.cs
-../../../external/Lucene.Net/src/core/Util/NumericUtils.cs
-../../../external/Lucene.Net/src/core/Util/OpenBitSet.cs
-../../../external/Lucene.Net/src/core/Util/OpenBitSetDISI.cs
-../../../external/Lucene.Net/src/core/Util/OpenBitSetIterator.cs
-../../../external/Lucene.Net/src/core/Util/PriorityQueue.cs
-../../../external/Lucene.Net/src/core/Util/RamUsageEstimator.cs
-../../../external/Lucene.Net/src/core/Util/ReaderUtil.cs
-../../../external/Lucene.Net/src/core/Util/ScorerDocQueue.cs
-../../../external/Lucene.Net/src/core/Util/SimpleStringInterner.cs
-../../../external/Lucene.Net/src/core/Util/SmallFloat.cs
-../../../external/Lucene.Net/src/core/Util/SortedVIntList.cs
-../../../external/Lucene.Net/src/core/Util/SorterTemplate.cs
-../../../external/Lucene.Net/src/core/Util/StringHelper.cs
-../../../external/Lucene.Net/src/core/Util/StringInterner.cs
-../../../external/Lucene.Net/src/core/Util/ToStringUtils.cs
-../../../external/Lucene.Net/src/core/Util/UnicodeUtil.cs
-../../../external/Lucene.Net/src/core/Util/Version.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Analyzer.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/ASCIIFoldingFilter.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/BaseCharFilter.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/CachingTokenFilter.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/CharArraySet.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/CharFilter.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/CharReader.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/CharStream.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/CharTokenizer.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/ISOLatin1AccentFilter.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/KeywordAnalyzer.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/KeywordTokenizer.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/LengthFilter.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/LetterTokenizer.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/LowerCaseFilter.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/LowerCaseTokenizer.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/MappingCharFilter.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/NormalizeCharMap.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/NumericTokenStream.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/PerFieldAnalyzerWrapper.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/PorterStemFilter.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/PorterStemmer.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/SimpleAnalyzer.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Standard/StandardAnalyzer.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Standard/StandardFilter.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Standard/StandardTokenizer.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Standard/StandardTokenizerImpl.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/StopAnalyzer.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/StopFilter.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/TeeSinkTokenFilter.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Token.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Tokenattributes/FlagsAttribute.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Tokenattributes/IFlagsAttribute.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Tokenattributes/IOffsetAttribute.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Tokenattributes/IPayloadAttribute.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Tokenattributes/IPositionIncrementAttribute.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Tokenattributes/ITermAttribute.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Tokenattributes/ITypeAttribute.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Tokenattributes/OffsetAttribute.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Tokenattributes/PayloadAttribute.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Tokenattributes/PositionIncrementAttribute.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Tokenattributes/TermAttribute.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Tokenattributes/TypeAttribute.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/TokenFilter.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/Tokenizer.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/TokenStream.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/WhitespaceAnalyzer.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/WhitespaceTokenizer.cs
+../../../external/Lucene.Net.Light/src/core/Analysis/WordlistLoader.cs
+../../../external/Lucene.Net.Light/src/core/Document/AbstractField.cs
+../../../external/Lucene.Net.Light/src/core/Document/CompressionTools.cs
+../../../external/Lucene.Net.Light/src/core/Document/DateField.cs
+../../../external/Lucene.Net.Light/src/core/Document/DateTools.cs
+../../../external/Lucene.Net.Light/src/core/Document/Document.cs
+../../../external/Lucene.Net.Light/src/core/Document/Field.cs
+../../../external/Lucene.Net.Light/src/core/Document/Fieldable.cs
+../../../external/Lucene.Net.Light/src/core/Document/FieldSelector.cs
+../../../external/Lucene.Net.Light/src/core/Document/FieldSelectorResult.cs
+../../../external/Lucene.Net.Light/src/core/Document/LoadFirstFieldSelector.cs
+../../../external/Lucene.Net.Light/src/core/Document/MapFieldSelector.cs
+../../../external/Lucene.Net.Light/src/core/Document/NumberTools.cs
+../../../external/Lucene.Net.Light/src/core/Document/NumericField.cs
+../../../external/Lucene.Net.Light/src/core/Document/SetBasedFieldSelector.cs
+../../../external/Lucene.Net.Light/src/core/Index/AbstractAllTermDocs.cs
+../../../external/Lucene.Net.Light/src/core/Index/AllTermDocs.cs
+../../../external/Lucene.Net.Light/src/core/Index/BufferedDeletes.cs
+../../../external/Lucene.Net.Light/src/core/Index/ByteBlockPool.cs
+../../../external/Lucene.Net.Light/src/core/Index/ByteSliceReader.cs
+../../../external/Lucene.Net.Light/src/core/Index/ByteSliceWriter.cs
+../../../external/Lucene.Net.Light/src/core/Index/CharBlockPool.cs
+../../../external/Lucene.Net.Light/src/core/Index/CheckIndex.cs
+../../../external/Lucene.Net.Light/src/core/Index/CompoundFileReader.cs
+../../../external/Lucene.Net.Light/src/core/Index/CompoundFileWriter.cs
+../../../external/Lucene.Net.Light/src/core/Index/ConcurrentMergeScheduler.cs
+../../../external/Lucene.Net.Light/src/core/Index/CorruptIndexException.cs
+../../../external/Lucene.Net.Light/src/core/Index/DefaultSkipListReader.cs
+../../../external/Lucene.Net.Light/src/core/Index/DefaultSkipListWriter.cs
+../../../external/Lucene.Net.Light/src/core/Index/DirectoryReader.cs
+../../../external/Lucene.Net.Light/src/core/Index/DocConsumer.cs
+../../../external/Lucene.Net.Light/src/core/Index/DocConsumerPerThread.cs
+../../../external/Lucene.Net.Light/src/core/Index/DocFieldConsumer.cs
+../../../external/Lucene.Net.Light/src/core/Index/DocFieldConsumerPerField.cs
+../../../external/Lucene.Net.Light/src/core/Index/DocFieldConsumerPerThread.cs
+../../../external/Lucene.Net.Light/src/core/Index/DocFieldConsumers.cs
+../../../external/Lucene.Net.Light/src/core/Index/DocFieldConsumersPerField.cs
+../../../external/Lucene.Net.Light/src/core/Index/DocFieldConsumersPerThread.cs
+../../../external/Lucene.Net.Light/src/core/Index/DocFieldProcessor.cs
+../../../external/Lucene.Net.Light/src/core/Index/DocFieldProcessorPerField.cs
+../../../external/Lucene.Net.Light/src/core/Index/DocFieldProcessorPerThread.cs
+../../../external/Lucene.Net.Light/src/core/Index/DocInverter.cs
+../../../external/Lucene.Net.Light/src/core/Index/DocInverterPerField.cs
+../../../external/Lucene.Net.Light/src/core/Index/DocInverterPerThread.cs
+../../../external/Lucene.Net.Light/src/core/Index/DocumentsWriter.cs
+../../../external/Lucene.Net.Light/src/core/Index/DocumentsWriterThreadState.cs
+../../../external/Lucene.Net.Light/src/core/Index/FieldInfo.cs
+../../../external/Lucene.Net.Light/src/core/Index/FieldInfos.cs
+../../../external/Lucene.Net.Light/src/core/Index/FieldInvertState.cs
+../../../external/Lucene.Net.Light/src/core/Index/FieldReaderException.cs
+../../../external/Lucene.Net.Light/src/core/Index/FieldSortedTermVectorMapper.cs
+../../../external/Lucene.Net.Light/src/core/Index/FieldsReader.cs
+../../../external/Lucene.Net.Light/src/core/Index/FieldsWriter.cs
+../../../external/Lucene.Net.Light/src/core/Index/FilterIndexReader.cs
+../../../external/Lucene.Net.Light/src/core/Index/FormatPostingsDocsConsumer.cs
+../../../external/Lucene.Net.Light/src/core/Index/FormatPostingsDocsWriter.cs
+../../../external/Lucene.Net.Light/src/core/Index/FormatPostingsFieldsConsumer.cs
+../../../external/Lucene.Net.Light/src/core/Index/FormatPostingsFieldsWriter.cs
+../../../external/Lucene.Net.Light/src/core/Index/FormatPostingsPositionsConsumer.cs
+../../../external/Lucene.Net.Light/src/core/Index/FormatPostingsPositionsWriter.cs
+../../../external/Lucene.Net.Light/src/core/Index/FormatPostingsTermsConsumer.cs
+../../../external/Lucene.Net.Light/src/core/Index/FormatPostingsTermsWriter.cs
+../../../external/Lucene.Net.Light/src/core/Index/FreqProxFieldMergeState.cs
+../../../external/Lucene.Net.Light/src/core/Index/FreqProxTermsWriter.cs
+../../../external/Lucene.Net.Light/src/core/Index/FreqProxTermsWriterPerField.cs
+../../../external/Lucene.Net.Light/src/core/Index/FreqProxTermsWriterPerThread.cs
+../../../external/Lucene.Net.Light/src/core/Index/IndexCommit.cs
+../../../external/Lucene.Net.Light/src/core/Index/IndexDeletionPolicy.cs
+../../../external/Lucene.Net.Light/src/core/Index/IndexFileDeleter.cs
+../../../external/Lucene.Net.Light/src/core/Index/IndexFileNameFilter.cs
+../../../external/Lucene.Net.Light/src/core/Index/IndexFileNames.cs
+../../../external/Lucene.Net.Light/src/core/Index/IndexReader.cs
+../../../external/Lucene.Net.Light/src/core/Index/IndexWriter.cs
+../../../external/Lucene.Net.Light/src/core/Index/IntBlockPool.cs
+../../../external/Lucene.Net.Light/src/core/Index/InvertedDocConsumer.cs
+../../../external/Lucene.Net.Light/src/core/Index/InvertedDocConsumerPerField.cs
+../../../external/Lucene.Net.Light/src/core/Index/InvertedDocConsumerPerThread.cs
+../../../external/Lucene.Net.Light/src/core/Index/InvertedDocEndConsumer.cs
+../../../external/Lucene.Net.Light/src/core/Index/InvertedDocEndConsumerPerField.cs
+../../../external/Lucene.Net.Light/src/core/Index/InvertedDocEndConsumerPerThread.cs
+../../../external/Lucene.Net.Light/src/core/Index/KeepOnlyLastCommitDeletionPolicy.cs
+../../../external/Lucene.Net.Light/src/core/Index/LogByteSizeMergePolicy.cs
+../../../external/Lucene.Net.Light/src/core/Index/LogDocMergePolicy.cs
+../../../external/Lucene.Net.Light/src/core/Index/LogMergePolicy.cs
+../../../external/Lucene.Net.Light/src/core/Index/MergeDocIDRemapper.cs
+../../../external/Lucene.Net.Light/src/core/Index/MergePolicy.cs
+../../../external/Lucene.Net.Light/src/core/Index/MergeScheduler.cs
+../../../external/Lucene.Net.Light/src/core/Index/MultiLevelSkipListReader.cs
+../../../external/Lucene.Net.Light/src/core/Index/MultiLevelSkipListWriter.cs
+../../../external/Lucene.Net.Light/src/core/Index/MultipleTermPositions.cs
+../../../external/Lucene.Net.Light/src/core/Index/MultiReader.cs
+../../../external/Lucene.Net.Light/src/core/Index/NormsWriter.cs
+../../../external/Lucene.Net.Light/src/core/Index/NormsWriterPerField.cs
+../../../external/Lucene.Net.Light/src/core/Index/NormsWriterPerThread.cs
+../../../external/Lucene.Net.Light/src/core/Index/ParallelReader.cs
+../../../external/Lucene.Net.Light/src/core/Index/Payload.cs
+../../../external/Lucene.Net.Light/src/core/Index/PositionBasedTermVectorMapper.cs
+../../../external/Lucene.Net.Light/src/core/Index/RawPostingList.cs
+../../../external/Lucene.Net.Light/src/core/Index/ReadOnlyDirectoryReader.cs
+../../../external/Lucene.Net.Light/src/core/Index/ReadOnlySegmentReader.cs
+../../../external/Lucene.Net.Light/src/core/Index/ReusableStringReader.cs
+../../../external/Lucene.Net.Light/src/core/Index/SegmentInfo.cs
+../../../external/Lucene.Net.Light/src/core/Index/SegmentInfos.cs
+../../../external/Lucene.Net.Light/src/core/Index/SegmentMergeInfo.cs
+../../../external/Lucene.Net.Light/src/core/Index/SegmentMergeQueue.cs
+../../../external/Lucene.Net.Light/src/core/Index/SegmentMerger.cs
+../../../external/Lucene.Net.Light/src/core/Index/SegmentReader.cs
+../../../external/Lucene.Net.Light/src/core/Index/SegmentTermDocs.cs
+../../../external/Lucene.Net.Light/src/core/Index/SegmentTermEnum.cs
+../../../external/Lucene.Net.Light/src/core/Index/SegmentTermPositions.cs
+../../../external/Lucene.Net.Light/src/core/Index/SegmentTermPositionVector.cs
+../../../external/Lucene.Net.Light/src/core/Index/SegmentTermVector.cs
+../../../external/Lucene.Net.Light/src/core/Index/SegmentWriteState.cs
+../../../external/Lucene.Net.Light/src/core/Index/SerialMergeScheduler.cs
+../../../external/Lucene.Net.Light/src/core/Index/SnapshotDeletionPolicy.cs
+../../../external/Lucene.Net.Light/src/core/Index/SortedTermVectorMapper.cs
+../../../external/Lucene.Net.Light/src/core/Index/StaleReaderException.cs
+../../../external/Lucene.Net.Light/src/core/Index/StoredFieldsWriter.cs
+../../../external/Lucene.Net.Light/src/core/Index/StoredFieldsWriterPerThread.cs
+../../../external/Lucene.Net.Light/src/core/Index/Term.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermBuffer.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermDocs.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermEnum.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermFreqVector.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermInfo.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermInfosReader.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermInfosWriter.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermPositions.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermPositionVector.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermsHash.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermsHashConsumer.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermsHashConsumerPerField.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermsHashConsumerPerThread.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermsHashPerField.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermsHashPerThread.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermVectorEntry.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermVectorEntryFreqSortedComparator.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermVectorMapper.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermVectorOffsetInfo.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermVectorsReader.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermVectorsTermsWriter.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermVectorsTermsWriterPerField.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermVectorsTermsWriterPerThread.cs
+../../../external/Lucene.Net.Light/src/core/Index/TermVectorsWriter.cs
+../../../external/Lucene.Net.Light/src/core/LucenePackage.cs
+../../../external/Lucene.Net.Light/src/core/LZOCompressor.cs
+../../../external/Lucene.Net.Light/src/core/Messages/INLSException.cs
+../../../external/Lucene.Net.Light/src/core/Messages/Message.cs
+../../../external/Lucene.Net.Light/src/core/Messages/MessageImpl.cs
+../../../external/Lucene.Net.Light/src/core/Messages/NLS.cs
+../../../external/Lucene.Net.Light/src/core/QueryParser/CharStream.cs
+../../../external/Lucene.Net.Light/src/core/QueryParser/FastCharStream.cs
+../../../external/Lucene.Net.Light/src/core/QueryParser/MultiFieldQueryParser.cs
+../../../external/Lucene.Net.Light/src/core/QueryParser/ParseException.cs
+../../../external/Lucene.Net.Light/src/core/QueryParser/QueryParser.cs
+../../../external/Lucene.Net.Light/src/core/QueryParser/QueryParserConstants.cs
+../../../external/Lucene.Net.Light/src/core/QueryParser/QueryParserTokenManager.cs
+../../../external/Lucene.Net.Light/src/core/QueryParser/Token.cs
+../../../external/Lucene.Net.Light/src/core/QueryParser/TokenMgrError.cs
+../../../external/Lucene.Net.Light/src/core/Search/BooleanClause.cs
+../../../external/Lucene.Net.Light/src/core/Search/BooleanQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/BooleanScorer.cs
+../../../external/Lucene.Net.Light/src/core/Search/BooleanScorer2.cs
+../../../external/Lucene.Net.Light/src/core/Search/CachingSpanFilter.cs
+../../../external/Lucene.Net.Light/src/core/Search/CachingWrapperFilter.cs
+../../../external/Lucene.Net.Light/src/core/Search/Collector.cs
+../../../external/Lucene.Net.Light/src/core/Search/ComplexExplanation.cs
+../../../external/Lucene.Net.Light/src/core/Search/ConjunctionScorer.cs
+../../../external/Lucene.Net.Light/src/core/Search/ConstantScoreQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/DefaultSimilarity.cs
+../../../external/Lucene.Net.Light/src/core/Search/DisjunctionMaxQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/DisjunctionMaxScorer.cs
+../../../external/Lucene.Net.Light/src/core/Search/DisjunctionSumScorer.cs
+../../../external/Lucene.Net.Light/src/core/Search/DocIdSet.cs
+../../../external/Lucene.Net.Light/src/core/Search/DocIdSetIterator.cs
+../../../external/Lucene.Net.Light/src/core/Search/ExactPhraseScorer.cs
+../../../external/Lucene.Net.Light/src/core/Search/Explanation.cs
+../../../external/Lucene.Net.Light/src/core/Search/FieldCache.cs
+../../../external/Lucene.Net.Light/src/core/Search/FieldCacheImpl.cs
+../../../external/Lucene.Net.Light/src/core/Search/FieldCacheRangeFilter.cs
+../../../external/Lucene.Net.Light/src/core/Search/FieldCacheTermsFilter.cs
+../../../external/Lucene.Net.Light/src/core/Search/FieldComparator.cs
+../../../external/Lucene.Net.Light/src/core/Search/FieldComparatorSource.cs
+../../../external/Lucene.Net.Light/src/core/Search/FieldDoc.cs
+../../../external/Lucene.Net.Light/src/core/Search/FieldDocSortedHitQueue.cs
+../../../external/Lucene.Net.Light/src/core/Search/FieldValueHitQueue.cs
+../../../external/Lucene.Net.Light/src/core/Search/Filter.cs
+../../../external/Lucene.Net.Light/src/core/Search/FilteredDocIdSet.cs
+../../../external/Lucene.Net.Light/src/core/Search/FilteredDocIdSetIterator.cs
+../../../external/Lucene.Net.Light/src/core/Search/FilteredQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/FilteredTermEnum.cs
+../../../external/Lucene.Net.Light/src/core/Search/FilterManager.cs
+../../../external/Lucene.Net.Light/src/core/Search/Function/ByteFieldSource.cs
+../../../external/Lucene.Net.Light/src/core/Search/Function/CustomScoreProvider.cs
+../../../external/Lucene.Net.Light/src/core/Search/Function/CustomScoreQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/Function/DocValues.cs
+../../../external/Lucene.Net.Light/src/core/Search/Function/FieldCacheSource.cs
+../../../external/Lucene.Net.Light/src/core/Search/Function/FieldScoreQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/Function/FloatFieldSource.cs
+../../../external/Lucene.Net.Light/src/core/Search/Function/IntFieldSource.cs
+../../../external/Lucene.Net.Light/src/core/Search/Function/OrdFieldSource.cs
+../../../external/Lucene.Net.Light/src/core/Search/Function/ReverseOrdFieldSource.cs
+../../../external/Lucene.Net.Light/src/core/Search/Function/ShortFieldSource.cs
+../../../external/Lucene.Net.Light/src/core/Search/Function/ValueSource.cs
+../../../external/Lucene.Net.Light/src/core/Search/Function/ValueSourceQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/FuzzyQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/FuzzyTermEnum.cs
+../../../external/Lucene.Net.Light/src/core/Search/HitQueue.cs
+../../../external/Lucene.Net.Light/src/core/Search/IndexSearcher.cs
+../../../external/Lucene.Net.Light/src/core/Search/MatchAllDocsQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/MultiPhraseQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/MultiSearcher.cs
+../../../external/Lucene.Net.Light/src/core/Search/MultiTermQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/MultiTermQueryWrapperFilter.cs
+../../../external/Lucene.Net.Light/src/core/Search/NumericRangeFilter.cs
+../../../external/Lucene.Net.Light/src/core/Search/NumericRangeQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/ParallelMultiSearcher.cs
+../../../external/Lucene.Net.Light/src/core/Search/Payloads/AveragePayloadFunction.cs
+../../../external/Lucene.Net.Light/src/core/Search/Payloads/MaxPayloadFunction.cs
+../../../external/Lucene.Net.Light/src/core/Search/Payloads/MinPayloadFunction.cs
+../../../external/Lucene.Net.Light/src/core/Search/Payloads/PayloadFunction.cs
+../../../external/Lucene.Net.Light/src/core/Search/Payloads/PayloadNearQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/Payloads/PayloadSpanUtil.cs
+../../../external/Lucene.Net.Light/src/core/Search/Payloads/PayloadTermQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/PhrasePositions.cs
+../../../external/Lucene.Net.Light/src/core/Search/PhraseQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/PhraseQueue.cs
+../../../external/Lucene.Net.Light/src/core/Search/PhraseScorer.cs
+../../../external/Lucene.Net.Light/src/core/Search/PositiveScoresOnlyCollector.cs
+../../../external/Lucene.Net.Light/src/core/Search/PrefixFilter.cs
+../../../external/Lucene.Net.Light/src/core/Search/PrefixQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/PrefixTermEnum.cs
+../../../external/Lucene.Net.Light/src/core/Search/Query.cs
+../../../external/Lucene.Net.Light/src/core/Search/QueryTermVector.cs
+../../../external/Lucene.Net.Light/src/core/Search/QueryWrapperFilter.cs
+../../../external/Lucene.Net.Light/src/core/Search/ReqExclScorer.cs
+../../../external/Lucene.Net.Light/src/core/Search/ReqOptSumScorer.cs
+../../../external/Lucene.Net.Light/src/core/Search/ScoreCachingWrappingScorer.cs
+../../../external/Lucene.Net.Light/src/core/Search/ScoreDoc.cs
+../../../external/Lucene.Net.Light/src/core/Search/Scorer.cs
+../../../external/Lucene.Net.Light/src/core/Search/Searchable.cs
+../../../external/Lucene.Net.Light/src/core/Search/Searcher.cs
+../../../external/Lucene.Net.Light/src/core/Search/Similarity.cs
+../../../external/Lucene.Net.Light/src/core/Search/SimilarityDelegator.cs
+../../../external/Lucene.Net.Light/src/core/Search/SingleTermEnum.cs
+../../../external/Lucene.Net.Light/src/core/Search/SloppyPhraseScorer.cs
+../../../external/Lucene.Net.Light/src/core/Search/Sort.cs
+../../../external/Lucene.Net.Light/src/core/Search/SortField.cs
+../../../external/Lucene.Net.Light/src/core/Search/SpanFilter.cs
+../../../external/Lucene.Net.Light/src/core/Search/SpanFilterResult.cs
+../../../external/Lucene.Net.Light/src/core/Search/SpanQueryFilter.cs
+../../../external/Lucene.Net.Light/src/core/Search/Spans/FieldMaskingSpanQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/Spans/NearSpansOrdered.cs
+../../../external/Lucene.Net.Light/src/core/Search/Spans/NearSpansUnordered.cs
+../../../external/Lucene.Net.Light/src/core/Search/Spans/SpanFirstQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/Spans/SpanNearQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/Spans/SpanNotQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/Spans/SpanOrQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/Spans/SpanQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/Spans/Spans.cs
+../../../external/Lucene.Net.Light/src/core/Search/Spans/SpanScorer.cs
+../../../external/Lucene.Net.Light/src/core/Search/Spans/SpanTermQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/Spans/SpanWeight.cs
+../../../external/Lucene.Net.Light/src/core/Search/Spans/TermSpans.cs
+../../../external/Lucene.Net.Light/src/core/Search/TermQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/TermRangeFilter.cs
+../../../external/Lucene.Net.Light/src/core/Search/TermRangeQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/TermRangeTermEnum.cs
+../../../external/Lucene.Net.Light/src/core/Search/TermScorer.cs
+../../../external/Lucene.Net.Light/src/core/Search/TimeLimitingCollector.cs
+../../../external/Lucene.Net.Light/src/core/Search/TopDocs.cs
+../../../external/Lucene.Net.Light/src/core/Search/TopDocsCollector.cs
+../../../external/Lucene.Net.Light/src/core/Search/TopFieldCollector.cs
+../../../external/Lucene.Net.Light/src/core/Search/TopFieldDocs.cs
+../../../external/Lucene.Net.Light/src/core/Search/TopScoreDocCollector.cs
+../../../external/Lucene.Net.Light/src/core/Search/Weight.cs
+../../../external/Lucene.Net.Light/src/core/Search/WildcardQuery.cs
+../../../external/Lucene.Net.Light/src/core/Search/WildcardTermEnum.cs
+../../../external/Lucene.Net.Light/src/core/Store/AlreadyClosedException.cs
+../../../external/Lucene.Net.Light/src/core/Store/BufferedIndexInput.cs
+../../../external/Lucene.Net.Light/src/core/Store/BufferedIndexOutput.cs
+../../../external/Lucene.Net.Light/src/core/Store/CheckSumIndexInput.cs
+../../../external/Lucene.Net.Light/src/core/Store/CheckSumIndexOutput.cs
+../../../external/Lucene.Net.Light/src/core/Store/Directory.cs
+../../../external/Lucene.Net.Light/src/core/Store/FileSwitchDirectory.cs
+../../../external/Lucene.Net.Light/src/core/Store/FSDirectory.cs
+../../../external/Lucene.Net.Light/src/core/Store/FSLockFactory.cs
+../../../external/Lucene.Net.Light/src/core/Store/IndexInput.cs
+../../../external/Lucene.Net.Light/src/core/Store/IndexOutput.cs
+../../../external/Lucene.Net.Light/src/core/Store/Lock.cs
+../../../external/Lucene.Net.Light/src/core/Store/LockFactory.cs
+../../../external/Lucene.Net.Light/src/core/Store/LockObtainFailedException.cs
+../../../external/Lucene.Net.Light/src/core/Store/LockReleaseFailedException.cs
+../../../external/Lucene.Net.Light/src/core/Store/LockStressTest.cs
+../../../external/Lucene.Net.Light/src/core/Store/LockVerifyServer.cs
+../../../external/Lucene.Net.Light/src/core/Store/MMapDirectory.cs
+../../../external/Lucene.Net.Light/src/core/Store/NativeFSLockFactory.cs
+../../../external/Lucene.Net.Light/src/core/Store/NIOFSDirectory.cs
+../../../external/Lucene.Net.Light/src/core/Store/NoLockFactory.cs
+../../../external/Lucene.Net.Light/src/core/Store/NoSuchDirectoryException.cs
+../../../external/Lucene.Net.Light/src/core/Store/RAMDirectory.cs
+../../../external/Lucene.Net.Light/src/core/Store/RAMFile.cs
+../../../external/Lucene.Net.Light/src/core/Store/RAMInputStream.cs
+../../../external/Lucene.Net.Light/src/core/Store/RAMOutputStream.cs
+../../../external/Lucene.Net.Light/src/core/Store/SimpleFSDirectory.cs
+../../../external/Lucene.Net.Light/src/core/Store/SimpleFSLockFactory.cs
+../../../external/Lucene.Net.Light/src/core/Store/SingleInstanceLockFactory.cs
+../../../external/Lucene.Net.Light/src/core/Store/VerifyingLockFactory.cs
+../../../external/Lucene.Net.Light/src/core/Support/AppSettings.cs
+../../../external/Lucene.Net.Light/src/core/Support/AttributeImplItem.cs
+../../../external/Lucene.Net.Light/src/core/Support/BitSetSupport.cs
+../../../external/Lucene.Net.Light/src/core/Support/BuildType.cs
+../../../external/Lucene.Net.Light/src/core/Support/Character.cs
+../../../external/Lucene.Net.Light/src/core/Support/CloseableThreadLocalProfiler.cs
+../../../external/Lucene.Net.Light/src/core/Support/CollectionsHelper.cs
+../../../external/Lucene.Net.Light/src/core/Support/Compare.cs
+../../../external/Lucene.Net.Light/src/core/Support/Compatibility/ConcurrentDictionary.cs
+../../../external/Lucene.Net.Light/src/core/Support/Compatibility/Func.cs
+../../../external/Lucene.Net.Light/src/core/Support/Compatibility/ISet.cs
+../../../external/Lucene.Net.Light/src/core/Support/Compatibility/SetFactory.cs
+../../../external/Lucene.Net.Light/src/core/Support/Compatibility/SortedSet.cs
+../../../external/Lucene.Net.Light/src/core/Support/Compatibility/ThreadLocal.cs
+../../../external/Lucene.Net.Light/src/core/Support/Compatibility/WrappedHashSet.cs
+../../../external/Lucene.Net.Light/src/core/Support/CRC32.cs
+../../../external/Lucene.Net.Light/src/core/Support/Cryptography.cs
+../../../external/Lucene.Net.Light/src/core/Support/Deflater.cs
+../../../external/Lucene.Net.Light/src/core/Support/Double.cs
+../../../external/Lucene.Net.Light/src/core/Support/EquatableList.cs
+../../../external/Lucene.Net.Light/src/core/Support/FileSupport.cs
+../../../external/Lucene.Net.Light/src/core/Support/GeneralKeyedCollection.cs
+../../../external/Lucene.Net.Light/src/core/Support/HashMap.cs
+../../../external/Lucene.Net.Light/src/core/Support/IChecksum.cs
+../../../external/Lucene.Net.Light/src/core/Support/Inflater.cs
+../../../external/Lucene.Net.Light/src/core/Support/IThreadRunnable.cs
+../../../external/Lucene.Net.Light/src/core/Support/Number.cs
+../../../external/Lucene.Net.Light/src/core/Support/OS.cs
+../../../external/Lucene.Net.Light/src/core/Support/SharpZipLib.cs
+../../../external/Lucene.Net.Light/src/core/Support/Single.cs
+../../../external/Lucene.Net.Light/src/core/Support/TextSupport.cs
+../../../external/Lucene.Net.Light/src/core/Support/ThreadClass.cs
+../../../external/Lucene.Net.Light/src/core/Support/ThreadLock.cs
+../../../external/Lucene.Net.Light/src/core/Support/WeakDictionary.cs
+../../../external/Lucene.Net.Light/src/core/Util/ArrayUtil.cs
+../../../external/Lucene.Net.Light/src/core/Util/Attribute.cs
+../../../external/Lucene.Net.Light/src/core/Util/AttributeSource.cs
+../../../external/Lucene.Net.Light/src/core/Util/AverageGuessMemoryModel.cs
+../../../external/Lucene.Net.Light/src/core/Util/BitUtil.cs
+../../../external/Lucene.Net.Light/src/core/Util/BitVector.cs
+../../../external/Lucene.Net.Light/src/core/Util/Cache/Cache.cs
+../../../external/Lucene.Net.Light/src/core/Util/Cache/SimpleLRUCache.cs
+../../../external/Lucene.Net.Light/src/core/Util/Cache/SimpleMapCache.cs
+../../../external/Lucene.Net.Light/src/core/Util/CloseableThreadLocal.cs
+../../../external/Lucene.Net.Light/src/core/Util/Constants.cs
+../../../external/Lucene.Net.Light/src/core/Util/DocIdBitSet.cs
+../../../external/Lucene.Net.Light/src/core/Util/FieldCacheSanityChecker.cs
+../../../external/Lucene.Net.Light/src/core/Util/IAttribute.cs
+../../../external/Lucene.Net.Light/src/core/Util/IdentityDictionary.cs
+../../../external/Lucene.Net.Light/src/core/Util/IndexableBinaryStringTools.cs
+../../../external/Lucene.Net.Light/src/core/Util/MapOfSets.cs
+../../../external/Lucene.Net.Light/src/core/Util/MemoryModel.cs
+../../../external/Lucene.Net.Light/src/core/Util/NumericUtils.cs
+../../../external/Lucene.Net.Light/src/core/Util/OpenBitSet.cs
+../../../external/Lucene.Net.Light/src/core/Util/OpenBitSetDISI.cs
+../../../external/Lucene.Net.Light/src/core/Util/OpenBitSetIterator.cs
+../../../external/Lucene.Net.Light/src/core/Util/PriorityQueue.cs
+../../../external/Lucene.Net.Light/src/core/Util/RamUsageEstimator.cs
+../../../external/Lucene.Net.Light/src/core/Util/ReaderUtil.cs
+../../../external/Lucene.Net.Light/src/core/Util/ScorerDocQueue.cs
+../../../external/Lucene.Net.Light/src/core/Util/SimpleStringInterner.cs
+../../../external/Lucene.Net.Light/src/core/Util/SmallFloat.cs
+../../../external/Lucene.Net.Light/src/core/Util/SortedVIntList.cs
+../../../external/Lucene.Net.Light/src/core/Util/SorterTemplate.cs
+../../../external/Lucene.Net.Light/src/core/Util/StringHelper.cs
+../../../external/Lucene.Net.Light/src/core/Util/StringInterner.cs
+../../../external/Lucene.Net.Light/src/core/Util/ToStringUtils.cs
+../../../external/Lucene.Net.Light/src/core/Util/UnicodeUtil.cs
+../../../external/Lucene.Net.Light/src/core/Util/Version.cs
--- /dev/null
+using System.Runtime.CompilerServices;
+
+[assembly: InternalsVisibleTo("cs0122-38, PublicKeyToken=<ad60da1470a03d36")]
+
+class Internal
+{
+
+}
\ No newline at end of file
TEST_SUPPORT_FILES = \
CS0012-lib.dll CS0012-2-lib.dll CS0012-3-lib.dll CS0012-4-lib.dll CS0012-5-lib.dll CS0012-6-lib.dll CS0012-9-lib.dll CS0012-10-lib.dll CS0012-11-lib.dll CS0012-12-lib.dll CS0012-13-lib.dll CS0012-14-lib.dll CS0012-15-lib.dll CS0012-16-lib.dll CS0012-17-lib.dll CS0012-18-lib.dll CS0012-21-lib.dll CS0012-22-lib.dll CS0012-23-lib.dll CS0012-24-lib.dll CS0019-71-lib.dll CS0029-26-lib.dll \
- CS0103-2-lib.dll CS0118-2-lib.dll CS0122-8-lib.dll CS0122-10-lib.dll CS0122-14-lib.dll CS0122-15-lib.dll CS0122-19-lib.dll CS0122-35-lib.dll CS0122-36-lib.dll CS0143-lib.dll CS0144-3-lib.dll CS0165-19-lib.dll CS0165-51-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 CS0122-38-lib.dll CS0143-lib.dll CS0144-3-lib.dll CS0165-19-lib.dll CS0165-51-lib.dll \
CS0205-3-lib.dll CS0246-29-lib.dll CS0229-3-lib.dll CS0229-4-lib.dll CS0266-25-lib.dll \
CS0315-2-lib.dll \
CS0425-7-lib.dll CS0433-lib.dll CS0433-2-lib.dll \
--- /dev/null
+// CS0122: `Internal' is inaccessible due to its protection level
+// Line: 9
+// Compiler options: -r:CS0122-38-lib.dll
+
+class M
+{
+ public static void Main ()
+ {
+ new Internal ();
+ }
+}
\ No newline at end of file
--- /dev/null
+// CS9030: The left-hand side of an assignment cannot contain a null propagating operator
+// Line: 15
+
+public class Test1
+{
+ public class Test2
+ {
+ public System.EventHandler<System.EventArgs> E;
+ }
+
+ public Test2 test2 = new Test2 ();
+
+ static void Main ()
+ {
+ new Test1 ()?.test2.E += null;
+ }
+}
using System;
#if STATIC
+using SecurityType = System.Collections.Generic.List<IKVM.Reflection.Emit.CustomAttributeBuilder>;
using IKVM.Reflection;
using IKVM.Reflection.Emit;
#else
+using SecurityType = System.Collections.Generic.Dictionary<System.Security.Permissions.SecurityAction, System.Security.PermissionSet>;
using System.Reflection;
using System.Reflection.Emit;
#endif
Expression instance_expr;
ReturnParameter return_attributes;
+ SecurityType declarative_security;
+
const Modifiers MethodModifiers = Modifiers.PUBLIC | Modifiers.VIRTUAL;
const Modifiers AllowedModifiers =
return;
}
+ if (a.IsValidSecurityAttribute ()) {
+ a.ExtractSecurityPermissionSet (ctor, ref declarative_security);
+ return;
+ }
+
base.ApplyAttributeBuilder (a, ctor, cdata, pa);
}
{
base.Emit ();
+ if (declarative_security != null) {
+ foreach (var de in declarative_security) {
+#if STATIC
+ TypeBuilder.__AddDeclarativeSecurity (de);
+#else
+ TypeBuilder.AddDeclarativeSecurity (de.Key, de.Value);
+#endif
+ }
+ }
+
if (ReturnType.Type != null) {
if (ReturnType.Type.BuiltinType == BuiltinTypeSpec.Type.Dynamic) {
return_attributes = new ReturnParameter (this, InvokeBuilder.MethodBuilder, Location);
public override Expression DoResolveLValue (ResolveContext ec, Expression right_side)
{
- if (ConditionalAccess)
+ if (HasConditionalAccess ())
Error_NullPropagatingLValue (ec);
if (spec is FixedFieldSpec) {
public override Expression DoResolveLValue (ResolveContext rc, Expression right_side)
{
- if (ConditionalAccess)
+ if (HasConditionalAccess ())
Error_NullPropagatingLValue (rc);
if (right_side == EmptyExpression.OutAccess) {
return null;
}
- if (ConditionalAccess)
+ if (HasConditionalAccess ())
Error_NullPropagatingLValue (ec);
op = CandidateToBaseOverride (ec, op);
public override Expression DoResolveLValue (ResolveContext ec, Expression right_side)
{
- if (ConditionalAccess)
+ if (HasConditionalAccess ())
Error_NullPropagatingLValue (ec);
return DoResolve (ec);
using System.Runtime.CompilerServices;
using System.Linq;
using System.Collections.Generic;
+using System.IO;
#if STATIC
using MetaType = IKVM.Reflection.Type;
if (s == null)
continue;
- var an = new AssemblyName (s);
+ AssemblyName an;
+ try {
+ an = new AssemblyName (s);
+ } catch (FileLoadException) {
+ // Invalid assembly name reuses FileLoadException
+ continue;
+ }
+
if (internals_visible_to == null)
internals_visible_to = new List<AssemblyName> ();
protected override void ApplyToExtraTarget (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)
{
if (a.Target == AttributeTargets.Parameter) {
- parameters[0].ApplyAttributeBuilder (a, ctor, cdata, pa);
+ parameters[parameters.Count - 1].ApplyAttributeBuilder (a, ctor, cdata, pa);
return;
}
--- /dev/null
+using System;
+
+namespace Test
+{
+ public class Program
+ {
+ static int[] testValues = {0, -1, 200, -200, 32, -32, 64, -128, 333, 5};
+
+ dynamic dynBase;
+ dynamic dynAmt;
+
+ int? optBase;
+ int? optAmt;
+
+ int normBase;
+ int normAmt;
+
+ dynamic uDynBase;
+
+ public static void Main ()
+ {
+ var tester = new Program ();
+
+ foreach (int baseVal in testValues)
+ foreach (int amt in testValues)
+ tester.ShiftTest (baseVal, amt);
+ }
+
+ public static void AreEqual<A, B> (A a, B b)
+ {
+ if (!a.Equals (b))
+ throw new Exception (
+ String.Format (
+ "Shift Equality Assertion Failed: Had {0} and expected {1}", a, b));
+ }
+
+ public void ShiftTest (int shiftBase, int shiftAmt)
+ {
+ optBase = dynBase = normBase = shiftBase;
+ optAmt = dynAmt = normAmt = shiftAmt;
+ int immediate = shiftBase << shiftAmt;
+
+ AreEqual<int?, int?> (dynBase << dynAmt, immediate);
+ AreEqual<int?, int?> (dynBase << optAmt, immediate);
+ AreEqual<int?, int?> (dynBase << normAmt, immediate);
+
+ AreEqual<int?, int?> (optBase << dynAmt, immediate);
+ AreEqual<int?, int?> (optBase << optAmt, immediate);
+ AreEqual<int?, int?> (optBase << normAmt, immediate);
+
+ AreEqual<int?, int?> (normBase << dynAmt, immediate);
+ AreEqual<int?, int?> (normBase << optAmt, immediate);
+ AreEqual<int?, int?> (normBase << normAmt, immediate);
+
+ uint uShiftBase = (uint)shiftBase;
+ uDynBase = uShiftBase;
+
+ AreEqual<uint?, uint?> (uShiftBase << dynAmt, uDynBase << dynAmt);
+ AreEqual<uint?, uint?> (uShiftBase << optAmt, uDynBase << optAmt);
+ AreEqual<uint?, uint?> (uShiftBase << normAmt, uDynBase << normAmt);
+ }
+ }
+}
using System.Security;
using System.Security.Permissions;
+[HostProtection]
+delegate void D ();
+
[HostProtection]
class X
{
--- /dev/null
+using System;
+using System.Linq;
+using System.Reflection;
+
+class Program
+{
+ public static int Main ()
+ {
+ var setter = typeof (MyClass).GetMember("set_Item")[0] as MethodInfo;
+ var sp = setter.GetParameters ();
+ var first = sp [0].GetCustomAttributes ();
+ var value = sp [2].GetCustomAttributes ();
+
+ if (first.Count () != 0)
+ return 1;
+
+ if (value.Count () != 1)
+ return 2;
+
+ return 0;
+ }
+}
+
+[AttributeUsage(AttributeTargets.All)]
+public class MyAttribute2Attribute : Attribute
+{
+}
+
+public class MyClass
+{
+ public string this[int index1, int index2]
+ {
+ get
+ {
+ return "";
+ }
+
+ [param: MyAttribute2]
+ set
+ {
+ }
+ }
+}
\ No newline at end of file
<size>7</size>
</method>
</type>
+ <type name="D">
+ <method name="Void Invoke()" attrs="454">
+ <size>0</size>
+ </method>
+ <method name="System.IAsyncResult BeginInvoke(System.AsyncCallback, System.Object)" attrs="454">
+ <size>0</size>
+ </method>
+ <method name="Void EndInvoke(System.IAsyncResult)" attrs="454">
+ <size>0</size>
+ </method>
+ <method name="Void .ctor(Object, IntPtr)" attrs="6278">
+ <size>0</size>
+ </method>
+ </type>
</test>
<test name="test-911.cs">
<type name="N">
</method>
</type>
</test>
+ <test name="test-925.cs">
+ <type name="Program">
+ <method name="Int32 Main()" attrs="150">
+ <size>104</size>
+ </method>
+ <method name="Void .ctor()" attrs="6278">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="MyAttribute2Attribute">
+ <method name="Void .ctor()" attrs="6278">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="MyClass">
+ <method name="System.String get_Item(Int32, Int32)" attrs="2182">
+ <size>14</size>
+ </method>
+ <method name="Void set_Item(Int32, Int32, System.String)" attrs="2182">
+ <size>2</size>
+ </method>
+ <method name="Void .ctor()" attrs="6278">
+ <size>7</size>
+ </method>
+ </type>
+ </test>
<test name="test-93.cs">
<type name="N1.C">
<method name="Void .ctor()" attrs="6278">
#endif
#endif
-#if defined(PLATFORM_MACOSX) || defined(__OpenBSD__)
+#if defined(PLATFORM_MACOSX) || defined(__OpenBSD__) || defined(__FreeBSD__)
#include <sys/proc.h>
#include <sys/sysctl.h>
# if !defined(__OpenBSD__)
# include <sys/utsname.h>
# endif
+# if defined(__FreeBSD__)
+# include <sys/user.h> /* struct kinfo_proc */
+# endif
#endif
#ifdef PLATFORM_SOLARIS
static void process_close (gpointer handle, gpointer data);
static gboolean is_pid_valid (pid_t pid);
-#if !(defined(PLATFORM_MACOSX) || defined(__OpenBSD__) || defined(__HAIKU__))
+#if !(defined(PLATFORM_MACOSX) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__HAIKU__))
static FILE *
open_process_map (int pid, const char *mode);
#endif
{
gboolean result = FALSE;
-#if defined(PLATFORM_MACOSX) || defined(__OpenBSD__)
+#if defined(PLATFORM_MACOSX) || defined(__OpenBSD__) || defined(__FreeBSD__)
if (((kill(pid, 0) == 0) || (errno == EPERM)) && pid != 0)
result = TRUE;
#elif defined(__HAIKU__)
return(ret);
}
-#elif defined(__OpenBSD__)
+#elif defined(__OpenBSD__) || defined(__FreeBSD__)
#include <link.h>
static int load_modules_callback (struct dl_phdr_info *info, size_t size, void *ptr)
{
if (procname == NULL || modulename == NULL)
return (FALSE);
+ DEBUG ("%s: procname=\"%s\", modulename=\"%s\"", __func__, procname, modulename);
pname = mono_path_resolve_symlinks (procname);
mname = mono_path_resolve_symlinks (modulename);
g_free (pname);
g_free (mname);
+ DEBUG ("%s: result is %d", __func__, result);
return result;
}
-#if !(defined(PLATFORM_MACOSX) || defined(__OpenBSD__) || defined(__HAIKU__))
+#if !(defined(PLATFORM_MACOSX) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__HAIKU__))
static FILE *
open_process_map (int pid, const char *mode)
{
}
#endif
+static char *get_process_name_from_proc (pid_t pid);
+
gboolean EnumProcessModules (gpointer process, gpointer *modules,
guint32 size, guint32 *needed)
{
WapiHandle_process *process_handle;
-#if !defined(__OpenBSD__) && !defined(PLATFORM_MACOSX)
+#if !defined(__OpenBSD__) && !defined(PLATFORM_MACOSX) && !defined(__FreeBSD__)
FILE *fp;
#endif
GSList *mods = NULL;
if (WAPI_IS_PSEUDO_PROCESS_HANDLE (process)) {
pid = WAPI_HANDLE_TO_PID (process);
+ proc_name = get_process_name_from_proc (pid);
} else {
process_handle = lookup_process_handle (process);
if (!process_handle) {
proc_name = process_handle->proc_name;
}
-#if defined(PLATFORM_MACOSX) || defined(__OpenBSD__) || defined(__HAIKU__)
+#if defined(PLATFORM_MACOSX) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__HAIKU__)
mods = load_modules ();
if (!proc_name) {
modules[0] = NULL;
static char *
get_process_name_from_proc (pid_t pid)
{
-#if defined(__OpenBSD__)
+#if defined(__OpenBSD__) || defined(__FreeBSD__)
int mib [6];
size_t size;
struct kinfo_proc *pi;
free(pi);
#endif
+#elif defined(__FreeBSD__)
+ mib [0] = CTL_KERN;
+ mib [1] = KERN_PROC;
+ mib [2] = KERN_PROC_PID;
+ mib [3] = pid;
+ if (sysctl(mib, 4, NULL, &size, NULL, 0) < 0) {
+ DEBUG ("%s: sysctl() failed: %d", __func__, errno);
+ return(ret);
+ }
+
+ if ((pi = malloc(size)) == NULL)
+ return(ret);
+
+ if (sysctl (mib, 4, pi, &size, NULL, 0) < 0) {
+ if (errno == ENOMEM) {
+ free(pi);
+ DEBUG ("%s: Didn't allocate enough memory for kproc info", __func__);
+ }
+ return(ret);
+ }
+
+ if (strlen (pi->ki_comm) > 0)
+ ret = g_strdup (pi->ki_comm);
+ free(pi);
#elif defined(__OpenBSD__)
mib [0] = CTL_KERN;
mib [1] = KERN_PROC;
mib [5] = 0;
retry:
- if (sysctl(mib, 6, NULL, &size, NULL, 0) < 0)
+ if (sysctl(mib, 6, NULL, &size, NULL, 0) < 0) {
+ DEBUG ("%s: sysctl() failed: %d", __func__, errno);
return(ret);
+ }
if ((pi = malloc(size)) == NULL)
return(ret);
return(ret);
}
+#if defined(__OpenBSD__)
if (strlen (pi->p_comm) > 0)
ret = g_strdup (pi->p_comm);
+#elif defined(__FreeBSD__)
+ if (strlen (pi->ki_comm) > 0)
+ ret = g_strdup (pi->ki_comm);
+#endif
free(pi);
#elif defined(__HAIKU__)
char *procname_ext = NULL;
glong len;
gsize bytes;
-#if !defined(__OpenBSD__) && !defined(PLATFORM_MACOSX)
+#if !defined(__OpenBSD__) && !defined(PLATFORM_MACOSX) && !defined(__FreeBSD__)
FILE *fp;
#endif
GSList *mods = NULL;
}
/* Look up the address in /proc/<pid>/maps */
-#if defined(PLATFORM_MACOSX) || defined(__OpenBSD__) || defined(__HAIKU__)
+#if defined(PLATFORM_MACOSX) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__HAIKU__)
mods = load_modules ();
#else
fp = open_process_map (pid, "r");
{
WapiHandle_process *process_handle;
pid_t pid;
-#if !defined(__OpenBSD__) && !defined(PLATFORM_MACOSX)
+#if !defined(__OpenBSD__) && !defined(PLATFORM_MACOSX) && !defined(__FreeBSD__)
FILE *fp;
#endif
GSList *mods = NULL;
proc_name = g_strdup (process_handle->proc_name);
}
-#if defined(PLATFORM_MACOSX) || defined(__OpenBSD__) || defined(__HAIKU__)
+#if defined(PLATFORM_MACOSX) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__HAIKU__)
mods = load_modules ();
#else
/* Look up the address in /proc/<pid>/maps */
return NULL;
if (klass->byval_arg.type == MONO_TYPE_STRING) {
atype = ATYPE_STRING;
+ } else if (!known_instance_size) {
+ return NULL;
} else if (!klass->has_references) {
if (for_box)
atype = ATYPE_FREEPTR_FOR_BOX;
void
mono_loader_clear_error (void);
+void
+mono_loader_assert_no_error (void);
+
void
mono_reflection_init (void);
mono_error_set_type_load_name (error, name, assembly, "Could not resolve type with token %08x", type_token);
}
}
- g_assert (!mono_loader_get_last_error ());
+ mono_loader_assert_no_error ();
return res;
}
mono_error_set_type_load_class (error, class, "Could not find base type");
fail:
- g_assert (!mono_loader_get_last_error ());
+ mono_loader_assert_no_error ();
return NULL;
}
if (mono_metadata_token_table (type_token) != MONO_TABLE_TYPEDEF || tidx > tt->rows) {
mono_error_set_bad_image (error, image, "Invalid typedef token %x", type_token);
- g_assert (!mono_loader_get_last_error ());
+ mono_loader_assert_no_error ();
return NULL;
}
if ((class = mono_internal_hash_table_lookup (&image->class_cache, GUINT_TO_POINTER (type_token)))) {
mono_loader_unlock ();
- g_assert (!mono_loader_get_last_error ());
+ mono_loader_assert_no_error ();
return class;
}
mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup (mono_error_get_message (error)));
mono_loader_unlock ();
mono_profiler_class_loaded (class, MONO_PROFILE_FAILED);
- g_assert (!mono_loader_get_last_error ());
+ mono_loader_assert_no_error ();
return NULL;
}
}
mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup (mono_error_get_message (error)));
mono_loader_unlock ();
mono_profiler_class_loaded (class, MONO_PROFILE_FAILED);
- g_assert (!mono_loader_get_last_error ());
+ mono_loader_assert_no_error ();
return NULL;
}
class->cast_class = class->element_class = mono_class_from_mono_type (enum_basetype);
mono_class_set_failure (class, MONO_EXCEPTION_TYPE_LOAD, g_strdup_printf ("Could not load generic parameter constrains due to %s", mono_error_get_message (error)));
mono_loader_unlock ();
mono_profiler_class_loaded (class, MONO_PROFILE_FAILED);
- g_assert (!mono_loader_get_last_error ());
+ mono_loader_assert_no_error ();
return NULL;
}
mono_loader_unlock ();
mono_profiler_class_loaded (class, MONO_PROFILE_OK);
- g_assert (!mono_loader_get_last_error ());
+ mono_loader_assert_no_error ();
return class;
mono_class_setup_mono_type (class);
mono_loader_unlock ();
mono_profiler_class_loaded (class, MONO_PROFILE_FAILED);
- g_assert (!mono_loader_get_last_error ());
+ mono_loader_assert_no_error ();
return NULL;
}
MonoType *inflated = inflate_generic_type (NULL, t, context, error);
if (!mono_error_ok (error)) {
- g_assert (!mono_loader_get_last_error ());
+ mono_loader_assert_no_error ();
return NULL;
}
MonoClass *class = mono_class_get_checked (image, type_token, error);
if (!class) {
- g_assert (!mono_loader_get_last_error ());
+ mono_loader_assert_no_error ();
return NULL;
}
type = mono_type_retrieve_from_typespec (image, type_token, context, &inflated, error);
if (!type) {
- g_assert (!mono_loader_get_last_error ());
+ mono_loader_assert_no_error ();
return NULL;
}
{
char *res;
char wrapper [64];
- char *klass_desc = mono_type_get_name_full (&method->klass->byval_arg, format);
+ char *klass_desc;
char *inst_desc = NULL;
+ if (format == MONO_TYPE_NAME_FORMAT_IL)
+ klass_desc = mono_type_full_name (&method->klass->byval_arg);
+ else
+ klass_desc = mono_type_get_name_full (&method->klass->byval_arg, format);
+
if (method->is_inflated && ((MonoMethodInflated*)method)->context.method_inst) {
GString *str = g_string_new ("");
if (format == MONO_TYPE_NAME_FORMAT_IL)
#endif /* !DISABLE_POLICY_EVIDENCE */
ICALL_TYPE(SECMAN, "System.Security.SecurityManager", SECMAN_1)
-ICALL(SECMAN_1, "GetLinkDemandSecurity", ves_icall_System_Security_SecurityManager_GetLinkDemandSecurity)
-ICALL(SECMAN_2, "get_CheckExecutionRights", ves_icall_System_Security_SecurityManager_get_CheckExecutionRights)
-ICALL(SECMAN_3, "get_RequiresElevatedPermissions", mono_security_core_clr_require_elevated_permissions)
-ICALL(SECMAN_4, "get_SecurityEnabled", ves_icall_System_Security_SecurityManager_get_SecurityEnabled)
-ICALL(SECMAN_5, "set_CheckExecutionRights", ves_icall_System_Security_SecurityManager_set_CheckExecutionRights)
-ICALL(SECMAN_6, "set_SecurityEnabled", ves_icall_System_Security_SecurityManager_set_SecurityEnabled)
+ICALL(SECMAN_1, "get_RequiresElevatedPermissions", mono_security_core_clr_require_elevated_permissions)
+ICALL(SECMAN_2, "get_SecurityEnabled", ves_icall_System_Security_SecurityManager_get_SecurityEnabled)
+ICALL(SECMAN_3, "set_SecurityEnabled", ves_icall_System_Security_SecurityManager_set_SecurityEnabled)
ICALL_TYPE(STRING, "System.String", STRING_1)
ICALL(STRING_1, ".ctor(char*)", ves_icall_System_String_ctor_RedirectToCreateString)
if (!exportedOnly || mono_module_type_is_visible (tdef, image, i + 1)) {
MonoError error;
klass = mono_class_get_checked (image, (i + 1) | MONO_TOKEN_TYPE_DEF, &error);
- g_assert (!mono_loader_get_last_error ()); /* Plug any leaks */
+ mono_loader_assert_no_error (); /* Plug any leaks */
if (klass) {
mono_array_setref (res, count, mono_type_get_object (domain, &klass->byval_arg));
return (MonoLoaderError*)mono_native_tls_get_value (loader_error_thread_id);
}
+void
+mono_loader_assert_no_error (void)
+{
+ MonoLoaderError *error = mono_loader_get_last_error ();
+
+ if (error) {
+ g_print ("Unhandled loader error: %x, %s %s %s\n", error->exception_type, error->msg, error->assembly_name, error->class_name);
+ g_assert_not_reached ();
+ }
+}
+
/**
* mono_loader_clear_error:
*
field = mono_class_get_field_from_name_full (klass, fname, sig_type);
if (!field) {
- g_assert (!mono_loader_get_last_error ());
+ mono_loader_assert_no_error ();
mono_error_set_field_load (error, klass, fname, "Could not find field '%s'", fname);
}
{
MonoError error;
MonoClassField *res = mono_field_from_token_checked (image, token, retklass, context, &error);
- g_assert (!mono_loader_get_last_error ());
+ mono_loader_assert_no_error ();
if (!mono_error_ok (&error)) {
mono_loader_set_error_from_mono_error (&error);
mono_error_cleanup (&error);
if (mono_metadata_token_table (token) == MONO_TABLE_MEMBERREF) {
field = field_from_memberref (image, token, retklass, context, error);
- g_assert (!mono_loader_get_last_error ());
+ mono_loader_assert_no_error ();
} else {
type = mono_metadata_typedef_from_field (image, mono_metadata_token_index (token));
if (!type) {
if (field && field->parent && !field->parent->generic_class && !field->parent->generic_container)
mono_conc_hashtable_insert (image->field_cache, GUINT_TO_POINTER (token), field);
- g_assert (!mono_loader_get_last_error ());
+ mono_loader_assert_no_error ();
return field;
}
MonoError error;
MonoMethodSignature *res = mono_method_get_signature_checked (method, image, token, context, &error);
- g_assert (!mono_loader_get_last_error ());
+ mono_loader_assert_no_error ();
if (!res) {
g_assert (!mono_error_ok (&error));
MonoError error;
MonoMethodSignature *res = mono_method_get_signature_checked (method, image, token, NULL, &error);
- g_assert (!mono_loader_get_last_error ());
+ mono_loader_assert_no_error ();
if (!res) {
g_assert (!mono_error_ok (&error));
g_free (msig);
}
- g_assert (!mono_loader_get_last_error ());
+ mono_loader_assert_no_error ();
return method;
fail:
- g_assert (!mono_loader_get_last_error ());
+ mono_loader_assert_no_error ();
g_assert (!mono_error_ok (error));
return NULL;
}
inst = mono_metadata_parse_generic_inst (image, NULL, param_count, ptr, &ptr);
if (!inst) {
- g_assert (!mono_loader_get_last_error ());
+ mono_loader_assert_no_error ();
mono_error_set_bad_image (error, image, "Cannot parse generic instance for methodspec 0x%08x", idx);
return NULL;
}
new_context.method_inst = inst;
method = mono_class_inflate_generic_method_full_checked (method, klass, &new_context, error);
- g_assert (!mono_loader_get_last_error ());
+ mono_loader_assert_no_error ();
return method;
}
/*
* Try loading the module using a variety of names
*/
- for (i = 0; i < 4; ++i) {
+ for (i = 0; i < 5; ++i) {
char *base_name = NULL, *dir_name = NULL;
gboolean is_absolute = is_absolute_path (new_scope);
break;
}
continue;
+ case 3:
+ if (!is_absolute && mono_dl_get_system_dir ()) {
+ dir_name = mono_dl_get_system_dir ();
+ file_name = g_path_get_basename (new_scope);
+ base_name = NULL;
+ } else
+ continue;
+ break;
default:
#ifndef TARGET_WIN32
if (!g_ascii_strcasecmp ("user32.dll", new_scope) ||
MonoClass *handle_class;
result = mono_lookup_dynamic_token_class (image, token, TRUE, &handle_class, context);
- g_assert (!mono_loader_get_last_error ());
+ mono_loader_assert_no_error ();
// This checks the memberref type as well
if (result && handle_class != mono_defaults.methodhandle_class) {
*/
if (*sig & 0x10) {
generic_container = mono_metadata_load_generic_params (image, token, container);
- g_assert (!mono_loader_get_last_error ()); /* FIXME don't swallow this error. */
+ mono_loader_assert_no_error (); /* FIXME don't swallow this error. */
}
if (generic_container) {
result->is_generic = TRUE;
if (generic_container)
mono_method_set_generic_container (result, generic_container);
- g_assert (!mono_loader_get_last_error ());
+ mono_loader_assert_no_error ();
return result;
}
{
MonoError error;
MonoMethod *result = mono_get_method_checked (image, token, klass, context, &error);
- g_assert (!mono_loader_get_last_error ());
+ mono_loader_assert_no_error ();
if (!mono_error_ok (&error)) {
mono_loader_set_error_from_mono_error (&error);
mono_error_cleanup (&error);
MonoError error;
MonoMethod *result = mono_get_method_constrained_checked (image, token, constrained_class, context, cil_method, &error);
- g_assert (!mono_loader_get_last_error ());
+ mono_loader_assert_no_error ();
if (!mono_error_ok (&error)) {
mono_loader_set_error_from_mono_error (&error);
mono_error_cleanup (&error);
for (i = 0; i < method->param_count; ++i) {
if (*ptr == MONO_TYPE_SENTINEL) {
if (method->call_convention != MONO_CALL_VARARG || def) {
- g_assert (!mono_loader_get_last_error ());
+ mono_loader_assert_no_error ();
mono_error_set_bad_image (error, m, "Found sentinel for methoddef or no vararg");
g_free (pattrs);
return NULL;
}
if (method->sentinelpos >= 0) {
- g_assert (!mono_loader_get_last_error ());
+ mono_loader_assert_no_error ();
mono_error_set_bad_image (error, m, "Found sentinel twice in the same signature.");
g_free (pattrs);
return NULL;
* Add signature to a cache and increase ref count...
*/
- g_assert (!mono_loader_get_last_error ());
+ mono_loader_assert_no_error ();
return method;
}
return TRUE;
for (i = 0; i < container->type_argc; i++) {
if (!get_constraints (image, start_row + i, &mono_generic_container_get_param_info (container, i)->constraints, container, error)) {
- g_assert (!mono_loader_get_last_error ());
+ mono_loader_assert_no_error ();
return FALSE;
}
}
DECL_OFFSET(DynCallArgs, res)
-DECL_OFFSET(MonoLMFTramp, regs)
+DECL_OFFSET(MonoLMFTramp, ctx)
DECL_OFFSET(MonoLMFTramp, lmf_addr)
#elif defined(TARGET_ARM)
DECL_OFFSET(MonoLMF, sp)
*
* Author:
* Paolo Molaro (lupus@ximian.com)
+ * Alex Rønne Petersen (alexrp@xamarin.com)
*
* Copyright 2001-2003 Ximian, Inc (http://www.ximian.com)
* Copyright 2004-2009 Novell, Inc (http://www.novell.com)
ves_icall_System_Security_SecurityManager_set_SecurityEnabled (MonoBoolean value)
{
}
-
-MonoBoolean
-ves_icall_System_Security_SecurityManager_get_CheckExecutionRights (void)
-{
- return FALSE;
-}
-
-void
-ves_icall_System_Security_SecurityManager_set_CheckExecutionRights (MonoBoolean value)
-{
-}
-
-MonoBoolean
-ves_icall_System_Security_SecurityManager_GetLinkDemandSecurity (MonoReflectionMethod *m, MonoDeclSecurityActions *kactions, MonoDeclSecurityActions *mactions)
-{
- return FALSE;
-}
/* internal calls */
MonoBoolean ves_icall_System_Security_SecurityManager_get_SecurityEnabled (void);
void ves_icall_System_Security_SecurityManager_set_SecurityEnabled (MonoBoolean value);
-MonoBoolean ves_icall_System_Security_SecurityManager_get_CheckExecutionRights (void);
-void ves_icall_System_Security_SecurityManager_set_CheckExecutionRights (MonoBoolean value);
-MonoBoolean ves_icall_System_Security_SecurityManager_GetLinkDemandSecurity (MonoReflectionMethod *m, MonoDeclSecurityActions *kactions, MonoDeclSecurityActions *mactions);
#ifndef DISABLE_SECURITY
#define mono_security_core_clr_enabled() (mono_security_get_mode () == MONO_SECURITY_MODE_CORE_CLR)
int tlab_next_addr_var, new_next_var;
const char *name = NULL;
AllocatorWrapperInfo *info;
+ int num_params, i;
if (!registered) {
mono_register_jit_icall (mono_gc_alloc_obj, "mono_gc_alloc_obj", mono_create_icall_signature ("object ptr int"), FALSE);
g_assert_not_reached ();
}
- csig = mono_metadata_signature_alloc (mono_defaults.corlib, 2);
+ if (atype == ATYPE_NORMAL)
+ num_params = 1;
+ else
+ num_params = 2;
+
+ csig = mono_metadata_signature_alloc (mono_defaults.corlib, num_params);
if (atype == ATYPE_STRING) {
csig->ret = &mono_defaults.string_class->byval_arg;
csig->params [0] = &mono_defaults.int_class->byval_arg;
csig->params [1] = &mono_defaults.int32_class->byval_arg;
} else {
csig->ret = &mono_defaults.object_class->byval_arg;
- csig->params [0] = &mono_defaults.int_class->byval_arg;
- csig->params [1] = &mono_defaults.int_class->byval_arg;
+ for (i = 0; i < num_params; i++)
+ csig->params [i] = &mono_defaults.int_class->byval_arg;
}
mb = mono_mb_new (mono_defaults.object_class, name, MONO_WRAPPER_ALLOC);
// Ported from C++ to C and adjusted to Mono runtime
#include <stdlib.h>
+#define _USE_MATH_DEFINES // needed by MSVC to define math constants
#include <math.h>
#include <config.h>
#include <glib.h>
-#if !defined (HAVE_COMPLEX_H)
-#include <../../support/libm/complex.h>
-#else
-#include <complex.h>
-#endif
-
#include <mono/metadata/class-internals.h>
#include <mono/metadata/exception.h>
#include <mono/metadata/gc-internal.h>
#include <mono/metadata/threadpool-internals.h>
#include <mono/utils/atomic.h>
#include <mono/utils/mono-compiler.h>
+#include <mono/utils/mono-complex.h>
#include <mono/utils/mono-proclib.h>
#include <mono/utils/mono-threads.h>
#include <mono/utils/mono-time.h>
}
}
-static double complex
+static double_complex
hill_climbing_get_wave_component (gdouble *samples, guint sample_count, gdouble period)
{
ThreadPoolHillClimbing *hc;
q1 = q0;
}
- return ((q1 - q2 * cosine) + (q2 * sine) * I) / ((gdouble) sample_count);
+ return mono_double_complex_scalar_div (mono_double_complex_make (q1 - q2 * cosine, (q2 * sine)), ((gdouble)sample_count));
}
static gint16
gint sample_count;
gint new_thread_wave_magnitude;
gint new_thread_count;
- double complex thread_wave_component;
- double complex throughput_wave_component;
- double complex ratio;
+ double_complex thread_wave_component;
+ double_complex throughput_wave_component;
+ double_complex ratio;
g_assert (threadpool);
g_assert (adjustment_interval);
hc->total_samples ++;
/* Set up defaults for our metrics. */
- thread_wave_component = 0;
- throughput_wave_component = 0;
+ thread_wave_component = mono_double_complex_make(0, 0);
+ throughput_wave_component = mono_double_complex_make(0, 0);
throughput_error_estimate = 0;
- ratio = 0;
+ ratio = mono_double_complex_make(0, 0);
confidence = 0;
transition = TRANSITION_WARMUP;
/* Get the the three different frequency components of the throughput (scaled by average
* throughput). Our "error" estimate (the amount of noise that might be present in the
* frequency band we're really interested in) is the average of the adjacent bands. */
- throughput_wave_component = hill_climbing_get_wave_component (hc->samples, sample_count, hc->wave_period) / average_throughput;
- throughput_error_estimate = cabs (hill_climbing_get_wave_component (hc->samples, sample_count, adjacent_period_1) / average_throughput);
+ throughput_wave_component = mono_double_complex_scalar_div (hill_climbing_get_wave_component (hc->samples, sample_count, hc->wave_period), average_throughput);
+ throughput_error_estimate = cabs (mono_double_complex_scalar_div (hill_climbing_get_wave_component (hc->samples, sample_count, adjacent_period_1), average_throughput));
if (adjacent_period_2 <= sample_count) {
- throughput_error_estimate = MAX (throughput_error_estimate, cabs (hill_climbing_get_wave_component (
- hc->samples, sample_count, adjacent_period_2) / average_throughput));
+ throughput_error_estimate = MAX (throughput_error_estimate, cabs (mono_double_complex_scalar_div (hill_climbing_get_wave_component (
+ hc->samples, sample_count, adjacent_period_2), average_throughput)));
}
/* Do the same for the thread counts, so we have something to compare to. We don't
* measure thread count noise, because there is none; these are exact measurements. */
- thread_wave_component = hill_climbing_get_wave_component (hc->thread_counts, sample_count, hc->wave_period) / average_thread_count;
+ thread_wave_component = mono_double_complex_scalar_div (hill_climbing_get_wave_component (hc->thread_counts, sample_count, hc->wave_period), average_thread_count);
/* Update our moving average of the throughput noise. We'll use this
* later as feedback to determine the new size of the thread wave. */
if (cabs (thread_wave_component) > 0) {
/* Adjust the throughput wave so it's centered around the target wave,
* and then calculate the adjusted throughput/thread ratio. */
- ratio = (throughput_wave_component - (hc->target_throughput_ratio * thread_wave_component)) / thread_wave_component;
+ ratio = mono_double_complex_div (mono_double_complex_sub (throughput_wave_component, mono_double_complex_scalar_mul(thread_wave_component, hc->target_throughput_ratio)), thread_wave_component);
transition = TRANSITION_CLIMBING_MOVE;
} else {
- ratio = 0;
+ ratio = mono_double_complex_make (0, 0);
transition = TRANSITION_STABILIZING;
}
chmod a+x ../../libtool
# Utility target for patching libtool to get rid of the 'ranlib: file <file> has no symbols" warnings
-patch-libtool-osx:
+patch-osx-libtool:
sed -e 's/old_archive_cmds=.*/old_archive_cmds="libtool -no_warning_for_no_symbols -static -o \\$$oldlib \\$$oldobjs"/g' < ../../libtool > 2; mv 2 ../../libtool
chmod a+x ../../libtool
guint8 *code;
guint8 *loop_start, *loop_branch_back, *loop_end_check, *imt_found_check;
int i;
+ int pagesize = MONO_AOT_TRAMP_PAGE_SIZE;
#define COMMON_TRAMP_SIZE 16
- int count = (mono_pagesize () - COMMON_TRAMP_SIZE) / 8;
+ int count = (pagesize - COMMON_TRAMP_SIZE) / 8;
int imm8, rot_amount;
char symbol [128];
if (!acfg->aot_opts.use_trampolines_page)
return;
- acfg->tramp_page_size = mono_pagesize ();
+ acfg->tramp_page_size = pagesize;
sprintf (symbol, "%sspecific_trampolines_page", acfg->user_symbol_prefix);
- emit_alignment (acfg, mono_pagesize ());
+ emit_alignment (acfg, pagesize);
emit_global (acfg, symbol, TRUE);
emit_label (acfg, symbol);
/* emit the generic code first, the trampoline address + 8 is in the lr register */
code = buf;
- imm8 = mono_arm_is_rotated_imm8 (mono_pagesize (), &rot_amount);
+ imm8 = mono_arm_is_rotated_imm8 (pagesize, &rot_amount);
ARM_SUB_REG_IMM (code, ARMREG_LR, ARMREG_LR, imm8, rot_amount);
ARM_LDR_IMM (code, ARMREG_R1, ARMREG_LR, -8);
ARM_LDR_IMM (code, ARMREG_PC, ARMREG_LR, -4);
emit_global (acfg, symbol, TRUE);
emit_label (acfg, symbol);
code = buf;
- imm8 = mono_arm_is_rotated_imm8 (mono_pagesize (), &rot_amount);
+ imm8 = mono_arm_is_rotated_imm8 (pagesize, &rot_amount);
ARM_SUB_REG_IMM (code, ARMREG_IP, ARMREG_IP, imm8, rot_amount);
ARM_LDR_IMM (code, MONO_ARCH_RGCTX_REG, ARMREG_IP, -8);
ARM_LDR_IMM (code, ARMREG_PC, ARMREG_IP, -4);
emit_label (acfg, symbol);
code = buf;
ARM_PUSH (code, (1 << ARMREG_R0) | (1 << ARMREG_R1) | (1 << ARMREG_R2) | (1 << ARMREG_R3));
- imm8 = mono_arm_is_rotated_imm8 (mono_pagesize (), &rot_amount);
+ imm8 = mono_arm_is_rotated_imm8 (pagesize, &rot_amount);
ARM_SUB_REG_IMM (code, ARMREG_IP, ARMREG_IP, imm8, rot_amount);
ARM_LDR_IMM (code, ARMREG_R0, ARMREG_IP, -8);
ARM_LDR_IMM (code, ARMREG_PC, ARMREG_IP, -4);
/* Need at least two free registers, plus a slot for storing the pc */
ARM_PUSH (code, (1 << ARMREG_R0)|(1 << ARMREG_R1)|(1 << ARMREG_R2));
- imm8 = mono_arm_is_rotated_imm8 (mono_pagesize (), &rot_amount);
+ imm8 = mono_arm_is_rotated_imm8 (pagesize, &rot_amount);
ARM_SUB_REG_IMM (code, ARMREG_IP, ARMREG_IP, imm8, rot_amount);
ARM_LDR_IMM (code, ARMREG_R0, ARMREG_IP, -8);
static void
add_extra_method_with_depth (MonoAotCompile *acfg, MonoMethod *method, int depth)
{
- if (mono_method_is_generic_sharable_full (method, FALSE, TRUE, FALSE))
+ if (mono_method_is_generic_sharable_full (method, TRUE, TRUE, FALSE))
method = mini_get_shared_method (method);
else if ((acfg->opts & MONO_OPT_GSHAREDVT) && prefer_gsharedvt_method (acfg, method) && mono_method_is_generic_sharable_full (method, FALSE, FALSE, TRUE))
/* Use the gsharedvt version */
add_generic_class (acfg, mono_class_inflate_generic_class (gcomparer, &ctx), FALSE, "EqualityComparer<T>");
}
}
+
+ /* Add an instance of EnumComparer<T> which is created dynamically by EqualityComparer<T> for enums */
+ if (klass->image == mono_defaults.corlib && !strcmp (klass->name_space, "System.Collections.Generic") && !strcmp (klass->name, "EqualityComparer`1")) {
+ MonoClass *enum_comparer;
+ MonoClass *tclass = mono_class_from_mono_type (klass->generic_class->context.class_inst->type_argv [0]);
+ MonoGenericContext ctx;
+ MonoType *args [16];
+
+ if (mono_class_is_enum (tclass)) {
+ memset (&ctx, 0, sizeof (ctx));
+ args [0] = &tclass->byval_arg;
+ ctx.class_inst = mono_metadata_get_generic_inst (1, args);
+
+ enum_comparer = mono_class_from_name (mono_defaults.corlib, "System.Collections.Generic", "EnumEqualityComparer`1");
+ g_assert (enum_comparer);
+ add_generic_class (acfg, mono_class_inflate_generic_class (enum_comparer, &ctx), FALSE, "EqualityComparer<T>");
+ }
+ }
+
+ /* Add an instance of ObjectComparer<T> which is created dynamically by Comparer<T> for enums */
+ if (klass->image == mono_defaults.corlib && !strcmp (klass->name_space, "System.Collections.Generic") && !strcmp (klass->name, "Comparer`1")) {
+ MonoClass *comparer;
+ MonoClass *tclass = mono_class_from_mono_type (klass->generic_class->context.class_inst->type_argv [0]);
+ MonoGenericContext ctx;
+ MonoType *args [16];
+
+ if (mono_class_is_enum (tclass)) {
+ memset (&ctx, 0, sizeof (ctx));
+ args [0] = &tclass->byval_arg;
+ ctx.class_inst = mono_metadata_get_generic_inst (1, args);
+
+ comparer = mono_class_from_name (mono_defaults.corlib, "System.Collections.Generic", "ObjectComparer`1");
+ g_assert (comparer);
+ add_generic_class (acfg, mono_class_inflate_generic_class (comparer, &ctx), FALSE, "Comparer<T>");
+ }
+ }
}
static void
emit_method_info (MonoAotCompile *acfg, MonoCompile *cfg)
{
MonoMethod *method;
- GList *l;
int pindex, buf_size, n_patches;
GPtrArray *patches;
MonoJumpInfo *patch_info;
/* Not needed when loading the method */
encode_value (0, p, &p);
- /* String table */
- if (cfg->opt & MONO_OPT_SHARED) {
- encode_value (g_list_length (cfg->ldstr_list), p, &p);
- for (l = cfg->ldstr_list; l; l = l->next) {
- encode_value ((long)l->data, p, &p);
- }
- }
- else
- /* Used only in shared mode */
- g_assert (!cfg->ldstr_list);
+ g_assert (!(cfg->opt & MONO_OPT_SHARED));
n_patches = 0;
for (pindex = 0; pindex < patches->len; ++pindex) {
emit_trampoline (acfg, acfg->got_offset, info);
}
- mono_arch_get_nullified_class_init_trampoline (&info);
- emit_trampoline (acfg, acfg->got_offset, info);
#if defined(MONO_ARCH_MONITOR_OBJECT_REG)
mono_arch_create_monitor_enter_trampoline (&info, FALSE, TRUE);
emit_trampoline (acfg, acfg->got_offset, info);
if (m->is_inflated) {
if (!(mono_class_generic_sharing_enabled (m->klass) &&
mono_method_is_generic_sharable_full (m, FALSE, FALSE, FALSE)) &&
- !method_has_type_vars (m)) {
+ (!method_has_type_vars (m) || mono_method_is_generic_sharable_full (m, TRUE, TRUE, FALSE))) {
if (m->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) {
- if (mono_aot_mode_is_full (&acfg->aot_opts))
+ if (mono_aot_mode_is_full (&acfg->aot_opts) && !method_has_type_vars (m))
add_extra_method_with_depth (acfg, mono_marshal_get_native_wrapper (m, TRUE, TRUE), depth + 1);
} else {
add_extra_method_with_depth (acfg, m, depth + 1);
emit_pointer (acfg, NULL);
emit_pointer (acfg, NULL);
}
- if (acfg->thumb_mixed) {
- emit_pointer (acfg, "thumb_end");
- } else {
- emit_pointer (acfg, NULL);
- }
if (acfg->aot_opts.static_link) {
emit_pointer (acfg, "globals");
} else {
}
*/
+ if (method->is_generic || method->klass->generic_container)
+ /* Compile the ref shared version instead */
+ method = mini_get_shared_method (method);
+
/* Since we add the normal methods first, their index will be equal to their zero based token index */
add_method_with_index (acfg, method, i, FALSE);
acfg->method_index ++;
method = mono_get_method_checked (acfg->image, token, NULL, NULL, &error);
report_loader_error (acfg, &error, "Failed to load method token 0x%x due to %s\n", i, mono_error_get_message (&error));
- /*
- if (strcmp (method->name, "gshared2"))
- continue;
- */
- /*
- if (!strstr (method->klass->image->name, "mini"))
- continue;
- */
if (method->is_generic || method->klass->generic_container) {
MonoMethod *gshared;
* Emit all LLVM code into a separate assembly/object file and link with it
* normally.
*/
- if (!acfg->aot_opts.asm_only)
+ if (!acfg->aot_opts.asm_only) {
acfg->llvm_owriter = TRUE;
+ } else if (acfg->aot_opts.llvm_outfile) {
+ int len = strlen (acfg->aot_opts.llvm_outfile);
+
+ if (len >= 2 && acfg->aot_opts.llvm_outfile [len - 2] == '.' && acfg->aot_opts.llvm_outfile [len - 1] == 'o')
+ acfg->llvm_owriter = TRUE;
+ }
}
if (mono_aot_mode_is_full (&acfg->aot_opts))
arch_init (acfg);
+ if (acfg->llvm && acfg->thumb_mixed)
+ acfg->flags |= MONO_AOT_FILE_FLAG_LLVM_THUMB;
+
acfg->assembly_name_sym = g_strdup (acfg->image->assembly->aname.name);
/* Get rid of characters which cannot occur in symbols */
for (p = acfg->assembly_name_sym; *p; ++p) {
}
g_assert (acfg->aot_opts.llvm_outfile);
acfg->llvm_sfile = g_strdup (acfg->aot_opts.llvm_outfile);
+ if (acfg->llvm_owriter)
+ acfg->llvm_ofile = g_strdup (acfg->aot_opts.llvm_outfile);
+ else
+ acfg->llvm_sfile = g_strdup (acfg->aot_opts.llvm_outfile);
} else {
acfg->tmpbasename = g_strdup_printf ("%s", "temp");
acfg->tmpfname = g_strdup_printf ("%s.s", acfg->tmpbasename);
if (acfg->dwarf)
mono_dwarf_writer_emit_base_info (acfg->dwarf, g_path_get_basename (acfg->image->name), mono_unwind_get_cie_program ());
- if (acfg->thumb_mixed) {
- char symbol [256];
- /*
- * This global symbol marks the end of THUMB code, and the beginning of ARM
- * code generated by our JIT.
- */
- sprintf (symbol, "thumb_end");
- emit_section_change (acfg, ".text", 0);
- emit_alignment_code (acfg, 8);
- emit_label (acfg, symbol);
- emit_zero_bytes (acfg, 16);
-
- fprintf (acfg->fp, ".arm\n");
- }
-
emit_code (acfg);
emit_info (acfg);
guint32 *unbox_trampolines_end;
guint32 *unbox_trampoline_addresses;
guint8 *unwind_info;
- guint8 *thumb_end;
/* Points to the mono EH data created by LLVM */
guint8 *mono_eh_frame;
static void
compute_llvm_code_range (MonoAotModule *amodule, guint8 **code_start, guint8 **code_end);
+static gboolean
+mono_aot_init_method (MonoAotModule *amodule, guint32 method_index, MonoMethod *method, MonoClass **klass);
+
/*****************************************************/
/* AOT RUNTIME */
/*****************************************************/
if (!m)
return FALSE;
mono_class_init (m->klass);
- ref->method = mono_marshal_get_remoting_invoke_with_check (m);
+ if (mono_aot_only)
+ ref->method = m;
+ else
+ ref->method = mono_marshal_get_remoting_invoke_with_check (m);
break;
}
case MONO_WRAPPER_PROXY_ISINST: {
amodule->trampolines [MONO_AOT_TRAMP_STATIC_RGCTX] = info->static_rgctx_trampolines;
amodule->trampolines [MONO_AOT_TRAMP_IMT_THUNK] = info->imt_thunks;
amodule->trampolines [MONO_AOT_TRAMP_GSHAREDVT_ARG] = info->gsharedvt_arg_trampolines;
- amodule->thumb_end = info->thumb_end;
/* Compute code_offsets from the method addresses */
amodule->code_offsets = g_malloc0 (amodule->info.nmethods * sizeof (gint32));
}
}
+static gboolean
+is_thumb_code (MonoAotModule *amodule, guint8 *code)
+{
+ if ((amodule->info.flags & MONO_AOT_FILE_FLAG_LLVM_THUMB) && (guint8*)code >= amodule->llvm_code_start && (guint8*)code < amodule->llvm_code_end)
+ return TRUE;
+ else
+ return FALSE;
+}
+
/*
* decode_mono_eh_frame:
*
g_assert (code >= code_start && code < code_end);
- if (amodule->thumb_end && (guint8*)code_start < amodule->thumb_end)
+ if (is_thumb_code (amodule, code_start))
/* Clear thumb flag */
code_start = (guint8*)(((mgreg_t)code_start) & ~1);
jei->handler_start = ei [i].handler_start;
jei->clause_index = clause_index;
- /* Make sure we transition to thumb when a handler starts */
- if (amodule->thumb_end && (guint8*)jei->handler_start < amodule->thumb_end)
+ if (is_thumb_code (amodule, jei->try_start)) {
+ jei->try_start = (void*)((mgreg_t)jei->try_start & ~1);
+ jei->try_end = (void*)((mgreg_t)jei->try_end & ~1);
+ /* Make sure we transition to thumb when a handler starts */
jei->handler_start = (void*)((mgreg_t)jei->handler_start + 1);
+ }
}
/* See exception_cb () in mini-llvm.c as to why this is needed */
{
MonoClass *klass;
gboolean from_plt = method == NULL;
- MonoMemPool *mp;
- int i, pindex, n_patches, used_strings;
- gboolean keep_patches = TRUE;
- guint8 *p;
MonoJitInfo *jinfo = NULL;
guint8 *code, *info;
+ gboolean res;
if (mono_profiler_get_events () & MONO_PROFILE_ENTER_LEAVE) {
if (mono_aot_only)
return NULL;
}
- if ((domain != mono_get_root_domain ()) && (!(amodule->info.opts & MONO_OPT_SHARED)))
+ if (domain != mono_get_root_domain ())
/* Non shared AOT code can't be used in other appdomains */
return NULL;
}
}
- p = info;
-
- if (method) {
- klass = method->klass;
- decode_klass_ref (amodule, p, &p);
- } else {
- klass = decode_klass_ref (amodule, p, &p);
- }
-
- if (amodule->info.opts & MONO_OPT_SHARED)
- used_strings = decode_value (p, &p);
- else
- used_strings = 0;
-
- for (i = 0; i < used_strings; i++) {
- guint token = decode_value (p, &p);
- mono_ldstr (mono_get_root_domain (), image, mono_metadata_token_index (token));
- }
-
- if (amodule->info.opts & MONO_OPT_SHARED)
- keep_patches = FALSE;
-
- n_patches = decode_value (p, &p);
-
- keep_patches = FALSE;
-
- if (n_patches) {
- MonoJumpInfo *patches;
- guint32 *got_slots;
- gboolean llvm;
- gpointer *got;
-
- if (keep_patches)
- mp = domain->mp;
- else
- mp = mono_mempool_new ();
-
- if ((gpointer)code >= amodule->info.jit_code_start && (gpointer)code <= amodule->info.jit_code_end) {
- llvm = FALSE;
- got = amodule->got;
- } else {
- llvm = TRUE;
- got = amodule->llvm_got;
- g_assert (got);
- }
-
- patches = load_patch_info (amodule, mp, n_patches, llvm, &got_slots, p, &p);
- if (patches == NULL)
- goto cleanup;
-
- for (pindex = 0; pindex < n_patches; ++pindex) {
- MonoJumpInfo *ji = &patches [pindex];
- gpointer addr;
-
- /*
- * For SFLDA, we need to call resolve_patch_target () since the GOT slot could have
- * been initialized by load_method () for a static cctor before the cctor has
- * finished executing (#23242).
- */
- if (!got [got_slots [pindex]] || ji->type == MONO_PATCH_INFO_SFLDA) {
- addr = mono_resolve_patch_target (method, domain, code, ji, TRUE);
- if (ji->type == MONO_PATCH_INFO_METHOD_JUMP)
- addr = mono_create_ftnptr (domain, addr);
- mono_memory_barrier ();
- got [got_slots [pindex]] = addr;
- if (ji->type == MONO_PATCH_INFO_METHOD_JUMP)
- register_jump_target_got_slot (domain, ji->data.method, &(got [got_slots [pindex]]));
- }
- ji->type = MONO_PATCH_INFO_NONE;
- }
-
- g_free (got_slots);
-
- if (!keep_patches)
- mono_mempool_destroy (mp);
- }
-
- if (mini_get_debug_options ()->load_aot_jit_info_eagerly)
- jinfo = mono_aot_find_jit_info (domain, amodule->assembly->image, code);
+ res = mono_aot_init_method (amodule, method_index, method, &klass);
+ if (!res)
+ goto cleanup;
if (mono_trace_is_traced (G_LOG_LEVEL_DEBUG, MONO_TRACE_AOT)) {
char *full_name;
MonoJitInfo *jinfo;
if (!method) {
- method = mono_get_method (image, token, NULL);
+ method = mono_get_method (amodule->assembly->image, token, NULL);
g_assert (method);
}
mono_profiler_method_jit (method);
return code;
cleanup:
- /* FIXME: The space in domain->mp is wasted */
- if (amodule->info.opts & MONO_OPT_SHARED)
- /* No need to cache patches */
- mono_mempool_destroy (mp);
-
if (jinfo)
g_free (jinfo);
return find_aot_method (method, &out_amodule);
}
+static gboolean
+mono_aot_init_method (MonoAotModule *amodule, guint32 method_index, MonoMethod *method, MonoClass **klass)
+{
+ MonoDomain *domain = mono_domain_get ();
+ MonoMemPool *mp;
+ int pindex, n_patches;
+ guint8 *p;
+ MonoJitInfo *jinfo = NULL;
+ guint8 *code, *info;
+
+ code = &amodule->code [amodule->code_offsets [method_index]];
+ info = &amodule->blob [mono_aot_get_offset (amodule->method_info_offsets, method_index)];
+
+ p = info;
+
+ if (method) {
+ *klass = method->klass;
+ decode_klass_ref (amodule, p, &p);
+ } else {
+ *klass = decode_klass_ref (amodule, p, &p);
+ }
+
+ n_patches = decode_value (p, &p);
+
+ if (n_patches) {
+ MonoJumpInfo *patches;
+ guint32 *got_slots;
+ gboolean llvm;
+ gpointer *got;
+
+ mp = mono_mempool_new ();
+
+ if ((gpointer)code >= amodule->info.jit_code_start && (gpointer)code <= amodule->info.jit_code_end) {
+ llvm = FALSE;
+ got = amodule->got;
+ } else {
+ llvm = TRUE;
+ got = amodule->llvm_got;
+ g_assert (got);
+ }
+
+ patches = load_patch_info (amodule, mp, n_patches, llvm, &got_slots, p, &p);
+ if (patches == NULL)
+ goto cleanup;
+
+ for (pindex = 0; pindex < n_patches; ++pindex) {
+ MonoJumpInfo *ji = &patches [pindex];
+ gpointer addr;
+
+ /*
+ * For SFLDA, we need to call resolve_patch_target () since the GOT slot could have
+ * been initialized by load_method () for a static cctor before the cctor has
+ * finished executing (#23242).
+ */
+ if (!got [got_slots [pindex]] || ji->type == MONO_PATCH_INFO_SFLDA) {
+ addr = mono_resolve_patch_target (method, domain, code, ji, TRUE);
+ if (ji->type == MONO_PATCH_INFO_METHOD_JUMP)
+ addr = mono_create_ftnptr (domain, addr);
+ mono_memory_barrier ();
+ got [got_slots [pindex]] = addr;
+ if (ji->type == MONO_PATCH_INFO_METHOD_JUMP)
+ register_jump_target_got_slot (domain, ji->data.method, &(got [got_slots [pindex]]));
+ }
+ ji->type = MONO_PATCH_INFO_NONE;
+ }
+
+ g_free (got_slots);
+
+ mono_mempool_destroy (mp);
+ }
+
+ if (mini_get_debug_options ()->load_aot_jit_info_eagerly)
+ jinfo = mono_aot_find_jit_info (domain, amodule->assembly->image, code);
+
+ return TRUE;
+
+ cleanup:
+ if (jinfo)
+ g_free (jinfo);
+
+ return FALSE;
+}
+
/*
* mono_aot_get_method:
*
return NULL;
#ifdef TARGET_ARM
- if (amodule->thumb_end) {
- if (code >= amodule->llvm_code_start && code < amodule->llvm_code_end)
- return mono_arm_get_thumb_plt_entry (code);
- }
+ if (is_thumb_code (amodule, code))
+ return mono_arm_get_thumb_plt_entry (code);
#endif
#ifdef MONO_ARCH_AOT_SUPPORTED
return code;
}
mono_aot_page_unlock ();
- psize = mono_pagesize ();
/* the trampoline template page is in the mscorlib module */
image = mono_defaults.corlib;
g_assert (image);
+ psize = MONO_AOT_TRAMP_PAGE_SIZE;
+
amodule = image->aot_module;
g_assert (amodule);
- g_assert (amodule->info.tramp_page_size == psize);
-
if (tramp_type == MONO_AOT_TRAMP_SPECIFIC)
tpage = load_function (amodule, "specific_trampolines_page");
else if (tramp_type == MONO_AOT_TRAMP_STATIC_RGCTX)
code = get_new_trampoline_from_page (MONO_AOT_TRAMP_SPECIFIC);
- data = (gpointer*)((char*)code - mono_pagesize ());
+ data = (gpointer*)((char*)code - MONO_AOT_TRAMP_PAGE_SIZE);
data [0] = arg;
data [1] = tramp;
/*g_warning ("new trampoline at %p for data %p, tramp %p (stored at %p)", code, arg, tramp, data);*/
code = get_new_trampoline_from_page (MONO_AOT_TRAMP_STATIC_RGCTX);
- data = (gpointer*)((char*)code - mono_pagesize ());
+ data = (gpointer*)((char*)code - MONO_AOT_TRAMP_PAGE_SIZE);
data [0] = arg;
data [1] = tramp;
/*g_warning ("new rgctx trampoline at %p for data %p, tramp %p (stored at %p)", code, arg, tramp, data);*/
code = get_new_trampoline_from_page (MONO_AOT_TRAMP_IMT_THUNK);
- data = (gpointer*)((char*)code - mono_pagesize ());
+ data = (gpointer*)((char*)code - MONO_AOT_TRAMP_PAGE_SIZE);
data [0] = arg;
/*g_warning ("new imt trampoline at %p for data %p, (stored at %p)", code, arg, data);*/
return code;
code = get_new_trampoline_from_page (MONO_AOT_TRAMP_GSHAREDVT_ARG);
- data = (gpointer*)((char*)code - mono_pagesize ());
+ data = (gpointer*)((char*)code - MONO_AOT_TRAMP_PAGE_SIZE);
data [0] = arg;
data [1] = tramp;
/*g_warning ("new rgctx trampoline at %p for data %p, tramp %p (stored at %p)", code, arg, tramp, data);*/
d.Add ("key1", "banana");
return d ["key1"] == "banana" ? 0 : 1;
}
+
+ class NullableMethods {
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static bool GetHasValue<T>(Nullable<T> value) where T : struct {
+ return value.HasValue;
+ }
+
+ [MethodImplAttribute (MethodImplOptions.NoInlining)]
+ public static T GetValue<T>(Nullable<T> value) where T : struct {
+ return value.Value;
+ }
+ }
+
+ [Category ("DYNCALL")]
+ public static int test_0_dyncall_nullable () {
+ int? v;
+
+ v = 42;
+ NullableMethods.GetHasValue (v);
+ bool b = (bool)typeof (NullableMethods).GetMethod ("GetHasValue").MakeGenericMethod (new Type [] { typeof (int) }).Invoke (null, new object [] { v });
+ if (!b)
+ return 1;
+ v = null;
+ b = (bool)typeof (NullableMethods).GetMethod ("GetHasValue").MakeGenericMethod (new Type [] { typeof (int) }).Invoke (null, new object [] { v });
+ if (b)
+ return 2;
+
+ v = 42;
+ NullableMethods.GetValue (v);
+ var res = (int)typeof (NullableMethods).GetMethod ("GetValue").MakeGenericMethod (new Type [] { typeof (int) }).Invoke (null, new object [] { v });
+ if (res != 42)
+ return 3;
+ return 0;
+ }
+
+ enum AnEnum {
+ A = 0,
+ B = 1
+ }
+
+ public static int test_0_enum_eq_comparer () {
+ var c = EqualityComparer<AnEnum>.Default;
+ return (!c.Equals (AnEnum.A, AnEnum.B) && c.Equals (AnEnum.A, AnEnum.A)) ? 0 : 1;
+ }
+
+ public static int test_0_enum_comparer () {
+ var c = Comparer<AnEnum>.Default;
+ return c.Compare (AnEnum.A, AnEnum.A);
+ }
}
return (int)(f1 / f2);
}
+ public static int test_1_frem_r4 () {
+ float f1 = 7.0f;
+ float f2 = 2.0f;
+ return (int)(f1 % f2);
+ }
+
public static int test_0_fcmp_eq_r4 () {
float f1 = 1.0f;
float f2 = 1.0f;
return ERR_INVALID_ARGUMENT;
}
m = mono_object_get_virtual_method (this, m);
+ /* Transform this to the format the rest of the code expects it to be */
+ if (m->klass->valuetype) {
+ this_buf = g_alloca (mono_class_instance_size (m->klass));
+ memcpy (this_buf, mono_object_unbox (this), mono_class_instance_size (m->klass));
+ }
} else if ((m->flags & METHOD_ATTRIBUTE_VIRTUAL) && !m->klass->valuetype && invoke->flags & INVOKE_FLAG_VIRTUAL) {
if (!this) {
DEBUG_PRINTF (1, "[%p] Error: invoke with INVOKE_FLAG_VIRTUAL flag set without this argument.\n", (gpointer)GetCurrentThreadId ());
return ERR_INVALID_ARGUMENT;
}
m = mono_object_get_virtual_method (this, m);
+ if (m->klass->valuetype) {
+ this_buf = g_alloca (mono_class_instance_size (m->klass));
+ memcpy (this_buf, mono_object_unbox (this), mono_class_instance_size (m->klass));
+ }
}
DEBUG_PRINTF (1, "[%p] Invoking method '%s' on receiver '%s'.\n", (gpointer)GetCurrentThreadId (), mono_method_full_name (m, TRUE), this ? this->vtable->klass->name : "<null>");
return TRUE;
}
- if (((guint64)(*lmf)->previous_lmf) & 1) {
+ if (((guint64)(*lmf)->previous_lmf) & 4) {
+ MonoLMFTramp *ext = (MonoLMFTramp*)(*lmf);
+
+ rip = (guint64)MONO_CONTEXT_GET_IP (ext->ctx);
+ } else if (((guint64)(*lmf)->previous_lmf) & 1) {
/* This LMF has the rip field set */
rip = (*lmf)->rip;
} else if ((*lmf)->rsp == 0) {
if (!ji)
return FALSE;
- /* Adjust IP */
- rip --;
-
frame->ji = ji;
frame->type = FRAME_TYPE_MANAGED_TO_NATIVE;
- new_ctx->gregs [AMD64_RIP] = rip;
- new_ctx->gregs [AMD64_RBP] = (*lmf)->rbp;
- new_ctx->gregs [AMD64_RSP] = (*lmf)->rsp;
-
if (((guint64)(*lmf)->previous_lmf) & 4) {
MonoLMFTramp *ext = (MonoLMFTramp*)(*lmf);
/* Trampoline frame */
- for (i = 0; i < AMD64_NREG; ++i) {
- if (AMD64_IS_CALLEE_SAVED_REG (i) && i != AMD64_RBP)
- new_ctx->gregs [i] = ext->ctx->gregs [i];
- }
+ for (i = 0; i < AMD64_NREG; ++i)
+ new_ctx->gregs [i] = ext->ctx->gregs [i];
+ /* Adjust IP */
+ new_ctx->gregs [AMD64_RIP] --;
} else {
/*
* The registers saved in the LMF will be restored using the normal unwind info,
* when the wrapper frame is processed.
*/
+ /* Adjust IP */
+ rip --;
+ new_ctx->gregs [AMD64_RIP] = rip;
+ new_ctx->gregs [AMD64_RSP] = (*lmf)->rsp;
+ new_ctx->gregs [AMD64_RBP] = (*lmf)->rbp;
for (i = 0; i < AMD64_NREG; ++i) {
if (AMD64_IS_CALLEE_SAVED_REG (i) && i != AMD64_RBP)
new_ctx->gregs [i] = 0;
return ((CONTEXT*)sigctx)->Rip;
#else
MonoContext *ctx = sigctx;
- return (gpointer)ctx->rip;
+ return (gpointer)ctx->gregs [AMD64_RIP];
#endif
}
/* Initial LMF */
return;
- if ((guint64)lmf->previous_lmf & 1)
+ if ((guint64)lmf->previous_lmf & 5)
/* Already hijacked or trampoline LMF entry */
return;
#include <glib.h>
#include <signal.h>
#include <string.h>
+#ifdef HAVE_UCONTEXT_H
+#include <ucontext.h>
+#endif
#include <mono/metadata/abi-details.h>
#include <mono/arch/x86/x86-codegen.h>
}
return 1;
}
+
+ static bool finally_called = false;
+
+ static void regress_30472 (int a, int b) {
+ checked {
+ try {
+ int sum = a + b;
+ } finally {
+ finally_called = true;
+ }
+ }
+ }
+
+ public static int test_0_regress_30472 () {
+ finally_called = false;
+ try {
+ regress_30472 (Int32.MaxValue - 1, 2);
+ } catch (Exception ex) {
+ }
+ return finally_called ? 0 : 1;
+ }
}
#if !MOBILE
emit_class_init (MonoCompile *cfg, MonoClass *klass, MonoBasicBlock **out_bblock)
{
/* This could be used as a fallback if needed */
- //emit_generic_class_init (cfg, klass, out_bblock);
+ if (cfg->compile_aot) {
+ /* With the overhead of plt entries, the inline version is comparable in size/speed */
+ emit_generic_class_init (cfg, klass, out_bblock);
+ return;
+ }
*out_bblock = cfg->cbb;
}
static gboolean
-is_unsafe_mov_compatible (MonoClass *param_klass, MonoClass *return_klass)
+is_unsafe_mov_compatible (MonoCompile *cfg, MonoClass *param_klass, MonoClass *return_klass)
{
uint32_t align;
+ param_klass = mono_class_from_mono_type (mini_get_underlying_type (cfg, ¶m_klass->byval_arg));
+
//Only allow for valuetypes
if (!param_klass->valuetype || !return_klass->valuetype)
return FALSE;
MonoClass *return_klass = mono_class_from_mono_type (fsig->ret);
//Valuetypes that are semantically equivalent
- if (is_unsafe_mov_compatible (param_klass, return_klass))
+ if (is_unsafe_mov_compatible (cfg, param_klass, return_klass))
return args [0];
//Arrays of valuetypes that are semantically equivalent
- if (param_klass->rank == 1 && return_klass->rank == 1 && is_unsafe_mov_compatible (param_klass->element_class, return_klass->element_class))
+ if (param_klass->rank == 1 && return_klass->rank == 1 && is_unsafe_mov_compatible (cfg, param_klass->element_class, return_klass->element_class))
return args [0];
return NULL;
* Backward branches are handled at the end of method-to-ir ().
*/
gboolean intr_loc = ip == header->code || (!cfg->cbb->last_ins && cfg->header->num_clauses);
+ gboolean sym_seq_point = sym_seq_points && mono_bitset_test_fast (seq_point_locs, ip - header->code);
/* Avoid sequence points on empty IL like .volatile */
// FIXME: Enable this
//if (!(cfg->cbb->last_ins && cfg->cbb->last_ins->opcode == OP_SEQ_POINT)) {
NEW_SEQ_POINT (cfg, ins, ip - header->code, intr_loc);
- if (sp != stack_start)
+ if ((sp != stack_start) && !sym_seq_point)
ins->flags |= MONO_INST_NONEMPTY_STACK;
MONO_ADD_INS (cfg->cbb, ins);
return start;
}
+#define MAX_VIRTUAL_DELEGATE_OFFSET 32
+
+static gpointer
+get_delegate_virtual_invoke_impl (gboolean load_imt_reg, int offset, guint32 *code_len)
+{
+ guint8 *code, *start;
+ int size = 20;
+
+ if (offset / sizeof (gpointer) > MAX_VIRTUAL_DELEGATE_OFFSET)
+ return NULL;
+
+ start = code = mono_global_codeman_reserve (size);
+
+ /* Replace the this argument with the target */
+ amd64_mov_reg_reg (code, AMD64_RAX, AMD64_ARG_REG1, 8);
+ amd64_mov_reg_membase (code, AMD64_ARG_REG1, AMD64_RAX, MONO_STRUCT_OFFSET (MonoDelegate, target), 8);
+
+ if (load_imt_reg) {
+ /* Load the IMT reg */
+ amd64_mov_reg_membase (code, MONO_ARCH_IMT_REG, AMD64_RAX, MONO_STRUCT_OFFSET (MonoDelegate, method), 8);
+ }
+
+ /* Load the vtable */
+ amd64_mov_reg_membase (code, AMD64_RAX, AMD64_ARG_REG1, MONO_STRUCT_OFFSET (MonoObject, vtable), 8);
+ amd64_jump_membase (code, AMD64_RAX, offset);
+ mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_DELEGATE_INVOKE, NULL);
+
+ if (code_len)
+ *code_len = code - start;
+
+ return start;
+}
+
/*
* mono_arch_get_delegate_invoke_impls:
*
g_free (tramp_name);
}
+ for (i = 0; i < MAX_VIRTUAL_DELEGATE_OFFSET; ++i) {
+ code = get_delegate_virtual_invoke_impl (TRUE, i * SIZEOF_VOID_P, &code_len);
+ tramp_name = g_strdup_printf ("delegate_virtual_invoke_imt_%d", i);
+ res = g_slist_prepend (res, mono_tramp_info_create (tramp_name, code, code_len, NULL, NULL));
+ g_free (tramp_name);
+
+ code = get_delegate_virtual_invoke_impl (FALSE, i * SIZEOF_VOID_P, &code_len);
+ tramp_name = g_strdup_printf ("delegate_virtual_invoke_%d", i);
+ res = g_slist_prepend (res, mono_tramp_info_create (tramp_name, code, code_len, NULL, NULL));
+ g_free (tramp_name);
+ }
+
return res;
}
gpointer
mono_arch_get_delegate_virtual_invoke_impl (MonoMethodSignature *sig, MonoMethod *method, int offset, gboolean load_imt_reg)
{
- guint8 *code, *start;
- int size = 20;
-
- start = code = mono_global_codeman_reserve (size);
-
- /* Replace the this argument with the target */
- amd64_mov_reg_reg (code, AMD64_RAX, AMD64_ARG_REG1, 8);
- amd64_mov_reg_membase (code, AMD64_ARG_REG1, AMD64_RAX, MONO_STRUCT_OFFSET (MonoDelegate, target), 8);
-
- if (load_imt_reg) {
- /* Load the IMT reg */
- amd64_mov_reg_membase (code, MONO_ARCH_IMT_REG, AMD64_RAX, MONO_STRUCT_OFFSET (MonoDelegate, method), 8);
- }
-
- /* Load the vtable */
- amd64_mov_reg_membase (code, AMD64_RAX, AMD64_ARG_REG1, MONO_STRUCT_OFFSET (MonoObject, vtable), 8);
- amd64_jump_membase (code, AMD64_RAX, offset);
- mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_DELEGATE_INVOKE, NULL);
-
- return start;
+ return get_delegate_virtual_invoke_impl (load_imt_reg, offset, NULL);
}
void
* the caller ip is saved.
* If the second lowest bit is set, then this is a MonoLMFExt structure, and
* the other fields are not valid.
- * If the third lowest bit is set, then this is a MonoLMFTramp structure.
+ * If the third lowest bit is set, then this is a MonoLMFTramp structure, and
+ * the 'rbp' field is not valid.
*/
gpointer previous_lmf;
#if defined(__default_codegen__) || defined(HOST_WIN32)
p->regs [slot] = (mgreg_t)*arg;
break;
} else {
- /* Fall though */
+ if (t->type == MONO_TYPE_GENERICINST && mono_class_is_nullable (mono_class_from_mono_type (t))) {
+ MonoClass *klass = mono_class_from_mono_type (t);
+ guint8 *nullable_buf;
+ int size;
+
+ size = mono_class_value_size (klass, NULL);
+ nullable_buf = g_alloca (size);
+ g_assert (nullable_buf);
+
+ /* The argument pointed to by arg is either a boxed vtype or null */
+ mono_nullable_init (nullable_buf, (MonoObject*)arg, klass);
+
+ arg = (gpointer*)nullable_buf;
+ /* Fall though */
+ } else {
+ /* Fall though */
+ }
}
case MONO_TYPE_VALUETYPE:
g_assert (ainfo->storage == RegTypeStructByVal);
break;
case OP_IL_SEQ_POINT:
case OP_SEQ_POINT:
- printf (" il: %x", (int)ins->inst_imm);
+ printf (" il: 0x%x%s", (int)ins->inst_imm, ins->flags & MONO_INST_NONEMPTY_STACK ? ", nonempty-stack" : "");
break;
default:
break;
k = mono_class_inflate_generic_class (gclass->container_class, &context);
return get_shared_gparam (t, &k->byval_arg);
+ } else if (MONO_TYPE_ISSTRUCT (type)) {
+ return type;
}
- g_assert (!type->byref && (((type->type >= MONO_TYPE_BOOLEAN) && (type->type <= MONO_TYPE_R8)) || (type->type == MONO_TYPE_I) || (type->type == MONO_TYPE_U) || (type->type == MONO_TYPE_VALUETYPE && type->data.klass->enumtype)));
-
/* Create a type variable with a constraint which encodes which types can match it */
ttype = type->type;
- if (type->type == MONO_TYPE_VALUETYPE)
+ if (type->type == MONO_TYPE_VALUETYPE) {
ttype = mono_class_enum_basetype (type->data.klass)->type;
+ } else if (MONO_TYPE_IS_REFERENCE (type)) {
+ ttype = MONO_TYPE_OBJECT;
+ } else if (type->type == MONO_TYPE_VAR || type->type == MONO_TYPE_MVAR) {
+ if (type->data.generic_param->gshared_constraint)
+ return get_shared_gparam (t, type->data.generic_param->gshared_constraint);
+ ttype = MONO_TYPE_OBJECT;
+ }
{
MonoType t2;
type_argv = g_new0 (MonoType*, inst->type_argc);
for (i = 0; i < inst->type_argc; ++i) {
- if (all_vt) {
+ if (all_vt || gsharedvt) {
type_argv [i] = get_gsharedvt_type (shared_inst->type_argv [i]);
- } else if ((MONO_TYPE_IS_REFERENCE (inst->type_argv [i]) || inst->type_argv [i]->type == MONO_TYPE_VAR || inst->type_argv [i]->type == MONO_TYPE_MVAR)) {
- g_assert (shared_inst);
- type_argv [i] = get_shared_gparam (shared_inst->type_argv [i], &mono_defaults.object_class->byval_arg);
- } else if (partial) {
+ } else {
/* These types match the ones in generic_inst_is_sharable () */
type_argv [i] = get_shared_type (shared_inst->type_argv [i], inst->type_argv [i]);
- } else if (gsharedvt) {
- type_argv [i] = get_gsharedvt_type (shared_inst->type_argv [i]);
- } else {
- type_argv [i] = inst->type_argv [i];
}
}
res = mono_class_inflate_generic_method_checked (declaring_method, &shared_context, &error);
g_assert (mono_error_ok (&error)); /* FIXME don't swallow the error */
+ //printf ("%s\n", mono_method_full_name (res, 1));
+
return res;
}
emit_dbg_loc (ctx, builder, ins->cil_code);
nins ++;
- if (nins > 5000 && builder == starting_builder) {
+ if (nins > 3000 && builder == starting_builder) {
/* some steps in llc are non-linear in the size of basic blocks, see #5714 */
LLVM_FAILURE (ctx, "basic block too long");
}
case MONO_PATCH_INFO_METHOD:
case MONO_PATCH_INFO_METHOD_JUMP:
case MONO_PATCH_INFO_IMAGE:
- case MONO_PATCH_INFO_JIT_ICALL_ADDR:
case MONO_PATCH_INFO_ICALL_ADDR:
case MONO_PATCH_INFO_FIELD:
case MONO_PATCH_INFO_SFLDA:
return (ji->type << 8) | (gssize)info->klass | (gssize)info->method;
}
+ case MONO_PATCH_INFO_JIT_ICALL_ADDR:
+ return (ji->type << 8) | g_str_hash (ji->data.target);
default:
printf ("info type: %d\n", ji->type);
mono_print_ji (ji); printf ("\n");
return ji1->data.index == ji2->data.index;
case MONO_PATCH_INFO_VIRT_METHOD:
return ji1->data.virt_method->klass == ji2->data.virt_method->klass && ji1->data.virt_method->method == ji2->data.virt_method->method;
+ case MONO_PATCH_INFO_JIT_ICALL_ADDR:
+ if (ji1->data.target == ji2->data.target)
+ return 1;
+ return strcmp (ji1->data.target, ji2->data.target) == 0 ? 1 : 0;
default:
if (ji1->data.target != ji2->data.target)
return 0;
for (i = 0; i < sig->param_count; ++i) {
MonoType *t = sig->params [i];
- if (t->type == MONO_TYPE_GENERICINST && mono_class_is_nullable (mono_class_from_mono_type (t)))
+ if (t->byref && t->type == MONO_TYPE_GENERICINST && mono_class_is_nullable (mono_class_from_mono_type (t)))
supported = FALSE;
}
if (!method)
return NULL;
- /* FIXME Support more cases */
- if (mono_aot_only)
- return NULL;
-
if (MONO_TYPE_ISSTRUCT (sig->ret))
return NULL;
if (cache [idx])
return cache [idx];
- return cache [idx] = mono_arch_get_delegate_virtual_invoke_impl (sig, method, offset, load_imt_reg);
+ /* FIXME Support more cases */
+ if (mono_aot_only) {
+ char tramp_name [256];
+
+ sprintf (tramp_name, "delegate_virtual_invoke%s_%d", load_imt_reg ? "_imt" : "", offset / SIZEOF_VOID_P);
+ cache [idx] = mono_aot_get_trampoline (tramp_name);
+ g_assert (cache [idx]);
+ } else {
+ cache [idx] = mono_arch_get_delegate_virtual_invoke_impl (sig, method, offset, load_imt_reg);
+ }
+ return cache [idx];
}
static gpointer
#ifdef MONO_ARCH_EMULATE_FREM
#if defined(__default_codegen__)
register_opcode_emulation (OP_FREM, "__emul_frem", "double double double", fmod, "fmod", FALSE);
+ register_opcode_emulation (OP_RREM, "__emul_rrem", "float float float", fmodf, "fmodf", FALSE);
#elif defined(__native_client_codegen__)
register_opcode_emulation (OP_FREM, "__emul_frem", "double double double", mono_fmod, "mono_fmod", FALSE);
#endif
MonoTrampInfo *info;
if (mono_aot_only) {
- tramp = mono_aot_get_trampoline ("nullified_class_init_trampoline");
+ /* Not used */
+ g_assert_not_reached ();
+ tramp = NULL;
} else {
tramp = mono_arch_get_nullified_class_init_trampoline (&info);
mono_tramp_info_register (info);
return start;
}
+#define MAX_VIRTUAL_DELEGATE_OFFSET 32
+
+static gpointer
+get_delegate_virtual_invoke_impl (gboolean load_imt_reg, int offset, guint32 *code_size)
+{
+ guint8 *code, *start;
+ int size = 24;
+
+ /*
+ * The stack contains:
+ * <delegate>
+ * <return addr>
+ */
+ start = code = mono_global_codeman_reserve (size);
+
+ /* Replace the this argument with the target */
+ x86_mov_reg_membase (code, X86_EAX, X86_ESP, 4, 4);
+ x86_mov_reg_membase (code, X86_ECX, X86_EAX, MONO_STRUCT_OFFSET (MonoDelegate, target), 4);
+ x86_mov_membase_reg (code, X86_ESP, 4, X86_ECX, 4);
+
+ if (load_imt_reg) {
+ /* Load the IMT reg */
+ x86_mov_reg_membase (code, MONO_ARCH_IMT_REG, X86_EAX, MONO_STRUCT_OFFSET (MonoDelegate, method), 4);
+ }
+
+ /* Load the vtable */
+ x86_mov_reg_membase (code, X86_EAX, X86_ECX, MONO_STRUCT_OFFSET (MonoObject, vtable), 4);
+ x86_jump_membase (code, X86_EAX, offset);
+ mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_DELEGATE_INVOKE, NULL);
+
+ if (code_size)
+ *code_size = code - start;
+
+ return start;
+}
+
GSList*
mono_arch_get_delegate_invoke_impls (void)
{
g_free (tramp_name);
}
+ for (i = 0; i < MAX_VIRTUAL_DELEGATE_OFFSET; ++i) {
+ code = get_delegate_virtual_invoke_impl (TRUE, i * SIZEOF_VOID_P, &code_len);
+ tramp_name = g_strdup_printf ("delegate_virtual_invoke_imt_%d", i);
+ res = g_slist_prepend (res, mono_tramp_info_create (tramp_name, code, code_len, NULL, NULL));
+ g_free (tramp_name);
+
+ code = get_delegate_virtual_invoke_impl (FALSE, i * SIZEOF_VOID_P, &code_len);
+ tramp_name = g_strdup_printf ("delegate_virtual_invoke_%d", i);
+ res = g_slist_prepend (res, mono_tramp_info_create (tramp_name, code, code_len, NULL, NULL));
+ g_free (tramp_name);
+ }
+
return res;
}
gpointer
mono_arch_get_delegate_virtual_invoke_impl (MonoMethodSignature *sig, MonoMethod *method, int offset, gboolean load_imt_reg)
{
- guint8 *code, *start;
- int size = 24;
-
- /*
- * The stack contains:
- * <delegate>
- * <return addr>
- */
- start = code = mono_global_codeman_reserve (size);
-
- /* Replace the this argument with the target */
- x86_mov_reg_membase (code, X86_EAX, X86_ESP, 4, 4);
- x86_mov_reg_membase (code, X86_ECX, X86_EAX, MONO_STRUCT_OFFSET (MonoDelegate, target), 4);
- x86_mov_membase_reg (code, X86_ESP, 4, X86_ECX, 4);
-
- if (load_imt_reg) {
- /* Load the IMT reg */
- x86_mov_reg_membase (code, MONO_ARCH_IMT_REG, X86_EAX, MONO_STRUCT_OFFSET (MonoDelegate, method), 4);
- }
-
- /* Load the vtable */
- x86_mov_reg_membase (code, X86_EAX, X86_ECX, MONO_STRUCT_OFFSET (MonoObject, vtable), 4);
- x86_jump_membase (code, X86_EAX, offset);
- mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_DELEGATE_INVOKE, NULL);
-
- return start;
+ return get_delegate_virtual_invoke_impl (load_imt_reg, offset, NULL);
}
mgreg_t
mono_create_gc_safepoint (MonoCompile *cfg, MonoBasicBlock *bblock)
{
MonoInst *poll_addr, *ins;
- if (cfg->verbose_level)
+ if (cfg->verbose_level > 1)
printf ("ADDING SAFE POINT TO BB %d\n", bblock->block_num);
#if defined(__native_client_codegen__)
if (bblock->flags & BB_EXCEPTION_HANDLER) {
MonoInst *eh_op = bblock->code;
- // we only skip the ops that start EH blocks.
- if (eh_op && eh_op->opcode != OP_START_HANDLER && eh_op->opcode != OP_GET_EX_OBJ)
+ if (eh_op && eh_op->opcode != OP_START_HANDLER && eh_op->opcode != OP_GET_EX_OBJ) {
eh_op = NULL;
+ } else {
+ MonoInst *next_eh_op = eh_op ? eh_op->next : NULL;
+ // skip all EH relateds ops
+ while (next_eh_op && (next_eh_op->opcode == OP_START_HANDLER || next_eh_op->opcode == OP_GET_EX_OBJ)) {
+ eh_op = next_eh_op;
+ next_eh_op = eh_op->next;
+ }
+ }
mono_bblock_insert_after_ins (bblock, eh_op, poll_addr);
mono_bblock_insert_after_ins (bblock, poll_addr, ins);
{
MonoBasicBlock *bb;
- if (cfg->verbose_level)
+ if (cfg->verbose_level > 1)
printf ("INSERTING SAFEPOINTS\n");
+ if (cfg->verbose_level > 2)
+ mono_print_code (cfg, "BEFORE SAFEPOINTS");
for (bb = cfg->bb_entry; bb; bb = bb->next_bb) {
if (bb->loop_body_start || bb == cfg->bb_entry || bb->flags & BB_EXCEPTION_HANDLER)
mono_create_gc_safepoint (cfg, bb);
}
+
+ if (cfg->verbose_level > 2)
+ mono_print_code (cfg, "AFTER SAFEPOINTS");
+
}
#else
if (MONO_METHOD_COMPILE_BEGIN_ENABLED ())
MONO_PROBE_METHOD_COMPILE_BEGIN (method);
+ gsharedvt_method = is_gsharedvt_method (method);
+
/*
* In AOT mode, method can be the following:
- * - the generic method definition. In this case, we are compiling the fully shared
- * version of the method, i.e. the version where all the type parameters are
- * reference types.
* - a gsharedvt method.
- * - a method inflated with type parameters. This is for partial sharing.
+ * - a method inflated with type parameters. This is for ref/partial sharing.
* - a method inflated with concrete types.
*/
- if (compile_aot)
- try_generic_shared = mono_class_generic_sharing_enabled (method->klass) &&
- (opts & MONO_OPT_GSHARED) && ((method->is_generic || method->klass->generic_container) || (!method->klass->generic_class && mono_method_is_generic_sharable_full (method, TRUE, FALSE, FALSE)));
- else
+ if (compile_aot) {
+ if (is_open_method (method)) {
+ try_generic_shared = TRUE;
+ method_is_gshared = TRUE;
+ } else {
+ try_generic_shared = FALSE;
+ }
+ g_assert (opts & MONO_OPT_GSHARED);
+ } else {
try_generic_shared = mono_class_generic_sharing_enabled (method->klass) &&
(opts & MONO_OPT_GSHARED) && mono_method_is_generic_sharable (method, FALSE);
+ if (mini_is_gsharedvt_sharable_method (method)) {
+ if (!mono_debug_count ())
+ try_generic_shared = FALSE;
+ }
+ }
/*
if (try_generic_shared && !mono_debug_count ())
mono_stats.generics_unsharable_methods++;
}
- if (mini_is_gsharedvt_sharable_method (method)) {
- if (!mono_debug_count ())
- try_generic_shared = FALSE;
- if (compile_aot)
- try_generic_shared = FALSE;
- }
-
- gsharedvt_method = is_gsharedvt_method (method);
- if (gsharedvt_method || (compile_aot && is_open_method (method))) {
- /* We are AOTing a gshared method directly */
- method_is_gshared = TRUE;
- g_assert (compile_aot);
- try_generic_shared = TRUE;
- }
-
#ifdef ENABLE_LLVM
try_llvm = mono_use_llvm || llvm;
#endif
#endif
/* Version number of the AOT file format */
-#define MONO_AOT_FILE_VERSION 116
+#define MONO_AOT_FILE_VERSION 117
//TODO: This is x86/amd64 specific.
#define mono_simd_shuffle_mask(a,b,c,d) ((a) | ((b) << 2) | ((c) << 4) | ((d) << 6))
#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)))))
+#define MONO_AOT_TRAMP_PAGE_SIZE 16384
+
/* Constants used to encode different types of methods in AOT */
enum {
MONO_AOT_METHODREF_MIN = 240,
MONO_AOT_FILE_FLAG_WITH_LLVM = 1,
MONO_AOT_FILE_FLAG_FULL_AOT = 2,
MONO_AOT_FILE_FLAG_DEBUG = 4,
+ MONO_AOT_FILE_FLAG_LLVM_THUMB = 8,
} MonoAotFileFlags;
/* This structure is stored in the AOT file */
gpointer static_rgctx_trampolines;
gpointer imt_thunks;
gpointer gsharedvt_arg_trampolines;
- /*
- * The end of LLVM generated thumb code, or NULL.
- */
- gpointer thumb_end;
/* In static mode, points to a table of global symbols for trampolines etc */
gpointer globals;
/* Points to a string containing the assembly name*/
last = ins;
}
- if (bb->last_ins && bb->last_ins->opcode == OP_ENDFINALLY && bb->seq_points) {
+ /* The second case handles endfinally opcodes which are in a separate bb by themselves */
+ if ((bb->last_ins && bb->last_ins->opcode == OP_ENDFINALLY && bb->seq_points) || (bb->out_count == 1 && bb->out_bb [0]->code && bb->out_bb [0]->code->opcode == OP_ENDFINALLY)) {
MonoBasicBlock *bb2;
MonoInst *endfinally_seq_point = NULL;
/* RAX is already saved */
amd64_mov_reg_membase (code, AMD64_RAX, AMD64_RBP, rbp_offset, sizeof(mgreg_t));
amd64_mov_membase_reg (code, AMD64_RBP, saved_regs_offset + (i * sizeof(mgreg_t)), AMD64_RAX, sizeof(mgreg_t));
+ } else if (i == AMD64_RIP) {
+ if (has_caller)
+ amd64_mov_reg_membase (code, AMD64_R11, AMD64_RBP, 8, sizeof(gpointer));
+ else
+ amd64_mov_reg_imm (code, AMD64_R11, 0);
+ amd64_mov_membase_reg (code, AMD64_RBP, saved_regs_offset + (i * sizeof(mgreg_t)), AMD64_R11, sizeof(mgreg_t));
+ } else if (i == AMD64_RSP) {
+ amd64_mov_reg_reg (code, AMD64_R11, AMD64_RSP, sizeof(mgreg_t));
+ amd64_alu_reg_imm (code, X86_ADD, AMD64_R11, framesize + 16);
+ amd64_mov_membase_reg (code, AMD64_RBP, saved_regs_offset + (i * sizeof(mgreg_t)), AMD64_R11, sizeof(mgreg_t));
} else if (i != AMD64_R11) {
amd64_mov_membase_reg (code, AMD64_RBP, saved_regs_offset + (i * sizeof(mgreg_t)), i, sizeof(mgreg_t));
} else {
else
amd64_mov_reg_imm (code, AMD64_R11, 0);
amd64_mov_membase_reg (code, AMD64_RBP, lmf_offset + MONO_STRUCT_OFFSET (MonoLMF, rip), AMD64_R11, sizeof(mgreg_t));
- /* Save fp */
- amd64_mov_reg_membase (code, AMD64_R11, AMD64_RSP, framesize, sizeof(mgreg_t));
- amd64_mov_membase_reg (code, AMD64_RBP, lmf_offset + MONO_STRUCT_OFFSET (MonoLMF, rbp), AMD64_R11, sizeof(mgreg_t));
/* Save sp */
amd64_mov_reg_reg (code, AMD64_R11, AMD64_RSP, sizeof(mgreg_t));
amd64_alu_reg_imm (code, X86_ADD, AMD64_R11, framesize + 16);
amd64_mov_membase_reg (code, AMD64_RBP, lmf_offset + MONO_STRUCT_OFFSET (MonoLMF, rsp), AMD64_R11, sizeof(mgreg_t));
- /* Save pointer to registers */
+ /* Save pointer to context */
amd64_lea_membase (code, AMD64_R11, AMD64_RBP, ctx_offset);
amd64_mov_membase_reg (code, AMD64_RBP, lmf_offset + MONO_STRUCT_OFFSET (MonoLMFTramp, ctx), AMD64_R11, sizeof(mgreg_t));
/*
* decode.c: mprof-report program source: decode and analyze the log profiler data
*
- * Author:
+ * Authors:
* Paolo Molaro (lupus@ximian.com)
+ * Alex Rønne Petersen (alexrp@xamarin.com)
*
* Copyright 2010 Novell, Inc (http://www.novell.com)
*/
/*
* proflog.c: mono log profiler
*
- * Author:
+ * Authors:
* Paolo Molaro (lupus@ximian.com)
+ * Alex Rønne Petersen (alexrp@xamarin.com)
*
* Copyright 2010 Novell, Inc (http://www.novell.com)
* Copyright 2011 Xamarin Inc (http://www.xamarin.com)
static gboolean debug_coverage = FALSE;
static MonoProfileSamplingMode sampling_mode = MONO_PROFILER_STAT_MODE_PROCESS;
-/* For linux compile with:
- * gcc -fPIC -shared -o libmono-profiler-log.so proflog.c utils.c -Wall -g -lz `pkg-config --cflags --libs mono-2`
- * gcc -o mprof-report decode.c utils.c -Wall -g -lz -lrt -lpthread `pkg-config --cflags mono-2`
- *
- * For osx compile with:
- * gcc -m32 -Dmono_free=free shared -o libmono-profiler-log.dylib proflog.c utils.c -Wall -g -lz `pkg-config --cflags mono-2` -undefined suppress -flat_namespace
- * gcc -m32 -o mprof-report decode.c utils.c -Wall -g -lz -lrt -lpthread `pkg-config --cflags mono-2`
- *
- * Install with:
- * sudo cp mprof-report /usr/local/bin
- * sudo cp libmono-profiler-log.so /usr/local/lib
- * sudo ldconfig
- */
-
typedef struct _LogBuffer LogBuffer;
/*
* number of methods that are fully and partially covered.
*/
+/*
+ * Format oddities that we ought to fix:
+ *
+ * - Methods written in emit_bt () should be based on the buffer's base
+ * method instead of the base pointer.
+ * - The TYPE_SAMPLE_HIT event contains (currently) pointless data like
+ * always-one unmanaged frame count and always-zero IL offsets.
+ *
+ * These are mostly small things and are not worth a format change by
+ * themselves. They should be done when some other major change has to
+ * be done to the format.
+ */
+
struct _LogBuffer {
LogBuffer *next;
uint64_t time_base;
}
static void
-register_method_local (MonoProfiler *prof, MonoDomain *domain, MonoMethod *method, MonoJitInfo *ji)
+register_method_local (MonoProfiler *prof, MonoMethod *method, MonoJitInfo *ji)
{
- if (!domain)
- g_assert (ji);
-
if (!mono_conc_hashtable_lookup (prof->method_table, method)) {
if (!ji) {
MethodSearch search = { method, NULL };
}
static void
-emit_method (MonoProfiler *prof, LogBuffer *logbuffer, MonoDomain *domain, MonoMethod *method)
+emit_method (MonoProfiler *prof, LogBuffer *logbuffer, MonoMethod *method)
{
- register_method_local (prof, domain, method, NULL);
+ register_method_local (prof, method, NULL);
emit_method_inner (logbuffer, method);
}
+static void
+emit_method_as_ptr (MonoProfiler *prof, LogBuffer *logbuffer, MonoMethod *method)
+{
+ register_method_local (prof, method, NULL);
+ emit_ptr (logbuffer, method);
+}
+
static void
emit_obj (LogBuffer *logbuffer, void *ptr)
{
}
static void
-emit_bt (LogBuffer *logbuffer, FrameData *data)
+emit_bt (MonoProfiler *prof, LogBuffer *logbuffer, FrameData *data)
{
/* FIXME: this is actually tons of data and we should
* just output it the first time and use an id the next
//if (*p != data.count) {
// printf ("bad num frames enc at %d: %d -> %d\n", count, data.count, *p); printf ("frames end: %p->%p\n", p, logbuffer->data); exit(0);}
while (data->count) {
- emit_ptr (logbuffer, data->methods [--data->count]);
+ emit_method_as_ptr (prof, logbuffer, data->methods [--data->count]);
}
}
emit_obj (logbuffer, obj);
emit_value (logbuffer, len);
if (do_bt)
- emit_bt (logbuffer, &data);
+ emit_bt (prof, logbuffer, &data);
EXIT_LOG (logbuffer);
if (logbuffer->next)
safe_send (prof, logbuffer);
}
#ifndef DISABLE_HELPER_THREAD
-static void process_method_enter (MonoProfiler *prof, MonoMethod *method);
+static void process_method_enter_coverage (MonoProfiler *prof, MonoMethod *method);
#endif /* DISABLE_HELPER_THREAD */
static void
method_enter (MonoProfiler *prof, MonoMethod *method)
{
- uint64_t now;
+ uint64_t now = current_time ();
+
+#ifndef DISABLE_HELPER_THREAD
+ process_method_enter_coverage (prof, method);
+#endif /* DISABLE_HELPER_THREAD */
+
LogBuffer *logbuffer = ensure_logbuf (16);
if (logbuffer->call_depth++ > max_call_depth)
return;
- now = current_time ();
ENTER_LOG (logbuffer, "enter");
emit_byte (logbuffer, TYPE_ENTER | TYPE_METHOD);
emit_time (logbuffer, now);
- emit_method (prof, logbuffer, mono_domain_get (), method);
+ emit_method (prof, logbuffer, method);
EXIT_LOG (logbuffer);
-#ifndef DISABLE_HELPER_THREAD
- process_method_enter (prof, method);
-#endif /* DISABLE_HELPER_THREAD */
-
process_requests (prof);
}
ENTER_LOG (logbuffer, "leave");
emit_byte (logbuffer, TYPE_LEAVE | TYPE_METHOD);
emit_time (logbuffer, now);
- emit_method (prof, logbuffer, mono_domain_get (), method);
+ emit_method (prof, logbuffer, method);
EXIT_LOG (logbuffer);
if (logbuffer->next)
safe_send (prof, logbuffer);
ENTER_LOG (logbuffer, "eleave");
emit_byte (logbuffer, TYPE_EXC_LEAVE | TYPE_METHOD);
emit_time (logbuffer, now);
- emit_method (prof, logbuffer, mono_domain_get (), method);
+ emit_method (prof, logbuffer, method);
EXIT_LOG (logbuffer);
process_requests (prof);
}
if (result != MONO_PROFILE_OK)
return;
- register_method_local (prof, NULL, method, ji);
+ register_method_local (prof, method, ji);
}
static void
emit_time (logbuffer, now);
emit_obj (logbuffer, object);
if (do_bt)
- emit_bt (logbuffer, &data);
+ emit_bt (prof, logbuffer, &data);
EXIT_LOG (logbuffer);
process_requests (prof);
}
emit_time (logbuffer, now);
emit_value (logbuffer, clause_type);
emit_value (logbuffer, clause_num);
- emit_method (prof, logbuffer, mono_domain_get (), method);
+ emit_method (prof, logbuffer, method);
EXIT_LOG (logbuffer);
}
emit_time (logbuffer, now);
emit_obj (logbuffer, object);
if (do_bt)
- emit_bt (logbuffer, &data);
+ emit_bt (profiler, logbuffer, &data);
EXIT_LOG (logbuffer);
process_requests (profiler);
}
num_code_pages += add_code_page (code_pages, size_code_pages, ip & CPAGE_MASK);
}
-#if defined(HAVE_DL_ITERATE_PHDR) && defined(ELFMAG0)
+/* ELF code crashes on some systems. */
+//#if defined(HAVE_DL_ITERATE_PHDR) && defined(ELFMAG0)
+#if 0
static void
dump_ubin (const char *filename, uintptr_t load_addr, uint64_t offset, uintptr_t size)
{
logbuffer->data += len;
}
-#ifdef ELFMAG0
+/* ELF code crashes on some systems. */
+//#if defined(ELFMAG0)
+#if 0
#if SIZEOF_VOID_P == 4
#define ELF_WSIZE 32
}
#endif
-#if defined(HAVE_DL_ITERATE_PHDR) && defined(ELFMAG0)
+/* ELF code crashes on some systems. */
+//#if defined(HAVE_DL_ITERATE_PHDR) && defined(ELFMAG0)
+#if 0
static int
elf_dl_callback (struct dl_phdr_info *info, size_t size, void *data)
{
emit_uvalue (logbuffer, mbt_count);
for (i = 0; i < mbt_count; ++i) {
MonoMethod *method = (MonoMethod *) sample [i * 4 + 0];
- MonoDomain *domain = (MonoDomain *) sample [i * 4 + 1];
uintptr_t native_offset = sample [i * 4 + 3];
- emit_method (prof, logbuffer, domain, method);
+ emit_method (prof, logbuffer, method);
emit_svalue (logbuffer, 0); /* il offset will always be 0 from now on */
emit_svalue (logbuffer, native_offset);
}
}
static void
-process_method_enter (MonoProfiler *prof, MonoMethod *method)
+process_method_enter_coverage (MonoProfiler *prof, MonoMethod *method)
{
MonoClass *klass;
MonoImage *image;
else
test-messages: w32message.exe
> test_messages.zero
- $(with_mono_path) $(JITTEST_PROG_RUN) w32message.exe >& w32message.allout && cmp test_messages.zero w32message.allout
+ $(with_mono_path) $(JITTEST_PROG_RUN) w32message.exe > w32message.allout 2>&1 && cmp test_messages.zero w32message.allout
endif
endif
Test (i => ProbeArray (new int [int.MaxValue - i]));
Test (i => ProbeArray (new int [int.MaxValue - i * 100]));
+ // FIXME: This commit 4gb of memory
+ /*
Console.WriteLine ("strings");
Test (i => ProbeString ("abcd".PadRight(int.MaxValue - i)));
Test (i => ProbeString ("abcd".PadRight(int.MaxValue - i * 100)));
+ */
//Console.WriteLine ("no objects allocated - all good");
return 0;
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/mono $(LIBGC_CPPFLAGS) $(GLIB_CFLAGS) -DMONO_BINDIR=\"$(bindir)/\" -DMONO_ASSEMBLIES=\"$(assembliesdir)\" -DMONO_CFG_DIR=\"$(confdir)\"
test_cflags = $(AM_CFLAGS) $(SGEN_DEFINES)
-test_ldadd = ../metadata/libmonoruntimesgen.la ../sgen/libmonosgen.la ../io-layer/libwapi.la ../utils/libmonoutils.la \
+test_ldadd = libtestlib.la \
$(LIBGC_LIBS) $(GLIB_LIBS) -lm $(LIBICONV)
if PLATFORM_DARWIN
test_ldflags = -framework CoreFoundation -framework Foundation
if !CROSS_COMPILE
if !HOST_WIN32
if SUPPORT_BOEHM
-if !PLATFORM_GNU
+
+noinst_LTLIBRARIES = libtestlib.la
+libtestlib_la_SOURCES =
+libtestlib_la_LIBADD = ../metadata/libmonoruntimesgen.la ../sgen/libmonosgen.la ../utils/libmonoutils.la ../io-layer/libwapi.la
test_sgen_qsort_SOURCES = test-sgen-qsort.c
test_sgen_qsort_CFLAGS = $(test_cflags)
TESTS = test-sgen-qsort test-memfuncs test-mono-linked-list-set test-conc-hashtable
-endif !PLATFORM_GNU
endif SUPPORT_BOEHM
endif !HOST_WIN32
endif !CROSS_COMPILE
dlmalloc.c \
mono-counters.c \
mono-compiler.h \
+ mono-complex.h \
mono-dl.c \
mono-dl-windows.c \
mono-dl-darwin.c \
: "=r" (offset))
#endif
#elif defined(__s390x__)
-# if defined(PIC)
+# if defined(__PIC__)
+# if !defined(__PIE__)
// This only works if libmono is linked into the application
-# define MONO_THREAD_VAR_OFFSET(var,offset) do { guint64 foo; \
- __asm__ ("basr %%r1,0\n\t" \
- "j 0f\n\t" \
- ".quad " #var "@TLSGD\n\t" \
+# define MONO_THREAD_VAR_OFFSET(var,offset) do { guint64 foo; \
+ __asm__ ("basr %%r1,0\n\t" \
+ "j 0f\n\t" \
+ ".quad " #var "@TLSGD\n" \
"0:\n\t" \
- "lg %%r2,4(%%r1)\n\t" \
+ "lg %%r2,4(%%r1)\n\t" \
"brasl %%r14,__tls_get_offset@PLT:tls_gdcall:"#var"\n\t" \
"lgr %0,%%r2\n\t" \
: "=r" (foo) : \
: "1", "2", "14", "cc"); \
offset = foo; } while (0)
+# elif __PIE__ == 1
+# define MONO_THREAD_VAR_OFFSET(var,offset) do { guint64 foo; \
+ __asm__ ("lg %0," #var "@GOTNTPOFF(%%r12)\n\t" \
+ : "=r" (foo)); \
+ offset = foo; } while (0)
+# elif __PIE__ == 2
+# define MONO_THREAD_VAR_OFFSET(var,offset) do { guint64 foo; \
+ __asm__ ("larl %%r1," #var "@INDNTPOFF\n\t" \
+ "lg %0,0(%%r1)\n\t" \
+ : "=r" (foo) : \
+ : "1", "cc"); \
+ offset = foo; } while (0)
+# endif
# else
-# define MONO_THREAD_VAR_OFFSET(var,offset) do { guint64 foo; \
- __asm__ ("basr %%r1,0\n\t" \
- "j 0f\n\t" \
- ".quad " #var "@NTPOFF\n" \
- "0:\n\t" \
- "lg %0,4(%%r1)\n\t" \
- : "=r" (foo) : : "1"); \
+# define MONO_THREAD_VAR_OFFSET(var,offset) do { guint64 foo; \
+ __asm__ ("basr %%r1,0\n\t" \
+ "j 0f\n\t" \
+ ".quad " #var "@NTPOFF\n" \
+ "0:\n\t" \
+ "lg %0,4(%%r1)\n\t" \
+ : "=r" (foo) : : "1"); \
offset = foo; } while (0)
# endif
-
#else
#define MONO_THREAD_VAR_OFFSET(var,offset) (offset) = -1
#endif
--- /dev/null
+/*
+* mono-complex.h: C99 Complex math cross-platform support code
+*
+* Author:
+* Joao Matos (joao.matos@xamarin.com)
+*
+* Copyright 2015 Xamarin, Inc (http://www.xamarin.com)
+*/
+
+#include <config.h>
+#include <glib.h>
+
+#if !defined (HAVE_COMPLEX_H)
+#include <../../support/libm/complex.h>
+#else
+#include <complex.h>
+#endif
+
+#define _USE_MATH_DEFINES // needed by MSVC to define math constants
+#include <math.h>
+
+#ifdef _MSC_VER
+
+#define double_complex _C_double_complex
+
+static inline
+double_complex mono_double_complex_make(gdouble re, gdouble im)
+{
+ return _Cbuild (re, im);
+}
+
+static inline
+double_complex mono_double_complex_scalar_div(double_complex c, gdouble s)
+{
+ return mono_double_complex_make(creal(c) / s, cimag(c) / s);
+}
+
+static inline
+double_complex mono_double_complex_scalar_mul(double_complex c, gdouble s)
+{
+ return mono_double_complex_make(creal(c) * s, cimag(c) * s);
+}
+
+static inline
+double_complex mono_double_complex_div(double_complex left, double_complex right)
+{
+ double denom = creal(right) * creal(right) + cimag(right) * cimag(right);
+
+ return mono_double_complex_make(
+ (creal(left) * creal(right) + cimag(left) * cimag(right)) / denom,
+ (-creal(left) * cimag(right) + cimag(left) * creal(right)) / denom);
+}
+
+static inline
+double_complex mono_double_complex_sub(double_complex left, double_complex right)
+{
+ return mono_double_complex_make(creal(left) - creal(right), cimag(left)
+ - cimag(right));
+}
+
+#else
+
+#define double_complex double complex
+
+static inline
+double_complex mono_double_complex_make(gdouble re, gdouble im)
+{
+ return re + im * I;
+}
+
+static inline
+double_complex mono_double_complex_scalar_div(double_complex c, gdouble s)
+{
+ return c / s;
+}
+
+static inline
+double_complex mono_double_complex_scalar_mul(double_complex c, gdouble s)
+{
+ return c * s;
+}
+
+static inline
+double_complex mono_double_complex_div(double_complex left, double_complex right)
+{
+ return left / right;
+}
+
+static inline
+double_complex mono_double_complex_sub(double_complex left, double_complex right)
+{
+ return left - right;
+}
+
+#endif
#elif defined(HOST_WIN32)
CONTEXT *context = (CONTEXT*)sigctx;
- mctx->gregs [AMD64_RIP] = context->gregs [AMD64_RIP];
- mctx->gregs [AMD64_RAX] = context->gregs [AMD64_RAX];
- mctx->gregs [AMD64_RCX] = context->gregs [AMD64_RCX];
- mctx->gregs [AMD64_RDX] = context->gregs [AMD64_RDX];
- mctx->gregs [AMD64_RBX] = context->gregs [AMD64_RBX];
- mctx->gregs [AMD64_RSP] = context->gregs [AMD64_RSP];
- mctx->gregs [AMD64_RBP] = context->gregs [AMD64_RBP];
- mctx->gregs [AMD64_RSI] = context->gregs [AMD64_RSI];
- mctx->gregs [AMD64_RDI] = context->gregs [AMD64_RDI];
- mctx->gregs [AMD64_R8] = context->gregs [AMD64_R8];
- mctx->gregs [AMD64_R9] = context->gregs [AMD64_R9];
- mctx->gregs [AMD64_R10] = context->gregs [AMD64_R10];
- mctx->gregs [AMD64_R11] = context->gregs [AMD64_R11];
- mctx->gregs [AMD64_R12] = context->gregs [AMD64_R12];
- mctx->gregs [AMD64_R13] = context->gregs [AMD64_R13];
- mctx->gregs [AMD64_R14] = context->gregs [AMD64_R14];
- mctx->gregs [AMD64_R15] = context->gregs [AMD64_R15];
+ mctx->gregs [AMD64_RIP] = context->Rip;
+ mctx->gregs [AMD64_RAX] = context->Rax;
+ mctx->gregs [AMD64_RCX] = context->Rcx;
+ mctx->gregs [AMD64_RDX] = context->Rdx;
+ mctx->gregs [AMD64_RBX] = context->Rbx;
+ mctx->gregs [AMD64_RSP] = context->Rsp;
+ mctx->gregs [AMD64_RBP] = context->Rbp;
+ mctx->gregs [AMD64_RSI] = context->Rsi;
+ mctx->gregs [AMD64_RDI] = context->Rdi;
+ mctx->gregs [AMD64_R8] = context->R8;
+ mctx->gregs [AMD64_R9] = context->R9;
+ mctx->gregs [AMD64_R10] = context->R10;
+ mctx->gregs [AMD64_R11] = context->R11;
+ mctx->gregs [AMD64_R12] = context->R12;
+ mctx->gregs [AMD64_R13] = context->R13;
+ mctx->gregs [AMD64_R14] = context->R14;
+ mctx->gregs [AMD64_R15] = context->R15;
#else
MonoContext *ctx = (MonoContext *)sigctx;
#elif defined(HOST_WIN32)
CONTEXT *context = (CONTEXT*)sigctx;
- context->gregs [AMD64_RIP] = mctx->gregs [AMD64_RIP];
- context->gregs [AMD64_RAX] = mctx->gregs [AMD64_RAX];
- context->gregs [AMD64_RCX] = mctx->gregs [AMD64_RCX];
- context->gregs [AMD64_RDX] = mctx->gregs [AMD64_RDX];
- context->gregs [AMD64_RBX] = mctx->gregs [AMD64_RBX];
- context->gregs [AMD64_RSP] = mctx->gregs [AMD64_RSP];
- context->gregs [AMD64_RBP] = mctx->gregs [AMD64_RBP];
- context->gregs [AMD64_RSI] = mctx->gregs [AMD64_RSI];
- context->gregs [AMD64_RDI] = mctx->gregs [AMD64_RDI];
- context->gregs [AMD64_R8] = mctx->gregs [AMD64_R8];
- context->gregs [AMD64_R9] = mctx->gregs [AMD64_R9];
- context->gregs [AMD64_R10] = mctx->gregs [AMD64_R10];
- context->gregs [AMD64_R11] = mctx->gregs [AMD64_R11];
- context->gregs [AMD64_R12] = mctx->gregs [AMD64_R12];
- context->gregs [AMD64_R13] = mctx->gregs [AMD64_R13];
- context->gregs [AMD64_R14] = mctx->gregs [AMD64_R14];
- context->gregs [AMD64_R15] = mctx->gregs [AMD64_R15];
+ context->Rip = mctx->gregs [AMD64_RIP];
+ context->Rax = mctx->gregs [AMD64_RAX];
+ context->Rcx = mctx->gregs [AMD64_RCX];
+ context->Rdx = mctx->gregs [AMD64_RDX];
+ context->Rbx = mctx->gregs [AMD64_RBX];
+ context->Rsp = mctx->gregs [AMD64_RSP];
+ context->Rbp = mctx->gregs [AMD64_RBP];
+ context->Rsi = mctx->gregs [AMD64_RSI];
+ context->Rdi = mctx->gregs [AMD64_RDI];
+ context->R8 = mctx->gregs [AMD64_R8];
+ context->R9 = mctx->gregs [AMD64_R9];
+ context->R10 = mctx->gregs [AMD64_R10];
+ context->R11 = mctx->gregs [AMD64_R11];
+ context->R12 = mctx->gregs [AMD64_R12];
+ context->R13 = mctx->gregs [AMD64_R13];
+ context->R14 = mctx->gregs [AMD64_R14];
+ context->R15 = mctx->gregs [AMD64_R15];
#else
MonoContext *ctx = (MonoContext *)sigctx;
return -1;
}
+const char*
+mono_dl_get_system_dir (void)
+{
+#ifdef TARGET_IOS
+ /* IOS9 can't load system libraries using relative paths, i.e. 'libc' doesn't work, but '/usr/lib/libc' does. */
+ return "/usr/lib";
+#else
+ return NULL;
+#endif
+}
+
#endif
{
return readlink ("/proc/self/exe", buf, buflen - 1);
}
+
+const char*
+mono_dl_get_system_dir (void)
+{
+ return NULL;
+}
+
#endif
void *
return -1; //TODO
}
+const char*
+mono_dl_get_system_dir (void)
+{
+ return NULL;
+}
+
#endif
int mono_dl_convert_flags (int flags);
char* mono_dl_current_error_string (void);
int mono_dl_get_executable_path (char *buf, int buflen);
+const char* mono_dl_get_system_dir (void);
#endif /* __MONO_UTILS_DL_H__ */
/* Logging - enable them below if you need specific logging for the category you need */
#define MOSTLY_ASYNC_SAFE_PRINTF(...) do { \
char __buff[1024]; __buff [0] = '\0'; \
- snprintf (__buff, sizeof (__buff), __VA_ARGS__); \
+ g_snprintf (__buff, sizeof (__buff), __VA_ARGS__); \
write (1, __buff, strlen (__buff)); \
} while (0)