Exception handling for the C backend used setjmp()/longjmp()
unconditionally. However, on POSIX systems, these functions save and
restore the signal mask, adding considerable overhead to exception
handling, even where no exceptions are involved. The compiler and
library now try to use either _setjmp()/_longjmp() or
sigsetjmp()/siglongjmp() where possible, marked by the defines
"nimRawSetjmp" and "nimSigSetjmp", respectively. The define
"nimStdSetjmp" can be used to revert to setjmp()/longjmp() instead.
Because PreMain() was now called before the new stack bottom
initialization, it still relied on the old version of initStackBottom(),
which may not handle the top few words of the stack correctly. This
patch also sets the stack bottom in PreMain() using the new approach.
This patch inserts an extra stack frame above the function that
calls the actual Nimrod code and ensures that a reference to this
frame is stored as the stack bottom.
The code incorrectly used relative instead of absolute paths to
see if *.babel files could be found, which could result in them
not being located properly.
Also added an underscore between the package and the module name
for package_moduleInit() and package_moduleDatInit() so that there
won't be spurious conflicts, e.g. for package A and module BC vs.
package AB and module C.
tyIter(T) represents an "iteration yielding values of type T"
I'm planning to use that in the context of the `is` operator
supporting predicates such as `C.items is iterator` and also
in the upcoming support for higher-order inline iterators.
The rationale here is that it has become too hard to step into a program
when #line directives are enabled. You have to skip over many lines of init
code that doesn't have corresponding lines in the nimrod program.
Now, you can just step-out of PreMain and go straight to the useful code
in NimMain.