1. 29 Jan, 2002 12 commits
    • sewardj's avatar
      [project @ 2002-01-29 16:54:41 by sewardj] · 975b3c32
      sewardj authored
      x86 only: remove special ccall support for calling PerformGC_wrapper
      using dodgy-looking calling convention.  PerformGC_wrapper was last
      seen alive in GHC 3.X, AFAIK.
      975b3c32
    • simonmar's avatar
      [project @ 2002-01-29 16:52:46 by simonmar] · aeefae7c
      simonmar authored
      Remove some empty structs that weren't used.  Apparently empty structs
      are illegal C.
      aeefae7c
    • sewardj's avatar
      [project @ 2002-01-29 16:52:25 by sewardj] · 383f737f
      sewardj authored
      sparc NCG fixes for f-i-dynamic.
      383f737f
    • simonmar's avatar
      [project @ 2002-01-29 16:50:08 by simonmar] · 2674c7c3
      simonmar authored
      Remove StgParInfo - not used anywhere.
      2674c7c3
    • simonmar's avatar
      [project @ 2002-01-29 16:49:42 by simonmar] · 1b0e92fe
      simonmar authored
      Remove PAR_ITBL_SIZE - not used anywhere.
      1b0e92fe
    • simonmar's avatar
      [project @ 2002-01-29 16:24:08 by simonmar] · 662555be
      simonmar authored
      Inline mpz_cmp_si() into cmpIntegerInt#, and mpz_cmp() into cmpInteger#
      to offset recent performance degradation caused by outlining of these
      primitives.
      
      Also remove heap checks in these primitives: they don't do any
      allocation, so no heap check is necessary.
      662555be
    • simonmar's avatar
      [project @ 2002-01-29 14:41:52 by simonmar] · 5bed878b
      simonmar authored
      Fix highly obscure bug.
      
      The heap check in cmpIntegerzh_fast was erroneously passing
      cmpIntegerIntzh_fast as the resumption point instead of
      cmpIntegerzh_fast, with the result that if a heap-check happened to
      strike in cmpIntegerzh_fast then we would end up resuming in
      cmpIntegerIntzh and returning an incorrect comparison result.  One
      symptom is that very occasionally floating point numbers would print
      incorrectly (ending in an 'a').
      5bed878b
    • sewardj's avatar
      [project @ 2002-01-29 13:22:28 by sewardj] · ec269b12
      sewardj authored
      Teach the NCG how to do f-i-dynamic.  Nothing unexpected.
      sparc-side now needs fixing.
      ec269b12
    • sewardj's avatar
      [project @ 2002-01-29 11:07:26 by sewardj] · 7f42c60a
      sewardj authored
      Allow constructors with non-ptr fields to be allocated in-line.
      7f42c60a
    • simonpj's avatar
      [project @ 2002-01-29 09:58:14 by simonpj] · f2054812
      simonpj authored
      ------------
      	Rule phasing
      	------------
      
      This commit adds a little more control to when rules are enabled.
      
        {-# RULES
             "foo" [2] forall ...
             "baz" [~2] forall ...
        #-}
      
      Rule "foo" is active in phase 2 and later.  The new thing is that the
      "~2" means that Rule "baz" is active in phase 3 and earlier.
      (Remember tha phases decrease towards zero.)
      
      All the machinery was there to implement this, it just needed the syntax.
      
      
      Why do this?  Peter Gammie (at UNSW) found that rules weren't firing
      because of bindings of the form
      
      	M.f = f
      	f = ....
      
      where the rules where on the M.f binding.  It turned out that an old
      hack (which have for some time elicited the harmless "shortMeOut" debug
      warnings) prevented this trivial construction from being correctly
      simplified.  The hack in turn derived from a trick in the way the
      foldr/build rule was implemented....and that hack is no longer necessary
      now we can switch rules *off* as well as *on*.
      
      
      There are consequential changes in the Prelude foldr/build RULE stuff.
      It's a clean-up.... Instead of strange definitions like
      	map = mapList
      which we had before, we have an ordinary recursive defn of map, together
      with rules to convert first to foldr/build form, and then (if nothing
      happens) back again.
      
      There's a fairly long comment about the general plan of attack in
      PrelBase, near the defn of map.
      f2054812
    • sof's avatar
      [project @ 2002-01-29 06:15:03 by sof] · a704ee9c
      sof authored
      Update comments re: reloc overflow. A careful re-read of the PE
      spec did prove useful; Sec 4.1 (last para) describes how overflow
      is handled.
      a704ee9c
    • sof's avatar
      [project @ 2002-01-29 02:41:21 by sof] · 9efa7107
      sof authored
      PEi386/COFF: handle relocation overflows, i.e., if a section is
      marked with the flag (MY)IMAGE_SCN_LNK_NRELOC_OVFL, then
      the first entry in the relocation table holds the 32-bit
      relocation count rather than 16-bit number in the section header.
      Apparently, a version of the MS PE spec exists that spells this
      out, but haven't been able to locate it (perhaps people on the
      'inside' could try to locate an up-to-date version...?) winnt.h
      is clear enough about it though (as is the GNU libbfd sources).
      
      This is the Right Way to compute the relocation count, but
      unfortunately libbfd / GNU ld is generating bogus output
      when the reloc field overflows (causing objdump/nm etc. to
      crash when trying to read the generated output!) Looking into it.
      
      Once this has been cleared up/fixed, the splitting up of HSstd.o
      (and HSwin32.o) should be a thing of the past. I've taken the
      liberty of disabling the suspiciously-large-reloc-section test
      already.
      9efa7107
  2. 28 Jan, 2002 6 commits
    • sewardj's avatar
      [project @ 2002-01-28 17:22:45 by sewardj] · 7bf9669c
      sewardj authored
      Generate better code for lets whose RHS is a simple fn or constructor
      application.  Details are in comment in code.
      7bf9669c
    • simonmar's avatar
      [project @ 2002-01-28 17:09:05 by simonmar] · 8de7cb84
      simonmar authored
      Catch up with recent changes in the middle end that changed the
      assumptions about constructor applications: it is not necessarily the
      case any more that constructor applications are always saturated in
      the output from CorePrep.
      
      For a non-saturated constructor application there is always a curried
      worker function that can be called instead.  This change updates the
      byte code generator to use the curried worker when necessary.
      
      Also: a couple of micro-optimisations/cleanups.
      8de7cb84
    • simonpj's avatar
      [project @ 2002-01-28 16:52:37 by simonpj] · 0d62bdb2
      simonpj authored
      ----------------------
      	Zero-constructor types
      	----------------------
      
      If we have
      
      	data T
      	data S = MkS !T
      
      we were getting a crash in the compiler because ctrlRetConvAlg
      didn't know what to do for zero-constructor types.
      
      This fix arbitrarily says that they use a non-vectored return,
      which fixes the crash.  (Since they only have bottom values,
      the return never gets exercised, but GC and exception handling
      should work.)
      
      What is still unclear is how we handle data types that are defined
      with zero constructors in an hi-boot file.  I think that Bad Things
      may well happen if you do a 'seq' on them before we get up to the
      definition.  (e.g. as a result of this fix we'll say "unvectored"
      whereas the truth may be "vectored".)  This obviously doesn't happen
      much (because at present we'd get a compiler crash in ctrlRetConvAlg,
      but we should look into it.
      0d62bdb2
    • simonmar's avatar
      [project @ 2002-01-28 13:47:05 by simonmar] · 6d550803
      simonmar authored
      Never close std file descriptors.  This works around a "problem" in
      GHCi: if the program reaches EOF on stdin, it might close it, which in
      turn causes the interactive shell to fall over with a "bad file
      descriptor" error when it tries to read from stdin.
      6d550803
    • simonmar's avatar
      [project @ 2002-01-28 13:34:10 by simonmar] · a7549035
      simonmar authored
      Set stdin to unbuffered, so that GHCi doesn't accidentally buffer any
      input that might be intended for the program.
      a7549035
    • simonmar's avatar
      [project @ 2002-01-28 12:01:12 by simonmar] · 4db852d2
      simonmar authored
      Make GHCi silent in "unverbose" mode (-v0).  Now you can get a crude
      runhugs-style behaviour like this:
      
         echo main | ghci -v0 Main
      4db852d2
  3. 27 Jan, 2002 1 commit
    • panne's avatar
      [project @ 2002-01-27 10:53:26 by panne] · 388a6347
      panne authored
      Unbreak 2nd stage build by tracking recent RTS naming changes
      (ATTENTION: I'm not quite sure what I'm doing here exactly,
       but things seem to work... :-}
      388a6347
  4. 26 Jan, 2002 3 commits
    • rje's avatar
      [project @ 2002-01-26 18:04:48 by rje] · d117cff1
      rje authored
      Minor tweak to use the new names.
      
      X_ret_info -> X_info.
      
      Just so the mangler finds things more easily.
      
      For more info, see the commit to HeapStackCheck.hc
      d117cff1
    • rje's avatar
      [project @ 2002-01-26 18:02:05 by rje] · 9a73dc38
      rje authored
      Change to declarations of info tables of the form X_ret_info to syncronise with my previous commit to HeapStackCheck.hc
      9a73dc38
    • rje's avatar
      [project @ 2002-01-26 17:58:47 by rje] · 464f0373
      rje authored
      This is a simple fix for a rather obscure bug.
      
      In the heap/stack checking code, we were creating info tables with names of the form stg_gc_X_ret_info, and giving them entry points with names of the form stg_gc_X_ret.
      
      Unfortunately, the mangler expects that if an info table is called Y_info, the entry point should be called Y_ret or Y_entry.
      
      In this case, the mangler thus looks for stg_gc_X_ret_ret and stg_gc_X_ret_entry, neither of which exists.
      
      As a result, the entry points aren't placed directly after the info tables.
      
      Fortunately, the code for the entry points was defined emmediately after the info table definition, and so was *usually* in the right place already.
      
      
      However, in certain circumstances (that can result from some tweaks on my private tree, and might possibly occur by other means), this was not happening, and thus any attempts to enter the entry point for this info table will cause problems.
      
      
      The fix is quite simple: rename the info tables so that the mangler finds the entry points and puts them in the right places.
      
      
      I don't think this commit is likely to have a notable effect on anything else.
      464f0373
  5. 25 Jan, 2002 5 commits
  6. 24 Jan, 2002 8 commits
    • simonmar's avatar
      [project @ 2002-01-24 16:55:35 by simonmar] · 03b874e7
      simonmar authored
      Add support for Hugs's :browse (or :b) command.  There are two forms:
      
      	- :b M   (interpreted modules only) shows everything
                defined in M - the types of top-level functions,
      	  and definitions of classes and datatypes.
      
      	- :b *M  shows everything exported from module M.
      	  Available for both compiled and interpreted modules.
      
      The user interface is subject to change, but for now it is consistent
      with the new semantics of the :module command.
      
      The implementation is a little tricky, since for a package module we
      have to be sure to slurp in all the required declarations first.
      03b874e7
    • sewardj's avatar
      [project @ 2002-01-24 16:55:04 by sewardj] · d8ef45a3
      sewardj authored
      This is one of those commits where the commit message is hundreds of
      times, in bytes, larger than the fix.  If you count pixels, it's
      probably more like thousands of times larger, since the fix involves
      adding a missing apostrophe.
      
      In compiling let bindings, when filtering the free vars of each RHS
      against the supplied on-stack environment p, filter against p after it
      has been augmented with the binders in this let (viz, p'), rather than
      before.  Without this, letrec-bound binders can never "get started" in
      the environment.
      
      This fixes the HEAD crash for [(i,1) | i <- [1]].  Stable branch
      is ok since the free-var machinery works a different way there.
      d8ef45a3
    • sof's avatar
      [project @ 2002-01-24 07:50:01 by sof] · 373fabef
      sof authored
      SMP: misc tasks timing stats fixes
      373fabef
    • sof's avatar
      [project @ 2002-01-24 02:15:19 by sof] · 2a59f826
      sof authored
      SMP: hack-and-slash to bring BaseReg into scope
      2a59f826
    • sof's avatar
      [project @ 2002-01-24 02:06:48 by sof] · 797d6341
      sof authored
      SMP: disable spark support (only a little bit of header file re-jigging is reqd to get it going again, I suspect.)
      797d6341
    • sof's avatar
      [project @ 2002-01-24 01:45:55 by sof] · b502893a
      sof authored
      SMP: bunch of triv. changes to account for the fact that a Capability is no longer just a RegTable
      b502893a
    • sof's avatar
      [project @ 2002-01-24 00:53:18 by sof] · 533633e4
      sof authored
      Way 's': add -DSMP to HC_ and CC_OPTS
      533633e4
    • sof's avatar
      [project @ 2002-01-24 00:40:28 by sof] · affd9133
      sof authored
      SMP: move link field from StgRegTable to Capability
      affd9133
  7. 23 Jan, 2002 5 commits
    • sof's avatar
      [project @ 2002-01-23 23:53:54 by sof] · 6d4c5bff
      sof authored
      make it compile when GHCI aint
      6d4c5bff
    • lewie's avatar
      [project @ 2002-01-23 17:51:46 by lewie] · d3bd93cf
      lewie authored
      Add special case for installing shared libs (which need the execute bit set).
      d3bd93cf
    • simonmar's avatar
      [project @ 2002-01-23 16:50:46 by simonmar] · 92cdc09e
      simonmar authored
      - Implement an alternative :module syntax so we can play around with it.
      
      - Implement ':show bindings' and ':show modules'
      
      - Fix a bug whereby doing :info on a local binding would cause a panic
        (this needs to be merged to STABLE - the change is part of the patch
        to HscMain).
      
      - Some cleanups in InteractiveUI.hs
      92cdc09e
    • sewardj's avatar
      [project @ 2002-01-23 11:29:12 by sewardj] · 830c1108
      sewardj authored
      Fix two problems with the ELF linker:
      
      1.  Determine section attributes by examining various bits in the
          section header tables, rather than from the section names.  This
          makes it robust against future changes / additions to the set of
          section names.
      
      2.  Handle local symbols differently.  Do not add them to our own
          local symbol table for this object, since that's
      
          (a) wrong -- multiple local symbols can have the same name so long
              as each is in a different section, so if we just dump them into
              the local symbol table we'll wind up with apparently duplicate
              symbols
      
          (b) totally unnecessary, since the relocations against local symbols
              simply specify an index into the ELF symbol table for the object,
              from whence the address can be calculated without reference to the
              name.
      
      TODO: Test on sparc-solaris
            Investigate whether PEi386 linker needs fixing similarly
      and then
      MERGE TO STABLE
      830c1108
    • simonmar's avatar
      [project @ 2002-01-23 11:11:13 by simonmar] · c8d89540
      simonmar authored
      Revert to running command-line statements in the context of the
      current thread, so that ^C exceptions get delivered to the right
      place.
      
      Now that a deadlock generates an exception this is not so bad, but it
      would be nice to do it the "right" way so I've left the old code in a
      comment for now.
      c8d89540