Merge branch 'upstream'

Former-commit-id: 3b62452c14c2a37cfdb44e3c1b257be4cdadb796
This commit is contained in:
Jo Shields 2015-06-11 07:18:52 +01:00
commit 3eb7232db3
46 changed files with 249 additions and 134 deletions

View File

@ -1 +1 @@
62dc0af03655563a8fea1115dcadaa9a3dd95399
0d2865058e8904b609431e735d1a6a58dd269476

View File

@ -1 +1 @@
cb8a0a6dc718f29977f2e6e37b92839c51c7e80b
e26c88521f1fb3392393ffb4a102d2f9441ab54f

View File

@ -34,7 +34,7 @@ static class Consts
// Use these assembly version constants to make code more maintainable.
//
public const string MonoVersion = "4.0.1.0";
public const string MonoVersion = "4.0.2.0";
public const string MonoCompany = "Mono development team";
public const string MonoProduct = "Mono Common Language Infrastructure";
public const string MonoCopyright = "(c) Various Mono authors";

View File

@ -256,9 +256,8 @@ namespace Microsoft.Build.Tasks {
{
PackageAssemblyInfo pkg = null;
if (specific_version) {
pkg = PcCache.GetAssemblyLocation (reference.ItemSpec);
} else {
pkg = PcCache.GetAssemblyLocation (reference.ItemSpec);
if (pkg == null && !specific_version) {
// if not specific version, then just match simple name
string name = reference.ItemSpec;
if (name.IndexOf (',') > 0)

View File

@ -26,6 +26,8 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using System.Xml;
@ -334,34 +336,29 @@ 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 ()
{
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 ();
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);
}
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);
return sw.ToString ().Trim ();
}
}
}
}

View File

@ -205,6 +205,14 @@ 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 ()
{

View File

@ -7,7 +7,7 @@ using System.Security;
namespace System.Text
{
internal static class EncodingHelper
internal static partial class EncodingHelper
{
//
// Only internal, to be used by the class libraries: Unmarked and non-input-validating
@ -71,6 +71,7 @@ internal static class EncodingHelper
[MethodImpl (MethodImplOptions.InternalCall)]
extern internal static string InternalCodePage (ref int code_page);
#if !MONOTOUCH
internal static Encoding GetDefaultEncoding ()
{
Encoding enc = null;
@ -105,6 +106,7 @@ internal static class EncodingHelper
}
return enc;
}
#endif
// Loaded copy of the "I18N" assembly. We need to move
// this into a class in "System.Private" eventually.

View File

@ -592,7 +592,7 @@ namespace System
public AdjustmentRule [] GetAdjustmentRules ()
{
if (!supportsDaylightSavingTime)
if (!supportsDaylightSavingTime || adjustmentRules == null)
return new AdjustmentRule [0];
else
return (AdjustmentRule []) adjustmentRules.Clone ();
@ -1254,8 +1254,10 @@ namespace System
tz = CreateCustomTimeZone (id, baseUtcOffset, id, standardDisplayName, daylightDisplayName, ValidateRules (adjustmentRules).ToArray ());
}
if (storeTransition)
if (storeTransition && transitions.Count > 0) {
tz.transitions = transitions;
tz.supportsDaylightSavingTime = true;
}
return tz;
}

View File

@ -1 +1 @@
a7e75eef6368c6220420fa94b92d9f18efdc954b
f38526856d8b1842bd8d401eb0d67765bff4c2cb

View File

@ -1 +1 @@
2eb43af5239e63316874341249c70a7aaaa21548
c5f8a1c26efb5e43b4537118287011b39e48146e

View File

@ -1 +1 @@
1e8e4cd027b107938b2ccffcb417211866ad1223
fab1f967bd41df8741fe07faecefc4570b2fa0a0

View File

@ -1 +1 @@
c662727d3b509939685f97c0494d303020cc0725
02bc04de3431cb4492836a94aa678ff49f7a43b2

View File

@ -1 +1 @@
134f3a9815c9cb89f775b433dcde3143b910e93c
b65949d5a9390ad455d5f54e6afffd8dedd94429

View File

@ -100,7 +100,8 @@ namespace Mono.Linker.Steps {
var references = assembly.MainModule.AssemblyReferences;
for (int i = 0; i < references.Count; i++) {
var reference = references [i];
if (!AreSameReference (reference, target.Name))
var r = Context.Resolver.Resolve (reference);
if (!AreSameReference (r.Name, target.Name))
continue;
references.RemoveAt (i);

View File

@ -8,3 +8,9 @@ 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

View File

@ -301,10 +301,10 @@ class MonoP {
static Options options = new Options ();
static void Main (string [] args)
static int Main (string [] args)
{
if (!options.ProcessArgs (args))
return;
return 1;
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;
return 0;
} else {
if (options.Type == null) {
if (options.PrintRefs)
PrintRefs (assembly);
else
PrintTypes (assembly, options.ShowPrivate, options.FilterObsolete);
return;
return 0;
}
}
}
@ -348,7 +348,7 @@ class MonoP {
if (count > 1){
Console.WriteLine ("Found " + count + " types that match:");
Console.WriteLine (matches);
return;
return 0;
}
}
@ -394,7 +394,7 @@ class MonoP {
notfound:
if (t == null) {
Console.WriteLine ("Could not find {0}", tname);
return;
return 1;
}
found:
//
@ -406,6 +406,7 @@ class MonoP {
if (message != null)
Console.WriteLine (message);
return 0;
}
}

View File

@ -42,6 +42,19 @@ 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;
@ -636,7 +649,7 @@ public class Outline {
if (!type.StartsWith ("System.")) {
if (type.IndexOf (".") == -1)
return type;
if (t.Namespace == this.t.Namespace)
if (t.GetNamespace () == this.t.GetNamespace ())
return t.Name;
return type;
}
@ -745,7 +758,8 @@ public class Outline {
}
if (!recursed) {
string ns = t.Namespace;
string ns;
ns = t.GetNamespace ();
if ((ns != null) && (ns != "")) {
sb.Append (ns);
sb.Append (".");

View File

@ -15,7 +15,7 @@ License: LGPL v2.1 only
Group: Development/Languages/Mono
Summary: A .NET Runtime Environment
Url: http://www.mono-project.com
Version: 4.0.1
Version: 4.0.2
Release: 0
Source0: mono-%{version}.tar.bz2
BuildRequires: bison

View File

@ -1 +1 @@
b70897dccb00767160a66906636e4a11d355eba9
1296ed12123a12950e6d9b97c95d1d2eda6c2b2a

View File

@ -1 +1 @@
0b3265de9b69f018f6bbdbc74247de6151f934c1
57cf909b79c9925e99852392121898be48f52512

View File

@ -308,6 +308,9 @@ 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;

View File

@ -758,16 +758,7 @@ EXTRA_DIST = TestDriver.cs ldscript ldscript.mono \
Makefile.am.in
version.h: Makefile
if test -d $(top_srcdir)/.git; then \
(cd $(top_srcdir); \
LANG=C; export LANG; \
branch=`git branch | grep '^\*' | cut -d ' ' -f 2`; \
version=`git log --no-color --first-parent -n1 --pretty=format:%h`; \
echo "#define FULL_VERSION \"$$branch/$$version\""; \
); \
else \
echo "#define FULL_VERSION \"tarball\""; \
fi > version.h
echo "#define FULL_VERSION \"Stable 4.0.2.4/198235d\"" > version.h
# Utility target for patching libtool to speed up linking
patch-libtool:

View File

@ -758,16 +758,7 @@ EXTRA_DIST = TestDriver.cs ldscript ldscript.mono \
Makefile.am.in
version.h: Makefile
if test -d $(top_srcdir)/.git; then \
(cd $(top_srcdir); \
LANG=C; export LANG; \
branch=`git branch | grep '^\*' | cut -d ' ' -f 2`; \
version=`git log --no-color --first-parent -n1 --pretty=format:%h`; \
echo "#define FULL_VERSION \"$$branch/$$version\""; \
); \
else \
echo "#define FULL_VERSION \"tarball\""; \
fi > version.h
echo "#define FULL_VERSION \"Stable 4.0.2.4/198235d\"" > version.h
# Utility target for patching libtool to speed up linking
patch-libtool:

View File

@ -1 +1 @@
8046fb5169b2fc7fb8a247a8ea7b9577f1666b9f
c39e0c15b49d478226e1a68b24c751029eb0cd2b

View File

@ -1 +1 @@
eff409c294acd4fb9800517fd4fedf8558e63ee9
746324b102b743279f76bc697ae22671f330cd68

View File

@ -704,6 +704,12 @@ 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;

View File

@ -401,7 +401,7 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls,
if (ji != NULL) {
int i;
gssize regs [MONO_MAX_IREGS + 1 + 8];
mono_unwind_reg_t 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] = new_ctx->fregs [8 + i];
regs [MONO_MAX_IREGS + i] = *(guint64*)&(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] = regs [MONO_MAX_IREGS + i];
new_ctx->fregs [8 + i] = *(double*)&(regs [MONO_MAX_IREGS + i]);
#endif
/* Clear thumb bit */

View File

@ -124,6 +124,9 @@
* 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,

View File

@ -12,6 +12,11 @@
#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.
@ -145,7 +150,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,
mgreg_t *regs, int nregs,
mono_unwind_reg_t *regs, int nregs,
mgreg_t **save_locations, int save_locations_len,
guint8 **out_cfa) MONO_INTERNAL;

View File

@ -1 +1 @@
9c391bd627650570aa4f69767e44703f6d8e5f7e
2db8d861eff4843bacec8f1b86cc931e68850d75

View File

@ -51,11 +51,12 @@ 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 */
/* Assign d8..d15 to hregs 16..24 (dwarf regs 264..271) */
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)
@ -109,6 +110,10 @@ 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];
@ -480,7 +485,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,
mgreg_t *regs, int nregs,
mono_unwind_reg_t *regs, int nregs,
mgreg_t **save_locations, int save_locations_len,
guint8 **out_cfa)
{
@ -602,7 +607,10 @@ 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);
regs [hreg] = *(mgreg_t*)(cfa_val + locations [i].offset);
if (IS_DOUBLE_REG (i))
regs [hreg] = *(guint64*)(cfa_val + locations [i].offset);
else
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);
}

View File

@ -1 +1 @@
#define FULL_VERSION "(detached/ed1d3ec"
#define FULL_VERSION "Stable 4.0.2.4/198235d"

View File

@ -93,7 +93,8 @@ static int use_zip = 0;
static int do_report = 0;
static int do_heap_shot = 0;
static int max_call_depth = 100;
static int runtime_inited = 0;
static volatile int runtime_inited = 0;
static int need_helper_thread = 0;
static int command_port = 0;
static int heapshot_requested = 0;
static int sample_type = 0;
@ -623,11 +624,8 @@ find_method (MonoDomain *domain, void *user_data)
}
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 };
@ -649,12 +647,19 @@ register_method_local (MonoProfiler *prof, MonoDomain *domain, MonoMethod *metho
}
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)
{
@ -802,24 +807,22 @@ 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));
@ -967,7 +970,7 @@ collect_bt (FrameData *data)
}
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
@ -979,7 +982,7 @@ emit_bt (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_ptr (logbuffer, data->methods [--data->count]);
emit_method_as_ptr (prof, logbuffer, data->methods [--data->count]);
}
}
@ -988,7 +991,7 @@ gc_alloc (MonoProfiler *prof, MonoObject *obj, MonoClass *klass)
{
uint64_t now;
uintptr_t len;
int do_bt = (nocalls && runtime_inited && !notraces)? TYPE_ALLOC_BT: 0;
int do_bt = (nocalls && InterlockedRead (&runtime_inited) && !notraces)? TYPE_ALLOC_BT: 0;
FrameData data;
LogBuffer *logbuffer;
len = mono_object_get_size (obj);
@ -1006,7 +1009,7 @@ gc_alloc (MonoProfiler *prof, MonoObject *obj, MonoClass *klass)
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);
@ -1144,7 +1147,7 @@ class_loaded (MonoProfiler *prof, MonoClass *klass, int result)
LogBuffer *logbuffer;
if (result != MONO_PROFILE_OK)
return;
if (runtime_inited)
if (InterlockedRead (&runtime_inited))
name = mono_type_get_name (mono_class_get_type (klass));
else
name = type_name (klass);
@ -1183,7 +1186,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, mono_domain_get (), method);
emit_method (prof, logbuffer, method);
EXIT_LOG (logbuffer);
process_requests (prof);
}
@ -1199,7 +1202,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, mono_domain_get (), method);
emit_method (prof, logbuffer, method);
EXIT_LOG (logbuffer);
if (logbuffer->next)
safe_send (prof, logbuffer);
@ -1220,7 +1223,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, mono_domain_get (), method);
emit_method (prof, logbuffer, method);
EXIT_LOG (logbuffer);
process_requests (prof);
}
@ -1231,7 +1234,7 @@ method_jitted (MonoProfiler *prof, MonoMethod *method, MonoJitInfo *ji, int resu
if (result != MONO_PROFILE_OK)
return;
register_method_local (prof, NULL, method, ji);
register_method_local (prof, method, ji);
}
static void
@ -1267,7 +1270,7 @@ code_buffer_new (MonoProfiler *prof, void *buffer, int size, MonoProfilerCodeBuf
static void
throw_exc (MonoProfiler *prof, MonoObject *object)
{
int do_bt = (nocalls && runtime_inited && !notraces)? TYPE_EXCEPTION_BT: 0;
int do_bt = (nocalls && InterlockedRead (&runtime_inited) && !notraces)? TYPE_EXCEPTION_BT: 0;
uint64_t now;
FrameData data;
LogBuffer *logbuffer;
@ -1280,7 +1283,7 @@ throw_exc (MonoProfiler *prof, MonoObject *object)
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);
}
@ -1296,14 +1299,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, mono_domain_get (), method);
emit_method (prof, logbuffer, method);
EXIT_LOG (logbuffer);
}
static void
monitor_event (MonoProfiler *profiler, MonoObject *object, MonoProfilerMonitorEvent event)
{
int do_bt = (nocalls && runtime_inited && !notraces && event == MONO_PROFILER_MONITOR_CONTENTION)? TYPE_MONITOR_BT: 0;
int do_bt = (nocalls && InterlockedRead (&runtime_inited) && !notraces && event == MONO_PROFILER_MONITOR_CONTENTION)? TYPE_MONITOR_BT: 0;
uint64_t now;
FrameData data;
LogBuffer *logbuffer;
@ -1316,7 +1319,7 @@ monitor_event (MonoProfiler *profiler, MonoObject *object, MonoProfilerMonitorEv
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);
}
@ -1829,10 +1832,9 @@ 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, 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);
}
@ -2724,7 +2726,7 @@ helper_thread (void* arg)
if (strcmp (buf, "heapshot\n") == 0) {
heapshot_requested = 1;
//fprintf (stderr, "perform heapshot\n");
if (runtime_inited && !thread) {
if (InterlockedRead (&runtime_inited) && !thread) {
thread = mono_thread_attach (mono_get_root_domain ());
/*fprintf (stderr, "attached\n");*/
}
@ -2878,13 +2880,33 @@ 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;
@ -2943,12 +2965,7 @@ create_profiler (const char *filename)
if (do_counters && !need_helper_thread) {
need_helper_thread = 1;
}
#ifndef DISABLE_HELPER_THREAD
if (hs_mode_ondemand || need_helper_thread) {
if (!start_helper_thread (prof))
prof->command_port = 0;
}
#else
#ifdef DISABLE_HELPER_THREAD
if (hs_mode_ondemand)
fprintf (stderr, "Ondemand heapshot unavailable on this arch.\n");
#endif
@ -2957,8 +2974,6 @@ 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;
}

View File

@ -307,6 +307,7 @@ 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 \

View File

@ -726,6 +726,7 @@ 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 \

View File

@ -0,0 +1,61 @@
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;
}
}
}

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 8
#define BIND_ROOM 4
#endif
static CodeChunk*

Binary file not shown.

View File

@ -1 +1 @@
ff2d756a7f32d77cd2a721a68b035fbc69e57ef7
5e56b0a1f2613f59b5e7267001b7fe8b6b86bebd

Binary file not shown.

View File

@ -1 +1 @@
3b249963775464504655c0b1f30dfc2ca6a25709
3b480898afbea8dc4f824168008764f173da2d8d

Binary file not shown.

View File

@ -1 +1 @@
e20a637041eac6d869e1fda5b4fd5d14658b6347
9b62d681765d5632890b20973d0b71e75464aa92

View File

@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: mono 4.0.1\n"
"Project-Id-Version: mono 4.0.2\n"
"Report-Msgid-Bugs-To: http://www.mono-project.com/Bugs\n"
"POT-Creation-Date: 2015-05-28 04:20-0400\n"
"POT-Creation-Date: 2015-06-10 18:24-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

Binary file not shown.

View File

@ -1 +1 @@
f9040ad4c3d6d8b547cc25310a949e56da482c9a
27332917c426a7428e9975a59500e8912fcdc4b4