| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Most of the other users of the fptools build system have migrated to
Cabal, and with the move to darcs we can now flatten the source tree
without losing history, so here goes.
The main change is that the ghc/ subdir is gone, and most of what it
contained is now at the top level. The build system now makes no
pretense at being multi-project, it is just the GHC build system.
No doubt this will break many things, and there will be a period of
instability while we fix the dependencies. A straightforward build
should work, but I haven't yet fixed binary/source distributions.
Changes to the Building Guide will follow, too.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Cleanup: all (well, most) messages from the RTS now go through the
functions in RtsUtils: barf(), debugBelch() and errorBelch(). The
latter two were previously called belch() and prog_belch()
respectively. See the comments for the right usage of these message
functions.
One reason for doing this is so that we can avoid spurious uses of
stdout/stderr by Haskell apps on platforms where we shouldn't be using
them (eg. non-console apps on Windows).
|
| |
|
|
| |
Merge backend-hacking-branch onto HEAD. Yay!
|
| |
|
|
| |
BCO_INSTRS() is no more
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove most #includes of system headers from Stg.h, and instead
#include any required headers directly in each RTS source file.
The idea is to (a) reduce namespace pollution from system headers that
we don't need, (c) be clearer about dependencies on system things in
the RTS, and (c) improve via-C compilation times (maybe).
In practice though, HsBase.h #includes everything anyway, so the
difference from the point of view of .hc source is minimal. However,
this makes it easier to move to zero-includes if we wanted to (see
discussion on the FFI list; I'm still not sure that's possible but
at least this is a step in the right direction).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change the story about POSIX headers in C compilation.
Until now, all C code in the RTS and library cbits has by default been
compiled with settings for POSIXness enabled, that is:
#define _POSIX_SOURCE 1
#define _POSIX_C_SOURCE 199309L
#define _ISOC9X_SOURCE
If you wanted to negate this, you'd have to define NON_POSIX_SOURCE
before including headers.
This scheme has some bad effects:
* It means that ccall-unfoldings exported via interfaces from a
module compiled with -DNON_POSIX_SOURCE may not compile when
imported into a module which does not -DNON_POSIX_SOURCE.
* It overlaps with the feature tests we do with autoconf.
* It seems to have caused borkage in the Solaris builds for some
considerable period of time.
The New Way is:
* The default changes to not-being-in-Posix mode.
* If you want to force a C file into Posix mode, #include as
the **first** include the new file ghc/includes/PosixSource.h.
Most of the RTS C sources have this include now.
* NON_POSIX_SOURCE is almost totally expunged. Unfortunately
we have to retain some vestiges of it in ghc/compiler so that
modules compiled via C on Solaris using older compilers don't
break.
|
| |
|
|
| |
C-side FFI support for Byte/Ptr arrays.
|
| |
|
|
| |
C-side support for FFI in GHCi (foreign import only).
|
| |
|
|
| |
Implement bci_STKCHECK.
|
| |
|
|
|
|
| |
RTS support for the ugly tagToEnum# hack. Actually a very general
thing -- just a bytecode unconditional jump, so we can do more general
control-flow in BCOs.
|
| |
|
|
|
|
|
|
|
|
|
| |
Bite the bullet and make GHCi support non-optional in the RTS. GHC
4.11 should be able to build GHCi without any additional tweaks now.
- the Linker is split into two parts: LinkerBasic.c, containing the
routines required by the rest of the RTS, and Linker.c, containing
the linker proper, which is not referred to from the rest of the RTS.
Only Linker.c requires -ldl, so programs which don't make use of the
linker (everything except GHC, in other words) won't need -ldl.
|
| |
|
|
| |
Various bug fixes.
|
| |
|
|
|
| |
Start getting the bytecode interpreter to work. A matching commit to
compiler/ghci/ByteCodeGen.lhs follows ...
|
| |
|
|
| |
First shot at the new interpreter and disassembler.
|
| |
|
|
| |
Try to get the repo rts into a buildable state.
|
| |
|
|
|
|
|
|
|
|
| |
Lots of changes for Xmlambda. all changes are between
#ifdef XMLAMBDA blocks.
- new bytecodes for Inj constructors and witnesses
- new primops for rows
- code for calling foreign functions. This only works with
'dynamic.c' but that is not checked in yet.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Added new primitives and bytecodes that support
code generation for XMLambda. All additions are
surrounded by #ifdef XMLAMBDA.
Most important additions:
- Rows (n-tuples) which are implemented on top of Frozen Mutarrays
- Inj (variant sums), which is implemented using a new constructor
called Inj which contains both the value and an unboxed int
which represents the index.
|
| |
|
|
|
|
| |
Add i_ALLOC_CONSTR_big (== i_ALLOC_CONSTR with a 16-bit field
denoting offset of into table). The large constant tables in
nofib/spectral/hartel/nucleic2 need this.
|
| |
|
|
|
| |
Added basic support for MVars: data MVar, and newMVar, putMVar and
getMVar.
|
| |
|
|
|
| |
Computation of max-stack-use during BCO generation was completely bogus.
Fix it. Also, add a i_STK_CHECK_big insn with 16-bit opcode.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Add foreign import/export implementations for x86 stdcall convention.
Make parser notice calling conventions on f-i and f-x declarations,
check they are supported on the platform Hugs is compiled on. Pass
them all the way through the code generator to the interpreter.
Allow f-i/f-x decls to omit the calling convention, in which case
ccall is used. Remove calling convention from all such decls
in the Prelude so it will work on any platform.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Added basic support for foreign export dynamic.
Many aspects of it are still broken:
* Only supports x86-linux.
* The range of allowable types is small: Char Int Float Double
Addr and Word.
* Adjustor thunks are never freed.
* Returning Doubles or Floats doesn't work at all.
I expect to fix some of these shortly. foreign import also
needs redoing, so it can accept any number of arguments of
any type.
Also:
* Fixed setRtsFlags in Evaluator.c to make it endian-independent.
* Fixed raisePrim in Evaluator.c so things like division by zero,
array index errors, etc, throw an exception instead of
terminating StgHugs. raisePrim is renamed makeErrorCall.
|
| |
|
|
|
|
|
| |
Assembler/Disassembler: handle and print calls to compiled code
Evaluator: return to scheduler when entering unknown closure
StgCRun: debugging trace in miniinterpreter (temporary)
Updates: fix normal and vectored returns to Hugs
|
| |
|
|
|
|
|
|
|
| |
Changes to improve runtime performance of STG Hugs.
-- Reorganisation of the evaluator (Evaluator.c).
-- Changes to code emission (Assembler.c) to support peephole opts
-- An experimental simplifier (optimise.c).
-- Many supporting bug fixes and minor changes.
-- Experimental implementation of integer for standalone hugs (sainteger.c).
|
| |
|
|
|
|
|
|
|
|
| |
Many improvements resulting from first attempt to run nofib suite:
-- More libraries (lib/*.hs) brought into operation
-- Prelude error handling and basic I/O improved
-- Changed bytecode immediate value fields so large constant
-- tables can be compiled
-- Fixed bugs: translation of FATBAR, negative floating point
-- literals, strict constructors, handling of CAFs
|
| |
|
|
|
| |
Mods to make STG-hugs able to compile and run small examples. This
commit also includes proper implementations of seq, raise and catch.
|
| |
|
|
| |
Copyright police.
|
|
|
Move 4.01 onto the main trunk.
|