summaryrefslogtreecommitdiff
path: root/ghc/interpreter
Commit message (Collapse)AuthorAgeFilesLines
...
* [project @ 2000-01-10 16:23:32 by sewardj]sewardj2000-01-103-39/+80
|
* [project @ 2000-01-10 15:52:42 by sewardj]sewardj2000-01-101-3/+71
| | | | | ocGetNames: sort the acquired symbol table by symbol name, so that ocLookupSym can then use a fast binary search to find symbols.
* [project @ 2000-01-07 17:49:29 by sewardj]sewardj2000-01-073-15/+38
| | | | | | | type.c: implement typechecker(POSTPREL), so that initialisation of the typechecker is completed correctly in combined mode. storage.c(addTupleTycon): create a name table entry for () so that nameUnit in the above can be bound to something.
* [project @ 2000-01-07 16:56:47 by sewardj]sewardj2000-01-074-19/+37
| | | | | | | | storage.c: unZcode tuple types (eg Z4T) correctly (off by one) interface.c(startGHCClass): remember to do dictapsToQualtype on class member types (processInterfaces): return a Bool if Prelude.hi was processed, so we can know when to do everybody(POSTPREL)
* [project @ 2000-01-07 15:31:12 by sewardj]sewardj2000-01-072-8/+10
| | | | | finishGHCModule: correctly create export list entries for non-Names importEntity: allow TUPLE as a kind of TYCON (am dubious about this)
* [project @ 2000-01-07 10:29:59 by sewardj]sewardj2000-01-071-2/+3
| | | | Add a few more symbols to EXTERN_SYMS to track recent GHC Prelude changes.
* [project @ 2000-01-06 16:33:10 by sewardj]sewardj2000-01-063-10/+18
| | | | Update Hugs' knowledge of the GHC Prelude to track recent Prelude changes.
* [project @ 2000-01-06 14:17:16 by sewardj]sewardj2000-01-061-48/+7
| | | | Reinstate debug printing, but only only for combined mode.
* [project @ 2000-01-05 19:10:21 by andy]andy2000-01-053-10/+25
| | | | Commenting out the debugging messages for in the new interface code.
* [project @ 2000-01-05 18:05:33 by sewardj]sewardj2000-01-054-20/+74
| | | | | | | | | | | | | Fix more interface-reading bugs: -- Qualtypes were not being generated from DICTAPs for overloaded non-class values. New function dictapsToQualtype to handle this. -- Incorrect construction of constructor result type in startGHCDataDecl for parameterised types eg Just :: a -> Maybe a. Changed meaning of DICTAP, so that the construction is ap(DICTAP, (QConId, Type)) rather than ap(DICTAP, (QConId, [Type])). Will have to undo this if we want to support multiparam type classes.
* [project @ 2000-01-05 15:57:40 by sewardj]sewardj2000-01-052-9/+27
| | | | | | | Remember to add entities to module(m).names/.tycons/.classes as well as to module(m).exports. Otherwise the 'eval environment' will be wrong. Add assertions in storage.c for addName/addTycon/addClass.
* [project @ 2000-01-05 13:53:36 by sewardj]sewardj2000-01-054-43/+69
| | | | Fix some serious errors in the handling of instances in interfaces.
* [project @ 1999-12-20 16:55:26 by sewardj]sewardj1999-12-208-110/+343
| | | | | | | | | | | | | | | | | | * Fix silly bugs in new linker, object.[ch]. * Allow modules to have arbitrary numbers of "extra" object files as well as their primary object file. Initial requirement is that Prelude needs libHS_cbits.o/.dll as well as Prelude.o module(m).object is the primary object module(m).objectExtras are the extra objects module(m).objectExtraNames :: [Text] are their names. Modify machdep.c to assume that extra objects for module M live in the same directory as M's primary object. * Stuff 130ish symbol names into the RTS symbol table, enough so that the whole Prelude can be linked. That includes symbols in the C library needed by libHS_cbits. This is very hacky and needs to be fixed properly.
* [project @ 1999-12-17 16:34:08 by sewardj]sewardj1999-12-176-555/+867
| | | | | | | | | | | Reorganised object code loader/linker to make it much more modular and cleaner. All the machinery is now in object.[ch]. This stuff is packaged up as close to a standalone library as I can reasonably get it -- in particular, it knows nothing about Hugs -- so that the linker could easily be used in some entirely different application with almost no changes, if we so desire. Minor mods to interface.c & storage.c to use the new linker API.
* [project @ 1999-12-16 16:42:56 by sewardj]sewardj1999-12-161-2/+62
| | | | Add extended version of previous commit message as a comment.
* [project @ 1999-12-16 16:34:40 by sewardj]sewardj1999-12-166-349/+1159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Further major improvements in interface processing, mostly in the handling of types. Interfaces can contain references to unboxed types, and these need to be handled carefully. The following is a summary of how the interface loader now works. It is applied to groups of interfaces simultaneously, viz, the entire Prelude at once: 1. Throw away any entity not mentioned in the export lists. 2. Delete type (not data or newtype) definitions which refer to unknown types in their right hand sides. Because Hugs doesn't know of any unboxed types, this has the side effect of removing all type defns referring to unboxed types. Repeat step 2 until a fixed point is reached. 3. Make abstract all data/newtype defns which refer to an unknown type. eg, data Word = MkW Word# becomes data Word, because Word# is unknown. Hugs is happy to know about abstract boxed Words, but not about Word#s. 4. Step 2 could delete types referred to by values, instances and classes. So filter all entities, and delete those referring to unknown types _or_ classes. This could cause other entities to become invalid, so iterate step 4 to a fixed point. After step 4, the interfaces no longer contain anything unpalatable to Hugs. 5. Steps 1-4 operate purely on the iface syntax trees. We now start creating symbol table entries. First, create a module table entry for each interface, and locate and read in the corresponding object file. 6. Traverse all interfaces. For each entity, create an entry in the name, tycon, class or instance table, and fill in relevant fields, but do not attempt to link tycon/class/instance/name uses to their symbol table entries. 7. Revisit all symbol table entries created in step 6. We should now be able to replace all references to tycons/classes/instances/ names with the relevant symbol table entries. 8. Traverse all interfaces. For each iface, examine the export lists and use it to build export lists in the module table. Do the implicit 'import Prelude' thing if necessary. Finally, resolve references in the object code for this module. I'm sure the number of passes could be reduced. For the moment, understandability is of much higher priority. Hugs can now complete stages 1 through 8 for the whole GHC Prelude, excepting doing the object linking, which needs further work.
* [project @ 1999-12-10 15:59:41 by sewardj]sewardj1999-12-1017-1044/+1645
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Major improvements in interface processing, and minor supporting improvements to CT-storage management. * Make the iface parser return the complete interface as a single tree, which is processed later. Added abs syntax tags I_INTERFACE .. I_VALUE to support this. * Add tagged ("z") 2,3,4,5 tuples. Because they are tagged, they can't be confused with lists, etc. Selectors zfst, zsnd ... zsel45, zsel55 check tags first. Iface processing uses z-tuples wherever it can. * Add unap as a safe "inverse" of ap; it checks tags. So unap(TAG1, ap(TAG2,cell)) == cell but only if TAG1==TAG2, else assertion failure. * In interface.c, clean up the startGHC*/endGHC* functions. processInterfaces() is the top-level driver; it makes 4 passes over the supplied iface trees. * Throw away iface symbols not mentioned in export lists. * Use iface export lists to construct both the export and eval environments for a module. * Don't use Texts to refer to things. Instead use ConId and VarId. Added ConId and VarId as synonyms for Cell in storage.h. * Add findSimpleInstance in storage.c.
* [project @ 1999-12-07 11:36:40 by sewardj]sewardj1999-12-071-6/+11
| | | | | Correctly detect saturated applications of tuples, following recent change to Tuple machinery in Hugs.
* [project @ 1999-12-07 11:14:56 by sewardj]sewardj1999-12-073-15/+23
| | | | | | | | | | | | | Don't create a new infotable for every constructor application. Amazingly, that's what the codegen.c used to do. It didn't generate vast numbers of redundant infotables until recently, when I changed translate.c to generate saturated constructor applications in line. Prior to that, there was only ever one application of each constructor, so the old scheme was ok. Also, fix the assembler so that info table ptrs are commoned up. Eg, for [1,2,3], store only one copy of the address of the (:) itbl, rather than 3, in the BCO.
* [project @ 1999-12-06 16:47:07 by sewardj]sewardj1999-12-062-21/+16
| | | | | | Remove compile-time address space allocated to tuples, and remove all references to TUPMIN. I think I have fixed the address mapping for when TREX is defined, but you never know.
* [project @ 1999-12-06 16:25:23 by sewardj]sewardj1999-12-068-32/+87
| | | | | | | | | Remove Hugs' special treatment of tuples, and instead have them as just another Tycon. This is to make interworking with GHC simpler. Put tuple entries in the Tycon table. Modify isTycon, isTuple, tupleOf, mkTuple and whatIs so that client code doesn't see any difference. Add allocTupleTycon to manufacture tuple Tycon entries as startup.
* [project @ 1999-12-06 16:20:26 by sewardj]sewardj1999-12-061-4/+6
| | | | Only detect (# and #) as special tokens when parsing interface files.
* [project @ 1999-12-03 17:56:04 by sewardj]sewardj1999-12-033-54/+4
| | | | Remove some hooks into the Prelude which Hugs no longer needs to know about.
* [project @ 1999-12-03 17:01:20 by sewardj]sewardj1999-12-036-43/+69
| | | | | | More mods to interface file parsing: * Strictness annotations in data decls * Allow qualified names in a couple more places
* [project @ 1999-12-03 14:38:39 by sewardj]sewardj1999-12-032-9/+13
| | | | Make the combined/standalone switch, +c/-c, work at all :-)
* [project @ 1999-12-03 12:39:38 by sewardj]sewardj1999-12-038-127/+231
| | | | | | | | | | Add initial support for loading GHC Prelude (doesn't work yet): * Command line flag, +c/-c to start up in combined or standalone mode. In combined mode, looks for GHC's prelude in ghc/interpreter/GhcPrel (pro tem). * Parse unboxed tuple types and usage annotations in interface files.
* [project @ 1999-12-03 12:36:08 by sewardj]sewardj1999-12-032-7/+7
| | | | Directory wibbles
* [project @ 1999-12-01 11:50:31 by sewardj]sewardj1999-12-011-3/+3
| | | | Make <readline/history.h> a requirement for use of libreadline.
* [project @ 1999-12-01 10:56:25 by sewardj]sewardj1999-12-011-1/+8
| | | | Add rules so library sources can be obtained from fptools/hslibs.
* [project @ 1999-12-01 10:22:53 by sewardj]sewardj1999-12-012-13/+5
| | | | | | | | Fix bug in 'deriving Enum' reported by Ralf Hinze: data T = A | B deriving Enum failed, requiring instance Ord T, because code generated for enumFromThen required Ord. We now derive just fromEnum and toEnum, and let the Report's defaults do the rest.
* [project @ 1999-11-29 18:59:23 by sewardj]sewardj1999-11-2913-112/+374
| | | | | | | | | | | | | | | | Make StgHugs use the same naming scheme as GHC does for class + instance machinery. Add machinery to do Z-encoding/decoding of names extracted from interface files. Make the ELF object loader work again. It seemed to have suffered slight bitrot over the past couple of months. Fix various minor bugs. Track a small change in interface file syntax. Make Printer.c print tagged-unboxed stack sections in a decent way now that Alastair-style stack tags have been abandoned.
* [project @ 1999-11-29 18:53:14 by sewardj]sewardj1999-11-292-24/+81
| | | | Implement foreign import dynamic.
* [project @ 1999-11-25 12:12:25 by sewardj]sewardj1999-11-251-3/+2
| | | | Remove debugging printf in findQualifier().
* [project @ 1999-11-25 11:12:23 by sewardj]sewardj1999-11-251-1/+1
| | | | HUGS_VERSION ++
* [project @ 1999-11-25 11:10:16 by sewardj]sewardj1999-11-252-7/+7
| | | | Change STDCALL to STDKALL to avoid conflict with a header file.
* [project @ 1999-11-25 10:19:15 by sewardj]sewardj1999-11-256-48/+70
| | | | | Don't guess where the installation directory is. Instead, read it from the STGHUGSDIR env var at startup.
* [project @ 1999-11-24 17:32:41 by sewardj]sewardj1999-11-241-3/+3
| | | | Disable debug printing in setDefaultLibDir.
* [project @ 1999-11-24 17:25:14 by sewardj]sewardj1999-11-241-2/+5
| | | | Add clean target, and change hugslib to all.
* [project @ 1999-11-24 10:38:10 by andy]andy1999-11-241-4/+4
| | | | Fixing setDefaultLibDir to work with relative use of hugs binary.
* [project @ 1999-11-24 10:12:47 by andy]andy1999-11-241-3/+6
| | | | Adding method for packaging up binary distribution of Hugs.
* [project @ 1999-11-24 09:32:30 by andy]andy1999-11-241-20/+23
| | | | Fixes to allow compilation under cygwin and Win32.
* [project @ 1999-11-23 18:08:17 by sewardj]sewardj1999-11-236-21/+38
| | | | | Bind namePmFromInteger, namePmSubtract, namePmLe to stuff in Prelude so that n+k patterns work.
* [project @ 1999-11-23 15:12:04 by andy]andy1999-11-236-15/+35
| | | | | Changing the top level evaluator so it runs things of type IO a, not just IO <monomorphic-thing>.
* [project @ 1999-11-23 11:52:08 by andy]andy1999-11-231-3/+10
| | | | | Updating dll export function list to include new functions in nHandle.c
* [project @ 1999-11-23 10:03:41 by sewardj]sewardj1999-11-231-1/+0
| | | | wibble
* [project @ 1999-11-23 09:59:38 by sewardj]sewardj1999-11-232-4/+4
| | | | Update version number.
* [project @ 1999-11-23 09:48:46 by sewardj]sewardj1999-11-231-9/+2
| | | | Zap irrelevant ifdefs.
* [project @ 1999-11-22 18:11:00 by sewardj]sewardj1999-11-221-6/+36
| | | | | cgAlts(): Don't test constructor tag if the scrutinee is known to come from a product (single-constructor) type.
* [project @ 1999-11-22 17:18:02 by sewardj]sewardj1999-11-221-3/+7
| | | | | | When generating wrapper code for primops/callouts with return type IO (), don't allocate a unit to return. Instead, return the address of the unit closure.
* [project @ 1999-11-22 16:44:30 by sewardj]sewardj1999-11-221-2/+2
| | | | | Nuke DEBUG_EXTRA once and for all, and make Hugs use the same stack tags as GHC.