1. 16 Sep, 2008 1 commit
  2. 04 Sep, 2008 1 commit
  3. 19 Jun, 2008 1 commit
    • Simon Marlow's avatar
      Fix up inlines for gcc 4.3 · 24ad9cf0
      Simon Marlow authored
      gcc 4.3 emits warnings for static inline functions that its heuristics
      decided not to inline.  The workaround is to either mark appropriate
      functions as "hot" (a new attribute in gcc 4.3), or sometimes to use
      "extern inline" instead.
      
      With this fix I can validate with gcc 4.3 on Fedora 9.
      24ad9cf0
  4. 12 May, 2008 1 commit
  5. 25 Apr, 2008 1 commit
  6. 02 Apr, 2008 1 commit
    • Simon Marlow's avatar
      Do not #include external header files when compiling via C · c245355e
      Simon Marlow authored
      This has several advantages:
      
       - -fvia-C is consistent with -fasm with respect to FFI declarations:
         both bind to the ABI, not the API.
      
       - foreign calls can now be inlined freely across module boundaries, since
         a header file is not required when compiling the call.
      
       - bootstrapping via C will be more reliable, because this difference
         in behavour between the two backends has been removed.
      
      There is one disadvantage:
      
       - we get no checking by the C compiler that the FFI declaration
         is correct.
      
      So now, the c-includes field in a .cabal file is always ignored by
      GHC, as are header files specified in an FFI declaration.  This was
      previously the case only for -fasm compilations, now it is also the
      case for -fvia-C too.
      c245355e
  7. 24 Oct, 2006 1 commit
    • Simon Marlow's avatar
      Split GC.c, and move storage manager into sm/ directory · ab0e778c
      Simon Marlow authored
      In preparation for parallel GC, split up the monolithic GC.c file into
      smaller parts.  Also in this patch (and difficult to separate,
      unfortunatley):
        
        - Don't include Stable.h in Rts.h, instead just include it where
          necessary.
        
        - consistently use STATIC_INLINE in source files, and INLINE_HEADER
          in header files.  STATIC_INLINE is now turned off when DEBUG is on,
          to make debugging easier.
        
        - The GC no longer takes the get_roots function as an argument.
          We weren't making use of this generalisation.
      ab0e778c
  8. 28 Sep, 2006 1 commit
  9. 09 Sep, 2006 1 commit
  10. 07 Apr, 2006 1 commit
    • Simon Marlow's avatar
      Reorganisation of the source tree · 0065d5ab
      Simon Marlow authored
      Most of the other users of the fptools build system have migrated to
      Cabal, and with the move to darcs we can now flatten the source tree
      without losing history, so here goes.
      
      The main change is that the ghc/ subdir is gone, and most of what it
      contained is now at the top level.  The build system now makes no
      pretense at being multi-project, it is just the GHC build system.
      
      No doubt this will break many things, and there will be a period of
      instability while we fix the dependencies.  A straightforward build
      should work, but I haven't yet fixed binary/source distributions.
      Changes to the Building Guide will follow, too.
      0065d5ab
  11. 18 Nov, 2005 1 commit
    • simonmar's avatar
      [project @ 2005-11-18 15:13:46 by simonmar] · cbd29e0a
      simonmar authored
      Add wcStore(), a write-combining store if supported
      
      (I tried using it in the update code and only succeeded in making
      things slower, but it might come in handy in the future)
      cbd29e0a
  12. 14 Jul, 2005 1 commit
  13. 27 Mar, 2005 1 commit
    • panne's avatar
      [project @ 2005-03-27 13:41:13 by panne] · 03dc2dd3
      panne authored
      * Some preprocessors don't like the C99/C++ '//' comments after a
        directive, so use '/* */' instead. For consistency, a lot of '//' in
        the include files were converted, too.
      
      * UnDOSified libraries/base/cbits/runProcess.c.
      
      * My favourite sport: Killed $Id$s.
      03dc2dd3
  14. 01 Feb, 2005 1 commit
  15. 28 Jan, 2005 1 commit
    • simonmar's avatar
      [project @ 2005-01-28 12:55:17 by simonmar] · 153b9cb9
      simonmar authored
      Rationalise the BUILD,HOST,TARGET defines.
      
      Recall that:
      
        - build is the platform we're building on
        - host is the platform we're running on
        - target is the platform we're generating code for
      
      The change is that now we take these definitions as applying from the
      point of view of the particular source code being built, rather than
      the point of view of the whole build tree.
      
      For example, in RTS and library code, we were previously testing the
      TARGET platform.  But under the new rule, the platform on which this
      code is going to run is the HOST platform.  TARGET only makes sense in
      the compiler sources.
      
      In practical terms, this means that the values of BUILD, HOST & TARGET
      may vary depending on which part of the build tree we are in.
      
      Actual changes:
      
       - new file: includes/ghcplatform.h contains platform defines for
         the RTS and library code.
      
       - new file: includes/ghcautoconf.h contains the autoconf settings
         only (HAVE_BLAH).  This is so that we can get hold of these
         settings independently of the platform defines when necessary
         (eg. in GHC).
      
       - ghcconfig.h now #includes both ghcplatform.h and ghcautoconf.h.
      
       - MachRegs.h, which is included into both the compiler and the RTS,
         now has to cope with the fact that it might need to test either
         _TARGET_ or _HOST_ depending on the context.
      
       - the compiler's Makefile now generates
           stage{1,2,3}/ghc_boot_platform.h
         which contains platform defines for the compiler.  These differ
         depending on the stage, of course: in stage2, the HOST is the
         TARGET of stage1.  This was wrong before.
      
       - The compiler doesn't get platform info from Config.hs any more.
         Previously it did (sometimes), but unless we want to generate
         a new Config.hs for each stage we can't do this.
      
       - GHC now helpfully defines *_{BUILD,HOST}_{OS,ARCH} automatically
         in CPP'd Haskell source.
      
       - ghcplatform.h defines *_TARGET_* for backwards compatibility
         (ghcplatform.h is included by ghcconfig.h, which is included by
         config.h, so code which still #includes config.h will get the TARGET
         settings as before).
      
       - The Users's Guide is updated to mention *_HOST_* rather than
         *_TARGET_*.
      
       - coding-style.html in the commentary now contains a section on
         platform defines.  There are further doc updates to come.
      
      Thanks to Wolfgang Thaller for pointing me in the right direction.
      153b9cb9
  16. 13 Jan, 2005 1 commit
    • simonmar's avatar
      [project @ 2005-01-13 16:07:33 by simonmar] · 68e43002
      simonmar authored
      Instead of defining NO_REGS when IN_STG_CODE==0, define
      NO_GLOBAL_REG_DECLS instead.
      
      This means that in non-STG code we can still get at the values of
      REG_R1 & co., even though the global register decls are turned off.
      This is necessary because we sometimes need to set up different stack
      layouts depending on REG_R1.
      68e43002
  17. 02 Sep, 2004 1 commit
    • simonmar's avatar
      [project @ 2004-09-02 12:45:25 by simonmar] · c7ce56fd
      simonmar authored
      Rearrange so that Regs.h include comes before inline function
      definitions.  I'm guessing that newer versions of gcc are less picky
      about this, which is why we hadn't noticed it.
      c7ce56fd
  18. 13 Aug, 2004 1 commit
  19. 23 Mar, 2004 1 commit
  20. 08 Mar, 2004 1 commit
  21. 28 Dec, 2003 1 commit
  22. 14 Nov, 2003 2 commits
  23. 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
  24. 21 Sep, 2003 1 commit
  25. 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
  26. 22 Jul, 2003 1 commit
  27. 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
  28. 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
  29. 23 May, 2003 1 commit
  30. 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
  31. 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
  32. 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
  33. 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
  34. 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
  35. 13 Feb, 2002 1 commit
  36. 06 Dec, 2001 1 commit
  37. 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
  38. 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
  39. 25 Nov, 2001 1 commit