- 22 Aug, 2003 1 commit
-
-
sof authored
setupRtsFlags(): don't overwrite argv[0] with its basename: - argv[] may not point to writeable memory - System.Environment.getProgName strips off the 'dirname' portion anyway. - Not possible to get at the untransformed argv[0] from Haskell code, should such a need arise. Uses of prog_argv[0] within the RTS has now been replaced with prog_name, which is the basename of prog_argv[0].
-
- 22 Jul, 2003 1 commit
-
-
simonmar authored
Oops, move include of stdlib.h after MachRegs.h, so that it comes after register variable declarations.
-
- 21 Jul, 2003 1 commit
-
-
simonmar authored
We use NULL in the headers (at least when -prof is on), so we better #include <stdlib.h>. We normally get it via HsBase.h anyway, but we shouldn't rely on that.
-
- 29 May, 2003 1 commit
-
-
sof authored
Support for interop'ing with .NET via FFI declarations along the lines of what Hugs98.NET offers, see http://haskell.org/pipermail/cvs-hugs/2003-March/001723.html for FFI decl details. To enable, configure with --enable-dotnet + have a look in ghc/rts/dotnet/Makefile for details of what tools are needed to build the .NET interop layer (tools from VS.NET / Framework SDK.) The commit doesn't include some library additions + wider-scale testing is required before this extension can be regarded as available for general use. 'foreign import dotnet' is currently only supported by the C backend.
-
- 23 May, 2003 1 commit
-
-
simonmar authored
Remove ancient vestiges of StgHugs: the COMPILER #define.
-
- 11 Dec, 2002 1 commit
-
-
simonmar authored
Merge the eval-apply-branch on to the HEAD ------------------------------------------ This is a change to GHC's evaluation model in order to ultimately make GHC more portable and to reduce complexity in some areas. At some point we'll update the commentary to describe the new state of the RTS. Pending that, the highlights of this change are: - No more Su. The Su register is gone, update frames are one word smaller. - Slow-entry points and arg checks are gone. Unknown function calls are handled by automatically-generated RTS entry points (AutoApply.hc, generated by the program in utils/genapply). - The stack layout is stricter: there are no "pending arguments" on the stack any more, the stack is always strictly a sequence of stack frames. This means that there's no need for LOOKS_LIKE_GHC_INFO() or LOOKS_LIKE_STATIC_CLOSURE() any more, and GHC doesn't need to know how to find the boundary between the text and data segments (BIG WIN!). - A couple of nasty hacks in the mangler caused by the neet to identify closure ptrs vs. info tables have gone away. - Info tables are a bit more complicated. See InfoTables.h for the details. - As a side effect, GHCi can now deal with polymorphic seq. Some bugs in GHCi which affected primitives and unboxed tuples are now fixed. - Binary sizes are reduced by about 7% on x86. Performance is roughly similar, some programs get faster while some get slower. I've seen GHCi perform worse on some examples, but haven't investigated further yet (GHCi performance *should* be about the same or better in theory). - Internally the code generator is rather better organised. I've moved info-table generation from the NCG into the main codeGen where it is shared with the C back-end; info tables are now emitted as arrays of words in both back-ends. The NCG is one step closer to being able to support profiling. This has all been fairly thoroughly tested, but no doubt I've messed up the commit in some way.
-
- 06 Sep, 2002 1 commit
-
-
simonmar authored
Partial rewrite of the POSIX library. The main purpose of this sweep is to remove the last dependencies of the compiler on hslibs. When I've committed the associated compiler changes, only the 'base' package will be required to bootstrap the compiler. Additionally to build GHCi, the 'readline' and 'unix' packages will be required. The new POSIX library lives mostly in libraries/unix, with a few bits required for compiler bootstrapping in libraries/base. The 'base' package is mostly free of hsc2hs code to make bootstrapping from HC files easier, but the 'unix' package will use hsc2hs liberally. The old POSIX library continues to provide more-or-less the same interface as before, although some of the types are more correct now (previously lots of POSIX types were just mapped to Int). The new interface is largely the same as the old, except that some new functionality from the latest POSIX spec has been added (eg. symbolic links). So far, the new POSIX library has signal support, directory/file operations and lots of stuff from unistd.h. The module names are: System.Posix The main dude, exports everything System.Posix.Types All the POSIX types, using the same naming scheme as Foreign.C.Types, Eg. CUid, COff, etc. Many of these types were previously exported by GHC.Posix. Additionally exports the "nicer" names used by the old POSIX library for compatibility (eg. ProcessID == CPid, FileMode == CMode, etc.) All reasonable instances are derived for these types. System.Posix.Signals Signal support, contains most of which was in PosixProcPrim before. The RTS interface to the signal handling support has been rationalised slightly. System.Posix.Directory Directory support, most were in PosixFiles before. System.Posix.Files File operations, most were in PosixFiles before. System.Posix.Unistd (for want of a better name) Miscellaneous bits that mostly come from the unistd.h header file. PosixProcEnv before. The rest of the library should pan out like so: System.Posix.IO System.Posix.Error (maybe) System.Posix.Process System.Posix.Terminal (I've no doubt broken Win32 support, but I'm checking the build at the moment).
-
- 22 Jul, 2002 1 commit
-
-
simonmar authored
Add a comment to note that Stg.h must be included before system headers (this was always the case, but is now more important because it is often necessary to #include system headers where it wasn't previously).
-
- 17 Jul, 2002 1 commit
-
-
simonmar authored
Remove most #includes of system headers from Stg.h, and instead #include any required headers directly in each RTS source file. The idea is to (a) reduce namespace pollution from system headers that we don't need, (c) be clearer about dependencies on system things in the RTS, and (c) improve via-C compilation times (maybe). In practice though, HsBase.h #includes everything anyway, so the difference from the point of view of .hc source is minimal. However, this makes it easier to move to zero-includes if we wanted to (see discussion on the FFI list; I'm still not sure that's possible but at least this is a step in the right direction).
-
- 03 Jun, 2002 1 commit
-
-
matthewc authored
Initial mangling and tailcalls support for IA64. Function prologues and epilogues are deleted and we use a single register stack frame throughout (with a little register renaming in the mangler...) Dropthrough from fast to slow entry point is also implemented. Tailcalls are marked and converted into jumps at mangle time.
-
- 13 Feb, 2002 1 commit
-
-
sof authored
moved defn of RTS_SUPPORTS_THREADS from Rts.h to Stg.h
-
- 06 Dec, 2001 1 commit
-
-
sewardj authored
Remove mention of PrimOpHelpers.h.
-
- 05 Dec, 2001 1 commit
-
-
sewardj authored
-------------------------------------------- Translate out PrimOps at the AbstractC level -------------------------------------------- This is the first in what might be a series of changes intended to make GHC less dependent on its C back end. The main change is to translate PrimOps into vanilla abstract C inside the compiler, rather than having to duplicate that work in each code generation route. The main changes are: * A new type, MachOp, in compiler/absCSyn/MachOp.hs. A MachOp is a primitive operation which we can reasonably expect the native code generators to implement. The set is quite small and unlikely to change much, if at all. * Translations from PrimOps to MachOps, at the end of absCSyn/AbsCUtils. This should perhaps be moved to a different module, but it is hard to see how to do this without creating a circular dep between it and AbsCUtils. * The x86 insn selector has been updated to track these changes. The sparc insn selector remains to be done. As a result of this, it is possible to compile much more code via the NCG than before. Almost all the Prelude can be compiled with it. Currently it does not know how to do 64-bit code generation. Once this is fixed, the entire Prelude should be compilable that way. I also took the opportunity to clean up the NCG infrastructure. The old Stix data type has been split into StixStmt (statements) and StixExpr (now denoting values only). This removes a class of impossible constructions and clarifies the NCG. Still to do, in no particular order: * String and literal lifting, currently done in the NCG at the top of nativeGen/MachCode, should be done in the AbstractC flattener, for the benefit of all targets. * Further cleaning up of Stix assignments. * Remove word-size dependency from Abstract C. (should be easy). * Translate out MagicIds in the AbsC -> Stix translation, not in the Stix constant folder. (!) Testsuite failures caused by this: * memo001 - fails (segfaults) for some unknown reason now. * arith003 - wrong answer in gcdInt boundary cases. * arith011 - wrong answer for shifts >= word size. * cg044 - wrong answer for some FP boundary cases. These should be fixed, but I don't think they are mission-critical for anyone.
-
- 26 Nov, 2001 1 commit
-
-
simonmar authored
Profiling cleanup. This commit eliminates some duplication in the various heap profiling subsystems, and generally centralises much of the machinery. The key concept is the separation of a heap *census* (which is now done in one place only instead of three) from the calculation of retainer sets. Previously the retainer profiling code also did a heap census on the fly, and lag-drag-void profiling had its own census machinery. Value-adds: - you can now restrict a heap profile to certain retainer sets, but still display by cost centre (or type, or closure or whatever). - I've added an option to restrict the maximum retainer set size (+RTS -R<size>, defaulting to 8). - I've cleaned up the heap profiling options at the request of Simon PJ. See the help text for details. The new scheme is backwards compatible with the old. - I've removed some odd bits of LDV or retainer profiling-specific code from various parts of the system. - the time taken doing heap censuses (and retainer set calculation) is now accurately reported by the RTS when you say +RTS -Sstderr. Still to come: - restricting a profile to a particular biography (lag/drag/void/use). This requires keeping old heap censuses around, but the infrastructure is now in place to do this.
-
- 25 Nov, 2001 1 commit
-
-
sof authored
extend the scope of the doNothing() macro; can now be used in Stg headers
-
- 22 Nov, 2001 1 commit
-
-
simonmar authored
Retainer Profiling / Lag-drag-void profiling. This is mostly work by Sungwoo Park, who spent a summer internship at MSR Cambridge this year implementing these two types of heap profiling in GHC. Relative to Sungwoo's original work, I've made some improvements to the code: - it's now possible to apply constraints to retainer and LDV profiles in the same way as we do for other types of heap profile (eg. +RTS -hc{foo,bar} -hR -RTS gives you a retainer profiling considering only closures with cost centres 'foo' and 'bar'). - the heap-profile timer implementation is cleaned up. - heap profiling no longer has to be run in a two-space heap. - general cleanup of the code and application of the SDM C coding style guidelines. Profiling will be a little slower and require more space than before, mainly because closures have an extra header word to support either retainer profiling or LDV profiling (you can't do both at the same time). We've used the new profiling tools on GHC itself, with moderate success. Fixes for some space leaks in GHC to follow...
-
- 27 Oct, 2001 1 commit
-
-
sof authored
Move extern declaration for 'environ' from Stg.h into HsPosix.h
-
- 29 Aug, 2001 1 commit
-
-
qrczak authored
Remove annoying warnings about using a deprecated extension when compiling via gcc-3.0. #if __GNUC__ >= 3 /* Assume that a flexible array member at the end of a struct * can be defined thus: T arr[]; */ #define FLEXIBLE_ARRAY #else /* Assume that it must be defined thus: T arr[0]; */ #define FLEXIBLE_ARRAY 0 #endif A test program (hsking) compiled fine with gcc-3.0!
-
- 14 Aug, 2001 1 commit
-
-
sewardj authored
Change the story about POSIX headers in C compilation. Until now, all C code in the RTS and library cbits has by default been compiled with settings for POSIXness enabled, that is: #define _POSIX_SOURCE 1 #define _POSIX_C_SOURCE 199309L #define _ISOC9X_SOURCE If you wanted to negate this, you'd have to define NON_POSIX_SOURCE before including headers. This scheme has some bad effects: * It means that ccall-unfoldings exported via interfaces from a module compiled with -DNON_POSIX_SOURCE may not compile when imported into a module which does not -DNON_POSIX_SOURCE. * It overlaps with the feature tests we do with autoconf. * It seems to have caused borkage in the Solaris builds for some considerable period of time. The New Way is: * The default changes to not-being-in-Posix mode. * If you want to force a C file into Posix mode, #include as the **first** include the new file ghc/includes/PosixSource.h. Most of the RTS C sources have this include now. * NON_POSIX_SOURCE is almost totally expunged. Unfortunately we have to retain some vestiges of it in ghc/compiler so that modules compiled via C on Solaris using older compilers don't break.
-
- 01 Mar, 2001 1 commit
-
-
rrt authored
Apply stat fix for mingw. It's ugly, it's implausible, but it seems to work. Unlike Cygwin...(missing no. 3).
-
- 09 Feb, 2001 1 commit
-
-
simonmar authored
Remove all vestiges of INTERPRETER and __HUGS__.
-
- 04 Dec, 2000 1 commit
-
-
simonmar authored
merge recent changes from before-ghci-branch onto the HEAD
-
- 07 Nov, 2000 1 commit
-
-
simonmar authored
Clean ups: - reduce the namespace pollution of StgTypes.h, it doesn't define the shorthand versions any more (W_, I_ etc.). These are moved into Stg.h. StgTypes.h also defines StgClosure as an "opaque" struct. - RtsAPI.h is now standalone, and includes HsFFI.h and thereby config.h & StgTypes.h. Now we don't need to #include "Stg.h" in *_stub.c. - all the rts_mkXXXX and rts_getXXXX functions are defined in terms of the HsXXXX types rather than random C types (this fixes some potential bugs in our foreign export support). - added HsWord type, to match StgWord. The Haskell version of this type isn't "documented", but perhaps it should be.
-
- 27 May, 2000 1 commit
-
-
panne authored
Bug or feature? Changed `envyron' back to `environ', otherwise hslibs/posix/cbits/env.c can't be compiled. If this breaks something on M$, it must be #ifdef-ed somehow, but not simply be renamed.
-
- 26 May, 2000 1 commit
-
-
sewardj authored
Changes to allow Hugs to be built with mingw32, not cygwin. Also, updates so that DietHEP works properly for mingw32. Most changes are trivial (assert --> ASSERT), etc. For hugs, have deleted queries about the width of a terminal window, and so the printing of dots as progress indicators is gone too. No great loss. Zapped various other out-of-date platform-specific junk in machdep.c.
-
- 18 May, 2000 1 commit
-
-
panne authored
Make stackOverflow prototype available Haskell compilation
-
- 14 Apr, 2000 3 commits
-
-
sewardj authored
Change NO_MACHREGS back to NO_REGS -- I misunderstood the problem.
-
simonmar authored
back off from _POSIX_C_SOURCE=199506L to 199309L, because the former causes a bunch of extra functions thread-related to be compiled into each module on Solaris.
-
simonmar authored
#define _POSIX_C_SOURCE 199506L #define _ISOC9X_SOURCE
-
- 13 Apr, 2000 1 commit
-
-
sewardj authored
Changed NO_REGS to NO_MACHREGS to avoid inexplicable gcc warnings when building the rts for Hugs.
-
- 03 Apr, 2000 1 commit
-
-
simonmar authored
misc profiling cleanups
-
- 14 Mar, 2000 1 commit
-
-
sof authored
Simplified prog_* externs a little
-
- 13 Mar, 2000 1 commit
-
-
simonmar authored
Move Prelude.h from ghc/includes into ghc/rts. It's essentially a list of the things from the Prelude that the RTS depends on, and isn't relevant to STG code. Furthermore, this helps to clarify which parts of the RTS depend on things from the Prelude (by an explicity #include).
-
- 13 Jan, 2000 1 commit
-
-
hwloidl authored
Merged GUM-4-04 branch into the main trunk. In particular merged GUM and SMP code. Most of the GranSim code in GUM-4-04 still has to be carried over.
-
- 09 Nov, 1999 2 commits
-
-
simonmar authored
Fix up some problems with the IN_STG_CODE macro.
-
simonmar authored
A slew of SMP-related changes. - New locking scheme for thunks: we now check whether the thunk being entered is in our private allocation area, and if so we don't lock it. Well, that's the upshot. In practice it's a lot more fiddly than that. - I/O blocking is handled a bit more sanely now (but still not properly, methinks) - deadlock detection is back - remove old pre-SMP scheduler code - revamp the timing code. We actually get reasonable-looking timing info for SMP programs now. - fix a bug in the garbage collector to do with IND_OLDGENs appearing on the mutable list of the old generation. - move BDescr() function from rts/BlockAlloc.h to includes/Block.h. - move struct generation and struct step into includes/StgStorage.h (sigh) - add UPD_IND_NOLOCK for updating with an indirection where locking the black hole is not required.
-
- 05 Nov, 1999 1 commit
-
-
simonmar authored
_ccall_GC wibbles
-
- 02 Nov, 1999 1 commit
-
-
simonmar authored
This commit adds in the current state of our SMP support. Notably, this allows the new way 's' to be built, providing support for running multiple Haskell threads simultaneously on top of any pthreads implementation, the idea being to take advantage of commodity SMP boxes. Don't expect to get much of a speedup yet; due to the excessive locking required to synchronise access to mutable heap objects, you'll see a slowdown in most cases, even on a UP machine. The best I've seen is a 1.6-1.7 speedup on an example that did no locking (two optimised nfibs in parallel). - new RTS -N flag specifies how many pthreads to start. - new driver -smp flag, tells the driver to use way 's'. - new compiler -fsmp option (not for user comsumption) tells the compiler not to generate direct jumps to thunk entry code. - largely rewritten scheduler - _ccall_GC is now done by handing back a "token" to the RTS before executing the ccall; it should now be possible to execute blocking ccalls in the current thread while allowing the RTS to continue running Haskell threads as normal. - you can only call thread-safe C libraries from a way 's' build, of course. Pthread support is still incomplete, and weird things (including deadlocks) are likely to happen.
-
- 06 Jul, 1999 2 commits