| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
|
|
|
|
| |
ocGetNames: sort the acquired symbol table by symbol name, so that
ocLookupSym can then use a fast binary search to find symbols.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
| |
finishGHCModule: correctly create export list entries for non-Names
importEntity: allow TUPLE as a kind of TYCON (am dubious about this)
|
|
|
|
| |
Add a few more symbols to EXTERN_SYMS to track recent GHC Prelude changes.
|
|
|
|
| |
Update Hugs' knowledge of the GHC Prelude to track recent Prelude changes.
|
|
|
|
| |
Reinstate debug printing, but only only for combined mode.
|
|
|
|
| |
Commenting out the debugging messages for in the new interface code.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Fix some serious errors in the handling of instances in interfaces.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Add extended version of previous commit message as a comment.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Correctly detect saturated applications of tuples, following
recent change to Tuple machinery in Hugs.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Only detect (# and #) as special tokens when parsing interface files.
|
|
|
|
| |
Remove some hooks into the Prelude which Hugs no longer needs to know about.
|
|
|
|
|
|
| |
More mods to interface file parsing:
* Strictness annotations in data decls
* Allow qualified names in a couple more places
|
|
|
|
| |
Make the combined/standalone switch, +c/-c, work at all :-)
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Directory wibbles
|
|
|
|
| |
Make <readline/history.h> a requirement for use of libreadline.
|
|
|
|
| |
Add rules so library sources can be obtained from fptools/hslibs.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Implement foreign import dynamic.
|
|
|
|
| |
Remove debugging printf in findQualifier().
|
|
|
|
| |
HUGS_VERSION ++
|
|
|
|
| |
Change STDCALL to STDKALL to avoid conflict with a header file.
|
|
|
|
|
| |
Don't guess where the installation directory is. Instead,
read it from the STGHUGSDIR env var at startup.
|
|
|
|
| |
Disable debug printing in setDefaultLibDir.
|
|
|
|
| |
Add clean target, and change hugslib to all.
|
|
|
|
| |
Fixing setDefaultLibDir to work with relative use of hugs binary.
|
|
|
|
| |
Adding method for packaging up binary distribution of Hugs.
|
|
|
|
| |
Fixes to allow compilation under cygwin and Win32.
|
|
|
|
|
| |
Bind namePmFromInteger, namePmSubtract, namePmLe to stuff in Prelude
so that n+k patterns work.
|
|
|
|
|
| |
Changing the top level evaluator so it runs things
of type IO a, not just IO <monomorphic-thing>.
|
|
|
|
|
| |
Updating dll export function list to include
new functions in nHandle.c
|
|
|
|
| |
wibble
|
|
|
|
| |
Update version number.
|
|
|
|
| |
Zap irrelevant ifdefs.
|
|
|
|
|
| |
cgAlts(): Don't test constructor tag if the scrutinee is known
to come from a product (single-constructor) type.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Nuke DEBUG_EXTRA once and for all, and make Hugs use the same stack
tags as GHC.
|