+2003-10-31 Zoltan Varga <vargaz@freemail.hu>
+
+ * */tramp.c (mono_create_method_pointer): Rename to
+ mono_arch_create_method_pointer, move common code to a new function in
+ interp.c.
+
+ * */tramp.c (mono_create_trampoline): Rename to
+ mono_arch_create_trampoline for consistency.
+
2003-10-13 Bernie Solomon <bernard@ugsolutions.com>
* x86/tramp.c: restore EDX after memcpy call
}
MonoPIFunc
-mono_create_trampoline (MonoMethodSignature *sig, gboolean string_ctor)
+mono_arch_create_trampoline (MonoMethodSignature *sig, gboolean string_ctor)
{
unsigned char *p;
unsigned char *buffer;
}
void *
-mono_create_method_pointer (MonoMethod *method)
+mono_arch_create_method_pointer (MonoMethod *method)
{
g_error ("Unsupported arch");
return NULL;
/*
* Refer to ARM Procedure Call Standard (APCS) for more info.
*/
-MonoPIFunc mono_create_trampoline (MonoMethodSignature *sig, gboolean string_ctor)
+MonoPIFunc mono_arch_create_trampoline (MonoMethodSignature *sig, gboolean string_ctor)
{
MonoType* param;
MonoPIFunc code_buff;
* Still need to figure out how to handle the exception stuff
* across the managed/unmanaged boundary.
*/
-void* mono_create_method_pointer (MonoMethod* method)
+void* mono_arch_create_method_pointer (MonoMethod* method)
{
MonoMethodSignature* sig;
guchar* p, * p_method, * p_stackval_from_data, * p_exec;
int areg, reg_args, shift, pos;
MonoJitInfo *ji;
- /*
- * If it is a static P/Invoke method just
- * just return the pointer to the implementation
- */
- if (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL && method->addr) {
- ji = g_new0(MonoJitInfo, 1);
- ji->method = method;
- ji->code_size = 1;
- ji->code_start = method->addr;
-
- mono_jit_info_table_add(mono_root_domain, ji);
- return method->addr;
- }
-
code_buff = alloc_code_buff(128);
p = (guchar*)code_buff;
*/
MonoPIFunc
-mono_create_trampoline (MonoMethodSignature *sig, gboolean string_ctor)
+mono_arch_create_trampoline (MonoMethodSignature *sig, gboolean string_ctor)
{
int pc, save_pc;
int param;
}
void *
-mono_create_method_pointer (MonoMethod *method)
+mono_arch_create_method_pointer (MonoMethod *method)
{
MonoMethodSignature *sig = method->signature;
MonoJitInfo *ji;
fprintf(stderr, "%d: %d\n", i, sig->params[i]->type);
}
- /*
- * If it is a static P/Invoke method, we can just return the pointer
- * to the method implementation.
- */
- if (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL && method->addr) {
- ji = g_new0 (MonoJitInfo, 1);
- ji->method = method;
- ji->code_size = 1;
- ji->code_start = method->addr;
-
- mono_jit_info_table_add (mono_root_domain, ji);
- return method->addr;
- }
-
// the extra stackval is for the return val if necessary
// the 64 is for outgoing parameters and the 16 is the frame marker.
// the other 16 is space for struct return vals < 16 bytes
}
MonoPIFunc
-mono_create_trampoline (MonoMethodSignature *sig, gboolean string_ctor)
+mono_arch_create_trampoline (MonoMethodSignature *sig, gboolean string_ctor)
{
guint8 *p, *code_buffer;
guint stack_size, code_size;
* across the managed/unmanaged boundary.
*/
void *
-mono_create_method_pointer (MonoMethod *method)
+mono_arch_create_method_pointer (MonoMethod *method)
{
MonoMethodSignature *sig;
MonoJitInfo *ji;
gint *vtbuf;
guint32 simpletype;
- /*
- * If it is a static P/Invoke method, we can just return the pointer
- * to the method implementation.
- */
- if (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL && method->addr) {
- ji = g_new0 (MonoJitInfo, 1);
- ji->method = method;
- ji->code_size = 1;
- ji->code_start = method->addr;
-
- mono_jit_info_table_add (mono_root_domain, ji);
- return method->addr;
- }
-
code_size = 1024;
stack_size = 1024;
stack_param = 0;
\f
/*------------------------------------------------------------------*/
/* */
-/* Name - mono_create_method_pointer */
+/* Name - mono_arch_create_method_pointer */
/* */
/* Function - Returns a pointer to a native function that can */
/* be used to call the specified method. */
/* */
/* Logic: */
/* ------ */
-/* mono_create_method_pointer (MonoMethod *method) */
+/* mono_arch_create_method_pointer (MonoMethod *method) */
/* create the unmanaged->managed wrapper */
/* register it with mono_jit_info_table_add() */
/* */
/*------------------------------------------------------------------*/
void *
-mono_create_method_pointer (MonoMethod *method)
+mono_arch_create_method_pointer (MonoMethod *method)
{
MonoMethodSignature *sig;
MonoJitInfo *ji;
}
MonoPIFunc
-mono_create_trampoline (MonoMethodSignature *sig, gboolean string_ctor)
+mono_arch_create_trampoline (MonoMethodSignature *sig, gboolean string_ctor)
{
guint32 *p, *code_buffer;
guint stack_size, code_size, i;
#define MINV_POS (MINIMAL_STACK_SIZE * SLOT_SIZE + BIAS)
void *
-mono_create_method_pointer (MonoMethod *method)
+mono_arch_create_method_pointer (MonoMethod *method)
{
MonoMethodSignature *sig;
MonoJitInfo *ji;
gint *vtbuf;
gint32 simpletype;
- if (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL && method->addr) {
- ji = g_new0 (MonoJitInfo, 1);
- ji->method = method;
- ji->code_size = 1;
- ji->code_start = method->addr;
-
- mono_jit_info_table_add (mono_root_domain, ji);
- return method->addr;
- }
-
code_size = 1024; /* these should be calculated... */
stack_size = 1024;
stack_param = 0;
#define ARG_SIZE sizeof (stackval)
MonoPIFunc
-mono_create_trampoline (MonoMethodSignature *sig, gboolean string_ctor)
+mono_arch_create_trampoline (MonoMethodSignature *sig, gboolean string_ctor)
{
unsigned char *p, *code_buffer;
guint32 stack_size = 0, code_size = 50;
* across the managed/unmanaged boundary.
*/
void *
-mono_create_method_pointer (MonoMethod *method)
+mono_arch_create_method_pointer (MonoMethod *method)
{
MonoMethodSignature *sig;
MonoJitInfo *ji;
int i, size, align, cpos;
int *vtbuf;
- /*
- * If it is a static P/Invoke method, we can just return the pointer
- * to the method implementation.
- */
- if (method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL && method->addr) {
- ji = g_new0 (MonoJitInfo, 1);
- ji->method = method;
- ji->code_size = 1;
- ji->code_start = method->addr;
-
- mono_jit_info_table_add (mono_root_domain, ji);
- return method->addr;
- }
-
sig = method->signature;
code_buffer = p = alloca (512); /* FIXME: check for overflows... */