Compare commits

...
11 Commits
Author SHA1 Message Date
Zoltan Varga d4511ef6b5 Revert "[llvm] Fix the build."
This reverts commit d6cc1326bc.

Revert this as it doesn't work with the currently used llvm version.
2014-03-25 12:02:47 -04:00
Zoltan Varga d6cc1326bc [llvm] Fix the build. 2014-03-24 09:14:30 -04:00
Marek Safar 61fec75147 [mcs] Flow analysis of nested binary expressions inside anonymous methods was missing on left/right reset. Fixes #18417 2014-03-18 18:53:19 +01:00
Marek Safar 704ca7886e [mcs] Emit field initializer with expression tree in all user constructors. Fixes #18308 2014-03-18 18:53:04 +01:00
Miguel de Icaza 77d00e19fc System/PCL: Implement HttpWebRequest.SupportsCookieContainer, WebRequest.CreateHttp; Fixes #18378 2014-03-13 22:54:06 -04:00
Miguel de Icaza 5ec989143f WebResponse.cs: Implement SupportsHeaders property 2014-03-13 22:37:27 -04:00
Rodrigo Kumpera 69419b4be2 [boehm] Fix memory management for toggleref.
Replace GC_free with GC_INTERNAL_FREE. The former might take the GC lock
and deadlock us.

Replace GC_INTERNAL_MALLOC with GC_INTERNAL_MALLOC_IGNORE_OFF_PAGE as
we don't need the rest of the GC messing around with the toggleref array.
2014-03-13 18:52:33 -04:00
Rodrigo Kumpera 2bd6fef770 [thread] Only register a dead letter if the current NSThread is non-null.
This breaks all embedder that don't link with CoreFoundation. In mono's case, monodis.
2014-03-13 18:51:45 -04:00
Marek Safar ad325d4b1c [interpreter] Implement simple quote expression. Fixes #18248 2014-03-11 14:32:11 +01:00
Alex Rønne Petersen 64f1d09b65 Add support/ to the build when cross-compiling. 2014-03-11 10:12:09 +01:00
Zoltan Varga 94bc52a101 [runtime] Fix the build with newer clang versions. 2014-03-10 22:46:39 -04:00
19 changed files with 161 additions and 34 deletions

No files matched your search

+2 -2
View File
@@ -3,10 +3,10 @@ ACLOCAL_AMFLAGS = -I m4
MONOTOUCH_SUBDIRS = $(libgc_dir) eglib/src mono
if CROSS_COMPILING
SUBDIRS = po $(libgc_dir) eglib mono $(ikvm_native_dir) data runtime scripts man samples msvc $(docs_dir)
SUBDIRS = po $(libgc_dir) eglib mono $(ikvm_native_dir) support data runtime scripts man samples msvc $(docs_dir)
# Keep in sync with SUBDIRS
## 'tools' is not normally built
DIST_SUBDIRS = m4 po libgc eglib mono ikvm-native data runtime scripts man samples tools msvc docs
DIST_SUBDIRS = m4 po libgc eglib mono ikvm-native support data runtime scripts man samples tools msvc docs
else
if ONLY_MONOTOUCH
SUBDIRS = $(MONOTOUCH_SUBDIRS) runtime
+4 -5
View File
@@ -386,7 +386,7 @@ static void GC_mark_togglerefs ()
if (!GC_toggleref_array)
return;
GC_set_mark_bit (GC_toggleref_array);
GC_set_mark_bit ((GC_PTR)GC_toggleref_array);
for (i = 0; i < GC_toggleref_array_size; ++i) {
if (GC_toggleref_array [i].strong_ref) {
GC_PTR object = GC_toggleref_array [i].strong_ref;
@@ -424,7 +424,7 @@ ensure_toggleref_capacity (int capacity)
{
if (!GC_toggleref_array) {
GC_toggleref_array_capacity = 32;
GC_toggleref_array = (GCToggleRef *) GC_INTERNAL_MALLOC (GC_toggleref_array_capacity * sizeof (GCToggleRef), NORMAL);
GC_toggleref_array = (GCToggleRef *) GC_INTERNAL_MALLOC_IGNORE_OFF_PAGE (GC_toggleref_array_capacity * sizeof (GCToggleRef), NORMAL);
}
if (GC_toggleref_array_size + capacity >= GC_toggleref_array_capacity) {
GCToggleRef *tmp;
@@ -432,10 +432,9 @@ ensure_toggleref_capacity (int capacity)
while (GC_toggleref_array_capacity < GC_toggleref_array_size + capacity)
GC_toggleref_array_capacity *= 2;
tmp = (GCToggleRef *) GC_INTERNAL_MALLOC (GC_toggleref_array_capacity * sizeof (GCToggleRef), NORMAL);
tmp = (GCToggleRef *) GC_INTERNAL_MALLOC_IGNORE_OFF_PAGE (GC_toggleref_array_capacity * sizeof (GCToggleRef), NORMAL);
memcpy (tmp, GC_toggleref_array, GC_toggleref_array_size * sizeof (GCToggleRef));
GC_free((GC_PTR)GC_toggleref_array);
GC_INTERNAL_FREE (GC_toggleref_array);
GC_toggleref_array = tmp;
}
}
@@ -56,7 +56,6 @@ namespace MonoTests.System.Linq.Expressions
#endif
[Test]
[Category ("NotWorkingInterpreter")]
public void CompiledQuote ()
{
var quote42 = Expression.Lambda<Func<Expression<Func<int>>>> (
@@ -593,10 +593,11 @@ namespace System.Net
get { return servicePoint; }
}
#if NET_4_0
[MonoTODO ("for portable library support")]
public virtual bool SupportsCookieContainer {
get {
throw new NotImplementedException ();
// The managed implementation supports the cookie container
// it is only Silverlight that returns false here
return true;
}
}
#endif
+14 -4
View File
@@ -287,16 +287,26 @@ namespace System.Net
return GetCreator (requestUri.Scheme).Create (requestUri);
}
#if NET_4_0
[MonoTODO ("for portable library support")]
static HttpWebRequest SharedCreateHttp (Uri uri)
{
if (uri.Scheme != "http" && uri.Scheme != "https")
throw new NotSupportedException ("The uri should start with http or https");
return new HttpWebRequest (uri);
}
public static HttpWebRequest CreateHttp (string requestUriString)
{
throw new NotImplementedException ();
if (requestUriString == null)
throw new ArgumentNullException ("requestUriString");
return SharedCreateHttp (new Uri (requestUriString));
}
[MonoTODO ("for portable library support")]
public static HttpWebRequest CreateHttp (Uri requestUri)
{
throw new NotImplementedException ();
if (requestUri == null)
throw new ArgumentNullException ("requestUri");
return SharedCreateHttp (requestUri);
}
#endif
public virtual Stream EndGetRequestStream (IAsyncResult asyncResult)
+6 -2
View File
@@ -86,9 +86,13 @@ namespace System.Net
get { throw new NotSupportedException (); }
}
#if NET_4_0
[MonoTODO ("for portable library support")]
public virtual bool SupportsHeaders {
get { throw new NotImplementedException (); }
get {
// The managed stack always returns this as true, it is only
// the Silverlight stack that does not support this.
return true;
}
}
#endif
// Methods
@@ -35,16 +35,13 @@ using Microsoft.Scripting.Runtime;
using Microsoft.Scripting.Utils;
namespace Microsoft.Scripting.Interpreter {
abstract class ConstantInstruction : Instruction {
sealed class PushValueInstruction : Instruction {
object value;
public override int ConsumedStack { get { return 0; } }
public override int ProducedStack { get { return 1; } }
}
sealed class PushIntegerValueInstruction : ConstantInstruction {
int value;
public PushIntegerValueInstruction (int value)
public PushValueInstruction (object value)
{
this.value = value;
}
@@ -365,6 +365,10 @@ namespace Microsoft.Scripting.Interpreter {
Emit(PopInstruction.Instance);
}
public void EmitStore(object value) {
Emit (new PushValueInstruction (value));
}
#endregion
#region Locals
@@ -665,7 +669,7 @@ namespace Microsoft.Scripting.Interpreter {
#endregion
public void EmitIncrement (Type type) {
Emit (new PushIntegerValueInstruction (1));
Emit (new PushValueInstruction (1));
EmitAdd (type, false);
}
@@ -1478,6 +1478,10 @@ namespace Microsoft.Scripting.Interpreter {
_instructions.EmitCreateDelegate(creator);
}
private void CompileQuotedLambdaExpression(Expression expr) {
_instructions.EmitStore (expr);
}
private void CompileCoalesceBinaryExpression(Expression expr) {
var node = (BinaryExpression)expr;
@@ -1531,9 +1535,9 @@ namespace Microsoft.Scripting.Interpreter {
throw new System.NotImplementedException();
}
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "expr")]
private void CompileQuoteUnaryExpression(Expression expr) {
throw new System.NotImplementedException();
private void CompileQuoteUnaryExpression(Expression expr) {
var qe = (UnaryExpression)expr;
CompileQuotedLambdaExpression (qe.Operand);
}
private void CompileUnboxUnaryExpression(Expression expr) {
+2 -1
View File
@@ -1267,7 +1267,7 @@ namespace Mono.CSharp {
throw new InternalErrorException (e, loc);
}
if (!ec.IsInProbingMode) {
if (!ec.IsInProbingMode && !etree_conversion) {
compatibles.Add (type, am ?? EmptyExpression.Null);
}
@@ -1599,6 +1599,7 @@ namespace Mono.CSharp {
var da_ontrue = fc.DefiniteAssignmentOnTrue;
var da_onfalse = fc.DefiniteAssignmentOnFalse;
fc.DefiniteAssignmentOnTrue = fc.DefiniteAssignmentOnFalse = null;
block.FlowAnalysis (fc);
fc.ParametersBlock = prev_pb;
+8 -2
View File
@@ -334,7 +334,7 @@ namespace Mono.CSharp {
if (source == null) {
ok = false;
source = EmptyExpression.Null;
source = ErrorExpression.Instance;
}
target = target.ResolveLValue (ec, source);
@@ -589,6 +589,12 @@ namespace Mono.CSharp {
public int AssignmentOffset { get; private set; }
public FieldBase Field {
get {
return mc;
}
}
public override Location StartLocation {
get {
return loc;
@@ -601,8 +607,8 @@ namespace Mono.CSharp {
if (source == null)
return null;
var bc = (BlockContext) rc;
if (resolved == null) {
var bc = (BlockContext) rc;
var ctx = new FieldInitializerContext (mc, bc);
resolved = base.DoResolve (ctx) as ExpressionStatement;
AssignmentOffset = ctx.AssignmentInfoOffset - bc.AssignmentInfoOffset;
+13 -1
View File
@@ -1010,9 +1010,20 @@ namespace Mono.CSharp
for (int i = 0; i < initialized_fields.Count; ++i) {
FieldInitializer fi = initialized_fields [i];
//
// Clone before resolving otherwise when field initializer is needed
// in more than 1 constructor any resolve after the initial one would
// only took the resolved expression which is problem for expressions
// that generate extra expressions or code during Resolve phase
//
var cloned = fi.Clone (new CloneContext ());
ExpressionStatement s = fi.ResolveStatement (ec);
if (s == null)
if (s == null) {
initialized_fields [i] = new FieldInitializer (fi.Field, ErrorExpression.Instance, Location.Null);
continue;
}
//
// Field is re-initialized to its default value => removed
@@ -1022,6 +1033,7 @@ namespace Mono.CSharp
ec.AssignmentInfoOffset += fi.AssignmentOffset;
ec.CurrentBlock.AddScopeStatement (new StatementExpression (s));
initialized_fields [i] = (FieldInitializer) cloned;
}
}
+1
View File
@@ -1467,6 +1467,7 @@ namespace Mono.CSharp {
return e;
source.Error_ValueCannotBeConverted (ec, target_type, false);
return null;
}
+8
View File
@@ -5792,6 +5792,14 @@ namespace Mono.CSharp {
}
}
protected override void CloneTo (CloneContext clonectx, Expression target)
{
var t = (FieldExpr) target;
if (InstanceExpression != null)
t.InstanceExpression = InstanceExpression.Clone (clonectx);
}
public override Expression CreateExpressionTree (ResolveContext ec)
{
return CreateExpressionTree (ec, true);
+4
View File
@@ -9999,6 +9999,10 @@ namespace Mono.CSharp
loc = Location.Null;
}
protected override void CloneTo (CloneContext clonectx, Expression target)
{
}
public override bool ContainsEmitWithAwait ()
{
return false;
+30
View File
@@ -0,0 +1,30 @@
using System;
using System.Linq.Expressions;
public sealed class C
{
public C ()
{
}
public C (Action<object, object> tappedCallback)
{
}
public readonly string TappedCallbackProperty = Create<C, Action<object, object>> (o => o.TappedCallback);
public Action<object, object> TappedCallback {
get;
set;
}
public static string Create<T1, T2> (Expression<Func<T1, T2>> getter)
{
return null;
}
public static void Main ()
{
new C (null);
}
}
+43
View File
@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
static void Main ()
{
SomeMethod ();
}
private static bool SomeMethod ()
{
int m;
int n = 2;
bool b_const = true;
bool b = F (() => F1 (n, out m) && Ferror (m)) && b_const;
return b;
}
protected static bool F (Func<bool> rule)
{
return true;
}
private static bool F1 (int j, out int m)
{
m = 2;
return true;
}
private static bool Ferror (int i)
{
return true;
}
private static bool Fouter ()
{
return true;
}
}
+1 -1
View File
@@ -219,7 +219,7 @@ output_char (FILE *f, char c) {
if (isalnum (c))
fprintf (f, "%c", c);
else
fprintf (f, "\\x%x\" \"", c);
fprintf (f, "\\x%x\" \"", (guint8)c);
}
static void
+7 -3
View File
@@ -64,9 +64,13 @@ mono_dead_letter_dealloc (id self, SEL _cmd)
void
mono_threads_install_dead_letter (void)
{
id cur = objc_msgSend ((id)nsthread, currentThread);
id dict = objc_msgSend (cur, threadDictionary);
if (objc_msgSend (dict, objectForKey, mono_dead_letter_key) == nil) {
id cur, dict;
cur = objc_msgSend ((id)nsthread, currentThread);
if (!cur)
return;
dict = objc_msgSend (cur, threadDictionary);
if (dict && objc_msgSend (dict, objectForKey, mono_dead_letter_key) == nil) {
id value = objc_msgSend (objc_msgSend ((id)mono_dead_letter_class, alloc), init);
objc_msgSend (dict, setObjectForKey, value, mono_dead_letter_key);
objc_msgSend (value, release);