Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Branch: compiler-hooks
Commits on Nov 3, 2013
  1. @abock
  2. @vargaz

    [jit] Add support for generating the push/pop the LMF from the LMF st…

    vargaz authored
    …ack as IR instead of hand-written assembly code in the backends. Not yet used.
  3. @vargaz
  4. @vargaz

    [jit] Disable the optimization added by 63eb94e when using LLVM, the …

    vargaz authored
    …handler bblock has no in edges, which seems to cause problems when using LLVM.
Commits on Nov 2, 2013
  1. @vargaz

    [jit] Add a comment.

    vargaz authored
  2. @vargaz
  3. @vargaz
  4. @vargaz
  5. @marek-safar

    Merge pull request #798 from akoeplinger/fix-test

    marek-safar authored
    Fixed an issue in corlib Makefile
  6. @atsushieno
  7. @vargaz
Commits on Nov 1, 2013
  1. @kumpera
  2. @jonpryor

    [System] Avoid an NRE when Close() and Write() are concurrent.

    jonpryor authored
    Scenario (for which I couldn't easily create a testcase, but can
    sketch out): Imagine using a multithreaded manner:
    	// shared:
    	static CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource ();
    	// Thread 1
    	var request = new HttpRequestMessage(HttpMethod.Post, "") {
    		Content = new StringContent (new string('x', 1024)),
    	using (request)
    	using (HttpClient httpClient = new HttpClient())
    	using (HttpResponseMessage response = await httpClient.SendAsync(request,
    			_cancellationTokenSource.Token)) {
    		string responseContent = await response.Content.ReadAsStringAsync();
    		Console.WriteLine ("Read {0} chars", responseContent.Length);
    	// Thread 2
    	_cancellationTokenSource.Cancel ();
    This isn't entirely farfetched; in the case of #15857, Thread 2 was
    the Main thread (due to the user clicking a button), while Thread 1
    was the ThreadPool (because of async/await).
    The _occasional_ result: a TargetInvocationException exception:
    	System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object
    	  at (wrapper delegate-invoke) <Module>:invoke_bool__this___HttpsClientStream (Mono.Security.Protocol.Tls.HttpsClientStream)
    	  at System.Reflection.MonoProperty.GetterAdapterFrame[HttpsClientStream,Boolean] (System.Reflection.Getter`2 getter, System.Object obj)
    	  at System.Reflection.MonoProperty.GetValue (System.Object obj, System.Object[] index)
    	  --- End of inner exception stack trace ---
    	  at System.Reflection.MonoProperty.GetValue (System.Object obj, System.Object[] index)
    	  at System.Net.WebConnection.Write (System.Net.HttpWebRequest request, System.Byte[] buffer, Int32 offset, Int32 size, System.String& err_msg)
    	  at System.Net.WebConnectionStream.WriteHeaders ()
    	  at System.Net.WebConnectionStream.SetHeaders (System.Byte[] buffer)
    	  at System.Net.HttpWebRequest.SendRequestHeaders (Boolean propagate_error)
    	--- End of stack trace from previous location where exception was thrown ---
    	  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw ()
    	  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[System.Net.Http.HttpResponseMessage].GetResult ()
    	  at System.Net.Http.HttpClient+<SendAsyncWorker>c__async0.MoveNext ()
    	--- End of stack trace from previous location where exception was thrown ---
    	  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw ()
    	  at System.Runtime.CompilerServices.TaskAwaiter`1[System.Net.Http.HttpResponseMessage].GetResult ()
    	  at HttpClientAsyncCancellationRepro.Activity1+<AccessGoogleButton_Click>c__async0.MoveNext ()
    The reason why is because HttpClientHandler.SendAsync() registers a
    Cancel handler with the CancellationTokenSource, and the registered
    handler calls HttpWebRequest.Abort() (which eventually calls
    WebConnection.Close()). This causes WebConnection.nstream to _change_
    while WebConnection.Write() is executing, causing
    WebConnection.nstream to go from non-null to null, which
    WebConnection.Write() does not expect:
    	# WebConnection.CreateStream; from 5 Threadpool worker
    	# WebConnection.Write; from 5 Threadpool worker
    	# WebConnection.Close; from 1  at    at System.Environment.get_StackTrace()
    	   at System.Net.WebConnection.Close(Boolean sendNext)
    	   at System.Net.WebConnection.Abort(System.Object sender, System.EventArgs args)
    	   at System.Net.WebConnection+AbortHelper.Abort(System.Object sender, System.EventArgs args)
    	   at System.Net.HttpWebRequest.Abort()
    	   at System.Net.Http.HttpClientHandler+<SendAsync>c__async0.<>m__0(System.Object l)
    	   at System.Threading.CancellationToken+<Register>c__AnonStorey0.<>m__0()
    	   at System.Threading.CancellationTokenSource.Cancel(Boolean throwOnFirstException)
    	   at System.Threading.CancellationTokenSource.Cancel()
    	   at System.Threading.CancellationTokenSource.SafeLinkedCancel()
    	   at System.Threading.CancellationTokenSource.Cancel(Boolean throwOnFirstException)
    	   at System.Threading.CancellationTokenSource.Cancel()
    	   at HttpClientAsyncCancellationRepro.Activity1.CancelButton_Click(System.Object sender, System.EventArgs e)
    	   at Android.Views.View+IOnClickListenerImplementor.OnClick(Android.Views.View v)
    	   at Android.Views.View+IOnClickListenerInvoker.n_OnClick_Landroid_view_View_(IntPtr jnienv, IntPtr native__this, IntPtr native_v)
    	   at System.Object.e7b5b870-ea0f-434f-bc31-984f665a44ad(IntPtr , IntPtr , IntPtr )
    	# WebConnection.Write: checking piTrustFailure; from 5 Threadpool worker
    (Yay extra logging. Notice that WebConnection creates a stream from
    the ThreadPool, starts WebConnection.Write(), then before it can se
    piTrustFailure the instance is Close()d, which nulls out nstream.)
    Since WebConnection.Write() attempts to access the (now null)
    WebConnection.nstream field, it results in a NullReferenceException,
    which is wrapped into a TargetInvocationException by
    The fix? As usual, "don't do that."
    In this case, WebConnection.Write() has already captured
    WebConnection.nstream into the local variable `s` (which thus can't be
    changed by another thread). Instead of using WebConnection.nstream,
    reuse the `s` local variable, which cannot be null, thus avoiding the
    (This solution could fail if HttpsClientStream ever throws e.g.
    ObjectDisposedException from HttpsClientStream.TrustFailure, but at
    present HttpsClientStream.TrustFailure never throws, so this is fine.)
  3. @migueldeicaza

    Comment style

    migueldeicaza authored
  4. @kumpera

    [jit] Avoid linking the try block with the EH block as this produces …

    kumpera authored
    …spurious BBs during inlining.
    The inliner could not handle optimally when we inline code inside the try block as it would be linked
    with the catch block.
    Since the source block would have more than one exit, the inliner would conservatively not link them together,
    which hinders further local optimizations.
  5. @akoeplinger

    Fixed an issue in corlib Makefile that would make a resource test cas…

    akoeplinger authored
    …e fail which relies on satellite assemblies.
    The satellite assembly generated by the Makefile was suffixed with '.Resources.dll', but the assembly loader looks for '.resources.dll', thus the satellite assembly wasn't found.
  6. @kumpera

    [jit]Extract emit_init_local and use it with the ldloca optimization …

    kumpera authored
    …to handle any kind of types.
  7. @vargaz
  8. @vargaz

    Revert "[sgen] Use mono_class_has_parent () instead of mono_class_has…

    vargaz authored
    …_parent_fast () in one place."
    This reverts commit 2594b36.
    Revert this as its wrong.
  9. @vargaz

    Fix warnings.

    vargaz authored
  10. @vargaz
  11. @vargaz
  12. @kumpera
  13. @vargaz

    Merge pull request #797 from ranma42/fix-log-message

    vargaz authored
    [runtime] Fix AOT log message
  14. @vargaz
  15. @vargaz

    [sdb] Fix an assertion if a single step breakpoint is hit in a thread…

    vargaz authored
    … other than the thread the single stepping is done on. Fixes #14950.
  16. @vargaz

    [jit] Fix the processing of LLVM compiled method frames on x86. Fixes…

    vargaz authored
    … running corlib tests with LLVM.
  17. @vargaz

    [sdb] Fix tests.

    vargaz authored
  18. @ranma42

    [runtime] Fix AOT log message

    ranma42 authored
    In 72ca429 the message format was
    refactored and an additional '%s' format specifier was left over.
  19. @alexrp

    Fix indentation.

    alexrp authored
    Oddly, we don't use tabs here...
Commits on Oct 31, 2013
  1. @kumpera
  2. @kumpera

    [jit] The AggressiveInlining hint now triggers class initialization s…

    kumpera authored
    …o more stuff gets force-inlined.
  3. @kumpera
  4. @kumpera
  5. @kumpera

    [jit]Add an alias analysis pass to the JIT.

    kumpera authored
    The alias analysis pass is capable of simplifying indirection against
    local or temporary variables. It will replace a memory load or store
    with direct access to the variable.
    It does a local pass looking for addresses and replacing memory
    ops with direct ops.
    If any conversion happens, it does a DCE pass to try to kill those
    LDADDR and then recalculate the indirect flag.
    Finally, if the number of indirect variables is reduced, it does a
    global to local vreg pass and another DCE pass to kill most spurious
    Performance numbers on 32bits OSX:
    Code size:
    mcs: -11.366 (0.6%)
    corlib: -15.397 (0.6%)
    Execution time increased by less than 0.2% which is about the same
    value of the test variance.
    Numbers are not impressive since we don't perform store forwarding
    or constant load elimination. Proper handling of value type aggregates
    and longs would move us much further.
Something went wrong with that request. Please try again.