- 08 Feb, 2003 1 commit
-
-
wolfgang authored
PowerPC: for ccalls, use the correct minimum size (32 bytes) for the parameter area
-
- 11 Dec, 2002 1 commit
-
-
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.
-
- 21 Nov, 2002 1 commit
-
-
simonmar authored
Repair the HEAD after some file adds/removes that were supposed to happen on the eval-apply-branch yesterday mysteriously happened on the HEAD instead.
-
- 20 Nov, 2002 1 commit
-
-
simonmar authored
Snapshot of the Eval/Apply changes, c. 15 Nov 2002. This snapshot should be relatively stable, although GHCi and profiling are currently known to be broken.
-
- 27 Oct, 2002 1 commit
-
-
wolfgang authored
Fix a type and a bug for PowerPC.
-
- 14 Oct, 2002 1 commit
-
-
sof authored
make it compile again (x86)
-
- 12 Oct, 2002 1 commit
-
-
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)
-
- 13 Sep, 2002 2 commits
-
-
simonpj authored
Native code gen primpops (courtesy Julian)
-
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.
-
- 06 Sep, 2002 1 commit
-
-
simonmar authored
Finally separate the compiler from hslibs. Mainly import wibbles, and use the new POSIX library when bootstrapping.
-
- 29 Aug, 2002 1 commit
-
-
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.
-
- 02 Aug, 2002 1 commit
-
-
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.
-
- 19 Jul, 2002 1 commit
-
-
simonmar authored
Sparc NCG fix from Sven Panne: 8-byte align the stack ptr when doing a ccall.
-
- 16 Jul, 2002 1 commit
-
-
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.
-
- 20 Jun, 2002 1 commit
-
-
simonpj authored
Teach code gen about some extra no-ops
-
- 02 May, 2002 1 commit
-
-
simonmar authored
ptext => ftext
-
- 29 Apr, 2002 1 commit
-
-
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.
-
- 05 Apr, 2002 1 commit
-
-
sof authored
Friday afternoon pet peeve removal: define (Util.notNull :: [a] -> Bool) and use it
-
- 01 Apr, 2002 1 commit
-
-
simonpj authored
Import wibbles
-
- 14 Mar, 2002 2 commits
-
-
simonmar authored
Back out previous fix, it was wrong.
-
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.
-
- 13 Mar, 2002 1 commit
-
-
simonmar authored
Cope with VoidRep fields in a static constructor.
-
- 12 Mar, 2002 1 commit
-
-
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.
-
- 15 Feb, 2002 1 commit
-
-
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.
-
- 13 Feb, 2002 1 commit
-
-
simonpj authored
Import wibbles
-
- 12 Feb, 2002 1 commit
-
-
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 :-(
-
- 06 Feb, 2002 1 commit
-
-
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.
-
- 04 Feb, 2002 2 commits
- 30 Jan, 2002 2 commits
- 29 Jan, 2002 3 commits
-
-
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.
-
sewardj authored
sparc NCG fixes for f-i-dynamic.
-
sewardj authored
Teach the NCG how to do f-i-dynamic. Nothing unexpected. sparc-side now needs fixing.
-
- 08 Jan, 2002 2 commits
-
-
sewardj authored
merge from stable branch: 1.46.4.3 +14 -7 fptools/ghc/compiler/nativeGen/AsmCodeGen.lhs 1.47.4.3 +2 -0 fptools/ghc/compiler/nativeGen/MachMisc.lhs Treat literal appearances of BaseReg in Stix trees uniformly. This is now taken to mean the &MainCapability.r, regardless of whether BaseReg is in a register (x86) or synthesised (sparc).
-
sewardj authored
merge from the stable branch: 1.70.4.2 fptools/ghc/compiler/nativeGen/StixPrim.lhs 1.5.10.3 fptools/ghc/includes/mkNativeHdr.c Track recent changes to HpLim assignment in load_thread_state.
-
- 02 Jan, 2002 2 commits
-
-
simonmar authored
- Implement a small GC optimisation: when a static constructor has been determined to have no (indirect) CAF references, we set its static link field to a non-zero value (currently 1). This prevents the garbage collector from traversing this closure and transitively everything it points to, and thus should speed up GC a little. - Omit the static link field from static constructors which have no pointer fields (i.e. they are CONSTR_NOCAF_STATIC). - Add the padding words and the static link field for a static constructor at (AbsC) code generation time, rather than in the back ends. This eliminates some duplication between PprAbsC and AbsCStixGen.
-
simonmar authored
No need for #ifdef around shift primop now.
-
- 21 Dec, 2001 2 commits