- 27 Nov, 2001 8 commits
-
-
simonmar authored
Add a DEBUG catch-all case in do_expr.
-
simonpj authored
Wibble in hi-boot file
-
simonpj authored
Behave better in decode_escape failure
-
sof authored
hardtop: newer versions of bash (and ash) have 'pwd' return paths of the following form: /cygdrive/<drive>/<rest> Transform these into <drive>:/<rest>, as that format is easier to work with under mingw.
-
sof authored
make prev. commit compile on non-win32 boxes
-
sof authored
removed ToDo comment + braino
-
sof authored
Rearranged how the virtual timer 'subsystem' is brought up and down: * "int startVirtTimer(nat ms)" now starts the vtimer/ticker. * "int stopVirtTimer()" shuts down the ticker. i.e., removed install_vtalrm_handler() and initialize_virtual_timer().
-
sof authored
track 5.03's change to PrelHandle.fillReadBuffer
-
- 26 Nov, 2001 15 commits
-
-
sof authored
have happy-inplace rule depend on glafp-utils/
-
sof authored
make it work on non-mingw platforms
-
sof authored
Make the IO implementation work with WinSock once again. When creating sockets with WinSock, you don't get back a file descriptor, but a SOCKET (which just so happens to map to the same type as a 'normal' file descriptor). This SOCKET value cannot be used with the CRT ops read(), write(), close(), but you have to use the socket-specific operations (recv(), send(), and closesocket(), respectively) instead. To keep track of this distinction between file and socket file descriptors, the following changes were made: * a Handle__ has got a new field, haIsStream, which is True for sockets / streams. (this field is essentially unused in non-Win32 settings, but I decided not to conditionalise its presence). * PrelHandle.openFd now takes an extra (Maybe FDType) argument, which lets you force what type of FD we're converting into a Handle (this is crucial for WinSock SOCKETs, since we don't want to attempt fstat()ing them). Fixes breakage that was introduced with May 2001 (or earlier) rewrite of the IO layer. This commit build upon recent IO changes to HEAD, so merging it to STABLE will require importing those changes too (I'll let others be the judge whether this should be done or not).
-
sof authored
win32 only - provide closeFd, which closes a file descriptor, be it of file or socket ilk.
-
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.
-
sof authored
fdType: clarify that this op will fail with non-file handles/descriptors under Win32.
-
simonmar authored
Use an arena internally to allocate hash bucket cells instead of the current home-brewed combination of malloc/free and a free list. We still allocate hash table segments using malloc/free because these are large (4k by default) and might interact badly with the blockish nature of the arena allocator.
-
simonpj authored
In the Win32 build, don't call initProfTimer unless PROFILING is on. This mirrors the Unix deal. Indeed initProfTimer isn't defined if PROFILING is on. I don't know how this works for anyone else on Win32! Sigbjorn: have I done this right, or am I misunderstanding?
-
simonpj authored
Complete previous tcAddImportedIdInfo commit
-
simonpj authored
Improve error reporting
-
simonpj authored
Comments only
-
simonpj authored
-------------------------------------- Finally get rid of tcAddImportedIdInfo -------------------------------------- TcEnv.tcAddImportedIdInfo is a notorious source of space leaks. Simon M got rid of the need for it on default methods. This commit gets rid of the need for it for dictionary function Ids, and finally nukes the beast altogether. Hurrah! The change really involves putting tcInterfaceSigs *before* tcInstDecls1, so that any imported DFunIds are in the typechecker's environment before we get to tcInstDecls.
-
simonpj authored
Add missing files for Rank-N commit
-
simonpj authored
---------------------- Implement Rank-N types ---------------------- This commit implements the full glory of Rank-N types, using the Odersky/Laufer approach described in their paper "Putting type annotations to work" In fact, I've had to adapt their approach to deal with the full glory of Haskell (including pattern matching, and the scoped-type-variable extension). However, the result is: * There is no restriction to rank-2 types. You can nest forall's as deep as you like in a type. For example, you can write a type like p :: ((forall a. Eq a => a->a) -> Int) -> Int This is a rank-3 type, illegal in GHC 5.02 * When matching types, GHC uses the cunning Odersky/Laufer coercion rules. For example, suppose we have q :: (forall c. Ord c => c->c) -> Int Then, is this well typed? x :: Int x = p q Yes, it is, but GHC has to generate the right coercion. Here's what it looks like with all the big lambdas and dictionaries put in: x = p (\ f :: (forall a. Eq a => a->a) -> q (/\c \d::Ord c -> f c (eqFromOrd d))) where eqFromOrd selects the Eq superclass dictionary from the Ord dicationary: eqFromOrd :: Ord a -> Eq a * You can use polymorphic types in pattern type signatures. For example: f (g :: forall a. a->a) = (g 'c', g True) (Previously, pattern type signatures had to be monotypes.) * The basic rule for using rank-N types is that you must specify a type signature for every binder that you want to have a type scheme (as opposed to a plain monotype) as its type. However, you don't need to give the type signature on the binder (as I did above in the defn for f). You can give it in a separate type signature, thus: f :: (forall a. a->a) -> (Char,Bool) f g = (g 'c', g True) GHC will push the external type signature inwards, and use that information to decorate the binders as it comes across them. I don't have a *precise* specification of this process, but I think it is obvious enough in practice. * In a type synonym you can use rank-N types too. For example, you can write type IdFun = forall a. a->a f :: IdFun -> (Char,Bool) f g = (g 'c', g True) As always, type synonyms must always occur saturated; GHC expands them before it does anything else. (Still, GHC goes to some trouble to keep them unexpanded in error message.) The main plan is as before. The main typechecker for expressions, tcExpr, takes an "expected type" as its argument. This greatly improves error messages. The new feature is that when this "expected type" (going down) meets an "actual type" (coming up) we use the new subsumption function TcUnify.tcSub which checks that the actual type can be coerced into the expected type (and produces a coercion function to demonstrate). The main new chunk of code is TcUnify.tcSub. The unifier itself is unchanged, but it has moved from TcMType into TcUnify. Also checkSigTyVars has moved from TcMonoType into TcUnify. Result: the new module, TcUnify, contains all stuff relevant to subsumption and unification. Unfortunately, there is now an inevitable loop between TcUnify and TcSimplify, but that's just too bad (a simple TcUnify.hi-boot file). All of this doesn't come entirely for free. Here's the typechecker line count (INCLUDING comments) Before 16,551 After 17,116
-
chak authored
Added a new section that describes how GHC defines its hardwired knowledge about primitives and special prelude definitions.
-
- 25 Nov, 2001 3 commits
-
-
sof authored
Tidyup - only declare&use half-a-dozen prof-only global variables when PROFILING.
-
sof authored
Retainer/LDV changes. The recent prof-related commit forgot to include RtsFlags.h, methinks. But, modulo trivia, I'm reasonably sure that this commit mirrors whatever mods that unchecked-in file contains.
-
sof authored
extend the scope of the doNothing() macro; can now be used in Stg headers
-
- 23 Nov, 2001 12 commits
-
-
simonpj authored
Put spaces round %, in preparation for splittable name supplies
-
simonmar authored
unbreak tcModule.
-
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.
-
simonmar authored
Replace a lazy pattern match in tcGetInstLoc with a strict one (fixes a space leak).
-
simonmar authored
Adorn various constructor fields with strictness annotations - this fixes at least one space leak, in the mi_usages field of a ModIface.
-
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.
-
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().
-
simonmar authored
Call LDV_ENTER() on entry to a constructor in profiling mode.
-
simonmar authored
Call LDV_ENTER() on entry to a thunk or function in profiling mode.
-
simonmar authored
Add ldvEnter :: Code for LDV profiling: it records that the closure pointed to by R1 has just been entered.
-
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.
-
simonmar authored
Fix compilation problems with Stats.c in the !DEBUG case.
-
- 22 Nov, 2001 2 commits