projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[wasm] Fix test_0_conv_i under interp.
[mono.git]
/
mono
/
mini
/
jit-icalls.c
diff --git
a/mono/mini/jit-icalls.c
b/mono/mini/jit-icalls.c
index 1bd890d1b51a94032f21b0702627ed7c08336184..56c7bc8169f76b54e7f1f01caa0e23471a01a259 100644
(file)
--- a/
mono/mini/jit-icalls.c
+++ b/
mono/mini/jit-icalls.c
@@
-1,5
+1,6
@@
-/*
- * jit-icalls.c: internal calls used by the JIT
+/**
+ * \file
+ * internal calls used by the JIT
*
* Author:
* Dietmar Maurer (dietmar@ximian.com)
*
* Author:
* Dietmar Maurer (dietmar@ximian.com)
@@
-22,6
+23,7
@@
#include <mono/metadata/exception-internals.h>
#include <mono/metadata/threads-types.h>
#include <mono/metadata/reflection-internals.h>
#include <mono/metadata/exception-internals.h>
#include <mono/metadata/threads-types.h>
#include <mono/metadata/reflection-internals.h>
+#include <mono/utils/unlocked.h>
#ifdef ENABLE_LLVM
#include "mini-llvm-cpp.h"
#ifdef ENABLE_LLVM
#include "mini-llvm-cpp.h"
@@
-887,11
+889,16
@@
mono_class_static_field_address (MonoDomain *domain, MonoClassField *field)
//printf ("SFLDA1 %p\n", (char*)vtable->data + field->offset);
//printf ("SFLDA1 %p\n", (char*)vtable->data + field->offset);
- if (domain->special_static_fields && (addr = g_hash_table_lookup (domain->special_static_fields, field)))
+ if (field->offset == -1) {
+ /* Special static */
+ g_assert (domain->special_static_fields);
+ mono_domain_lock (domain);
+ addr = g_hash_table_lookup (domain->special_static_fields, field);
+ mono_domain_unlock (domain);
addr = mono_get_special_static_data (GPOINTER_TO_UINT (addr));
addr = mono_get_special_static_data (GPOINTER_TO_UINT (addr));
- else
+ } else {
addr = (char*)mono_vtable_get_static_field_data (vtable) + field->offset;
addr = (char*)mono_vtable_get_static_field_data (vtable) + field->offset;
-
+ }
return addr;
}
return addr;
}
@@
-1083,16
+1090,6
@@
mono_lconv_to_r8_un (guint64 a)
}
#endif
}
#endif
-#if defined(__native_client_codegen__) || defined(__native_client__)
-/* When we cross-compile to Native Client we can't directly embed calls */
-/* to the math library on the host. This will use the fmod on the target*/
-double
-mono_fmod(double a, double b)
-{
- return fmod(a, b);
-}
-#endif
-
gpointer
mono_helper_compile_generic_method (MonoObject *obj, MonoMethod *method, gpointer *this_arg)
{
gpointer
mono_helper_compile_generic_method (MonoObject *obj, MonoMethod *method, gpointer *this_arg)
{
@@
-1101,7
+1098,7
@@
mono_helper_compile_generic_method (MonoObject *obj, MonoMethod *method, gpointe
gpointer addr;
MonoGenericContext *context = mono_method_get_context (method);
gpointer addr;
MonoGenericContext *context = mono_method_get_context (method);
-
mono_jit_stats.generic_virtual_invocations++
;
+
UnlockedIncrement (&mono_jit_stats.generic_virtual_invocations)
;
if (obj == NULL) {
mono_set_pending_exception (mono_get_exception_null_reference ());
if (obj == NULL) {
mono_set_pending_exception (mono_get_exception_null_reference ());
@@
-1215,7
+1212,7
@@
mono_object_castclass_unbox (MonoObject *obj, MonoClass *klass)
MonoClass *oklass;
if (mini_get_debug_options ()->better_cast_details) {
MonoClass *oklass;
if (mini_get_debug_options ()->better_cast_details) {
- jit_tls = (MonoJitTlsData *)mono_
native_tls_get_value (mono_jit_tls_id
);
+ jit_tls = (MonoJitTlsData *)mono_
tls_get_jit_tls (
);
jit_tls->class_cast_from = NULL;
}
jit_tls->class_cast_from = NULL;
}
@@
-1249,7
+1246,7
@@
mono_object_castclass_with_cache (MonoObject *obj, MonoClass *klass, gpointer *c
gpointer cached_vtable, obj_vtable;
if (mini_get_debug_options ()->better_cast_details) {
gpointer cached_vtable, obj_vtable;
if (mini_get_debug_options ()->better_cast_details) {
- jit_tls = (MonoJitTlsData *)mono_
native_tls_get_value (mono_jit_tls_id
);
+ jit_tls = (MonoJitTlsData *)mono_
tls_get_jit_tls (
);
jit_tls->class_cast_from = NULL;
}
jit_tls->class_cast_from = NULL;
}
@@
-1332,7
+1329,7
@@
constrained_gsharedvt_call_setup (gpointer mp, MonoMethod *cmethod, MonoClass *k
MonoMethod *m;
int vt_slot, iface_offset;
MonoMethod *m;
int vt_slot, iface_offset;
-
mono_
error_init (error);
+ error_init (error);
if (mono_class_is_interface (klass)) {
MonoObject *this_obj;
if (mono_class_is_interface (klass)) {
MonoObject *this_obj;
@@
-1452,11
+1449,15
@@
mono_generic_class_init (MonoVTable *vtable)
}
void
}
void
-ves_icall_mono_delegate_ctor (MonoObject *this_obj
, MonoObject *target
, gpointer addr)
+ves_icall_mono_delegate_ctor (MonoObject *this_obj
_raw, MonoObject *target_raw
, gpointer addr)
{
{
+ HANDLE_FUNCTION_ENTER ();
MonoError error;
MonoError error;
+ MONO_HANDLE_DCL (MonoObject, this_obj);
+ MONO_HANDLE_DCL (MonoObject, target);
mono_delegate_ctor (this_obj, target, addr, &error);
mono_error_set_pending_exception (&error);
mono_delegate_ctor (this_obj, target, addr, &error);
mono_error_set_pending_exception (&error);
+ HANDLE_FUNCTION_RETURN ();
}
gpointer
}
gpointer
@@
-1504,7
+1505,7
@@
resolve_iface_call (MonoObject *this_obj, int imt_slot, MonoMethod *imt_method,
gpointer addr, compiled_method, aot_addr;
gboolean need_rgctx_tramp = FALSE, need_unbox_tramp = FALSE;
gpointer addr, compiled_method, aot_addr;
gboolean need_rgctx_tramp = FALSE, need_unbox_tramp = FALSE;
-
mono_
error_init (error);
+ error_init (error);
if (!this_obj)
/* The caller will handle it */
return NULL;
if (!this_obj)
/* The caller will handle it */
return NULL;
@@
-1588,7
+1589,7
@@
resolve_vcall (MonoVTable *vt, int slot, MonoMethod *imt_method, gpointer *out_a
gpointer addr, compiled_method;
gboolean need_unbox_tramp = FALSE;
gpointer addr, compiled_method;
gboolean need_unbox_tramp = FALSE;
-
mono_
error_init (error);
+ error_init (error);
/* Same as in common_call_trampoline () */
/* Avoid loading metadata or creating a generic vtable if possible */
/* Same as in common_call_trampoline () */
/* Avoid loading metadata or creating a generic vtable if possible */
@@
-1909,14
+1910,14
@@
mono_interruption_checkpoint_from_trampoline (void)
}
void
}
void
-mono_throw_method_access (MonoMethod *calle
e, MonoMethod *caller
)
+mono_throw_method_access (MonoMethod *calle
r, MonoMethod *callee
)
{
{
- char *calle
e_name = mono_method_full_name (callee, 1
);
- char *calle
r_name = mono_method_full_name (caller, 1
);
+ char *calle
r_name = mono_method_get_reflection_name (caller
);
+ char *calle
e_name = mono_method_get_reflection_name (callee
);
MonoError error;
MonoError error;
-
mono_
error_init (&error);
- mono_error_set_generic_error (&error, "System", "MethodAccessException", "Method `%s' is inaccessible from method `%s'
\n
", callee_name, caller_name);
+ error_init (&error);
+ mono_error_set_generic_error (&error, "System", "MethodAccessException", "Method `%s' is inaccessible from method `%s'", callee_name, caller_name);
mono_error_set_pending_exception (&error);
g_free (callee_name);
g_free (caller_name);
mono_error_set_pending_exception (&error);
g_free (callee_name);
g_free (caller_name);