Skip to content

Commit

Permalink
Mon Sep 24 18:49:01 CEST 2001 Paolo Molaro <lupus@ximian.com>
Browse files Browse the repository at this point in the history
	* x86/tramp.c: don't change a MONO_TYPE_STRING to a char*
	when it's an argument to an internalcall.


Mon Sep 24 18:56:59 CEST 2001 Paolo Molaro <lupus@ximian.com>

	* object.c, object.h: added mono_ldstr (), mono_string_is_interned () and
	mono_string_intern () to implement the semantics of the ldstr opcode
	and the interning of System.Strings.
	* icall.c: provide hooks to make String::IsIntern and String::Intern
	internalcalls.


Mon Sep 24 18:50:25 CEST 2001 Paolo Molaro <lupus@ximian.com>

	* interp.c: catch a few more error conditions with exceptions instead of
	erroring out.
	Don't use g_print() in stack traces because it doesn't work with
	some float values.
	When we call an instance method of a valuetype class, unbox the 'this'
	argument if it is an object.
	Use mono_ldstr () to implement the ldstr opcode: it takes care of
	interning the string if necessary.
	Implemented new opcodes: ckfinite, cgt.un, clt.un, ldvirtftn, ldarga.
	Fixes to handle NaNs when comparing doubles.
	Make sure the loaded assembly has an entry point defined.
	Fixed portability bugs in neg and not opcodes.

svn path=/trunk/mono/; revision=943
  • Loading branch information
illupus committed Sep 24, 2001
1 parent f8fddf0 commit 78550fa
Show file tree
Hide file tree
Showing 10 changed files with 355 additions and 78 deletions.
5 changes: 5 additions & 0 deletions mono/arch/ChangeLog
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,9 @@


Mon Sep 24 18:49:01 CEST 2001 Paolo Molaro <lupus@ximian.com>

* x86/tramp.c: don't change a MONO_TYPE_STRING to a char*
when it's an argument to an internalcall.

Sun Sep 23 13:44:57 CEST 2001 Paolo Molaro <lupus@ximian.com> Sun Sep 23 13:44:57 CEST 2001 Paolo Molaro <lupus@ximian.com>


* x86/tramp.c: handle MONO_TYPE_CLASS in trampolines. * x86/tramp.c: handle MONO_TYPE_CLASS in trampolines.
Expand Down
25 changes: 18 additions & 7 deletions mono/arch/x86/tramp.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "config.h" #include "config.h"
#include "x86-codegen.h" #include "x86-codegen.h"
#include "mono/metadata/class.h" #include "mono/metadata/class.h"
#include "mono/metadata/tabledefs.h"
#include "mono/interpreter/interp.h" #include "mono/interpreter/interp.h"


/* /*
Expand Down Expand Up @@ -149,10 +150,12 @@ mono_create_trampoline (MonoMethod *method)
continue; continue;
} }
switch (sig->params [i - 1]->type) { switch (sig->params [i - 1]->type) {
case MONO_TYPE_BOOLEAN:
case MONO_TYPE_I1: case MONO_TYPE_I1:
case MONO_TYPE_U1: case MONO_TYPE_U1:
case MONO_TYPE_I2: case MONO_TYPE_I2:
case MONO_TYPE_U2: case MONO_TYPE_U2:
case MONO_TYPE_CHAR:
case MONO_TYPE_I4: case MONO_TYPE_I4:
case MONO_TYPE_U4: case MONO_TYPE_U4:
case MONO_TYPE_I: case MONO_TYPE_I:
Expand All @@ -170,6 +173,14 @@ mono_create_trampoline (MonoMethod *method)
x86_fst_membase (p, X86_ESP, 0, TRUE, TRUE); x86_fst_membase (p, X86_ESP, 0, TRUE, TRUE);
break; break;
case MONO_TYPE_STRING: case MONO_TYPE_STRING:
/*
* If it is an internalcall we assume it's the object we want.
* Yet another reason why MONO_TYPE_STRING should not be used to indicate char*.
*/
if (method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) {
x86_push_membase (p, X86_EDX, arg_pos);
break;
}
/*if (frame->method->flags & PINVOKE_ATTRIBUTE_CHAR_SET_ANSI*/ /*if (frame->method->flags & PINVOKE_ATTRIBUTE_CHAR_SET_ANSI*/
x86_push_membase (p, X86_EDX, arg_pos); x86_push_membase (p, X86_EDX, arg_pos);
x86_mov_reg_imm (p, X86_EDX, mono_get_ansi_string); x86_mov_reg_imm (p, X86_EDX, mono_get_ansi_string);
Expand All @@ -190,8 +201,6 @@ mono_create_trampoline (MonoMethod *method)
x86_push_membase (p, X86_EDX, arg_pos + 4); x86_push_membase (p, X86_EDX, arg_pos + 4);
x86_push_membase (p, X86_EDX, arg_pos); x86_push_membase (p, X86_EDX, arg_pos);
break; break;
case MONO_TYPE_BOOLEAN:
case MONO_TYPE_CHAR:
default: default:
g_error ("Can't trampoline 0x%x", sig->params [i - 1]->type); g_error ("Can't trampoline 0x%x", sig->params [i - 1]->type);
} }
Expand Down Expand Up @@ -256,11 +265,13 @@ mono_create_trampoline (MonoMethod *method)
/* /*
* free the allocated strings. * free the allocated strings.
*/ */
if (local_size) if (!(method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL)) {
x86_mov_reg_imm (p, X86_EDX, g_free); if (local_size)
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); for (i = 1; i <= local_size; ++i) {
x86_call_reg (p, X86_EDX); x86_push_membase (p, X86_EBP, LOC_POS * i);
x86_call_reg (p, X86_EDX);
}
} }
/* /*
* Standard epilog. * Standard epilog.
Expand Down
16 changes: 16 additions & 0 deletions mono/interpreter/ChangeLog
Original file line number Original file line Diff line number Diff line change
@@ -1,3 +1,19 @@

Mon Sep 24 18:50:25 CEST 2001 Paolo Molaro <lupus@ximian.com>

* interp.c: catch a few more error conditions with exceptions instead of
erroring out.
Don't use g_print() in stack traces because it doesn't work with
some float values.
When we call an instance method of a valuetype class, unbox the 'this'
argument if it is an object.
Use mono_ldstr () to implement the ldstr opcode: it takes care of
interning the string if necessary.
Implemented new opcodes: ckfinite, cgt.un, clt.un, ldvirtftn, ldarga.
Fixes to handle NaNs when comparing doubles.
Make sure the loaded assembly has an entry point defined.
Fixed portability bugs in neg and not opcodes.

2001-09-24 Dietmar Maurer <dietmar@ximian.com> 2001-09-24 Dietmar Maurer <dietmar@ximian.com>


* interp.c (ves_exec_method): LDC_I4: 8bit constants are signed * interp.c (ves_exec_method): LDC_I4: 8bit constants are signed
Expand Down
Loading

0 comments on commit 78550fa

Please sign in to comment.