1. 23 Nov, 2001 10 commits
    • simonmar's avatar
      [project @ 2001-11-23 12:06:49 by simonmar] · dd823536
      simonmar authored
      Use (DefMeth Name) rather than (DefMeth Id) in ClassOpItem.  This not
      only eliminates a space leak, because Names generally hold on to much
      less stuff than Ids, but also turns out to be a minor cleanup.
      dd823536
    • simonmar's avatar
      [project @ 2001-11-23 12:03:59 by simonmar] · f4faa942
      simonmar authored
      Replace a lazy pattern match in tcGetInstLoc with a strict one (fixes
      a space leak).
      f4faa942
    • simonmar's avatar
      [project @ 2001-11-23 12:01:34 by simonmar] · c36b02d9
      simonmar authored
      Adorn various constructor fields with strictness annotations - this
      fixes at least one space leak, in the mi_usages field of a ModIface.
      c36b02d9
    • simonmar's avatar
      [project @ 2001-11-23 11:59:21 by simonmar] · 3642d212
      simonmar authored
      Collect up _scc_ expressions on the right hand side of a closure
      definition and attach them directly to the closure using PushCC-type
      cost centres, so that the allocation of the closure gets attributed to
      the right place.
      3642d212
    • simonmar's avatar
      [project @ 2001-11-23 11:57:59 by simonmar] · 79abe0ac
      simonmar authored
      Fix a long-standing bug in the cost attribution of cost-center stacks.
      The problem case is this:
      
      	let z = _scc_ "z" f x
      	in ... z ...
      
      previously we were attributing the cost of allocating the closure 'z'
      to the enclosing cost center stack (CCCS), when it should really be
      attributed to "z":CCCS.  The effects are particularly visible with
      retainer profiling, because the closure retaining 'f' and 'x' would
      show up with the wrong CCS attached.
      
      To fix this, we need a new form of CCS representation internally:
      'PushCC CostCentre CostCentreStack' which subsumes (and therefore
      replaces) SingletonCCS.  SingletonCCS is now represented by 'PushCC cc
      NoCCS'.
      
      The CCS argument to SET_HDR may now be an arbitrary expression, such
      as PushCostCentre(CCCS,foo_cc), as may be the argument to CCS_ALLOC().
      So we combine SET_HDR and CCS_ALLOC into a single macro, SET_HDR_, to
      avoid repeated calls to PushCostCentre().
      79abe0ac
    • simonmar's avatar
      [project @ 2001-11-23 11:47:37 by simonmar] · 7edf3bea
      simonmar authored
      Call LDV_ENTER() on entry to a constructor in profiling mode.
      7edf3bea
    • simonmar's avatar
      [project @ 2001-11-23 11:47:12 by simonmar] · 97349545
      simonmar authored
      Call LDV_ENTER() on entry to a thunk or function in profiling mode.
      97349545
    • simonmar's avatar
      [project @ 2001-11-23 11:46:31 by simonmar] · 0054140b
      simonmar authored
      Add
      	ldvEnter :: Code
      
      for LDV profiling: it records that the closure pointed to by R1 has
      just been entered.
      0054140b
    • simonmar's avatar
      [project @ 2001-11-23 11:42:11 by simonmar] · 9ef74223
      simonmar authored
      We don't need to consider Hp as a volatile register across C calls; it
      is already saved by the CALLER_SAVES_SYSTEM macro.
      9ef74223
    • simonmar's avatar
      [project @ 2001-11-23 10:27:58 by simonmar] · 986ac01d
      simonmar authored
      Fix compilation problems with Stats.c in the !DEBUG case.
      986ac01d
  2. 22 Nov, 2001 5 commits
    • simonmar's avatar
      [project @ 2001-11-22 16:33:06 by simonmar] · 9469779a
      simonmar authored
      Omit GC and SYSTEM from the cost centre summary at the top of the profile.
      9469779a
    • simonmar's avatar
      [project @ 2001-11-22 15:15:27 by simonmar] · 1041f9ab
      simonmar authored
      Add rts_getThreadId to the Linker's built in symbol table
      1041f9ab
    • 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
    • simonpj's avatar
      [project @ 2001-11-22 12:22:42 by simonpj] · a88cde39
      simonpj authored
      Inlining pragma buglet
      a88cde39
    • simonmar's avatar
      [project @ 2001-11-22 12:06:55 by simonmar] · 8f877d35
      simonmar authored
      Update this document.  Some of the implementation problems can be
      solved in a cleaner way, and the document was confused about the
      problems caused by slop in the heap (it's only a problem when
      traversing the dead heap, not the live heap).
      8f877d35
  3. 21 Nov, 2001 5 commits
    • sof's avatar
      [project @ 2001-11-21 20:55:10 by sof] · b88636e4
      sof authored
      initialize_virtual_timer: Robustified win32 version; don't
      assume that the minimal resolution is one millisec, consult
      the underlying impl via timeGetDevCaps().
      b88636e4
    • sof's avatar
      [project @ 2001-11-21 20:27:18 by sof] · b79fdec2
      sof authored
      StablePtr indexes/counts are no longer weighted (i.e., sync wrt Stable.{c,h} changes)
      b79fdec2
    • sof's avatar
      [project @ 2001-11-21 16:56:19 by sof] · 22584fda
      sof authored
      #ifdef protect generated config.h file.
      22584fda
    • simonmar's avatar
      [project @ 2001-11-21 10:09:15 by simonmar] · 560bf0f6
      simonmar authored
      Turn the weighted reference count in a StablePtr into a simple counter
      in the stable ptr table.  We never made use of the weighted count, and
      it caused problems when making many StablePtrs to the same object.
      
      In the future we could remove the reference counting altogether and
      just make a new StablePtr each time, rather than attempting to use an
      existing one.  This would save on the hash table lookup at creation
      time.
      560bf0f6
    • sof's avatar
      [project @ 2001-11-21 02:29:00 by sof] · 1222b052
      sof authored
      Have prototypes and implementation of prel_PrelHandle_{write,read}() match
      up with the stated Haskell FFI type in PrelHandle.hs, i.e., the size
      parameter is a CInt, not an Int.
      1222b052
  4. 20 Nov, 2001 4 commits
    • sof's avatar
      [project @ 2001-11-20 21:39:12 by sof] · 1d5ba9bb
      sof authored
      getTimes (win32): Win9x OSes don't provide per-process timing data, so
      GetProcessTimes() doesn't do anything interesting. So, resort to using
      system-time instead to measure user/process time iff running under Win9x.
      (the precision is not as good, deltas were ~6 millisecs when testing
      on a Win98 box, but it's better than nothing).
      
      This change should make profiling on Win9x boxes finally work.
      1d5ba9bb
    • sof's avatar
      [project @ 2001-11-20 16:43:18 by sof] · 17035366
      sof authored
      Nuke #include of MachDeps.h - nothing in there that cannot be
      (better) gotten from the in-tree config.h
      
      This is the only (last?) use of MachDeps.h, so if anyone won't argue
      for its continued existence, I'll nuke it sometime soon.
      17035366
    • simonmar's avatar
      [project @ 2001-11-20 16:17:23 by simonmar] · 62b639a5
      simonmar authored
      Print to stdout instead of stderr.  I'm pretty ambivalent about this,
      but Sungwoo Park made the changes as part of his retainer profiling
      work so he must have had a good reason for it at the time...
      62b639a5
    • simonpj's avatar
      [project @ 2001-11-20 14:12:48 by simonpj] · 1d8621c1
      simonpj authored
      Add constant-folding rules for Float# and Double#
      1d8621c1
  5. 19 Nov, 2001 5 commits
    • sof's avatar
      [project @ 2001-11-19 18:53:50 by sof] · 57d15e1c
      sof authored
      If the configure script determined that the build-tree version of happy
      is to be used, descend into happy/ and build it, if needs be.
      57d15e1c
    • sof's avatar
      [project @ 2001-11-19 18:47:43 by sof] · 5b4f91d4
      sof authored
      - change the interpretation of FPTOOLS_TOP_ABS, it is now the UNIXy path.
        For Win32, it is of the form <drive>:<path> where '/' is the directory
        separator. Prior to this commit, the directory separator was '\'.
      - for the (only) place we need to have a platform-native representation
        of FPTOOLS_TOP_ABS, use FPTOOLS_TOP_ABS_PLATFORM.
      5b4f91d4
    • simonpj's avatar
      [project @ 2001-11-19 16:34:12 by simonpj] · 53ce311e
      simonpj authored
      Tidy up imports
      53ce311e
    • simonpj's avatar
      [project @ 2001-11-19 16:33:17 by simonpj] · 615a5546
      simonpj authored
      Improve error msg
      615a5546
    • simonpj's avatar
      [project @ 2001-11-19 14:23:52 by simonpj] · d8af6b8c
      simonpj authored
      --------------------------------------
      	Yet another cut at the DmdAnal domains
      	--------------------------------------
      
      This version of the domain for demand analysis was developed
      in discussion with Peter Sestoft, so I think it might at last
      be more or less right!
      
      Our idea is mentally to separate
      	strictness analysis
      from
      	absence and boxity analysis
      
      Then we combine them back into a single domain.  The latter
      is all you see in the compiler (the Demand type, as before)
      but we understand it better now.
      d8af6b8c
  6. 18 Nov, 2001 1 commit
  7. 16 Nov, 2001 3 commits
    • sof's avatar
      [project @ 2001-11-16 16:58:41 by sof] · 116328b6
      sof authored
      if IS_CBITS_LIB is YES: Extend SRC_HS2HS_OPTS in the same way that SRC_CC_OPTS is
      116328b6
    • simonpj's avatar
      [project @ 2001-11-16 15:42:26 by simonpj] · 772ffb22
      simonpj authored
      ---------------------------------------
      	Add continuation splitting to Simplify
      	---------------------------------------
      
      When the simplifier finds a 'case', it calls mkDupableAlt
      to make the "continuation" (that is, the context of the
      case expression) duplicatable, so that it can push it into
      the case branches.  This is crucial for the case-of-case
      transformation.
      
      But it turns out that it's a bad idea to do that when
      the context is "I'm the argument of a strict function".  Consider
      
      	f (case x of { True -> False; False -> True }) arg2
      
      where f is a strict function.  Then we *could* (and were)
      transforming to
      
      	let $j a = f a arg2
      	in
      	case x of { True -> $j False; False -> $j True }
      
      But this is in general a terribly bad thing to do.
      See the example in comments with Simplify.mkDupableCont.
      772ffb22
    • simonpj's avatar
      [project @ 2001-11-16 15:33:53 by simonpj] · 2ce9f3af
      simonpj authored
      Correct docs about SPECIALIZE instance; MERGE TO STABLE
      2ce9f3af
  8. 15 Nov, 2001 1 commit
  9. 14 Nov, 2001 5 commits
    • simonmar's avatar
      [project @ 2001-11-14 16:34:22 by simonmar] · 9a558a75
      simonmar authored
      use SET_HDR rather than explicitly setting p->header.info.
      9a558a75
    • simonmar's avatar
      [project @ 2001-11-14 11:46:12 by simonmar] · 37ed96e4
      simonmar authored
      Fix up the interpreter following the recent modifications to
      suspendThread/resumeThread.  Someone should test that foreign imports
      in the interpreter still work.
      37ed96e4
    • simonmar's avatar
      [project @ 2001-11-14 11:39:29 by simonmar] · 9bd3b5f3
      simonmar authored
      Change the way we do finalization for duplex handles.  Previously, we
      arranged that the read side pointed to the right side via a special
      handle type (ReadSideHandle _), and the finalizer points to the write
      side.  This turned out to interact badly with hGetContents, which
      likes to explicitly close the read side of the handle after it reads
      EOF or gets an error, which resulted in double-closes for duplex
      handles.
      
      Now we store the pointer from the read side to the write side in the
      Handle structure itself, so it doesn't get lost when hGetContents
      changes the handle type to SemiClosedHandle.  Furthermore, in hClose
      we no longer close the file descriptor associated with the read side
      of a duplex handle - the actual close will have to wait until the
      finalizer runs, because someone might still be using the write side.
      
      Thanks to Volker Stolz for pointing out the problem.
      9bd3b5f3
    • simonmar's avatar
      [project @ 2001-11-14 11:35:23 by simonmar] · 01bd67ae
      simonmar authored
      remove an unnecessary duplicate binding
      01bd67ae
    • simonmar's avatar
      [project @ 2001-11-14 11:15:53 by simonmar] · 92b87035
      simonmar authored
      GC unused import
      92b87035
  10. 13 Nov, 2001 1 commit