summaryrefslogtreecommitdiff
path: root/compiler/ghci/ByteCodeAsm.lhs
Commit message (Collapse)AuthorAgeFilesLines
* Convert GHCi sources from .lhs to .hsRodlogic2014-10-291-559/+0
| | | | | | | | | | | | | | Summary: Signed-off-by: Rodlogic <admin@rodlogic.net> Test Plan: Does it compile? Reviewers: hvr, austin Reviewed By: austin Subscribers: thomie, carter, simonmar Differential Revision: https://phabricator.haskell.org/D319
* Make Applicative a superclass of MonadAustin Seipp2014-09-091-0/+2
| | | | | | | | | | | | | | | | | | | | | Summary: This includes pretty much all the changes needed to make `Applicative` a superclass of `Monad` finally. There's mostly reshuffling in the interests of avoid orphans and boot files, but luckily we can resolve all of them, pretty much. The only catch was that Alternative/MonadPlus also had to go into Prelude to avoid this. As a result, we must update the hsc2hs and haddock submodules. Signed-off-by: Austin Seipp <austin@well-typed.com> Test Plan: Build things, they might not explode horribly. Reviewers: hvr, simonmar Subscribers: simonmar Differential Revision: https://phabricator.haskell.org/D13
* Add LANGUAGE pragmas to compiler/ source filesHerbert Valerio Riedel2014-05-151-2/+2
| | | | | | | | | | | | | | | | | | In some cases, the layout of the LANGUAGE/OPTIONS_GHC lines has been reorganized, while following the convention, to - place `{-# LANGUAGE #-}` pragmas at the top of the source file, before any `{-# OPTIONS_GHC #-}`-lines. - Moreover, if the list of language extensions fit into a single `{-# LANGUAGE ... -#}`-line (shorter than 80 characters), keep it on one line. Otherwise split into `{-# LANGUAGE ... -#}`-lines for each individual language extension. In both cases, try to keep the enumeration alphabetically ordered. (The latter layout is preferable as it's more diff-friendly) While at it, this also replaces obsolete `{-# OPTIONS ... #-}` pragma occurences by `{-# OPTIONS_GHC ... #-}` pragmas.
* Fix BCO bitmap generation on 32-bit platforms (#8377)Takano Akio2013-09-291-11/+9
| | | | | | | On 32-bit platforms, the bitmap should be an array of 32-bit words, not Word64s. Signed-off-by: Austin Seipp <austin@well-typed.com>
* Add support for 512-bit-wide vectors.Geoffrey Mainland2013-09-221-0/+2
|
* Add support for 256-bit-wide vectors.Geoffrey Mainland2013-09-221-0/+2
|
* Fix AMP warnings.Austin Seipp2013-09-111-0/+8
| | | | | Authored-by: David Luposchainsky <dluposchainsky@gmail.com> Signed-off-by: Austin Seipp <austin@well-typed.com>
* Implement "roles" into GHC.Richard Eisenberg2013-08-021-4/+12
| | | | | | | | | | | | | | | | Roles are a solution to the GeneralizedNewtypeDeriving type-safety problem. Roles were first described in the "Generative type abstraction" paper, by Stephanie Weirich, Dimitrios Vytiniotis, Simon PJ, and Steve Zdancewic. The implementation is a little different than that paper. For a quick primer, check out Note [Roles] in Coercion. Also see http://ghc.haskell.org/trac/ghc/wiki/Roles and http://ghc.haskell.org/trac/ghc/wiki/RolesImplementation For a more formal treatment, check out docs/core-spec/core-spec.pdf. This fixes Trac #1496, #4846, #7148.
* Fix many ASSERT uses under Clang.Austin Seipp2013-06-181-1/+1
| | | | | | Clang doesn't like whitespace between macro and arguments. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Use the standard state monad transformer in GHCiIan Lynagh2013-04-091-8/+10
|
* Always pass vector values on the stack.Geoffrey Mainland2013-02-011-12/+14
| | | | | Vector values are now always passed on the stack. This isn't particularly efficient, but it will have to do for now.
* remove unnecessary size field in BCO (#7518)Simon Marlow2013-01-091-6/+2
|
* Do not treat a constructor in a *pattern* as a *use* of that constructorSimon Peyton Jones2012-10-291-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | Occurrences in terms are uses, in patterns they are not. In this way we get unused-constructor warnings from modules like this module M( f, g, T ) where data T = T1 | T2 Bool f x = T2 x g T1 = True g (T2 x) = x Here a T1 value cannot be constructed, so we can warn. The use in a pattern doesn't count. See Note [Patterns are not uses] in RnPat. Interestingly this change exposed three module in GHC itself that had unused constructors, which I duly removed: * ghc/Main.hs * compiler/ghci/ByteCodeAsm * compiler/nativeGen/PPC/RegInfo Their changes are in this patch.
* Remove the old codegenSimon Marlow2012-10-191-16/+16
| | | | | Except for CgUtils.fixStgRegisters that is used in the NCG and LLVM backends, and should probably be moved somewhere else.
* Make StgWord a portable type tooIan Lynagh2012-09-181-4/+4
| | | | | StgWord is a newtyped Word64, as it needed to be something that has a UArray instance.
* Move wORD_SIZE into platformConstantsIan Lynagh2012-09-161-14/+13
|
* Move wORD_SIZE_IN_BITS to DynFlagsIan Lynagh2012-09-141-20/+20
| | | | This frees wORD_SIZE up to be moved out of HaskellConstants
* Make -fscc-profiling a dynamic flagIan Lynagh2012-07-241-1/+1
| | | | All the flags that 'ways' imply are now dynamic
* Change how macros like ASSERT are definedIan Lynagh2012-06-051-0/+1
| | | | | By using Haskell's debugIsOn rather than CPP's "#ifdef DEBUG", we don't need to kludge things to keep the warning checker happy etc.
* Fix operand expansion function.Paolo Capriotti2012-04-161-57/+48
|
* Implemented word-sized addressing of pointers and literals.Paolo Capriotti2012-04-161-25/+25
|
* Bytecode assembler refactoring.Paolo Capriotti2012-04-161-330/+277
| | | | | | | | | Use a free monad to specify the assembling procedure, so that it can be run multiple times without producing side effects. This paves the way for a more general implementation of variable-sized instructions, since we need to dry-run the bytecode assembler to determine the size of the operands for some instructions.
* disable a debugging trace, and a little refactoringSimon Marlow2011-11-041-4/+2
|
* Get label calculations right when we have long (>16 bits) offsetsSimon Marlow2011-11-021-35/+68
| | | | | | This shows up as a segfault in GHCi when there is a very large BCO. I've constructed a test case that crashes with 7.2.1, which I'll put in the testsuite as ghcirun004.
* refactoring and fixing the stage 2 compilationSimon Marlow2011-08-251-0/+1
|
* fix some #ifdefs that were making compilation with 7.2.1 fail - theSimon Marlow2011-08-141-6/+0
| | | | safified array package is not in 7.2.1
* Fix import DEPRECATE failures for castSTUArraySimon Peyton Jones2011-08-021-0/+7
|
* Remove a use of cTargetOS, in favour of platformOSIan Lynagh2011-05-081-14/+15
|
* Remove some ifdefs in favour of Haskell testsIan Lynagh2011-05-011-0/+2
|
* Remove an ifdef from ghci/ByteCodeAsm.lhsIan Lynagh2011-05-011-2/+1
|
* Add LANGUAGE BangPatterns to modules that use themsimonpj@microsoft.com2010-11-121-0/+1
|
* Interruptible FFI calls with pthread_kill and CancelSynchronousIO. v4Edward Z. Yang2010-09-191-3/+3
| | | | | | | | | | | | | | | | | | | | | | | This is patch that adds support for interruptible FFI calls in the form of a new foreign import keyword 'interruptible', which can be used instead of 'safe' or 'unsafe'. Interruptible FFI calls act like safe FFI calls, except that the worker thread they run on may be interrupted. Internally, it replaces BlockedOnCCall_NoUnblockEx with BlockedOnCCall_Interruptible, and changes the behavior of the RTS to not modify the TSO_ flags on the event of an FFI call from a thread that was interruptible. It also modifies the bytecode format for foreign call, adding an extra Word16 to indicate interruptibility. The semantics of interruption vary from platform to platform, but the intent is that any blocking system calls are aborted with an error code. This is most useful for making function calls to system library functions that support interrupting. There is no support for pre-Vista Windows. There is a partner testsuite patch which adds several tests for this functionality.
* Remove (most of) the FiniteMap wrapperIan Lynagh2010-09-141-6/+7
| | | | | | | | We still have insertList, insertListWith, deleteList which aren't in Data.Map, and foldRightWithKey which works around the fold(r)WithKey addition and deprecation.
* implement case-on-Word in the byte code generator/interpreter (#2881)Simon Marlow2009-09-181-0/+11
|
* RTS tidyup sweep, first phaseSimon Marlow2009-08-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first phase of this tidyup is focussed on the header files, and in particular making sure we are exposinng publicly exactly what we need to, and no more. - Rts.h now includes everything that the RTS exposes publicly, rather than a random subset of it. - Most of the public header files have moved into subdirectories, and many of them have been renamed. But clients should not need to include any of the other headers directly, just #include the main public headers: Rts.h, HsFFI.h, RtsAPI.h. - All the headers needed for via-C compilation have moved into the stg subdirectory, which is self-contained. Most of the headers for the rest of the RTS APIs have moved into the rts subdirectory. - I left MachDeps.h where it is, because it is so widely used in Haskell code. - I left a deprecated stub for RtsFlags.h in place. The flag structures are now exposed by Rts.h. - Various internal APIs are no longer exposed by public header files. - Various bits of dead code and declarations have been removed - More gcc warnings are turned on, and the RTS code is more warning-clean. - More source files #include "PosixSource.h", and hence only use standard POSIX (1003.1c-1995) interfaces. There is a lot more tidying up still to do, this is just the first pass. I also intend to standardise the names for external RTS APIs (e.g use the rts_ prefix consistently), and declare the internal APIs as hidden for shared libraries.
* Allow more than 64k instructions in a BCO; fixes #789Ian Lynagh2009-08-011-26/+37
|
* Fix the 64k insns overflow check in ghci, and add more checksIan Lynagh2009-08-011-11/+14
|
* Remove some redundant fromIntegral'sIan Lynagh2009-07-301-1/+1
|
* Make the types we use when creating GHCi bytecode better match realityIan Lynagh2009-07-291-38/+37
| | | | | We were keeping things as Int, and then converting them to Word16 at the last minute, when really they ought to have been Word16 all along.
* Fix whitespace in ByteCodeAsm.lhsIan Lynagh2009-07-281-107/+107
|
* Remove unused importsIan Lynagh2009-07-071-10/+0
|
* Changes for the new IO library, mainly base-package modules moving aroundSimon Marlow2009-05-291-1/+6
|
* Remove type-ambiguous (fromIntegral 0)::Int, replacing it with just 0simonpj@microsoft.com2009-05-281-1/+1
| | | | | | This unnecessary ambiguity has been there for ages, and is now rejected by -Werror, after fixing #3261
* Require a bang pattern when unlifted types are where/let bound; #3182Ian Lynagh2009-04-241-2/+2
| | | | | For now we only get a warning, rather than an error, because the alex and happy templates don't follow the new rules yet.
* When generating C, don't pretend functions are dataIan Lynagh2009-02-061-2/+2
| | | | | | | | | | | | | | | We used to generated things like: extern StgWordArray (newCAF) __attribute__((aligned (8))); ((void (*)(void *))(W_)&newCAF)((void *)R1.w); (which is to say, pretend that newCAF is some data, then cast it to a function and call it). This goes wrong on at least IA64, where: A function pointer on the ia64 does not point to the first byte of code. Intsead, it points to a structure that describes the function. The first quadword in the structure is the address of the first byte of code so we end up dereferencing function pointers one time too many, and segfaulting.
* Fix warnings in ByteCodeAsmIan Lynagh2008-12-291-17/+19
|
* Support for using libffi to implement FFI calls in GHCi (#631)Simon Marlow2008-02-041-1/+2
| | | | | | | | | | | | This means that an unregisterised build on a platform not directly supported by GHC can now have full FFI support using libffi. Also in this commit: - use PrimRep rather than CgRep to describe FFI args in the byte code generator. No functional changes, but PrimRep is more correct. - change TyCon.sizeofPrimRep to primRepSizeW, which is more useful
* GHCi: use non-updatable thunks for breakpointsSimon Marlow2007-10-101-0/+2
| | | | | | | | | The extra safe points introduced for breakpoints were previously compiled as normal updatable thunks, but they are guaranteed single-entry, so we can use non-updatable thunks here. This restores the tail-call property where it was lost in some cases (although stack squeezing probably often recovered it), and should improve performance.
* Fix CodingStyle#Warnings URLsIan Lynagh2007-09-041-1/+1
|
* Use OPTIONS rather than OPTIONS_GHC for pragmasIan Lynagh2007-09-031-2/+2
| | | | | | | Older GHCs can't parse OPTIONS_GHC. This also changes the URL referenced for the -w options from WorkingConventions#Warnings to CodingStyle#Warnings for the compiler modules.