Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Molaro <lupus@oddwiz.org>2002-02-11 10:42:10 +0300
committerPaolo Molaro <lupus@oddwiz.org>2002-02-11 10:42:10 +0300
commit95f448bcff303618c49f9fd4ee0d723ce626922b (patch)
tree3f52d17941ac811b2a542890574d0c337cdf722e
parent50732e092b5e271f15aa0f494ace5772ee6f2d47 (diff)
Mon Feb 11 12:32:35 CET 2002 Paolo Molaro <lupus@ximian.com>
* x86/tramp.c: fix handling of multiple marshaleed strings. * x86/x86-codegen.h: some code to patch branch displacements. svn path=/trunk/mono/; revision=2308
-rw-r--r--mono/arch/ChangeLog5
-rw-r--r--mono/arch/x86/tramp.c3
-rw-r--r--mono/arch/x86/x86-codegen.h22
3 files changed, 27 insertions, 3 deletions
diff --git a/mono/arch/ChangeLog b/mono/arch/ChangeLog
index 7c572e75abb..a85e8658e45 100644
--- a/mono/arch/ChangeLog
+++ b/mono/arch/ChangeLog
@@ -1,4 +1,9 @@
+Mon Feb 11 12:32:35 CET 2002 Paolo Molaro <lupus@ximian.com>
+
+ * x86/tramp.c: fix handling of multiple marshaleed strings.
+ * x86/x86-codegen.h: some code to patch branch displacements.
+
Fri Feb 1 16:03:00 CET 2002 Paolo Molaro <lupus@ximian.com>
* x86/tramp.c, ppc/tramp.c: implement mono_method_pointer_get ().
diff --git a/mono/arch/x86/tramp.c b/mono/arch/x86/tramp.c
index 93e2664497e..e9fef810eeb 100644
--- a/mono/arch/x86/tramp.c
+++ b/mono/arch/x86/tramp.c
@@ -304,9 +304,8 @@ enum_retvalue:
* free the allocated strings.
*/
if (!(method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL)) {
- if (local_size)
- x86_mov_reg_imm (p, X86_EDX, g_free);
for (i = 1; i <= local_size; ++i) {
+ x86_mov_reg_imm (p, X86_EDX, g_free);
x86_push_membase (p, X86_EBP, LOC_POS * i);
x86_call_reg (p, X86_EDX);
}
diff --git a/mono/arch/x86/x86-codegen.h b/mono/arch/x86/x86-codegen.h
index 0bee23e436b..b57e50e3d58 100644
--- a/mono/arch/x86/x86-codegen.h
+++ b/mono/arch/x86/x86-codegen.h
@@ -1,7 +1,7 @@
/* Copyright (C) 2000 Intel Corporation. All rights reserved.
Copyright (C) 2001 Ximian, Inc.
//
-// $Header: /home/miguel/third-conversion/public/mono/mono/arch/x86/x86-codegen.h,v 1.21 2002/02/01 12:04:33 dietmar Exp $
+// $Header: /home/miguel/third-conversion/public/mono/mono/arch/x86/x86-codegen.h,v 1.22 2002/02/11 07:42:10 lupus Exp $
*/
#ifndef X86_H
@@ -260,6 +260,26 @@ typedef union {
} \
} while (0)
+/* disp will need to be relative to the start position... */
+#define x86_patch(ins,disp) \
+ do { \
+ unsigned char* pos = (ins) + 1; \
+ int size = 0; \
+ switch (*(ins)) { \
+ case 0xe9: ++size; break; \
+ case 0x0f: ++size; ++pos; break; \
+ case 0xeb: \
+ case 0x70: case 0x71: case 0x72: case 0x73: \
+ case 0x74: case 0x75: case 0x76: case 0x77: \
+ case 0x78: case 0x79: case 0x7a: case 0x7b: \
+ case 0x7c: case 0x7d: case 0x7e: case 0x7f: \
+ break; \
+ default: assert (0); \
+ } \
+ if (size) x86_imm_emit32 (pos, (disp)); \
+ else x86_imm_emit8 (pos, (disp)); \
+ } while (0)
+
#define x86_breakpoint(inst) \
do { \
*(inst)++ = 0xcc; \