Compare commits

..
Author SHA1 Message Date
Alex Rønne Petersen ff9d2c4ffc [runtime] Fix profiler reporting of object allocations.
Previously, not all allocations would be reported. For example, when using
managed allocators, we would go through mono_gc_alloc_obj () and friends which
did not call mono_profiler_allocation (). There were also some functions in
object.c which did not call it.

For SGen, we now report allocations in the client code, which is where all
object allocations ultimately end up going whether or not we're using managed
allocators. For Boehm, we call mono_profiler_allocation () in the object.c
macros. (This is not pretty, but will go away when Boehm does.)

Conflicts:

	mono/metadata/profiler-private.h
	mono/metadata/sgen-mono.c
2015-05-02 01:35:55 +02:00
52 changed files with 136 additions and 378 deletions

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
# Process this file with autoconf to produce a configure script.
#AC_PREREQ([2.62])
AC_INIT(mono, [4.0.2],
AC_INIT(mono, [4.0.1],
[http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
AC_CONFIG_SRCDIR([README.md])
@@ -256,8 +256,9 @@ namespace Microsoft.Build.Tasks {
{
PackageAssemblyInfo pkg = null;
pkg = PcCache.GetAssemblyLocation (reference.ItemSpec);
if (pkg == null && !specific_version) {
if (specific_version) {
pkg = PcCache.GetAssemblyLocation (reference.ItemSpec);
} else {
// if not specific version, then just match simple name
string name = reference.ItemSpec;
if (name.IndexOf (',') > 0)
@@ -73,8 +73,6 @@ namespace Microsoft.Build.Tasks {
commandLine.AppendSwitchIfNotNull ("/main:", MainEntryPoint);
// NoStandardLib
if (Bag ["NoStandardLib"] != null && NoStandardLib)
commandLine.AppendSwitch ("/nostdlib");
if (NoWarnings)
commandLine.AppendSwitch ("/nowarn");
@@ -11,17 +11,14 @@ namespace System.Runtime.Caching {
*/
internal class SRef {
// private Object _sizedRef;
private Object _sizedRef;
internal SRef (Object target) {
// _sizedRef = target;
_sizedRef = target;
}
internal long ApproximateSize {
get {
// TODO: .net uses System.SizedReference which contains approximate size after Gen 2 collection
return 16;
}
get { return (long) Marshal.SizeOf (_sizedRef.GetType ()); }
}
internal void Dispose() {
@@ -26,8 +26,6 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml;
@@ -336,29 +334,34 @@ namespace System.Xml.Linq
static readonly char [] escapeChars = new char [] {'<', '>', '&', '"', '\r', '\n', '\t'};
private static string GetPrefixOfNamespace (XNamespace ns)
{
string namespaceName = ns.NamespaceName;
if (namespaceName.Length == 0)
return string.Empty;
if (namespaceName == XNamespace.Xml.NamespaceName)
return "xml";
if (namespaceName == XNamespace.Xmlns.NamespaceName)
return "xmlns";
return null;
}
public override string ToString ()
{
using (StringWriter sw = new StringWriter (CultureInfo.InvariantCulture)) {
XmlWriterSettings ws = new XmlWriterSettings ();
ws.ConformanceLevel = ConformanceLevel.Fragment;
using (XmlWriter w = XmlWriter.Create (sw, ws)) {
w.WriteAttributeString (GetPrefixOfNamespace (Name.Namespace), Name.LocalName,
Name.NamespaceName, Value);
StringBuilder sb = new StringBuilder ();
sb.Append (name.ToString ());
sb.Append ("=\"");
int start = 0;
do {
int idx = value.IndexOfAny (escapeChars, start);
if (idx < 0) {
if (start > 0)
sb.Append (value, start, value.Length - start);
else
sb.Append (value);
sb.Append ("\"");
return sb.ToString ();
}
return sw.ToString ().Trim ();
}
sb.Append (value, start, idx - start);
switch (value [idx]) {
case '&': sb.Append ("&amp;"); break;
case '<': sb.Append ("&lt;"); break;
case '>': sb.Append ("&gt;"); break;
case '"': sb.Append ("&quot;"); break;
case '\r': sb.Append ("&#xD;"); break;
case '\n': sb.Append ("&#xA;"); break;
case '\t': sb.Append ("&#x9;"); break;
}
start = idx + 1;
} while (true);
}
}
}
@@ -205,14 +205,6 @@ namespace MonoTests.System.Xml.Linq
Assert.AreEqual ("a=\" &gt;_&lt; \"", a.ToString ());
}
[Test]
public void ToString_Xamarin29935 ()
{
var doc = XDocument.Parse ("<?xml version='1.0' encoding='utf-8'?><lift xmlns:test='http://test.example.com'></lift>");
Assert.AreEqual ("xmlns:test=\"http://test.example.com\"",
doc.Root.Attributes ().Select (s => s.ToString ()).First ());
}
[Test]
public void DateTimeAttribute ()
{
@@ -253,13 +253,6 @@ namespace System.IO {
m_buffer [pos ++] = (byte)read_byte;
bytes_read ++;
if (m_encoding is UnicodeEncoding) {
CheckBuffer (pos + 1);
read_byte = m_stream.ReadByte();
if (read_byte != -1) {
m_buffer [pos++] = (byte)read_byte;
}
}
int n = m_encoding.GetChars (m_buffer, 0, pos, buffer, index + chars_read);
if (n > 0)
@@ -7,7 +7,7 @@ using System.Security;
namespace System.Text
{
internal static partial class EncodingHelper
internal static class EncodingHelper
{
//
// Only internal, to be used by the class libraries: Unmarked and non-input-validating
@@ -71,7 +71,6 @@ internal static partial class EncodingHelper
[MethodImpl (MethodImplOptions.InternalCall)]
extern internal static string InternalCodePage (ref int code_page);
#if !MONOTOUCH
internal static Encoding GetDefaultEncoding ()
{
Encoding enc = null;
@@ -106,7 +105,6 @@ internal static partial class EncodingHelper
}
return enc;
}
#endif
// Loaded copy of the "I18N" assembly. We need to move
// this into a class in "System.Private" eventually.
+2 -4
View File
@@ -592,7 +592,7 @@ namespace System
public AdjustmentRule [] GetAdjustmentRules ()
{
if (!supportsDaylightSavingTime || adjustmentRules == null)
if (!supportsDaylightSavingTime)
return new AdjustmentRule [0];
else
return (AdjustmentRule []) adjustmentRules.Clone ();
@@ -1254,10 +1254,8 @@ namespace System
tz = CreateCustomTimeZone (id, baseUtcOffset, id, standardDisplayName, daylightDisplayName, ValidateRules (adjustmentRules).ToArray ());
}
if (storeTransition && transitions.Count > 0) {
if (storeTransition)
tz.transitions = transitions;
tz.supportsDaylightSavingTime = true;
}
return tz;
}
@@ -274,20 +274,6 @@ namespace MonoTests.System.IO
}
}
[Test]
public void TestReadUnicode ()
{
char testChar1 = 'H';
using (var stream = new MemoryStream())
using (var writer = new BinaryWriter(stream, Encoding.Unicode, true))
using (var reader = new BinaryReader(stream, Encoding.Unicode))
{
writer.Write(testChar1);
stream.Position = 0;
Assert.AreEqual ('H', reader.ReadChar ());
}
}
//-TODO: (TestRead[Type]*) Verify the ReadBoolean, ReadByte ....
// ReadBoolean, ReadByte, ReadChar, ReadInt32 Done
@@ -1 +0,0 @@
#include corlib.dll.sources
@@ -100,8 +100,7 @@ namespace Mono.Linker.Steps {
var references = assembly.MainModule.AssemblyReferences;
for (int i = 0; i < references.Count; i++) {
var reference = references [i];
var r = Context.Resolver.Resolve (reference);
if (!AreSameReference (r.Name, target.Name))
if (!AreSameReference (reference, target.Name))
continue;
references.RemoveAt (i);
-6
View File
@@ -8,9 +8,3 @@ LOCAL_MCS_FLAGS += -d:NO_AUTHENTICODE,STATIC,NO_SYMBOL_WRITER
CLEAN_FILES = monop.exe monop2.exe *.mdb
include ../../build/executable.make
run-test-local : basic-tests
basic-tests:
for type in System.Array System.String 'System.Collections.Generic.List`1'; do \
echo $$type; $(RUNTIME) $(build_lib) $$type >/dev/null || exit 1; done
+6 -7
View File
@@ -301,10 +301,10 @@ class MonoP {
static Options options = new Options ();
static int Main (string [] args)
static void Main (string [] args)
{
if (!options.ProcessArgs (args))
return 1;
return;
if (options.Style == null)
mscorlib = universe.LoadFile (typeof (int).Assembly.Location);
@@ -318,14 +318,14 @@ class MonoP {
if (options.ShowAll){
ShowAll (assembly, options.ShowPrivate, options.FilterObsolete);
return 0;
return;
} else {
if (options.Type == null) {
if (options.PrintRefs)
PrintRefs (assembly);
else
PrintTypes (assembly, options.ShowPrivate, options.FilterObsolete);
return 0;
return;
}
}
}
@@ -348,7 +348,7 @@ class MonoP {
if (count > 1){
Console.WriteLine ("Found " + count + " types that match:");
Console.WriteLine (matches);
return 0;
return;
}
}
@@ -394,7 +394,7 @@ class MonoP {
notfound:
if (t == null) {
Console.WriteLine ("Could not find {0}", tname);
return 1;
return;
}
found:
//
@@ -406,7 +406,6 @@ class MonoP {
if (message != null)
Console.WriteLine (message);
return 0;
}
}
+2 -16
View File
@@ -42,19 +42,6 @@ using System.Reflection;
#endif
namespace Mono.CSharp {
public static class TypeExtensions {
public static string GetNamespace (this Type t)
{
// IKVM crashes here with a null ref sometimes
try {
return t.Namespace;
} catch {
return null;
}
}
}
public class Outline {
bool declared_only;
bool show_private;
@@ -649,7 +636,7 @@ public class Outline {
if (!type.StartsWith ("System.")) {
if (type.IndexOf (".") == -1)
return type;
if (t.GetNamespace () == this.t.GetNamespace ())
if (t.Namespace == this.t.Namespace)
return t.Name;
return type;
}
@@ -758,8 +745,7 @@ public class Outline {
}
if (!recursed) {
string ns;
ns = t.GetNamespace ();
string ns = t.Namespace;
if ((ns != null) && (ns != "")) {
sb.Append (ns);
sb.Append (".");
-4
View File
@@ -58,11 +58,9 @@ install-pcl-targets:
$(MKINSTALLDIRS) $(DESTDIR)$(PORTABLE_TARGETS_DIR)/v4.0
$(INSTALL_DATA) targets/Microsoft.Portable.Common.targets $(DESTDIR)$(PORTABLE_TARGETS_DIR)/v4.0/Microsoft.Portable.Common.targets
$(INSTALL_DATA) targets/Microsoft.Portable.CSharp_4.0.targets $(DESTDIR)$(PORTABLE_TARGETS_DIR)/v4.0/Microsoft.Portable.CSharp.targets
$(INSTALL_DATA) targets/Microsoft.Portable.VisualBasic_4.0.targets $(DESTDIR)$(PORTABLE_TARGETS_DIR)/v4.0/Microsoft.Portable.VisualBasic.targets
$(MKINSTALLDIRS) $(DESTDIR)$(PORTABLE_TARGETS_DIR)/v4.5
$(INSTALL_DATA) targets/Microsoft.Portable.Common.targets $(DESTDIR)$(PORTABLE_TARGETS_DIR)/v4.5/Microsoft.Portable.Common.targets
$(INSTALL_DATA) targets/Microsoft.Portable.CSharp_4.5.targets $(DESTDIR)$(PORTABLE_TARGETS_DIR)/v4.5/Microsoft.Portable.CSharp.targets
$(INSTALL_DATA) targets/Microsoft.Portable.VisualBasic_4.5.targets $(DESTDIR)$(PORTABLE_TARGETS_DIR)/v4.5/Microsoft.Portable.VisualBasic.targets
$(INSTALL_DATA) targets/Microsoft.Portable.Core.targets $(DESTDIR)$(PORTABLE_TARGETS_DIR)/Microsoft.Portable.Core.targets
$(INSTALL_DATA) targets/Microsoft.Portable.Core.props $(DESTDIR)$(PORTABLE_TARGETS_DIR)/Microsoft.Portable.Core.props
@@ -109,7 +107,5 @@ EXTRA_DISTFILES = \
targets/Microsoft.Portable.Core.targets \
targets/Microsoft.Portable.Core.props \
targets/Microsoft.WebApplication.targets \
targets/Microsoft.Portable.VisualBasic_4.0.targets \
targets/Microsoft.Portable.VisualBasic_4.5.targets \
xbuild.make \
xbuild_test.make
@@ -8,7 +8,6 @@
<UsingTask TaskName="Microsoft.Build.Tasks.CombinePath" AssemblyName="Microsoft.Build.Tasks.v12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<UsingTask TaskName="Microsoft.Build.Tasks.Copy" AssemblyName="Microsoft.Build.Tasks.v12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<UsingTask TaskName="Microsoft.Build.Tasks.CreateCSharpManifestResourceName" AssemblyName="Microsoft.Build.Tasks.v12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<UsingTask TaskName="Microsoft.Build.Tasks.CreateVisualBasicManifestResourceName" AssemblyName="Microsoft.Build.Tasks.v12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<UsingTask TaskName="Microsoft.Build.Tasks.CreateItem" AssemblyName="Microsoft.Build.Tasks.v12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<UsingTask TaskName="Microsoft.Build.Tasks.CreateProperty" AssemblyName="Microsoft.Build.Tasks.v12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<UsingTask TaskName="Microsoft.Build.Tasks.Csc" AssemblyName="Microsoft.Build.Tasks.v12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
@@ -7,7 +7,6 @@
<UsingTask TaskName="Microsoft.Build.Tasks.CombinePath" AssemblyName="Microsoft.Build.Tasks.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<UsingTask TaskName="Microsoft.Build.Tasks.Copy" AssemblyName="Microsoft.Build.Tasks.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<UsingTask TaskName="Microsoft.Build.Tasks.CreateCSharpManifestResourceName" AssemblyName="Microsoft.Build.Tasks.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<UsingTask TaskName="Microsoft.Build.Tasks.CreateVisualBasicManifestResourceName" AssemblyName="Microsoft.Build.Tasks.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<UsingTask TaskName="Microsoft.Build.Tasks.CreateItem" AssemblyName="Microsoft.Build.Tasks.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<UsingTask TaskName="Microsoft.Build.Tasks.CreateProperty" AssemblyName="Microsoft.Build.Tasks.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<UsingTask TaskName="Microsoft.Build.Tasks.Csc" AssemblyName="Microsoft.Build.Tasks.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
@@ -7,7 +7,6 @@
<UsingTask TaskName="Microsoft.Build.Tasks.CombinePath" AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<UsingTask TaskName="Microsoft.Build.Tasks.Copy" AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<UsingTask TaskName="Microsoft.Build.Tasks.CreateCSharpManifestResourceName" AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<UsingTask TaskName="Microsoft.Build.Tasks.CreateVisualBasicManifestResourceName" AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<UsingTask TaskName="Microsoft.Build.Tasks.CreateItem" AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<UsingTask TaskName="Microsoft.Build.Tasks.CreateProperty" AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<UsingTask TaskName="Microsoft.Build.Tasks.Csc" AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
@@ -8,7 +8,6 @@
<UsingTask TaskName="Microsoft.Build.Tasks.CombinePath" AssemblyName="Microsoft.Build.Tasks.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<UsingTask TaskName="Microsoft.Build.Tasks.Copy" AssemblyName="Microsoft.Build.Tasks.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<UsingTask TaskName="Microsoft.Build.Tasks.CreateCSharpManifestResourceName" AssemblyName="Microsoft.Build.Tasks.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<UsingTask TaskName="Microsoft.Build.Tasks.CreateVisualBasicManifestResourceName" AssemblyName="Microsoft.Build.Tasks.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<UsingTask TaskName="Microsoft.Build.Tasks.CreateItem" AssemblyName="Microsoft.Build.Tasks.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<UsingTask TaskName="Microsoft.Build.Tasks.CreateProperty" AssemblyName="Microsoft.Build.Tasks.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<UsingTask TaskName="Microsoft.Build.Tasks.Csc" AssemblyName="Microsoft.Build.Tasks.v3.5, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
@@ -8,7 +8,6 @@
<UsingTask TaskName="Microsoft.Build.Tasks.CombinePath" AssemblyName="Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<UsingTask TaskName="Microsoft.Build.Tasks.Copy" AssemblyName="Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<UsingTask TaskName="Microsoft.Build.Tasks.CreateCSharpManifestResourceName" AssemblyName="Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<UsingTask TaskName="Microsoft.Build.Tasks.CreateVisualBasicManifestResourceName" AssemblyName="Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<UsingTask TaskName="Microsoft.Build.Tasks.CreateItem" AssemblyName="Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<UsingTask TaskName="Microsoft.Build.Tasks.CreateProperty" AssemblyName="Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<UsingTask TaskName="Microsoft.Build.Tasks.Csc" AssemblyName="Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
@@ -1,4 +1,5 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="Microsoft.Build.Tasks.CreateVisualBasicManifestResourceName" AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
<PropertyGroup>
<DefaultLanguageSourceExtension>.vb</DefaultLanguageSourceExtension>
<Language>VB</Language>
@@ -66,7 +67,7 @@
OptionStrictType="$(OptionStrictType)"
OutputAssembly="@(IntermediateAssembly)"
Platform="$(PlatformTarget)"
References="@(ReferencePath)"
References="@(ResolvedFiles)"
RemoveIntegerChecks="$(RemoveIntegerChecks)"
Resources="@(ManifestResourceWithNoCulture);@(ManifestNonResxWithNoCultureOnDisk);@(CompiledLicenseFile)"
ResponseFiles="$(CompilerResponseFile)"
@@ -1,5 +0,0 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\Microsoft.Portable.Core.props" />
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<Import Project="..\Microsoft.Portable.Core.targets" />
</Project>
@@ -1,5 +0,0 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\Microsoft.Portable.Core.props" />
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<Import Project="..\Microsoft.Portable.Core.targets" />
</Project>
-7
View File
@@ -74,9 +74,6 @@ static char **extra_gac_paths = NULL;
* The integer number is an index in the MonoRuntimeInfo structure, whose
* values can be found in domain.c - supported_runtimes. Look there
* to understand what remapping will be made.
*
* .NET version can be found at https://github.com/dotnet/coreclr/blob/master/src/inc/fxretarget.h#L99
*
*/
static const AssemblyVersionMap framework_assemblies [] = {
{"Accessibility", 0},
@@ -105,7 +102,6 @@ static const AssemblyVersionMap framework_assemblies [] = {
{"Npgsql", 0},
{"PEAPI", 0},
{"System", 0},
{"System.ComponentModel.Composition", 2},
{"System.ComponentModel.DataAnnotations", 2},
{"System.Configuration", 0},
{"System.Configuration.Install", 0},
@@ -121,8 +117,6 @@ static const AssemblyVersionMap framework_assemblies [] = {
{"System.Drawing", 0},
{"System.Drawing.Design", 0},
{"System.EnterpriseServices", 0},
{"System.IdentityModel", 3},
{"System.IdentityModel.Selectors", 3},
{"System.Management", 0},
{"System.Messaging", 0},
{"System.Net", 2},
@@ -130,7 +124,6 @@ static const AssemblyVersionMap framework_assemblies [] = {
{"System.Runtime.Serialization", 3},
{"System.Runtime.Serialization.Formatters.Soap", 0},
{"System.Security", 0},
{"System.ServiceModel", 3},
{"System.ServiceModel.Web", 2},
{"System.ServiceProcess", 0},
{"System.Transactions", 0},
+1 -7
View File
@@ -6049,13 +6049,7 @@ mono_generic_class_get_class (MonoGenericClass *gclass)
mono_generic_class_setup_parent (klass, gklass);
if (gclass->is_dynamic) {
/*
* We don't need to do any init workf with unbaked typebuilders. Generic instances created at this point will be later unregistered and/or fixed.
* This is to avoid work that would probably give wrong results as fields change as we build the TypeBuilder.
* See remove_instantiations_of_and_ensure_contents in reflection.c and its usage in reflection.c to understand the fixup stage of SRE banking.
*/
if (!gklass->wastypebuilder)
klass->inited = 1;
klass->inited = 1;
mono_class_setup_supertypes (klass);
+3 -5
View File
@@ -82,11 +82,9 @@ append_class_name (GString *res, MonoClass *class, gboolean include_namespace)
append_class_name (res, class->nested_in, include_namespace);
g_string_append_c (res, '/');
}
if (include_namespace && *(class->name_space)) {
g_string_append (res, class->name_space);
g_string_append_c (res, '.');
}
g_string_append (res, class->name);
if (include_namespace && *(class->name_space))
g_string_append_printf (res, "%s.", class->name_space);
g_string_append_printf (res, "%s", class->name);
}
static MonoClass*
+2 -2
View File
@@ -2246,9 +2246,9 @@ mono_decimal_compare (MonoDecimal *left, MonoDecimal *right)
}
//
// Signs are different. Use signed byte comparison
// Signs are different. Used signed byte compares
//
if ((signed char)left_sign > (signed char)right_sign)
if ((char)left_sign > (char)right_sign)
return MONO_DECIMAL_CMP_GT;
return MONO_DECIMAL_CMP_LT;
}
+2 -2
View File
@@ -3031,7 +3031,7 @@ free_signature_pointer_pair (SignaturePointerPair *pair)
g_free (pair);
}
MonoMethod *
static MonoMethod *
mono_marshal_get_delegate_invoke_internal (MonoMethod *method, gboolean callvirt, gboolean static_method_with_first_arg_bound, MonoMethod *target_method)
{
MonoMethodSignature *sig, *static_sig, *invoke_sig;
@@ -7474,7 +7474,7 @@ mono_marshal_get_native_func_wrapper_aot (MonoClass *klass)
info->d.managed_to_native.method = invoke;
g_assert (!sig->hasthis);
csig = signature_dup_add_this (image, sig, mono_defaults.object_class);
csig = signature_dup_add_this (image, sig, mono_defaults.int_class);
csig->pinvoke = 0;
res = mono_mb_create_and_cache_full (cache, invoke,
mb, csig, csig->param_count + 16,
-3
View File
@@ -308,9 +308,6 @@ mono_marshal_get_delegate_end_invoke (MonoMethod *method) MONO_INTERNAL;
MonoMethod *
mono_marshal_get_delegate_invoke (MonoMethod *method, MonoDelegate *del) MONO_INTERNAL;
MonoMethod *
mono_marshal_get_delegate_invoke_internal (MonoMethod *method, gboolean callvirt, gboolean static_method_with_first_arg_bound, MonoMethod *target_method) MONO_INTERNAL;
MonoMethod *
mono_marshal_get_runtime_invoke (MonoMethod *method, gboolean is_virtual) MONO_INTERNAL;
+6 -24
View File
@@ -47,17 +47,18 @@
#ifdef HAVE_BOEHM_GC
#define NEED_TO_ZERO_PTRFREE 1
#define ALLOC_PTRFREE(obj,vt,size) do { (obj) = GC_MALLOC_ATOMIC ((size)); (obj)->vtable = (vt); (obj)->synchronisation = NULL;} while (0)
#define ALLOC_OBJECT(obj,vt,size) do { (obj) = GC_MALLOC ((size)); (obj)->vtable = (vt);} while (0)
#define ALLOC_PTRFREE(obj,vt,size) do { (obj) = GC_MALLOC_ATOMIC ((size)); (obj)->vtable = (vt); (obj)->synchronisation = NULL; mono_profiler_allocation ((obj)); } while (0)
#define ALLOC_OBJECT(obj,vt,size) do { (obj) = GC_MALLOC ((size)); (obj)->vtable = (vt); mono_profiler_allocation ((obj)); } while (0)
#ifdef HAVE_GC_GCJ_MALLOC
#define GC_NO_DESCRIPTOR ((gpointer)(0 | GC_DS_LENGTH))
#define ALLOC_TYPED(dest,size,type) do { (dest) = GC_GCJ_MALLOC ((size),(type)); } while (0)
#define ALLOC_TYPED(dest,size,type) do { (dest) = GC_GCJ_MALLOC ((size),(type)); mono_profiler_allocation ((dest)); } while (0)
#else
#define GC_NO_DESCRIPTOR (NULL)
#define ALLOC_TYPED(dest,size,type) do { (dest) = GC_MALLOC ((size)); *(gpointer*)dest = (type);} while (0)
#define ALLOC_TYPED(dest,size,type) do { (dest) = GC_MALLOC ((size)); *(gpointer*)dest = (type); mono_profiler_allocation ((dest)); } while (0)
#endif
#else
#ifdef HAVE_SGEN_GC
/* allocations are reported to the profiler in the GC functions */
#define GC_NO_DESCRIPTOR (NULL)
#define ALLOC_PTRFREE(obj,vt,size) do { (obj) = mono_gc_alloc_obj (vt, size);} while (0)
#define ALLOC_OBJECT(obj,vt,size) do { (obj) = mono_gc_alloc_obj (vt, size);} while (0)
@@ -91,8 +92,6 @@ mono_string_to_utf8_internal (MonoMemPool *mp, MonoImage *image, MonoString *s,
#define ldstr_unlock() mono_mutex_unlock (&ldstr_section)
static mono_mutex_t ldstr_section;
static gboolean profile_allocs = TRUE;
void
mono_runtime_object_init (MonoObject *this)
{
@@ -4411,7 +4410,7 @@ mono_object_allocate_ptrfree (size_t size, MonoVTable *vtable)
static inline void *
mono_object_allocate_spec (size_t size, MonoVTable *vtable)
{
void *o;
MonoObject *o;
ALLOC_TYPED (o, size, vtable);
return o;
@@ -4515,8 +4514,6 @@ mono_object_new_alloc_specific (MonoVTable *vtable)
if (G_UNLIKELY (vtable->klass->has_finalize))
mono_object_register_finalizer (o);
if (G_UNLIKELY (profile_allocs))
mono_profiler_allocation (o, vtable->klass);
return o;
}
@@ -4575,9 +4572,6 @@ mono_class_get_allocation_ftn (MonoVTable *vtable, gboolean for_box, gboolean *p
{
*pass_size_in_words = FALSE;
if (!(mono_profiler_get_events () & MONO_PROFILE_ALLOCATIONS))
profile_allocs = FALSE;
if (mono_class_has_finalizer (vtable->klass) || mono_class_is_marshalbyref (vtable->klass) || (mono_profiler_get_events () & MONO_PROFILE_ALLOCATIONS))
return mono_object_new_specific;
@@ -4654,8 +4648,6 @@ mono_object_clone (MonoObject *obj)
/* do not copy the sync state */
mono_gc_memmove_atomic ((char*)o + sizeof (MonoObject), (char*)obj + sizeof (MonoObject), size - sizeof (MonoObject));
}
if (G_UNLIKELY (profile_allocs))
mono_profiler_allocation (o, obj->vtable->klass);
if (obj->vtable->klass->has_finalize)
mono_object_register_finalizer (o);
@@ -4900,9 +4892,6 @@ mono_array_new_full (MonoDomain *domain, MonoClass *array_class, uintptr_t *leng
}
}
if (G_UNLIKELY (profile_allocs))
mono_profiler_allocation (o, array_class);
return array;
}
@@ -4970,9 +4959,6 @@ mono_array_new_specific (MonoVTable *vtable, uintptr_t n)
ao = (MonoArray*)o;
#endif
if (G_UNLIKELY (profile_allocs))
mono_profiler_allocation (o, vtable->klass);
return ao;
}
@@ -5063,8 +5049,6 @@ mono_string_new_size (MonoDomain *domain, gint32 len)
#if NEED_TO_ZERO_PTRFREE
s->chars [len] = 0;
#endif
if (G_UNLIKELY (profile_allocs))
mono_profiler_allocation ((MonoObject*)s, mono_defaults.string_class);
return s;
}
@@ -5183,8 +5167,6 @@ mono_value_box (MonoDomain *domain, MonoClass *class, gpointer value)
return NULL;
size = mono_class_instance_size (class);
res = mono_object_new_alloc_specific (vtable);
if (G_UNLIKELY (profile_allocs))
mono_profiler_allocation (res, class);
size = size - sizeof (MonoObject);
+1 -1
View File
@@ -804,7 +804,7 @@ ves_icall_System_Diagnostics_Process_GetProcesses_internal (void)
}
procs = mono_array_new (mono_domain_get (), mono_get_int32_class (), count);
if (sizeof (guint32) == sizeof (gpointer)) {
memcpy (mono_array_addr (procs, guint32, 0), pidarray, count * sizeof (gint32));
memcpy (mono_array_addr (procs, guint32, 0), pidarray, count);
} else {
for (i = 0; i < count; ++i)
*(mono_array_addr (procs, guint32, i)) = GPOINTER_TO_UINT (pidarray [i]);
+1 -1
View File
@@ -34,7 +34,7 @@ void mono_profiler_method_start_invoke (MonoMethod *method) MONO_INTERNAL;
void mono_profiler_method_end_invoke (MonoMethod *method) MONO_INTERNAL;
void mono_profiler_code_transition (MonoMethod *method, int result) MONO_INTERNAL;
void mono_profiler_allocation (MonoObject *obj, MonoClass *klass) MONO_INTERNAL;
void mono_profiler_allocation (MonoObject *obj) MONO_INTERNAL;
void mono_profiler_monitor_event (MonoObject *obj, MonoProfilerMonitorEvent event) MONO_INTERNAL;
void mono_profiler_stat_hit (guchar *ip, void *context) MONO_INTERNAL;
void mono_profiler_stat_call_chain (int call_chain_depth, guchar **ips, void *context) MONO_INTERNAL;
+2 -2
View File
@@ -499,12 +499,12 @@ mono_profiler_code_transition (MonoMethod *method, int result)
}
void
mono_profiler_allocation (MonoObject *obj, MonoClass *klass)
mono_profiler_allocation (MonoObject *obj)
{
ProfilerDesc *prof;
for (prof = prof_list; prof; prof = prof->next) {
if ((prof->events & MONO_PROFILE_ALLOCATIONS) && prof->allocation_cb)
prof->allocation_cb (prof->profiler, obj, klass);
prof->allocation_cb (prof->profiler, obj, obj->vtable->klass);
}
}
+6
View File
@@ -505,6 +505,7 @@ mono_gc_alloc_obj (MonoVTable *vtable, size_t size)
UNLOCK_GC;
if (G_UNLIKELY (!res))
return mono_gc_out_of_memory (size);
mono_profiler_allocation ((MonoObject *) res);
return res;
}
@@ -544,6 +545,7 @@ mono_gc_alloc_vector (MonoVTable *vtable, size_t size, uintptr_t max_length)
done:
SGEN_ASSERT (6, SGEN_ALIGN_UP (size) == SGEN_ALIGN_UP (sgen_par_object_get_size (vtable, (MonoObject*)arr)), "Vector has incorrect size.");
mono_profiler_allocation (&arr->obj);
return arr;
}
@@ -589,6 +591,7 @@ mono_gc_alloc_array (MonoVTable *vtable, size_t size, uintptr_t max_length, uint
done:
SGEN_ASSERT (6, SGEN_ALIGN_UP (size) == SGEN_ALIGN_UP (sgen_par_object_get_size (vtable, (MonoObject*)arr)), "Array has incorrect size.");
mono_profiler_allocation (&arr->obj);
return arr;
}
@@ -625,6 +628,7 @@ mono_gc_alloc_string (MonoVTable *vtable, size_t size, gint32 len)
UNLOCK_GC;
mono_profiler_allocation (&str->object);
return str;
}
@@ -659,6 +663,7 @@ mono_gc_alloc_pinned_obj (MonoVTable *vtable, size_t size)
binary_protocol_alloc_pinned (p, vtable, size);
}
UNLOCK_GC;
mono_profiler_allocation ((MonoObject *) p);
return p;
}
@@ -678,6 +683,7 @@ mono_gc_alloc_mature (MonoVTable *vtable)
if (G_UNLIKELY (vtable->klass->has_finalize))
mono_object_register_finalizer ((MonoObject*)res);
mono_profiler_allocation ((MonoObject *) res);
return res;
}
+1 -1
View File
@@ -75,7 +75,7 @@ sgen_suspend_thread (SgenThreadInfo *info)
info->stack_start = NULL;
stack_start = (char*) mono_mach_arch_get_sp (state) - REDZONE_SIZE;
/* If stack_start is not within the limits, then don't set it in info and we will be restarted. */
if (stack_start >= info->stack_start_limit && stack_start <= info->stack_end) {
if (stack_start >= info->stack_start_limit && info->stack_start <= info->stack_end) {
info->stack_start = stack_start;
#ifdef USE_MONO_CTX
+1 -1
View File
@@ -82,7 +82,7 @@ suspend_thread (SgenThreadInfo *info, void *context)
/* If stack_start is not within the limits, then don't set it
in info and we will be restarted. */
if (stack_start >= info->stack_start_limit && stack_start <= info->stack_end) {
if (stack_start >= info->stack_start_limit && info->stack_start <= info->stack_end) {
info->stack_start = stack_start;
#ifdef USE_MONO_CTX
+2 -22
View File
@@ -3090,8 +3090,6 @@ static MonoPltEntry*
get_plt_entry (MonoAotCompile *acfg, MonoJumpInfo *patch_info)
{
MonoPltEntry *res;
gboolean synchronized = FALSE;
static int synchronized_symbol_idx;
if (!is_plt_patch (patch_info))
return NULL;
@@ -3107,7 +3105,6 @@ get_plt_entry (MonoAotCompile *acfg, MonoJumpInfo *patch_info)
* wrapper.
*/
res = NULL;
synchronized = TRUE;
}
if (!res) {
@@ -3121,13 +3118,6 @@ get_plt_entry (MonoAotCompile *acfg, MonoJumpInfo *patch_info)
res->symbol = get_plt_symbol (acfg, res->plt_offset, patch_info);
if (acfg->aot_opts.write_symbols)
res->debug_sym = get_plt_entry_debug_sym (acfg, res->ji, acfg->plt_entry_debug_sym_cache);
if (synchronized) {
/* Avoid duplicate symbols because we don't cache */
res->symbol = g_strdup_printf ("%s_%d", res->symbol, synchronized_symbol_idx);
if (res->debug_sym)
res->debug_sym = g_strdup_printf ("%s_%d", res->debug_sym, synchronized_symbol_idx);
synchronized_symbol_idx ++;
}
if (res->debug_sym)
res->llvm_symbol = g_strdup_printf ("%s_%s_llvm", res->symbol, res->debug_sym);
else
@@ -3632,18 +3622,8 @@ add_wrappers (MonoAotCompile *acfg)
for (j = 0; j < cattr->num_attrs; ++j)
if (cattr->attrs [j].ctor && (!strcmp (cattr->attrs [j].ctor->klass->name, "MonoNativeFunctionWrapperAttribute") || !strcmp (cattr->attrs [j].ctor->klass->name, "UnmanagedFunctionPointerAttribute")))
break;
if (j < cattr->num_attrs) {
MonoMethod *invoke;
MonoMethod *wrapper;
MonoMethod *del_invoke;
/* Add wrappers needed by mono_ftnptr_to_delegate () */
invoke = mono_get_delegate_invoke (klass);
wrapper = mono_marshal_get_native_func_wrapper_aot (klass);
del_invoke = mono_marshal_get_delegate_invoke_internal (invoke, FALSE, TRUE, wrapper);
add_method (acfg, wrapper);
add_method (acfg, del_invoke);
}
if (j < cattr->num_attrs)
add_method (acfg, mono_marshal_get_native_func_wrapper_aot (klass));
}
} else if ((acfg->opts & MONO_OPT_GSHAREDVT) && klass->generic_container) {
MonoError error;
+5 -5
View File
@@ -3739,7 +3739,7 @@ load_method (MonoDomain *domain, MonoAotModule *amodule, MonoImage *image, MonoM
}
static guint32
find_aot_method_in_amodule (MonoAotModule *amodule, MonoMethod *method, guint32 hash_full)
find_extra_method_in_amodule (MonoAotModule *amodule, MonoMethod *method)
{
guint32 table_size, entry_size, hash;
guint32 *table, *entry;
@@ -3750,10 +3750,11 @@ find_aot_method_in_amodule (MonoAotModule *amodule, MonoMethod *method, guint32
return 0xffffff;
table_size = amodule->extra_method_table [0];
hash = hash_full % table_size;
table = amodule->extra_method_table + 1;
entry_size = 3;
hash = mono_aot_method_hash (method) % table_size;
entry = &table [hash * entry_size];
if (entry [0] == 0)
@@ -3834,11 +3835,10 @@ find_extra_method (MonoMethod *method, MonoAotModule **out_amodule)
guint32 index;
GPtrArray *modules;
int i;
guint32 hash = mono_aot_method_hash (method);
/* Try the method's module first */
*out_amodule = method->klass->image->aot_module;
index = find_aot_method_in_amodule (method->klass->image->aot_module, method, hash);
index = find_extra_method_in_amodule (method->klass->image->aot_module, method);
if (index != 0xffffff)
return index;
@@ -3860,7 +3860,7 @@ find_extra_method (MonoMethod *method, MonoAotModule **out_amodule)
MonoAotModule *amodule = g_ptr_array_index (modules, i);
if (amodule != method->klass->image->aot_module)
index = find_aot_method_in_amodule (amodule, method, hash);
index = find_extra_method_in_amodule (amodule, method);
if (index != 0xffffff) {
*out_amodule = amodule;
break;
-6
View File
@@ -704,12 +704,6 @@ class Tests
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;
+1 -1
View File
@@ -139,7 +139,7 @@ i8const: dest:i len:20
icompare: src1:i src2:i len:4
icompare_imm: src1:i len:18
iconst: dest:i len:40
jmp: len:50
jmp: len:46
label: len:0
lcall: dest:o len:22 clob:c
lcall_membase: dest:o src1:b len:12 clob:c
-12
View File
@@ -5310,18 +5310,6 @@ ss_start (SingleStepReq *ss_req, MonoMethod *method, SeqPoint* sp, MonoSeqPointI
if (ss_req->nframes == 0)
ss_req->nframes = nframes;
if ((ss_req->depth == STEP_DEPTH_OVER) && (!sp && !parent_sp)) {
DEBUG_PRINTF (1, "[dbg] No parent frame for step over, transition to step into.\n");
/*
* This is needed since if we leave managed code, and later return to it, step over
* is not going to stop.
* This approach is a bit ugly, since we change the step depth, but it only affects
* clients who reuse the same step request, and only in this special case.
*/
ss_req->depth = STEP_DEPTH_INTO;
}
if (ss_req->depth == STEP_DEPTH_OVER) {
/* Need to stop in catch clauses as well */
for (i = 0; i < nframes; ++i) {
+3 -3
View File
@@ -401,7 +401,7 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls,
if (ji != NULL) {
int i;
mono_unwind_reg_t regs [MONO_MAX_IREGS + 1 + 8];
gssize regs [MONO_MAX_IREGS + 1 + 8];
guint8 *cfa;
guint32 unwind_info_len;
guint8 *unwind_info;
@@ -420,7 +420,7 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls,
#ifdef TARGET_IOS
/* On IOS, d8..d15 are callee saved. They are mapped to 8..15 in unwind.c */
for (i = 0; i < 8; ++i)
regs [MONO_MAX_IREGS + i] = *(guint64*)&(new_ctx->fregs [8 + i]);
regs [MONO_MAX_IREGS + i] = new_ctx->fregs [8 + i];
#endif
mono_unwind_frame (unwind_info, unwind_info_len, ji->code_start,
@@ -434,7 +434,7 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls,
new_ctx->regs [ARMREG_SP] = (gsize)cfa;
#ifdef TARGET_IOS
for (i = 0; i < 8; ++i)
new_ctx->fregs [8 + i] = *(double*)&(regs [MONO_MAX_IREGS + i]);
new_ctx->fregs [8 + i] = regs [MONO_MAX_IREGS + i];
#endif
/* Clear thumb bit */
+3
View File
@@ -7813,6 +7813,9 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
cfg->stat_cil_code_size += header->code_size;
seq_points = cfg->gen_seq_points && cfg->method == method;
#ifdef PLATFORM_ANDROID
seq_points &= cfg->method->wrapper_type == MONO_WRAPPER_NONE;
#endif
if (method->wrapper_type == MONO_WRAPPER_NATIVE_TO_MANAGED) {
/* We could hit a seq point before attaching to the JIT (#8338) */
-3
View File
@@ -124,9 +124,6 @@
* reproduceable results for benchmarks */
#define MONO_ARCH_CODE_ALIGNMENT 32
/* This needs to hold both a 32 bit int and a 64 bit double */
#define mono_unwind_reg_t guint64
/* Argument marshallings for calls between gsharedvt and normal code */
typedef enum {
GSHAREDVT_ARG_NONE = 0,
+1 -6
View File
@@ -12,11 +12,6 @@
#include "mini.h"
/* This is the same as mgreg_t, except on 32 bit bit platforms with callee saved fp regs */
#ifndef mono_unwind_reg_t
#define mono_unwind_reg_t mgreg_t
#endif
/*
* This is a platform-independent interface for unwinding through stack frames
* based on the Dwarf unwinding interface.
@@ -150,7 +145,7 @@ mono_unwind_ops_encode (GSList *unwind_ops, guint32 *out_len) MONO_INTERNAL;
void
mono_unwind_frame (guint8 *unwind_info, guint32 unwind_info_len,
guint8 *start_ip, guint8 *end_ip, guint8 *ip, guint8 **mark_locations,
mono_unwind_reg_t *regs, int nregs,
mgreg_t *regs, int nregs,
mgreg_t **save_locations, int save_locations_len,
guint8 **out_cfa) MONO_INTERNAL;
-9
View File
@@ -4918,14 +4918,6 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
cfg->gen_seq_points = debug_options.gen_seq_points_compact_data || debug_options.gen_seq_points_debug_data;
cfg->gen_seq_points_debug_data = debug_options.gen_seq_points_debug_data;
#ifdef PLATFORM_ANDROID
if (cfg->method->wrapper_type != MONO_WRAPPER_NONE) {
/* FIXME: Why is this needed ? */
cfg->gen_seq_points = FALSE;
cfg->gen_seq_points_debug_data = FALSE;
}
#endif
cfg->explicit_null_checks = debug_options.explicit_null_checks;
cfg->soft_breakpoints = debug_options.soft_breakpoints;
cfg->check_pinvoke_callconv = debug_options.check_pinvoke_callconv;
@@ -7600,7 +7592,6 @@ register_icalls (void)
#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
+3 -11
View File
@@ -51,12 +51,11 @@ static int map_hw_reg_to_dwarf_reg [] = { 0, 2, 1, 3, 7, 6, 4, 5, 8, 9, 10, 11,
#define DWARF_PC_REG (mono_hw_reg_to_dwarf_reg (AMD64_RIP))
#elif defined(TARGET_ARM)
// http://infocenter.arm.com/help/topic/com.arm.doc.ihi0040a/IHI0040A_aadwarf.pdf
/* Assign d8..d15 to hregs 16..24 (dwarf regs 264..271) */
/* Assign d8..d15 to hregs 16..24 */
static int map_hw_reg_to_dwarf_reg [] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 264, 265, 266, 267, 268, 269, 270, 271 };
#define NUM_REGS 272
#define DWARF_DATA_ALIGN (-4)
#define DWARF_PC_REG (mono_hw_reg_to_dwarf_reg (ARMREG_LR))
#define IS_DOUBLE_REG(dwarf_reg) (((dwarf_reg) >= 264) && ((dwarf_reg) <= 271))
#elif defined(TARGET_ARM64)
#define NUM_REGS 96
#define DWARF_DATA_ALIGN (-8)
@@ -110,10 +109,6 @@ static int map_hw_reg_to_dwarf_reg [16];
#define DWARF_PC_REG -1
#endif
#ifndef IS_DOUBLE_REG
#define IS_DOUBLE_REG(dwarf_reg) 0
#endif
static gboolean dwarf_reg_to_hw_reg_inited;
static int map_dwarf_reg_to_hw_reg [NUM_REGS];
@@ -485,7 +480,7 @@ typedef struct {
void
mono_unwind_frame (guint8 *unwind_info, guint32 unwind_info_len,
guint8 *start_ip, guint8 *end_ip, guint8 *ip, guint8 **mark_locations,
mono_unwind_reg_t *regs, int nregs,
mgreg_t *regs, int nregs,
mgreg_t **save_locations, int save_locations_len,
guint8 **out_cfa)
{
@@ -607,10 +602,7 @@ mono_unwind_frame (guint8 *unwind_info, guint32 unwind_info_len,
if (reg_saved [i] && locations [i].loc_type == LOC_OFFSET) {
int hreg = mono_dwarf_reg_to_hw_reg (i);
g_assert (hreg < nregs);
if (IS_DOUBLE_REG (i))
regs [hreg] = *(guint64*)(cfa_val + locations [i].offset);
else
regs [hreg] = *(mgreg_t*)(cfa_val + locations [i].offset);
regs [hreg] = *(mgreg_t*)(cfa_val + locations [i].offset);
if (save_locations && hreg < save_locations_len)
save_locations [hreg] = (mgreg_t*)(cfa_val + locations [i].offset);
}
+45 -60
View File
@@ -93,8 +93,7 @@ static int use_zip = 0;
static int do_report = 0;
static int do_heap_shot = 0;
static int max_call_depth = 100;
static volatile int runtime_inited = 0;
static int need_helper_thread = 0;
static int runtime_inited = 0;
static int command_port = 0;
static int heapshot_requested = 0;
static int sample_type = 0;
@@ -624,8 +623,11 @@ find_method (MonoDomain *domain, void *user_data)
}
static void
register_method_local (MonoProfiler *prof, MonoMethod *method, MonoJitInfo *ji)
register_method_local (MonoProfiler *prof, MonoDomain *domain, MonoMethod *method, MonoJitInfo *ji)
{
if (!domain)
g_assert (ji);
if (!mono_conc_hashtable_lookup (prof->method_table, method)) {
if (!ji) {
MethodSearch search = { method, NULL };
@@ -647,19 +649,12 @@ register_method_local (MonoProfiler *prof, MonoMethod *method, MonoJitInfo *ji)
}
static void
emit_method (MonoProfiler *prof, LogBuffer *logbuffer, MonoMethod *method)
emit_method (MonoProfiler *prof, LogBuffer *logbuffer, MonoDomain *domain, MonoMethod *method)
{
register_method_local (prof, method, NULL);
register_method_local (prof, domain, 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)
{
@@ -807,22 +802,24 @@ process_requests (MonoProfiler *profiler)
static void counters_init (MonoProfiler *profiler);
static void counters_sample (MonoProfiler *profiler, uint64_t timestamp);
static void
runtime_initialized (MonoProfiler *profiler)
{
runtime_inited = 1;
#ifndef DISABLE_HELPER_THREAD
counters_init (profiler);
counters_sample (profiler, 0);
#endif
/* ensure the main thread data and startup are available soon */
safe_send (profiler, ensure_logbuf (0));
}
/*
* Can be called only at safe callback locations.
*/
static void
safe_send (MonoProfiler *profiler, LogBuffer *logbuffer)
{
/* We need the runtime initialized so that we have threads and hazard
* pointers available. Otherwise, the lock free queue will not work and
* there won't be a thread to process the data.
*
* While the runtime isn't initialized, we just accumulate data in the
* thread local buffer list.
*/
if (!InterlockedRead (&runtime_inited))
return;
int cd = logbuffer->call_depth;
send_buffer (profiler, TLS_GET (GPtrArray, tlsmethodlist), TLS_GET (LogBuffer, tlsbuffer));
@@ -970,7 +967,7 @@ collect_bt (FrameData *data)
}
static void
emit_bt (MonoProfiler *prof, LogBuffer *logbuffer, FrameData *data)
emit_bt (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
@@ -982,7 +979,7 @@ emit_bt (MonoProfiler *prof, LogBuffer *logbuffer, FrameData *data)
//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_method_as_ptr (prof, logbuffer, data->methods [--data->count]);
emit_ptr (logbuffer, data->methods [--data->count]);
}
}
@@ -991,7 +988,7 @@ gc_alloc (MonoProfiler *prof, MonoObject *obj, MonoClass *klass)
{
uint64_t now;
uintptr_t len;
int do_bt = (nocalls && InterlockedRead (&runtime_inited) && !notraces)? TYPE_ALLOC_BT: 0;
int do_bt = (nocalls && runtime_inited && !notraces)? TYPE_ALLOC_BT: 0;
FrameData data;
LogBuffer *logbuffer;
len = mono_object_get_size (obj);
@@ -1009,7 +1006,7 @@ gc_alloc (MonoProfiler *prof, MonoObject *obj, MonoClass *klass)
emit_obj (logbuffer, obj);
emit_value (logbuffer, len);
if (do_bt)
emit_bt (prof, logbuffer, &data);
emit_bt (logbuffer, &data);
EXIT_LOG (logbuffer);
if (logbuffer->next)
safe_send (prof, logbuffer);
@@ -1147,7 +1144,7 @@ class_loaded (MonoProfiler *prof, MonoClass *klass, int result)
LogBuffer *logbuffer;
if (result != MONO_PROFILE_OK)
return;
if (InterlockedRead (&runtime_inited))
if (runtime_inited)
name = mono_type_get_name (mono_class_get_type (klass));
else
name = type_name (klass);
@@ -1186,7 +1183,7 @@ method_enter (MonoProfiler *prof, MonoMethod *method)
ENTER_LOG (logbuffer, "enter");
emit_byte (logbuffer, TYPE_ENTER | TYPE_METHOD);
emit_time (logbuffer, now);
emit_method (prof, logbuffer, method);
emit_method (prof, logbuffer, mono_domain_get (), method);
EXIT_LOG (logbuffer);
process_requests (prof);
}
@@ -1202,7 +1199,7 @@ method_leave (MonoProfiler *prof, MonoMethod *method)
ENTER_LOG (logbuffer, "leave");
emit_byte (logbuffer, TYPE_LEAVE | TYPE_METHOD);
emit_time (logbuffer, now);
emit_method (prof, logbuffer, method);
emit_method (prof, logbuffer, mono_domain_get (), method);
EXIT_LOG (logbuffer);
if (logbuffer->next)
safe_send (prof, logbuffer);
@@ -1223,7 +1220,7 @@ method_exc_leave (MonoProfiler *prof, MonoMethod *method)
ENTER_LOG (logbuffer, "eleave");
emit_byte (logbuffer, TYPE_EXC_LEAVE | TYPE_METHOD);
emit_time (logbuffer, now);
emit_method (prof, logbuffer, method);
emit_method (prof, logbuffer, mono_domain_get (), method);
EXIT_LOG (logbuffer);
process_requests (prof);
}
@@ -1234,7 +1231,7 @@ method_jitted (MonoProfiler *prof, MonoMethod *method, MonoJitInfo *ji, int resu
if (result != MONO_PROFILE_OK)
return;
register_method_local (prof, method, ji);
register_method_local (prof, NULL, method, ji);
}
static void
@@ -1270,7 +1267,7 @@ code_buffer_new (MonoProfiler *prof, void *buffer, int size, MonoProfilerCodeBuf
static void
throw_exc (MonoProfiler *prof, MonoObject *object)
{
int do_bt = (nocalls && InterlockedRead (&runtime_inited) && !notraces)? TYPE_EXCEPTION_BT: 0;
int do_bt = (nocalls && runtime_inited && !notraces)? TYPE_EXCEPTION_BT: 0;
uint64_t now;
FrameData data;
LogBuffer *logbuffer;
@@ -1283,7 +1280,7 @@ throw_exc (MonoProfiler *prof, MonoObject *object)
emit_time (logbuffer, now);
emit_obj (logbuffer, object);
if (do_bt)
emit_bt (prof, logbuffer, &data);
emit_bt (logbuffer, &data);
EXIT_LOG (logbuffer);
process_requests (prof);
}
@@ -1299,14 +1296,14 @@ clause_exc (MonoProfiler *prof, MonoMethod *method, int clause_type, int clause_
emit_time (logbuffer, now);
emit_value (logbuffer, clause_type);
emit_value (logbuffer, clause_num);
emit_method (prof, logbuffer, method);
emit_method (prof, logbuffer, mono_domain_get (), method);
EXIT_LOG (logbuffer);
}
static void
monitor_event (MonoProfiler *profiler, MonoObject *object, MonoProfilerMonitorEvent event)
{
int do_bt = (nocalls && InterlockedRead (&runtime_inited) && !notraces && event == MONO_PROFILER_MONITOR_CONTENTION)? TYPE_MONITOR_BT: 0;
int do_bt = (nocalls && runtime_inited && !notraces && event == MONO_PROFILER_MONITOR_CONTENTION)? TYPE_MONITOR_BT: 0;
uint64_t now;
FrameData data;
LogBuffer *logbuffer;
@@ -1319,7 +1316,7 @@ monitor_event (MonoProfiler *profiler, MonoObject *object, MonoProfilerMonitorEv
emit_time (logbuffer, now);
emit_obj (logbuffer, object);
if (do_bt)
emit_bt (profiler, logbuffer, &data);
emit_bt (logbuffer, &data);
EXIT_LOG (logbuffer);
process_requests (profiler);
}
@@ -1832,9 +1829,10 @@ dump_sample_hits (MonoProfiler *prof, StatBuffer *sbuf)
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, method);
emit_method (prof, logbuffer, domain, method);
emit_svalue (logbuffer, 0); /* il offset will always be 0 from now on */
emit_svalue (logbuffer, native_offset);
}
@@ -2726,7 +2724,7 @@ helper_thread (void* arg)
if (strcmp (buf, "heapshot\n") == 0) {
heapshot_requested = 1;
//fprintf (stderr, "perform heapshot\n");
if (InterlockedRead (&runtime_inited) && !thread) {
if (runtime_inited && !thread) {
thread = mono_thread_attach (mono_get_root_domain ());
/*fprintf (stderr, "attached\n");*/
}
@@ -2880,33 +2878,13 @@ start_writer_thread (MonoProfiler* prof)
return !pthread_create (&prof->writer_thread, NULL, writer_thread, prof);
}
static void
runtime_initialized (MonoProfiler *profiler)
{
#ifndef DISABLE_HELPER_THREAD
if (hs_mode_ondemand || need_helper_thread) {
if (!start_helper_thread (profiler))
profiler->command_port = 0;
}
#endif
start_writer_thread (profiler);
InterlockedWrite (&runtime_inited, 1);
#ifndef DISABLE_HELPER_THREAD
counters_init (profiler);
counters_sample (profiler, 0);
#endif
/* ensure the main thread data and startup are available soon */
safe_send (profiler, ensure_logbuf (0));
}
static MonoProfiler*
create_profiler (const char *filename)
{
MonoProfiler *prof;
char *nf;
int force_delete = 0;
int need_helper_thread = 0;
prof = calloc (1, sizeof (MonoProfiler));
prof->command_port = command_port;
@@ -2965,7 +2943,12 @@ create_profiler (const char *filename)
if (do_counters && !need_helper_thread) {
need_helper_thread = 1;
}
#ifdef DISABLE_HELPER_THREAD
#ifndef DISABLE_HELPER_THREAD
if (hs_mode_ondemand || need_helper_thread) {
if (!start_helper_thread (prof))
prof->command_port = 0;
}
#else
if (hs_mode_ondemand)
fprintf (stderr, "Ondemand heapshot unavailable on this arch.\n");
#endif
@@ -2974,6 +2957,8 @@ create_profiler (const char *filename)
mono_mutex_init (&prof->method_table_mutex);
prof->method_table = mono_conc_hashtable_new (&prof->method_table_mutex, NULL, NULL);
start_writer_thread (prof);
prof->startup_time = current_time ();
return prof;
}
-1
View File
@@ -307,7 +307,6 @@ BASE_TEST_CS_SRC= \
generic-typedef.2.cs \
generic-marshalbyref.2.cs \
generic-xdomain.2.cs \
dynamic-generic-size.cs \
bug-431413.2.cs \
bug-459285.2.cs \
generic-virtual-invoke.2.cs \
-61
View File
@@ -1,61 +0,0 @@
using System;
using System.Threading;
using System.Reflection;
using System.Reflection.Emit;
using System.Collections.Generic;
namespace GenericSize
{
class GenericSize
{
static int Iterations = 10000;
static AssemblyBuilder assembly;
static ModuleBuilder module;
static string ASSEMBLY_NAME = "MonoTests.System.Reflection.Emit.TypeBuilderTest";
static void SetUp ()
{
AssemblyName assemblyName = new AssemblyName ();
assemblyName.Name = ASSEMBLY_NAME;
assembly =
Thread.GetDomain ().DefineDynamicAssembly (assemblyName, AssemblyBuilderAccess.Run);
module = assembly.DefineDynamicModule ("module1");
}
static int Main()
{
SetUp ();
TypeBuilder tb = module.DefineType ("Test", TypeAttributes.Public);
tb.DefineGenericParameters ("T");
var tb_ctor = tb.DefineDefaultConstructor (MethodAttributes.Public);
var tb2 = module.DefineType ("Test2", TypeAttributes.Public);
var g0 = tb2.DefineGenericParameters ("T");
var mb = tb2.DefineMethod ("Foo", MethodAttributes.Public | MethodAttributes.Static, typeof (object), new Type [0]);
var il = mb.GetILGenerator();
il.Emit(OpCodes.Newobj, TypeBuilder.GetConstructor (tb.MakeGenericType (g0), tb_ctor));
il.Emit(OpCodes.Ret);
var t1 = tb.CreateType ();
var t2 = tb2.CreateType ();
var ginst = t2.MakeGenericType (typeof (string));
var method = ginst.GetMethod ("Foo", BindingFlags.Public | BindingFlags.Static);
var lst = new List<Object>();
for (int i = 0; i < GenericSize.Iterations; i++) {
lst.Add (method.Invoke (null, null));
if (i % 15 == 0)
GC.Collect();
}
return 0;
}
}
}
+1 -1
View File
@@ -492,7 +492,7 @@ mono_code_manager_foreach (MonoCodeManager *cman, MonoCodeManagerFunc func, void
#define BIND_ROOM 8
#endif
#if defined(TARGET_ARM64)
#define BIND_ROOM 4
#define BIND_ROOM 8
#endif
static CodeChunk*