1. 28 Dec, 2003 1 commit
  2. 14 Nov, 2003 2 commits
  3. 12 Nov, 2003 1 commit
    • sof's avatar
      [project @ 2003-11-12 17:27:00 by sof] · a814590c
      sof authored
      Tidy up a couple of unportable coding issues:
      
      - conditionally use empty structs.
      - use GNU attributes only if supported.
      - 'long long' usage
      - use of 'inline' in declarations and definitions.
      
      Upshot of these changes is that MSVC is now capable of compiling
      the non-.hc portions of the RTS.
      a814590c
  4. 21 Sep, 2003 1 commit
  5. 22 Aug, 2003 1 commit
    • sof's avatar
      [project @ 2003-08-22 22:24:12 by sof] · cffcb52b
      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].
      cffcb52b
  6. 22 Jul, 2003 1 commit
  7. 21 Jul, 2003 1 commit
    • simonmar's avatar
      [project @ 2003-07-21 15:05:54 by simonmar] · 665b340a
      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.
      665b340a
  8. 29 May, 2003 1 commit
    • sof's avatar
      [project @ 2003-05-29 14:39:26 by sof] · a7d8f437
      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.
      a7d8f437
  9. 23 May, 2003 1 commit
  10. 11 Dec, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-12-11 15:36:20 by simonmar] · 0bffc410
      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.
      0bffc410
  11. 06 Sep, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-09-06 14:34:13 by simonmar] · 77186ef4
      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).
      77186ef4
  12. 22 Jul, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-07-22 10:02:13 by simonmar] · ef834071
      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).
      ef834071
  13. 17 Jul, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-07-17 09:21:48 by simonmar] · 7457757f
      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).
      7457757f
  14. 03 Jun, 2002 1 commit
    • matthewc's avatar
      [project @ 2002-06-03 13:08:37 by matthewc] · cb5ccf0a
      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.
      cb5ccf0a
  15. 13 Feb, 2002 1 commit
  16. 06 Dec, 2001 1 commit
  17. 05 Dec, 2001 1 commit
    • sewardj's avatar
      [project @ 2001-12-05 17:35:12 by sewardj] · d11e681f
      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.
      d11e681f
  18. 26 Nov, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-11-26 16:54:21 by simonmar] · dbef766c
      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.
      dbef766c
  19. 25 Nov, 2001 1 commit
  20. 22 Nov, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-11-22 14:25:11 by simonmar] · db61851c
      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...
      db61851c
  21. 27 Oct, 2001 1 commit
  22. 29 Aug, 2001 1 commit
    • qrczak's avatar
      [project @ 2001-08-29 17:24:25 by qrczak] · aa84d93a
      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!
      aa84d93a
  23. 14 Aug, 2001 1 commit
    • sewardj's avatar
      [project @ 2001-08-14 13:40:07 by sewardj] · bc5c8021
      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.
      bc5c8021
  24. 01 Mar, 2001 1 commit
  25. 09 Feb, 2001 1 commit
  26. 04 Dec, 2000 1 commit
  27. 07 Nov, 2000 1 commit
    • simonmar's avatar
      [project @ 2000-11-07 17:05:47 by simonmar] · 2de8104d
      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.
      2de8104d
  28. 27 May, 2000 1 commit
    • panne's avatar
      [project @ 2000-05-27 14:28:06 by panne] · 3ea8a46c
      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.
      3ea8a46c
  29. 26 May, 2000 1 commit
    • sewardj's avatar
      [project @ 2000-05-26 10:14:33 by sewardj] · fda822c6
      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.
      fda822c6
  30. 18 May, 2000 1 commit
  31. 14 Apr, 2000 3 commits
  32. 13 Apr, 2000 1 commit
  33. 03 Apr, 2000 1 commit
  34. 14 Mar, 2000 1 commit
  35. 13 Mar, 2000 1 commit
    • simonmar's avatar
      [project @ 2000-03-13 10:53:55 by simonmar] · 0d5d32bf
      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).
      0d5d32bf
  36. 13 Jan, 2000 1 commit
    • hwloidl's avatar
      [project @ 2000-01-13 14:33:57 by hwloidl] · 1b28d4e1
      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.
      1b28d4e1
  37. 09 Nov, 1999 1 commit