bb4c29d849128917d10c5b7bed415a9f31d98492
[ghc-hetmet.git] / ghc / compiler / ilxGen / Entry.ilx
1 .assembly test { }
2 // ENTRYPOINT
3 .class MainMain { 
4    .method public static void Main(class [mscorlib]System.String[]) {
5        .entrypoint
6            ldstr "LOG: loading main value\n"   call void [mscorlib]System.Console::WriteLine(class [mscorlib]System.String)
7       ldsfld (func (unit) --> class [ilx std]'()') class Main::'Main_main'
8
9            ldstr "LOG: evaluating main value\n"
10            call void [mscorlib]System.Console::WriteLine(class [mscorlib]System.String) 
11       callfunc () --> (func (unit) --> class [ilx std]PrelBase_Z0T)
12            ldstr "LOG: calling main value\n"
13            call void [mscorlib]System.Console::WriteLine(class [mscorlib]System.String) 
14       ldunit
15       callfunc (void) --> class [ilx std]PrelBase_Z0T
16
17       pop
18
19
20 // HACK HACK HACK
21 // Call the "finalizers" for stdin, stdout and stderr, because COM+ doesn't 
22 // guarantee that finalizers will be run. WE DON'T GUARANTEE TO RUN ANY
23 // OTHER FINALIZERS...
24
25       ldstr "LOG: calling critical finalizers manually in main()\n"
26            call void [mscorlib]System.Console::WriteLine(class [mscorlib]System.String)
27
28 ldsfld (func (thunk<class [ilx std]PrelIOBase_MVar<class [ilx std]PrelIOBase_Handle__>>) --> (func (unit) --> class [ilx std]PrelBase_Z0T))  [ilx std]'PrelHandle'::'PrelHandle_stdHandleFinalizzer'
29 ldsfld thunk<class [ilx std]PrelIOBase_MVar<class [ilx std]PrelIOBase_Handle__>>  [ilx std]'PrelHandle'::'PrelHandle_stdin'
30       callfunc (thunk<class [ilx std]PrelIOBase_MVar<class [ilx std]PrelIOBase_Handle__>>) --> (func (unit) -->  class [ilx std]PrelBase_Z0T)
31       callfunc () --> (func (unit) --> class [ilx std]PrelBase_Z0T)
32       ldunit
33       callfunc (void) --> class [ilx std]PrelBase_Z0T
34       pop
35
36 ldsfld (func (thunk<class [ilx std]PrelIOBase_MVar<class [ilx std]PrelIOBase_Handle__>>) --> (func (unit) --> class [ilx std]PrelBase_Z0T))  [ilx std]'PrelHandle'::'PrelHandle_stdHandleFinalizzer'
37 ldsfld thunk<class [ilx std]PrelIOBase_MVar<class [ilx std]PrelIOBase_Handle__>>  [ilx std]'PrelHandle'::'PrelHandle_stdout'
38       callfunc (thunk<class [ilx std]PrelIOBase_MVar<class [ilx std]PrelIOBase_Handle__>>) --> (func (unit) -->  class [ilx std]PrelBase_Z0T)
39       callfunc () --> (func (unit) --> class [ilx std]PrelBase_Z0T)
40       ldunit
41       callfunc (void) --> class [ilx std]PrelBase_Z0T
42       pop
43
44 ldsfld (func (thunk<class [ilx std]PrelIOBase_MVar<class [ilx std]PrelIOBase_Handle__>>) --> (func (unit) --> class [ilx std]PrelBase_Z0T))  [ilx std]'PrelHandle'::'PrelHandle_stdHandleFinalizzer'
45 ldsfld thunk<class [ilx std]PrelIOBase_MVar<class [ilx std]PrelIOBase_Handle__>>  [ilx std]'PrelHandle'::'PrelHandle_stderr'
46       callfunc (thunk<class [ilx std]PrelIOBase_MVar<class [ilx std]PrelIOBase_Handle__>>) --> (func (unit) -->  class [ilx std]PrelBase_Z0T)
47       callfunc () --> (func (unit) --> class [ilx std]PrelBase_Z0T)
48       ldunit
49       callfunc (void) --> class [ilx std]PrelBase_Z0T
50       pop
51
52       ldstr "LOG: exit main()\n"
53            call void [mscorlib]System.Console::WriteLine(class [mscorlib]System.String)
54       ret
55    }
56 }
57