[Mono-bugs] [Bug 51096][Nor] Changed - hello world in Mercury produces no ouput

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 5 Dec 2003 11:59:10 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by lupus@ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=51096

--- shadow/51096	2003-12-04 14:42:47.000000000 -0500
+++ shadow/51096.tmp.22345	2003-12-05 11:59:09.000000000 -0500
@@ -58,6 +58,31 @@
 mono -v -v -v --compile mercury.io.mercury_code:.cctor io.dll
 
 Another problem is that the generated code calls class_init_trampoline
 dozens of times, when only the first call is neccesary.
 
 
+
+------- Additional Comments From lupus@ximian.com  2003-12-05 11:59 -------
+Running mono -v -v -v --compile mercury.io.mercury_code:.cctor io.dll
+I get a segv because the assembly name is NULL add_assemblies_to_domain().
+Anyway, since I guess the issue is only reproducible on windows the
+issue is more likely related not to a stack overflow per se, but to
+the need to touch each allocated stack page in windows. This is not
+usually an issue since stack frames are small, but any stack frame
+bigger than 4K can trigger it. The code to fix is in emit_prolog in
+mini-x86.c and the code to fix it can be taken from jit/x86.brg
+(mono_emit_stack_alloc_const): is should be used in place of the
+simple esp decrement, but only enabled when running on windows.
+As for the class_init issue, we should fix it with something like the
+following:
+create a new opcode called OP_CLASSINIT and emit that instead of
+a direct call to the trampoline. The opcode keeps a reference to the
+MonoClass or MonoVtable for the class to init. The class is also added
+to a list in the basic block if it's not already there (actually, we
+can omit the emission if we find it already there).
+OP_CLASSINIT is subtituted with the call later on, just like
+CEE_NEWARR is handled.
+This simple change likely removes most of the duplicate calls.
+Extra bonus points: after the dominator tree is created, we can
+eliminate all the OP_CLASSINIT instructions for each klass that has
+already the call in one of its parent nodes.