THROW_EX (mono_get_exception_execution_engine (NULL), ip); \
} while (0);
-static mono_mutex_t runtime_method_lookup_section;
-
RuntimeMethod*
mono_interp_get_runtime_method (MonoDomain *domain, MonoMethod *method, MonoError *error)
{
RuntimeMethod *rtm;
error_init (error);
- mono_os_mutex_lock (&runtime_method_lookup_section);
+ mono_domain_jit_code_hash_lock (domain);
if ((rtm = mono_internal_hash_table_lookup (&domain->jit_code_hash, method))) {
- mono_os_mutex_unlock (&runtime_method_lookup_section);
+ mono_domain_jit_code_hash_unlock (domain);
return rtm;
}
- rtm = mono_mempool_alloc (domain->mp, sizeof (RuntimeMethod));
- memset (rtm, 0, sizeof (*rtm));
+ rtm = mono_domain_alloc0 (domain, sizeof (RuntimeMethod));
rtm->method = method;
rtm->param_count = mono_method_signature (method)->param_count;
rtm->hasthis = mono_method_signature (method)->hasthis;
mono_internal_hash_table_insert (&domain->jit_code_hash, method, rtm);
- mono_os_mutex_unlock (&runtime_method_lookup_section);
+ mono_domain_jit_code_hash_unlock (domain);
return rtm;
}
{
mono_native_tls_alloc (&thread_context_id, NULL);
mono_native_tls_set_value (thread_context_id, NULL);
- mono_os_mutex_init_recursive (&runtime_method_lookup_section);
mono_os_mutex_init_recursive (&create_method_pointer_mutex);
mono_interp_transform_init ();
cfailed = failed = run = 0;
transform_time = elapsed = 0.0;
-#if 0
- /* fixme: ugly hack - delete all previously compiled methods */
- if (domain_jit_info (domain)) {
- g_hash_table_destroy (domain_jit_info (domain)->jit_trampoline_hash);
- domain_jit_info (domain)->jit_trampoline_hash = g_hash_table_new (mono_aligned_addr_hash, NULL);
- mono_internal_hash_table_destroy (&(domain->jit_code_hash));
- mono_jit_code_hash_init (&(domain->jit_code_hash));
- }
-#endif
-
g_timer_start (timer);
for (i = 0; i < mono_image_get_table_rows (image, MONO_TABLE_METHOD); ++i) {
MonoObject *exc = NULL;
}
g_assert (td.max_stack_height <= (header->max_stack + 1));
- rtm->clauses = mono_mempool_alloc (domain->mp, header->num_clauses * sizeof(MonoExceptionClause));
+ rtm->clauses = mono_domain_alloc0 (domain, header->num_clauses * sizeof (MonoExceptionClause));
memcpy (rtm->clauses, header->clauses, header->num_clauses * sizeof(MonoExceptionClause));
- rtm->code = mono_mempool_alloc (domain->mp, (td.new_ip - td.new_code) * sizeof(gushort));
+ rtm->code = mono_domain_alloc0 (domain, (td.new_ip - td.new_code) * sizeof (gushort));
memcpy (rtm->code, td.new_code, (td.new_ip - td.new_code) * sizeof(gushort));
g_free (td.new_code);
rtm->new_body_start = rtm->code + body_start_offset;
}
rtm->vt_stack_size = td.max_vt_sp;
rtm->alloca_size = rtm->locals_size + rtm->args_size + rtm->vt_stack_size + rtm->stack_size;
- rtm->data_items = mono_mempool_alloc (domain->mp, td.n_data_items * sizeof (td.data_items [0]));
+ rtm->data_items = mono_domain_alloc0 (domain, td.n_data_items * sizeof (td.data_items [0]));
memcpy (rtm->data_items, td.data_items, td.n_data_items * sizeof (td.data_items [0]));
g_free (td.in_offsets);
g_free (td.forward_refs);