#include <mono/metadata/object.h>
#include <mono/metadata/threads.h>
#include <mono/metadata/threads-types.h>
-#include <mono/metadata/threadpool.h>
#include <mono/metadata/threadpool-ms.h>
#include <mono/metadata/threadpool-ms-io.h>
#include <mono/metadata/monitor.h>
#include <mono/metadata/profiler-private.h>
#include <mono/metadata/locales.h>
#include <mono/metadata/filewatcher.h>
-#include <mono/metadata/char-conversions.h>
#include <mono/metadata/security.h>
#include <mono/metadata/mono-config.h>
#include <mono/metadata/cil-coff.h>
#include <mono/metadata/file-mmap.h>
#include <mono/metadata/seq-points-data.h>
#include <mono/io-layer/io-layer.h>
-#include <mono/utils/strtod.h>
#include <mono/utils/monobitset.h>
#include <mono/utils/mono-time.h>
#include <mono/utils/mono-proclib.h>
#include <shlobj.h>
#endif
#include "decimal-ms.h"
+#include "number-ms.h"
extern MonoString* ves_icall_System_Environment_GetOSVersionString (void);
mono_raise_exception (mono_class_get_exception_for_failure (klass));
}
-/*
- * We expect a pointer to a char, not a string
- */
-ICALL_EXPORT gboolean
-mono_double_ParseImpl (char *ptr, double *result)
-{
- gchar *endptr = NULL;
- *result = 0.0;
-
- if (*ptr){
- /* mono_strtod () is not thread-safe */
- mono_mutex_lock (&mono_strtod_mutex);
- *result = mono_strtod (ptr, &endptr);
- mono_mutex_unlock (&mono_strtod_mutex);
- }
-
- if (!*ptr || (endptr && *endptr))
- return FALSE;
-
- return TRUE;
-}
-
ICALL_EXPORT MonoObject *
ves_icall_System_Array_GetValueImpl (MonoObject *this, guint32 pos)
{
mono_image_register_token (mb->dynamic_image, token, obj);
}
+ICALL_EXPORT MonoObject*
+ves_icall_ModuleBuilder_GetRegisteredToken (MonoReflectionModuleBuilder *mb, guint32 token)
+{
+ gpointer obj;
+
+ mono_loader_lock ();
+ obj = mono_g_hash_table_lookup (mb->dynamic_image->tokens, GUINT_TO_POINTER (token));
+ mono_loader_unlock ();
+
+ return obj;
+}
+
static gboolean
get_caller (MonoMethod *m, gint32 no, gint32 ilo, gboolean managed, gpointer data)
{
mono_metadata_free_type (inflated);
}
+static guint
+get_interfaces_hash (gconstpointer v1)
+{
+ MonoClass *k = (MonoClass*)v1;
+
+ return k->type_token;
+}
+
ICALL_EXPORT MonoArray*
ves_icall_Type_GetInterfaces (MonoReflectionType* type)
{
FillIfaceArrayData data = { 0 };
int len;
- GHashTable *iface_hash = g_hash_table_new (NULL, NULL);
+ GHashTable *iface_hash = g_hash_table_new (get_interfaces_hash, NULL);
if (class->generic_class && class->generic_class->context.class_inst->is_open) {
data.context = mono_class_get_context (class);
if (type->type == MONO_TYPE_CLASS) {
MonoClass *klass = mono_type_get_class (type);
- if (mono_security_enabled () && !klass->exception_type)
- /* Some security problems are detected during generic vtable construction */
- mono_class_setup_vtable (klass);
-
/* need to report exceptions ? */
if (throwOnError && klass->exception_type) {
/* report SecurityException (or others) that occured when loading the assembly */
mono_loader_clear_error ();
mono_set_pending_exception (exc);
return NULL;
- } else if (mono_security_enabled () && klass->exception_type == MONO_EXCEPTION_SECURITY_INHERITANCEDEMAND) {
- return NULL;
}
}
if (!exportedOnly || mono_module_type_is_visible (tdef, image, i + 1)) {
MonoError error;
klass = mono_class_get_checked (image, (i + 1) | MONO_TOKEN_TYPE_DEF, &error);
- g_assert (!mono_loader_get_last_error ()); /* Plug any leaks */
+ mono_loader_assert_no_error (); /* Plug any leaks */
if (klass) {
mono_array_setref (res, count, mono_type_get_object (domain, &klass->byval_arg));
return delegate;
}
-ICALL_EXPORT void
-ves_icall_System_Delegate_SetMulticastInvoke (MonoDelegate *this)
+ICALL_EXPORT MonoMulticastDelegate *
+ves_icall_System_Delegate_AllocDelegateLike_internal (MonoDelegate *delegate)
{
- /* Reset the invoke impl to the default one */
- this->invoke_impl = mono_runtime_create_delegate_trampoline (this->object.vtable->klass);
+ MonoMulticastDelegate *ret;
+
+ g_assert (mono_class_has_parent (mono_object_class (delegate), mono_defaults.multicastdelegate_class));
+
+ ret = (MonoMulticastDelegate*) mono_object_new (mono_object_domain (delegate), mono_object_class (delegate));
+ ret->delegate.invoke_impl = mono_runtime_create_delegate_trampoline (mono_object_class (delegate));
+
+ return ret;
}
/* System.Buffer */
*decHexDigits = Formatter_DecHexDigits;
}
-/* These parameters are "readonly" in corlib/System/Globalization/TextInfo.cs */
-ICALL_EXPORT void
-ves_icall_System_Globalization_TextInfo_GetDataTablePointersLite (
- guint16 const **to_lower_data_low,
- guint16 const **to_lower_data_high,
- guint16 const **to_upper_data_low,
- guint16 const **to_upper_data_high)
-{
- *to_lower_data_low = ToLowerDataLow;
- *to_lower_data_high = ToLowerDataHigh;
- *to_upper_data_low = ToUpperDataLow;
- *to_upper_data_high = ToUpperDataHigh;
-}
-
/*
* We return NULL for no modifiers so the corlib code can return Type.EmptyTypes
* and avoid useless allocations.
guint32 il_offset;
char *path_str = mono_string_to_utf8 (path);
- if (!seq_point_data_get_il_offset (path_str, method_token, method_index, native_offset, &il_offset))
+ if (!mono_seq_point_data_get_il_offset (path_str, method_token, method_index, native_offset, &il_offset))
il_offset = -1;
g_free (path_str);