- Dec 04, 2013
-
-
parcs authored
We now do the allocation of the blackhole indirection closure inside the RTS procedure 'newCAF' instead of generating the allocation code inline in the closure body of each CAF. This slightly decreases code size in modules with a lot of CAFs. As a result of this change, for example, the size of DynFlags.o drops by ~60KB and HsExpr.o by ~100KB.
-
parcs authored
-
- Nov 22, 2013
-
-
Arash Rouhani authored
See #8552 Signed-off-by:
Arash Rouhani <rarash@student.chalmers.se> Reviewed-by:
Austin Seipp <austin@well-typed.com>
-
Austin Seipp authored
This adds code for jumping to given addresses for ARM, written by Ben Gamari. However, when allocating new infotables for bytecode (which is where this jump code occurs), we need to be sure to flush the cache on the execute pointer returned from allocateExec() - on systems like ARM, the processor won't reliably read back code or automatically cache flush, where x86 will. So we add a new flushExec primitive to call out to GCC's __builtin___clear_cache primitive, which will properly generate the correct code (nothing on x86, and a call to libgcc's __clear_cache on ARM) and make sure we use it after writing the code out. Authored-by:
Ben Gamari <bgamari.foss@gmail.com> Authored-by:
Austin Seipp <austin@well-typed.com> Signed-off-by:
Austin Seipp <austin@well-typed.com>
-
Gabor Greif authored
-
- Nov 21, 2013
-
-
Simon Marlow authored
This creates a new C API: initLinker_ (int retain_cafs) The old initLinker() was left as-is for backwards compatibility. See documentation in Linker.h.
-
Simon Marlow authored
This resurrects some old code and makes it work again. The idea is that we want to get an error message if we ever enter a CAF that has been GC'd, rather than following its indirection which will likely cause a segfault. Without this patch, these bugs are hard to track down in gdb, because the IND_STATIC code overwrites R1 (the pointer to the CAF) with its indirectee before jumping into bad memory, so we've lost the address of the CAF that got GC'd. Some associated refactoring while I was here.
-
- Nov 14, 2013
-
-
Duncan Coutts authored
This is the RTS part of a patch to base's topHandler to handle exiting by a signal. The intended behaviour is that on Unix, throwing ExitFailure (-sig) results in the process terminating with that signal. Previously shutdownHaskellAndSignal was only used for exiting with SIGINT due to the UserInterrupt exception. Improve shutdownHaskellAndSignal to do the signal part more carefully. In particular, it (should) now reliably terminates the process one way or another. Previusly if the signal was blocked, ignored or handled then shutdownHaskellAndSignal would actually return! Also, the topHandler code has two paths a careful shutdown and a "fast exit" where it does not give finalisers a chance to run. We want to support that mode also when we want to exit by signal. So rather than the base code directly calling stg_exit as it did before, we have a fastExit bool paramater for both shutdownHaskellAnd{Exit,Signal}.
-
- Oct 25, 2013
-
-
takano-akio authored
Signed-off-by:
Austin Seipp <austin@well-typed.com>
-
Austin Seipp authored
Once again the whitespace rules (and the rules concerning expansion of tokens) have bitten us. Authored-by:
Authored-by: Luke Iannini <lukexi@me.com> Signed-off-by:
Austin Seipp <austin@well-typed.com>
-
Ben Gamari authored
This requires that stackOverflow() in RtsUtils.c be passed a reference to the current TSO. This requires a small change in libraries/base.
-
Simon Marlow authored
The particular problematic code in #7762 was this: nat newSize = size - n; char *freeAddr = MBLOCK_ROUND_DOWN(bd->start); freeAddr += newSize * MBLOCK_SIZE; ^^^^^^^^^^^^^^^^^^^^^^ OVERFLOW!!! For good measure, I'm going to fix the bug twice. This patch fixes the class of bugs of this kind, by making sure that any expressions involving BLOCK_SIZE or MBLOCK_SIZE are promoted to unsigned long. In a separate patch, I'll fix a bunch of individual instances (including the one above).
-
Simon Marlow authored
Also refactor the #defines to hopefully make it clearer what's going on.
-
- Oct 12, 2013
-
-
Darin Morrison authored
Signed-off-by:
Austin Seipp <austin@well-typed.com>
-
- Oct 11, 2013
-
-
Simon Marlow authored
-
Simon Marlow authored
-
- Oct 01, 2013
-
-
Simon Marlow authored
-
Simon Marlow authored
We were passing the function address to stg_gc_prim_p in R9, which was wrong because the call was a high-level call and didn't declare R9 as a parameter. Passing R9 as an argument is the right way, but unfortunately that exposed another bug: we were using the same macro in some low-level Cmm, where it is illegal to call functions with arguments (see Note [syntax of cmm files]). So we now have low-level variants of STK_CHK() and STK_CHK_P() for use in low-level Cmm code.
-
- Sep 23, 2013
-
-
parcs authored
*p is both read and written to by the cmpxchg instruction, and therefore should be given the '+' constraint modifier. (In GCC's extended ASM language, '+' means that the operand is both read and written to whereas '=' means that it is only written to.) Otherwise, the compiler is allowed to rewrite something like SpinLock lock; initSpinLock(&lock); /* sets lock = 1 */ ACQUIRE_SPIN_LOCK(&lock); into SpinLock lock; ACQUIRE_SPIN_LOCK(&lock); because according to the asm statement, the previous value of 'lock' is not important.
-
Simon Marlow authored
See also #5435. Now we have to remember the the StablePtrs that get created by the module initializer so that we can free them again in unloadObj().
-
Geoffrey Mainland authored
-
Geoffrey Mainland authored
-
Geoffrey Mainland authored
-
Geoffrey Mainland authored
-
Geoffrey Mainland authored
Note that this will only work with the LLVM back end pending LLVM patches to change the GHC calling convention appropriately.
-
Geoffrey Mainland authored
-
- Sep 16, 2013
-
-
Edward Z. Yang authored
Signed-off-by:
Edward Z. Yang <ezyang@mit.edu>
-
- Sep 15, 2013
-
-
Austin Seipp authored
Authored-by:
Stephen Blackheath <...@blacksapphire.com> Signed-off-by:
Austin Seipp <austin@well-typed.com>
-
- Sep 08, 2013
-
-
Austin Seipp authored
This reverts commit d85044f6.
-
Austin Seipp authored
When servicing a stack overflows, only throw an exception to the given thread if the user explicitly set a max stack size, using +RTS -K. Otherwise just service it normally and grow the stack. In case we actually run out of *heap* (stack chuncks are allocated on the heap), then we need to bail by calling the stackOverflow() hook and exit immediately. Authored-by:
Ben Gamari <bgamari.foss@gmail.com> Signed-off-by:
Austin Seipp <aseipp@pobox.com>
-
- Sep 04, 2013
-
-
Simon Marlow authored
-
- Aug 21, 2013
- Aug 06, 2013
-
-
Geoffrey Mainland authored
We were using SSE is some places and XMM in others. Better to keep a consistent naming scheme.
-
- Jul 16, 2013
-
-
nfrisby authored
-
- Jul 13, 2013
-
-
Edward Z. Yang authored
Signed-off-by:
Edward Z. Yang <ezyang@mit.edu>
-
- Jul 10, 2013
-
-
Edward Z. Yang authored
Signed-off-by:
Edward Z. Yang <ezyang@mit.edu>
-