You've already forked linux-packaging-mono
Imported Upstream version 4.0.2.4
Former-commit-id: de0c2bbc3d900ab3bd764cd6c9d9062472ce7456
This commit is contained in:
@@ -1 +1 @@
|
||||
b70897dccb00767160a66906636e4a11d355eba9
|
||||
1296ed12123a12950e6d9b97c95d1d2eda6c2b2a
|
||||
@@ -1 +1 @@
|
||||
0b3265de9b69f018f6bbdbc74247de6151f934c1
|
||||
57cf909b79c9925e99852392121898be48f52512
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -1 +1 @@
|
||||
8046fb5169b2fc7fb8a247a8ea7b9577f1666b9f
|
||||
c39e0c15b49d478226e1a68b24c751029eb0cd2b
|
||||
@@ -1 +1 @@
|
||||
eff409c294acd4fb9800517fd4fedf8558e63ee9
|
||||
746324b102b743279f76bc697ae22671f330cd68
|
||||
@@ -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;
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
9c391bd627650570aa4f69767e44703f6d8e5f7e
|
||||
2db8d861eff4843bacec8f1b86cc931e68850d75
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define FULL_VERSION "(detached/ed1d3ec"
|
||||
#define FULL_VERSION "Stable 4.0.2.4/198235d"
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 \
|
||||
|
||||
@@ -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 \
|
||||
|
||||
61
mono/tests/dynamic-generic-size.cs
Normal file
61
mono/tests/dynamic-generic-size.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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*
|
||||
|
||||
Reference in New Issue
Block a user