1. 07 Feb, 2002 2 commits
  2. 06 Feb, 2002 4 commits
    • sewardj's avatar
      [project @ 2002-02-06 15:48:56 by sewardj] · 6e1e8a09
      sewardj authored
      x86 only: make %esp be 8-aligned before entering HC-world code.
      This avoids misalignment penalties for C doubles stored on the C
      stack.  A quick test using nofib/imaginary/rfib shows that getting
      this wrong increases run time by about 10% on our 1 GHz PIII.
      6e1e8a09
    • sof's avatar
      [project @ 2002-02-06 01:29:27 by sof] · 91fd2101
      sof authored
      - use task manager API to keep track of the number
        of tasks that are blocked waiting on the RTS lock.
      - comment updates/additions.
      91fd2101
    • sof's avatar
      [project @ 2002-02-06 01:26:14 by sof] · 80c55dc7
      sof authored
      - in the threaded case, keep track of the number of
        tasks/threads that are currently waiting to enter
        the RTS.
      - taskStart():
           + only start up a new thread/task if there aren't
             any already waiting to gain RTS access.
           + honour thread/task limits (if any).
      80c55dc7
    • sof's avatar
      [project @ 2002-02-06 01:21:40 by sof] · 7f906dc8
      sof authored
      make stat_getElapsedTime(), SMP-only again
      7f906dc8
  3. 05 Feb, 2002 2 commits
    • simonpj's avatar
      [project @ 2002-02-05 15:42:04 by simonpj] · e6601808
      simonpj authored
      ```------:frontmatter
      Main.main
      		---------
      
      A bunch of related fixes concerning 'main'
      
      * Arrange that 'main' doesn't need to be defined in module Main;
        it can be imported.
      
      * The typechecker now injects a binding
      	Main.$main = PrelTopHandler.runMain main
      
        So the runtime system now calls Main.$main, not PrelMain.main.
        With z-encoding, this look like
      		Main_zdmain_closure
      
      * The function
        	PrelTopHandler.runMain :: IO a -> IO ()
        wraps the programmer's 'main' in an exception-cacthing wrapper.
      
      * PrelMain.hs and Main.hi-boot are both removed from lib/std, along
        with multiple lines of special case handling in lib/std/Makefile.
        This is a worthwhile cleanup.
      
      * Since we now pick up whatever 'main' is in scope, the ranamer gets
        in on the act (RnRnv.checkMain).  There is a little more info to
        get from the renamer to the typechecker, so I've defined a new type
        Rename.RnResult (c.f. TcModule.TcResult)
      
      * With GHCi, it's now a warning, not an error, to omit the binding
        of main (RnEnv.checkMain)
      
      * It would be easy to add a flag "-main-is foo"; the place to use
        that information is in RnEnv.checkMain.
      ```
      
      ----
      
      On the way I made a new type,
      	type HscTypes.FixityEnv = NameEnv Fixity
      and used it in various places I'd tripped over
      e6601808
    • simonmar's avatar
      [project @ 2002-02-05 10:06:24 by simonmar] · 84a29fdd
      simonmar authored
      Fix bad bugs in deleteAllThreds: we were looping through the thread
      queues calling deleteThread() on each thread as we go, but calling
      deleteThread() has the side effect of removing the thread from the
      relevant queue, so we would end up breaking out of the loop after
      processing only a single thread.
      
      This may fix problems like "resurrectThreads: thread blocked in a
      strange way" seen after pressing ^C.
      
      Aside: we really shouldn't be using deleteThread() at all, since it
      doesn't give the thread a chance to clean up & release locks.  To be
      well-behaved a program has to catch ^C itself at the moment.
      84a29fdd
  4. 04 Feb, 2002 13 commits
  5. 01 Feb, 2002 2 commits
    • simonmar's avatar
      [project @ 2002-02-01 10:50:35 by simonmar] · b8684d58
      simonmar authored
      When distinguishing between code & data pointers, rather than testing
      for membership of the text section, test for not membership of one of
      the data sections.
      
      The reason for this change is that testing for membership of the text
      section was fragile:  we could only test whether a value was smaller
      than the end address, because there doesn't appear to be a portable
      way to find the beginning of the text section.  Indeed, the test
      breaks on very recent Linux kernels which mmap() memory below the
      program text.
      
      In fact, the reversed test may be faster because the expected common
      case is when the pointer is into the dynamic heap, and we eliminate
      these case immediately in the new test.  A quick test shows no
      measurable performance difference with the change.
      
      MERGE TO STABLE
      b8684d58
    • sof's avatar
      [project @ 2002-02-01 02:05:52 by sof] · 7d1c6665
      sof authored
      Add URLs and other pointers to resources on the PE COFF format.
      7d1c6665
  6. 31 Jan, 2002 3 commits
    • sof's avatar
      [project @ 2002-01-31 23:04:15 by sof] · 48ccd03c
      sof authored
      Win32 implementation, first pass.
      48ccd03c
    • sof's avatar
      [project @ 2002-01-31 11:18:06 by sof] · 3b9c5eb2
      sof authored
      First steps towards implementing better interop between
      Concurrent Haskell and native threads.
      
      - factored out Capability handling into a separate source file
        (only the SMP build uses multiple capabilities tho).
      - factored out OS/native threads handling into a separate
        source file, OSThreads.{c,h}. Currently, just a pthreads-based
        implementation; Win32 version to follow.
      - scheduler code now distinguishes between multi-task threaded
        code (SMP) and single-task threaded code ('threaded RTS'),
        but sharing code between these two modes whenever poss.
      
      i.e., just a first snapshot; the bulk of the transitioning code
      remains to be implemented.
      3b9c5eb2
    • sof's avatar
      [project @ 2002-01-31 07:04:27 by sof] · 1ac8af86
      sof authored
      got tired of seeing gcc trigraph warning
      1ac8af86
  7. 30 Jan, 2002 2 commits
    • simonmar's avatar
      [project @ 2002-01-30 16:27:34 by simonmar] · 1e046f78
      simonmar authored
      Set $(HC) *after* including boilerplate.mk, which re-defines it.
      1e046f78
    • simonmar's avatar
      [project @ 2002-01-30 12:17:21 by simonmar] · 975ef297
      simonmar authored
      Clean up this Makefile:
      
        - Use the enhanced automatic source-finding machinery from
          paths.mk rather than rolling our own,
      
        - Turn on UseGhcForCc to get our C files compiled with GHC.
          This fixes some obscure bugs caused by the fact that we
          were re-initializing $(CC_OPTS) in this Makefile using
          :=, when it had previously already been set with = (apparently
          different versions of GNU make behave differently presented
          with this kind of mixed assigment).
      975ef297
  8. 29 Jan, 2002 4 commits
    • 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
    • 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
  9. 26 Jan, 2002 2 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 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
  10. 25 Jan, 2002 2 commits
  11. 24 Jan, 2002 4 commits