1. 29 Apr, 2003 1 commit
  2. 01 Apr, 2003 1 commit
    • sof's avatar
      [project @ 2003-04-01 15:28:20 by sof] · 1d87bd26
      sof authored
      Have Literal.Literal support the representation of NULL pointers only,
      and not arbitrary pointer values.
      
      (MachAddr <some-pointer-value-as-an-Integer>) wasn't being used,
      except to handle nullAddr#. It (MachAddr) is a potential source of
      problems should the compiler start doing constant folding or other
      interesting operations over MachAddrs (think: interface files +
      cross-compilation), so we might as well scale back the representation
      of raw pointer values.
      1d87bd26
  3. 27 Mar, 2003 1 commit
    • sof's avatar
      [project @ 2003-03-27 17:59:09 by sof] · 6da62425
      sof authored
      NCG support for f.e.d. stdcall -- Literal.MachLabels now optionally carry
      the size (in bytes) of the stack frame it expects, if known. That just
      so happens to match what stdcall labels need to be annotated with when
      emitting them in the NCG..
      6da62425
  4. 13 Feb, 2003 1 commit
  5. 12 Feb, 2003 1 commit
    • simonpj's avatar
      [project @ 2003-02-12 15:01:31 by simonpj] · 42b63073
      simonpj authored
      -------------------------------------
        Big upheaval to the way that constructors are named
      	-------------------------------------
      
      This commit enshrines the new story for constructor names.  We could never
      really get External Core to work nicely before, but now it does.
      
      The story is laid out in detail in the Commentary
      	ghc/docs/comm/the-beast/data-types.html
      so I will not repeat it here.
      
      	[Manuel: the commentary isn't being updated, apparently.]
      
      However, the net effect is that in Core and in External Core, contructors look
      like constructors, and the way things are printed is all consistent.
      
      It is a fairly pervasive change (which is why it has been so long postponed),
      but I hope the question is now finally closed.
      
      All the libraries compile etc, and I've run many tests, but doubtless there will
      be some dark corners.
      42b63073
  6. 11 Feb, 2003 1 commit
    • wolfgang's avatar
      [project @ 2003-02-11 11:53:51 by wolfgang] · 5819de0c
      wolfgang authored
      Mac OS X:
      Add support for dynamic linker "symbol stubs". For every function that might
      be imported from a dynamic library, we have to generate a short piece of
      assembly code.
      Extend the NatM monad to keep track of the list of imports (for which stubs
      will be generated later).
      Fix a bug concerning 64 bit ints (hi and low words were swapped in one place).
      5819de0c
  7. 08 Feb, 2003 1 commit
  8. 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
  9. 21 Nov, 2002 1 commit
  10. 20 Nov, 2002 1 commit
  11. 27 Oct, 2002 1 commit
  12. 14 Oct, 2002 1 commit
  13. 12 Oct, 2002 1 commit
    • wolfgang's avatar
      [project @ 2002-10-12 23:28:48 by wolfgang] · 97906cfc
      wolfgang authored
      The Native Code Generator for PowerPC.
      Still to be done:
      *) Proper support of Floats and Doubles
         currently it seems to work, but it's just guesswork.
      *) Some missing operations, only needed for -O, AFAICT.
      *) Mach-O dynamic linker stub generation.
         (can't import foreign functions from dynamic libraries,
         and it might fail for big programs)
      97906cfc
  14. 13 Sep, 2002 2 commits
    • simonpj's avatar
      [project @ 2002-09-13 16:09:26 by simonpj] · c25f7667
      simonpj authored
      Native code gen primpops (courtesy Julian)
      c25f7667
    • simonpj's avatar
      [project @ 2002-09-13 15:02:25 by simonpj] · 9af77fa4
      simonpj authored
      --------------------------------------
      	Make Template Haskell into the HEAD
      	--------------------------------------
      
      This massive commit transfers to the HEAD all the stuff that
      Simon and Tim have been doing on Template Haskell.  The
      meta-haskell-branch is no more!
      
      WARNING: make sure that you
      
        * Update your links if you are using link trees.
          Some modules have been added, some have gone away.
      
        * Do 'make clean' in all library trees.
          The interface file format has changed, and you can
          get strange panics (sadly) if GHC tries to read old interface files:
          e.g.  ghc-5.05: panic! (the `impossible' happened, GHC version 5.05):
      	  Binary.get(TyClDecl): ForeignType
      
        * You need to recompile the rts too; Linker.c has changed
      
      
      However the libraries are almost unaltered; just a tiny change in
      Base, and to the exports in Prelude.
      
      
      NOTE: so far as TH itself is concerned, expression splices work
      fine, but declaration splices are not complete.
      
      
      		---------------
      		The main change
      		---------------
      
      The main structural change: renaming and typechecking have to be
      interleaved, because we can't rename stuff after a declaration splice
      until after we've typechecked the stuff before (and the splice
      itself).
      
      * Combine the renamer and typecheker monads into one
      	(TcRnMonad, TcRnTypes)
        These two replace TcMonad and RnMonad
      
      * Give them a single 'driver' (TcRnDriver).  This driver
        replaces TcModule.lhs and Rename.lhs
      
      * The haskell-src library package has a module
      	Language/Haskell/THSyntax
        which defines the Haskell data type seen by the TH programmer.
      
      * New modules:
      	hsSyn/Convert.hs 	converts THSyntax -> HsSyn
      	deSugar/DsMeta.hs 	converts HsSyn -> THSyntax
      
      * New module typecheck/TcSplice type-checks Template Haskell splices.
      
      		-------------
      		Linking stuff
      		-------------
      
      * ByteCodeLink has been split into
      	ByteCodeLink	(which links)
      	ByteCodeAsm	(which assembles)
      
      * New module ghci/ObjLink is the object-code linker.
      
      * compMan/CmLink is removed entirely (was out of place)
        Ditto CmTypes (which was tiny)
      
      * Linker.c initialises the linker when it is first used (no need to call
        initLinker any more).  Template Haskell makes it harder to know when
        and whether to initialise the linker.
      
      
      	-------------------------------------
      	Gathering the LIE in the type checker
      	-------------------------------------
      
      * Instead of explicitly gathering constraints in the LIE
      	tcExpr :: RenamedExpr -> TcM (TypecheckedExpr, LIE)
        we now dump the constraints into a mutable varabiable carried
        by the monad, so we get
      	tcExpr :: RenamedExpr -> TcM TypecheckedExpr
      
        Much less clutter in the code, and more efficient too.
        (Originally suggested by Mark Shields.)
      
      
      		-----------------
      		Remove "SysNames"
      		-----------------
      
      Because the renamer and the type checker were entirely separate,
      we had to carry some rather tiresome implicit binders (or "SysNames")
      along inside some of the HsDecl data structures.  They were both
      tiresome and fragile.
      
      Now that the typechecker and renamer are more intimately coupled,
      we can eliminate SysNames (well, mostly... default methods still
      carry something similar).
      
      		-------------
      		Clean up HsPat
      		-------------
      
      One big clean up is this: instead of having two HsPat types (InPat and
      OutPat), they are now combined into one.  This is more consistent with
      the way that HsExpr etc is handled; there are some 'Out' constructors
      for the type checker output.
      
      So:
      	HsPat.InPat	--> HsPat.Pat
      	HsPat.OutPat	--> HsPat.Pat
      	No 'pat' type parameter in HsExpr, HsBinds, etc
      
      	Constructor patterns are nicer now: they use
      		HsPat.HsConDetails
      	for the three cases of constructor patterns:
      		prefix, infix, and record-bindings
      
      	The *same* data type HsConDetails is used in the type
      	declaration of the data type (HsDecls.TyData)
      
      Lots of associated clean-up operations here and there.  Less code.
      Everything is wonderful.
      9af77fa4
  15. 06 Sep, 2002 1 commit
  16. 29 Aug, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-08-29 15:44:11 by simonmar] · ce9687a5
      simonmar authored
      Housekeeping:
      
        - The main goal is to remove dependencies on hslibs for a
          bootstrapped compiler, leaving only a requirement that the
          packages base, haskell98 and readline are built in stage 1 in
          order to bootstrap.  We're almost there: Posix is still required
          for signal handling, but all other dependencies on hslibs are now
          gone.
      
          Uses of Addr and ByteArray/MutableByteArray array are all gone
          from the compiler.  PrimPacked defines the Ptr type for GHC 4.08
          (which didn't have it), and it defines simple BA and MBA types to
          replace uses of ByteArray and MutableByteArray respectively.
      
        - Clean up import lists.  HsVersions.h now defines macros for some
          modules which have moved between GHC versions.  eg. one now
          imports 'GLAEXTS' to get at unboxed types and primops in the
          compiler.
      
          Many import lists have been sorted as per the recommendations in
          the new style guidelines in the commentary.
      
      I've built the compiler with GHC 4.08.2, 5.00.2, 5.02.3, 5.04 and
      itself, and everything still works here.  Doubtless I've got something
      wrong, though.
      ce9687a5
  17. 02 Aug, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-08-02 13:08:33 by simonmar] · 259be9ef
      simonmar authored
      PrimRep Cleanup
      
         - Remove all PrimReps which were just different flavours of
           PtrRep.  Now, everything which is a pointer to a closure of
           some kind is always a PtrRep.
      
         - Three of the deleted PrimReps, namely ArrayRep, ByteArrayRep,
           and ForeignObj rep, had a subtle reason for their existence:
           the abstract C pretty-printer(!) used them to decide whether
           to apply a shim to an outgoing C-call argument: a ByteArrayRep
           argument would be adjusted to point past the object header,
           for example.
      
           I've changed this to happen in a much more reasonable and
           obvious way: there are now explict macros in AbsCSyn to do the
           adjustment, and the code generator makes calls to these as
           necessary.  Slightly less hackery is necessary in the NCG as
           a result.
      259be9ef
  18. 19 Jul, 2002 1 commit
  19. 16 Jul, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-07-16 14:56:08 by simonmar] · 9a972425
      simonmar authored
      Implement a primitive failsafe mechanism for protecting against
      linking inconsistent object files.  The idea is that if object files
      which were compiled in the wrong order (non-dependency order) or
      compiled in different ways (eg. profiled vs. non-profiled) are linked
      together, a link error will result.
      
      This is achieved by adding the module version and the way to the
      module init label.  For example, previously the init label for a
      module Foo was named
      
      	__stginit_Foo
      
      now it is named
      
      	__stginit_Foo_<version>_<way>
      
      where <version> is the module version of Foo (same as the version in
      the interface file), and <way> is the current way (or empty).
      
      We also have to have a way to refer to the old plain init label, for
      using as the argument to shutdownHaskell() in a program using foreign
      exports.  So the old label now points to a jump instruction which
      transfers control to the new init code.
      9a972425
  20. 20 Jun, 2002 1 commit
  21. 02 May, 2002 1 commit
  22. 29 Apr, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-04-29 14:03:38 by simonmar] · b085ee40
      simonmar authored
      FastString cleanup, stage 1.
      
      The FastString type is no longer a mixture of hashed strings and
      literal strings, it contains hashed strings only with O(1) comparison
      (except for UnicodeStr, but that will also go away in due course).  To
      create a literal instance of FastString, use FSLIT("..").
      
      By far the most common use of the old literal version of FastString
      was in the pattern
      
      	  ptext SLIT("...")
      
      this combination still works, although it doesn't go via FastString
      any more.  The next stage will be to remove the need to use this
      special combination at all, using a RULE.
      
      To convert a FastString into an SDoc, now use 'ftext' instead of
      'ptext'.
      
      I've also removed all the FAST_STRING related macros from HsVersions.h
      except for SLIT and FSLIT, just use the relevant functions from
      FastString instead.
      b085ee40
  23. 05 Apr, 2002 1 commit
  24. 01 Apr, 2002 1 commit
  25. 14 Mar, 2002 2 commits
    • simonmar's avatar
      [project @ 2002-03-14 17:05:13 by simonmar] · ab73ca61
      simonmar authored
      Back out previous fix, it was wrong.
      ab73ca61
    • simonmar's avatar
      [project @ 2002-03-14 15:47:52 by simonmar] · b9312420
      simonmar authored
      Remove the interface file parser, and move .hi-boot parsing into the
      main parser.  The syntax of .hi-boot files is now greatly improved in
      terms of readability; here's an example:
      
      	module M where
      	data T
      	f :: T -> GHC.Base.Int
      
      note that
      	(a) layout can be used
      	(b) there's no explcit export list; everything declared
      	    is implicitly exported
      	(c) Z-encoding of names is no longer required
      	(d) Any identifier not declared in the current module must
      	    still be quailified with the module which originally
      	    defined it (eg. GHC.Base.Int above).
      
      We'd like to relax (d), but that will come later.
      b9312420
  26. 13 Mar, 2002 1 commit
  27. 12 Mar, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-03-12 16:48:52 by simonmar] · c50d5acc
      simonmar authored
      Fix a bug in the native code generator's handling of floating-point
      arguments to ccalls: it wasn't correctly promoting float arguments to
      doubles.  Amazingly this has gone undetected for quite a while.
      
      Fixes bug #523996.
      c50d5acc
  28. 15 Feb, 2002 1 commit
    • sof's avatar
      [project @ 2002-02-15 22:13:32 by sof] · d95869c5
      sof authored
      New call attribute on foreign imports, threadsafe.
      
      It indicates that a foreign import can(*) safely be called
      concurrently with the continued evaluation of other Haskell
      threads, i.e., when the foreign call is made by a Haskell
      thread, it won't hinder the progress of other threads.
      
      (*) - if the platform and RTS supports it, it _will be_
      invoked concurrently.
      d95869c5
  29. 13 Feb, 2002 1 commit
  30. 12 Feb, 2002 1 commit
    • simonmar's avatar
      [project @ 2002-02-12 15:17:13 by simonmar] · 2cc5b907
      simonmar authored
      Switch over to the new hierarchical libraries
      ---------------------------------------------
      
      This commit reorganises our libraries to use the new hierarchical
      module namespace extension.
      
      The basic story is this:
      
         - fptools/libraries contains the new hierarchical libraries.
           Everything in here is "clean", i.e. most deprecated stuff has
           been removed.
      
      	- fptools/libraries/base is the new base package
      	  (replacing "std") and contains roughly what was previously
      	  in std, lang, and concurrent, minus deprecated stuff.
      	  Things that are *not allowed* in libraries/base include:
      		Addr, ForeignObj, ByteArray, MutableByteArray,
      		_casm_, _ccall_, ``'', PrimIO
      
      	  For ByteArrays and MutableByteArrays we use UArray and
      	  STUArray/IOUArray respectively now.
      
      	  Modules previously called PrelFoo are now under
      	  fptools/libraries/GHC.  eg. PrelBase is now GHC.Base.
      
      	- fptools/libraries/haskell98 provides the Haskell 98 std.
      	  libraries (Char, IO, Numeric etc.) as a package.  This
      	  package is enabled by default.
      
      	- fptools/libraries/network is a rearranged version of
      	  the existing net package (the old package net is still
      	  available; see below).
      
      	- Other packages will migrate to fptools/libraries in
      	  due course.
      
           NB. you need to checkout fptools/libraries as well as
           fptools/hslibs now.  The nightly build scripts will need to be
           tweaked.
      
         - fptools/hslibs still contains (almost) the same stuff as before.
           Where libraries have moved into the new hierarchy, the hslibs
           version contains a "stub" that just re-exports the new version.
           The idea is that code will gradually migrate from fptools/hslibs
           into fptools/libraries as it gets cleaned up, and in a version or
           two we can remove the old packages altogether.
      
         - I've taken the opportunity to make some changes to the build
           system, ripping out the old hslibs Makefile stuff from
           mk/target.mk; the new package building Makefile code is in
           mk/package.mk (auto-included from mk/target.mk).
      
           The main improvement is that packages now register themselves at
           make boot time using ghc-pkg, and the monolithic package.conf
           in ghc/driver is gone.
      
           I've updated the standard packages but haven't tested win32,
           graphics, xlib, object-io, or OpenGL yet.  The Makefiles in
           these packages may need some further tweaks, and they'll need
           pkg.conf.in files added.
      
         - Unfortunately all this rearrangement meant I had to bump the
           interface-file version and create a bunch of .hi-boot-6 files :-(
      2cc5b907
  31. 06 Feb, 2002 1 commit
    • sewardj's avatar
      [project @ 2002-02-06 11:13:47 by sewardj] · 70d68b08
      sewardj authored
      Clean up the AbsC -> AbsC translation of array operations.
      
      * MachOps MO_ReadOSBI and MO_WriteOSBI, which previously did
        array indexing, are gone.  We translate now just to plain
        memory references and explicit address computations.  This
        has the happy side effect that all MachOps now return exactly
        one result (previously it was 0 or 1), cleaning up various
        bits of code.
      
        As a result the Abstract C structure now contains an unneccessary
        restriction, which is that the result of a MachOp can only be
        assigned to a temporary.  This made sense when MachOps had variable
        numbers of results (0, 1 or 2, originally), but is no longer needed.
        MachOps applied to args could now be allowed to appear as
        arbitrary nodes in expression trees, but so far they are not.
      
      * Get rid of CAddrMode constructor CMem, since it is a special case of
        CVal with a RegRelative of CIndex.
      
      AbstractC is inconsistent and non-orthogonal.  The StixStmt + StixExpr
      combination expresses a large part of what AbstractC does in a cleaner
      and simpler way, IMO.
      70d68b08
  32. 04 Feb, 2002 2 commits
  33. 30 Jan, 2002 2 commits
  34. 29 Jan, 2002 3 commits