summaryrefslogtreecommitdiff
path: root/compiler/ghci/ByteCodeGen.lhs
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove use of lambda with a refutable patternsimonpj@microsoft.com2010-09-231-26/+24
|
* Remove (most of) the FiniteMap wrapperIan Lynagh2010-09-141-14/+18
| | | | | | | | We still have insertList, insertListWith, deleteList which aren't in Data.Map, and foldRightWithKey which works around the fold(r)WithKey addition and deprecation.
* Super-monster patch implementing the new typechecker -- at lastsimonpj@microsoft.com2010-09-131-3/+5
| | | | | | | | | This major patch implements the new OutsideIn constraint solving algorithm in the typecheker, following our JFP paper "Modular type inference with local assumptions". Done with major help from Dimitrios Vytiniotis and Brent Yorgey.
* Refactor PackageTarget back into StaticTargetBen.Lippmeier@anu.edu.au2010-01-041-14/+1
|
* Follow PackageTarget change in byte code generatorBen.Lippmeier@anu.edu.au2010-01-021-0/+14
|
* implement case-on-Word in the byte code generator/interpreter (#2881)Simon Marlow2009-09-181-0/+10
|
* Windows build fixSimon Marlow2009-08-031-1/+1
|
* If ghci runs out of labels, panicIan Lynagh2009-08-011-1/+4
|
* Remove some redundant fromIntegral'sIan Lynagh2009-07-301-2/+2
|
* Make the types we use when creating GHCi bytecode better match realityIan Lynagh2009-07-291-51/+61
| | | | | 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.
* Trim unused imports detected by new unused-import codesimonpj@microsoft.com2009-07-061-3/+3
|
* FIX #2845: Allow breakpoints on expressions with unlifted typeSimon Marlow2009-04-201-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | It turns out we can easily support breakpoints on expressions with unlifted types, by translating case tick# of _ -> e into let f = \s . case tick# of _ -> e in f realWorld# instead of just a plain let-binding. This is the same trick that GHC uses for abstracting join points of unlifted type. In #2845, GHC has eta-expanded the tick expression, changing the result type from IO a to (# State#, a #), which was the reason the tick was suddenly being ignored. By supporting ticks on unlifted expressions we can make it work again, although some confusion might arise because _result will no longer be available (it now has unboxed-tuple type, so we can't bind it in the environment). The underlying problem here is that GHC does transformations like eta-expanding the tick expressions, and there's nothing we can do to prevent that.
* When generating C, don't pretend functions are dataIan Lynagh2009-02-061-1/+1
| | | | | | | | | | | | | | | 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.
* Tidy up treatment of big lambda (fixes Trac #2898)simonpj@microsoft.com2008-12-301-48/+43
| | | | | | | | | | There was a leftover big lambda in the CorePrep'd code, which confused the bytecode generator. Actually big lambdas are harmless. This patch refactors ByteCodeGen so that it systemantically used 'bcView' to eliminate junk. I did a little clean up in CorePrep too. See comments in Trac #2898.
* Comments only. Fix typo.Thomas Schilling2008-12-111-1/+1
|
* pushAtom: add missing case for MachNullAddr (#2589)Simon Marlow2008-10-091-0/+1
|
* Follow extensible exception changesIan Lynagh2008-07-301-2/+1
|
* validate fix: eliminate a warning on non-WindowsSimon Marlow2008-05-151-2/+2
|
* FIX #1288: GHCi wasn't adding the @n suffix to stdcalls on WindowsSimon Marlow2008-05-141-2/+13
|
* Make ByteCodeGen warning-freeIan Lynagh2008-05-041-67/+58
|
* (F)SLIT -> (f)sLit in ByteCodeGenIan Lynagh2008-04-121-2/+2
|
* Import libffi-3.0.4, and use it to provide FFI support in GHCiSimon Marlow2008-04-081-10/+0
| | | | | | | | | | | | | | | | | | | | This replaces the hand-rolled architecture-specific FFI support in GHCi with the standard libffi as used in GCJ, Python and other projects. I've bundled the complete libffi-3.0.4 tarball in the source tree in the same way as we do for GMP, the difference being that we always build and install our own libffi regardless of whether there's one on the system (it's small, and we don't want dependency/versioning headaches). In particular this means that unregisterised builds will now have a fully working GHCi including FFI out of the box, provided libffi supports the platform. There is also code in the RTS to use libffi in place of rts/Adjustor.c, but it is currently not enabled if we already have support in Adjustor.c for the current platform. We need to assess the performance impact before using libffi here too (in GHCi we don't care too much about performance).
* Support for using libffi to implement FFI calls in GHCi (#631)Simon Marlow2008-02-041-38/+57
| | | | | | | | | | | | 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-2/+10
| | | | | | | | | 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 #1466 (partly), which was causing concprog001(ghci) to failSimon Marlow2007-09-111-6/+8
| | | | | | | | | | An AP_STACK now ensures that there is at least AP_STACK_SPLIM words of stack headroom available after unpacking the payload. Continuations that require more than AP_STACK_SPLIM words of stack must do their own stack checks instead of aggregating their stack usage into the parent frame. I have made this change for the interpreter, but not for compiled code yet - we should do this in the glorious rewrite of the code generator.
* 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.
* Add {-# OPTIONS_GHC -w #-} and some blurb to all compiler modulesIan Lynagh2007-09-011-0/+7
|
* Update the panic msg from #1257 to be an ordinary error, not a panicSimon Marlow2007-05-181-4/+5
| | | | We don't support arbitrary unboxed tuples in GHCi right now.
* We shouldn't let-bind expressions with unlifted typeSimon Marlow2007-04-271-11/+17
| | | | Now I can single step through Happy-generated parsers
* remember the type of _resultSimon Marlow2007-04-251-0/+1
|
* Various cleanups and improvements to the breakpoint supportSimon Marlow2007-04-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | - move parts of the debugger implementation below the GHC API where they belong. There is still more in Debugger that violates the layering, hopefully I'll get to that later. - instead of returning an IO action from runStmt for resuming, return a ResumeHandle that is passed to GHC.resume. - breakpoints now return [Name] which is displayed in the same way as when a binding statement is executed. - :load, :add, :reload now clear the active breakpoints and context - :break gives a sensible error when used on a non-interpreted module - export breakpoint-related types from GHC - remove a bunch of layer-violating imports from InteractiveUI - remove some more vestiges of the old breakpoint code (topLevel in the GHCi state). - remove TickTree and use a simple array instead, cached per module
* Re-working of the breakpoint supportSimon Marlow2007-04-171-26/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the result of Bernie Pope's internship work at MSR Cambridge, with some subsequent improvements by me. The main plan was to (a) Reduce the overhead for breakpoints, so we could enable the feature by default without incurrent a significant penalty (b) Scatter more breakpoint sites throughout the code Currently we can set a breakpoint on almost any subexpression, and the overhead is around 1.5x slower than normal GHCi. I hope to be able to get this down further and/or allow breakpoints to be turned off. This patch also fixes up :print following the recent changes to constructor info tables. (most of the :print tests now pass) We now support single-stepping, which just enables all breakpoints. :step <expr> executes <expr> with single-stepping turned on :step single-steps from the current breakpoint The mechanism is quite different to the previous implementation. We share code with the HPC (haskell program coverage) implementation now. The coverage pass annotates source code with "tick" locations which are tracked by the coverage tool. In GHCi, each "tick" becomes a potential breakpoint location. Previously breakpoints were compiled into code that magically invoked a nested instance of GHCi. Now, a breakpoint causes the current thread to block and control is returned to GHCi. See the wiki page for more details and the current ToDo list: http://hackage.haskell.org/trac/ghc/wiki/NewGhciDebugger
* Fix C/Haskell type mismatchesIan Lynagh2007-04-041-2/+2
|
* refactor: use do-notation rather than `thenBc`-styleSimon Marlow2007-03-081-109/+106
|
* Handle LongArg's in the FFI on x86Ian Lynagh2006-12-221-0/+1
|
* Allow a word-sized argument for STKCHECKIan Lynagh2006-12-211-3/+1
|
* MERGE: Fix Windows DEP violations (bug #885)Simon Marlow2006-12-121-8/+15
| | | | Original patch by brianlsmith@gmail.com
* fix for #1013. Simon Marlow2006-12-071-2/+11
| | | | We weren't getting the bitmap right for the continuation BCO in a case-of-case.
* More import tidying and fixing the stage 2 buildSimon Marlow2006-10-111-38/+32
|
* In ByteCodeGen, correctly passthru AnnCast in all relevant places, so the ↵audreyt@audreyt.org2006-09-231-7/+7
| | | | previous band-aid fix is no longer needed.
* Add explicit eta-reduction to GHCI's schemeE such that deriving Typeable ↵audreyt@audreyt.org2006-09-231-0/+7
| | | | won't panick.
* Repair "ghci" under FC+AT by handling AnnCast in bytecode generator.audreyt@audreyt.org2006-09-221-0/+3
|
* Warning police: Removed overlapped pattern warningssven.panne@aedion.de2006-08-111-1/+0
|
* Reorganisation of the source treeSimon Marlow2006-04-071-0/+1358
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.