HANDLES(RUNH_1, "GetObjectValue", ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_GetObjectValue, MonoObject, 1, (MonoObject))
HANDLES(RUNH_2, "GetUninitializedObjectInternal", ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_GetUninitializedObjectInternal, MonoObject, 1, (MonoType_ptr))
HANDLES(RUNH_3, "InitializeArray", ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_InitializeArray, void, 2, (MonoArray, MonoClassField_ptr))
-ICALL(RUNH_7, "InternalGetHashCode", mono_object_hash_internal)
+HANDLES(RUNH_7, "InternalGetHashCode", mono_object_hash_icall, int, 1, (MonoObject))
HANDLES(RUNH_3a, "PrepareMethod", ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_PrepareMethod, void, 3, (MonoMethod_ptr, gpointer, int))
HANDLES(RUNH_4, "RunClassConstructor", ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor, void, 1, (MonoType_ptr))
HANDLES(RUNH_5, "RunModuleConstructor", ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunModuleConstructor, void, 1, (MonoImage_ptr))
ICALL_TYPE(OBJ, "System.Object", OBJ_1)
HANDLES(OBJ_1, "GetType", ves_icall_System_Object_GetType, MonoReflectionType, 1, (MonoObject))
-ICALL(OBJ_2, "InternalGetHashCode", mono_object_hash_internal)
+HANDLES(OBJ_2, "InternalGetHashCode", mono_object_hash_icall, int, 1, (MonoObject))
HANDLES(OBJ_3, "MemberwiseClone", ves_icall_System_Object_MemberwiseClone, MonoObject, 1, (MonoObject))
ICALL_TYPE(ASSEM, "System.Reflection.Assembly", ASSEM_2)
#include <mono/utils/w32api.h>
#include <mono/utils/mono-os-wait.h>
#include "external-only.h"
+#include "icall-decl.h"
/*
* Pull the list of opcodes
mono_object_hash_internal (MonoObject* obj)
{
#ifdef HAVE_MOVING_COLLECTOR
+
LockWord lw;
unsigned int hash;
if (!obj)
mono_memory_write_barrier ();
obj->synchronisation = lw.sync;
return hash;
+
#else
+
/*
* Wang's address-based hash function:
* http://www.concentric.net/~Ttwang/tech/addrhash.htm
*/
return (GPOINTER_TO_UINT (obj) >> MONO_OBJECT_ALIGNMENT_SHIFT) * 2654435761u;
#endif
+
+}
+
+int
+mono_object_hash_icall (MonoObjectHandle obj, MonoError* error)
+{
+ return mono_object_hash_internal (MONO_HANDLE_RAW (obj));
}
/*
int
mono_object_hash (MonoObject* obj)
{
+ // FIXME slow?
MONO_EXTERNAL_ONLY (int, mono_object_hash_internal (obj));
}
gboolean
mono_monitor_enter (MonoObject *obj)
{
+ // FIXME slow?
MONO_EXTERNAL_ONLY (gboolean, mono_monitor_enter_internal (obj));
}
unsigned
mono_string_hash_internal (MonoString *s);
-ICALL_EXPORT
int
mono_object_hash_internal (MonoObject* obj);