summaryrefslogtreecommitdiff
path: root/includes/Rts.h
Commit message (Collapse)AuthorAgeFilesLines
* Typos in error messages and in commentsGabor Greif2015-04-101-1/+1
|
* Replace hooks by callbacks in RtsConfig (#8785)Simon Marlow2015-04-071-1/+0
| | | | | | | | | | | | Summary: Hooks rely on static linking semantics, and are broken by -Bsymbolic which we need when using dynamic linking. Test Plan: Built it Reviewers: austin, hvr, tibbe Differential Revision: https://phabricator.haskell.org/D8
* Implement -XStaticValuesFacundo Domínguez2014-12-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: As proposed in [1], this extension introduces a new syntactic form `static e`, where `e :: a` can be any closed expression. The static form produces a value of type `StaticPtr a`, which works as a reference that programs can "dereference" to get the value of `e` back. References are like `Ptr`s, except that they are stable across invocations of a program. The relevant wiki pages are [2, 3], which describe the motivation/ideas and implementation plan respectively. [1] Jeff Epstein, Andrew P. Black, and Simon Peyton-Jones. Towards Haskell in the cloud. SIGPLAN Not., 46(12):118–129, September 2011. ISSN 0362-1340. [2] https://ghc.haskell.org/trac/ghc/wiki/StaticPointers [3] https://ghc.haskell.org/trac/ghc/wiki/StaticPointers/ImplementationPlan Authored-by: Facundo Domínguez <facundo.dominguez@tweag.io> Authored-by: Mathieu Boespflug <m@tweag.io> Authored-by: Alexander Vershilov <alexander.vershilov@tweag.io> Test Plan: `./validate` Reviewers: hvr, simonmar, simonpj, austin Reviewed By: simonpj, austin Subscribers: qnikst, bgamari, mboes, carter, thomie, goldfire Differential Revision: https://phabricator.haskell.org/D550 GHC Trac Issues: #7015
* Revert "Rename _closure to _static_closure, apply naming consistently."Edward Z. Yang2014-10-201-1/+0
| | | | | | | This reverts commit 35672072b4091d6f0031417bc160c568f22d0469. Conflicts: compiler/main/DriverPipeline.hs
* Rename _closure to _static_closure, apply naming consistently.Edward Z. Yang2014-10-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In preparation for indirecting all references to closures, we rename _closure to _static_closure to ensure any old code will get an undefined symbol error. In order to reference a closure foobar_closure (which is now undefined), you should instead use STATIC_CLOSURE(foobar). For convenience, a number of these old identifiers are macro'd. Across C-- and C (Windows and otherwise), there were differing conventions on whether or not foobar_closure or &foobar_closure was the address of the closure. Now, all foobar_closure references are addresses, and no & is necessary. CHARLIKE/INTLIKE were not changed, simply alpha-renamed. Part of remove HEAP_ALLOCED patch set (#8199) Depends on D265 Signed-off-by: Edward Z. Yang <ezyang@mit.edu> Test Plan: validate Reviewers: simonmar, austin Subscribers: simonmar, ezyang, carter, thomie Differential Revision: https://phabricator.haskell.org/D267 GHC Trac Issues: #8199
* [ci skip] includes: detabify/dewhitespace Rts.hAustin Seipp2014-08-201-10/+10
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* rts: Print correct stack size on stack overflowBen Gamari2013-10-251-1/+1
| | | | | This requires that stackOverflow() in RtsUtils.c be passed a reference to the current TSO. This requires a small change in libraries/base.
* Use dynamic linking only if the GHC package is compiled with -dynamic (#8376)Simon Marlow2013-10-111-0/+10
|
* Globally replace "hackage.haskell.org" with "ghc.haskell.org"Simon Marlow2013-10-011-1/+1
|
* Revert "Default to infinite stack size (#8189)"Austin Seipp2013-09-081-2/+1
| | | | This reverts commit d85044f6b201eae0a9e453b89c0433608e0778f0.
* Default to infinite stack size (#8189)Austin Seipp2013-09-081-1/+2
| | | | | | | | | | | | | When servicing a stack overflows, only throw an exception to the given thread if the user explicitly set a max stack size, using +RTS -K. Otherwise just service it normally and grow the stack. In case we actually run out of *heap* (stack chuncks are allocated on the heap), then we need to bail by calling the stackOverflow() hook and exit immediately. Authored-by: Ben Gamari <bgamari.foss@gmail.com> Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Optimise lockClosure when n_capabilities == 1; fixes #693Ian Lynagh2013-06-151-1/+1
| | | | Based on a patch from Yuras Shumovich.
* Fix a typoIan Lynagh2013-02-051-1/+1
|
* Expose the prototype for getMonotonicNSecIan Lynagh2013-01-171-0/+1
| | | | Fixes T3807 on OS X 32.
* Don't clearNurseries() in parallel with -debugSimon Marlow2012-11-011-0/+6
| | | | It makes sanity-checking fail.
* Produce new-style Cmm from the Cmm parserSimon Marlow2012-10-081-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main change here is that the Cmm parser now allows high-level cmm code with argument-passing and function calls. For example: foo ( gcptr a, bits32 b ) { if (b > 0) { // we can make tail calls passing arguments: jump stg_ap_0_fast(a); } return (x,y); } More details on the new cmm syntax are in Note [Syntax of .cmm files] in CmmParse.y. The old syntax is still more-or-less supported for those occasional code fragments that really need to explicitly manipulate the stack. However there are a couple of differences: it is now obligatory to give a list of live GlobalRegs on every jump, e.g. jump %ENTRY_CODE(Sp(0)) [R1]; Again, more details in Note [Syntax of .cmm files]. I have rewritten most of the .cmm files in the RTS into the new syntax, except for AutoApply.cmm which is generated by the genapply program: this file could be generated in the new syntax instead and would probably be better off for it, but I ran out of enthusiasm. Some other changes in this batch: - The PrimOp calling convention is gone, primops now use the ordinary NativeNodeCall convention. This means that primops and "foreign import prim" code must be written in high-level cmm, but they can now take more than 10 arguments. - CmmSink now does constant-folding (should fix #7219) - .cmm files now go through the cmmPipeline, and as a result we generate better code in many cases. All the object files generated for the RTS .cmm files are now smaller. Performance should be better too, but I haven't measured it yet. - RET_DYN frames are removed from the RTS, lots of code goes away - we now have some more canned GC points to cover unboxed-tuples with 2-4 pointers, which will reduce code size a little.
* Fix #7087 (integer overflow in getDelayTarget())Simon Marlow2012-07-311-0/+2
|
* Fix build on Win32, and handle the FMT_* #defines in a slightly nicer wayIan Lynagh2012-04-271-13/+0
|
* Simplify format specifiersIan Lynagh2012-04-271-27/+4
| | | | | It turns out that we can use %zu and %llu on Win32, provided we include PosixSource everywhere we want to use them.
* Fix build on OSX: Use the 'z' format specifier modifier when possibleIan Lynagh2012-04-261-15/+9
| | | | | On Win32 it's not recognised, so we unfortunately can't use it unconditionally.
* Fix warnings on Win64Ian Lynagh2012-04-261-3/+12
| | | | | | Mostly this meant getting pointer<->int conversions to use the right sizes. lnat is now size_t, rather than unsigned long, as that seems a better match for how it's used.
* A couple of build fixes for Win64Ian Lynagh2012-04-241-1/+1
|
* Fix mkDerivedConstants on Win64Ian Lynagh2012-03-191-0/+18
| | | | | It was assuming that long's are word-sized, which is not the case on Win64.
* Fixes for the threaded RTS on Win64Ian Lynagh2012-03-181-0/+7
|
* Fix a #defineIan Lynagh2012-01-151-1/+1
| | | | | | | I don't think it was causing any problems, but TimeToUS(x+y) would have evaluated to x + (y / 1000)
* Time handling overhaulSimon Marlow2011-11-251-0/+30
| | | | | | | | | | | | | | | | | | | | | Terminology cleanup: the type "Ticks" has been renamed "Time", which is an StgWord64 in units of TIME_RESOLUTION (currently nanoseconds). The terminology "tick" is now used consistently to mean the interval between timer signals. The ticker now always ticks in realtime (actually CLOCK_MONOTONIC if we have it). Before it used CPU time in the non-threaded RTS and realtime in the threaded RTS, but I've discovered that the CPU timer has terrible resolution (at least on Linux) and isn't much use for profiling. So now we always use realtime. This should also fix The default tick interval is now 10ms, except when profiling where we drop it to 1ms. This gives more accurate profiles without affecting runtime too much (<1%). Lots of cleanups - the resolution of Time is now in one place only (Rts.h) rather than having calculations that depend on the resolution scattered all over the RTS. I hope I found them all.
* Generate the C main() function when linking a binary (fixes #5373)Simon Marlow2011-11-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than have main() be statically compiled as part of the RTS, we now generate it into the tiny C file that we compile when linking a binary. The main motivation is that we want to pass the settings for the -rtsotps and -with-rtsopts flags into the RTS, rather than relying on fragile linking semantics to override the defaults, which don't work with DLLs on Windows (#5373). In order to do this, we need to extend the API for initialising the RTS, so now we have: void hs_init_ghc (int *argc, char **argv[], // program arguments RtsConfig rts_config); // RTS configuration hs_init_ghc() can optionally be used instead of hs_init(), and allows passing in configuration options for the RTS. RtsConfig is a struct, which currently has two fields: typedef struct { RtsOptsEnabledEnum rts_opts_enabled; const char *rts_opts; } RtsConfig; but might have more in the future. There is a default value for the struct, defaultRtsConfig, the idea being that you start with this and override individual fields as necessary. In fact, main() was in a separate static library, libHSrtsmain.a. That's now gone.
* prog_argv and rts_argv now contain *copies* of the args passed toSimon Marlow2011-05-251-3/+0
| | | | | | setupRtsFlags(), rather than sharing the memory. Previously if the caller of hs_init() passed in dynamically-allocated memory and then freed it, random crashes could happen later (#5177).
* Unicode fixes, taking into account PEP383 supportMax Bolingbroke2011-05-141-0/+6
|
* Add a configure test for the visibility hidden attributeIan Lynagh2010-11-231-1/+1
|
* Fix the symbol visibility pragmasSimon Marlow2010-06-171-9/+1
|
* New implementation of BLACKHOLEsSimon Marlow2010-03-291-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces the global blackhole_queue with a clever scheme that enables us to queue up blocked threads on the closure that they are blocked on, while still avoiding atomic instructions in the common case. Advantages: - gets rid of a locked global data structure and some tricky GC code (replacing it with some per-thread data structures and different tricky GC code :) - wakeups are more prompt: parallel/concurrent performance should benefit. I haven't seen anything dramatic in the parallel benchmarks so far, but a couple of threading benchmarks do improve a bit. - waking up a thread blocked on a blackhole is now O(1) (e.g. if it is the target of throwTo). - less sharing and better separation of Capabilities: communication is done with messages, the data structures are strictly owned by a Capability and cannot be modified except by sending messages. - this change will utlimately enable us to do more intelligent scheduling when threads block on each other. This is what started off the whole thing, but it isn't done yet (#3838). I'll be documenting all this on the wiki in due course.
* Fix the format specifier for Int64/Word64 on WindowsIan Lynagh2010-03-271-0/+7
| | | | | mingw doesn't understand %llu/%lld - it treats them as 32-bit rather than 64-bit. We use %I64u/%I64d instead.
* Optimise the code generated at trace pointsSimon Marlow2009-09-121-0/+6
|
* Omit visibility pragmas on Windows (fixes warnings/validate failures)Simon Marlow2009-09-091-0/+12
|
* add RTS_PRIVATE attributeSimon Marlow2009-08-291-0/+5
|
* Fix incorrectly hidden RTS symbolsSimon Marlow2009-08-291-0/+3
|
* Tidy up file headers and copyrights; point to the wiki for docsSimon Marlow2009-08-251-0/+3
| | | | | | | I've updated the wiki page about the RTS headers http://hackage.haskell.org/trac/ghc/wiki/Commentary/SourceTree/Includes to reflect the new layout and explain some of the rationale. All the header files now point to this page.
* move termios prototypes into a public headerSimon Marlow2009-08-031-0/+1
|
* move StgEntCounter type into its own headerSimon Marlow2009-08-031-25/+1
|
* RTS tidyup sweep, first phaseSimon Marlow2009-08-021-81/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* remove old incarnation of .NET supportSimon Marlow2009-06-281-4/+0
|
* Add CHECK(p), like ASSERT(p) but works even when !defined(DEBUG)Simon Marlow2009-07-291-5/+9
| | | | For inexpensive assertions
* NetBSD defines _REENTRANT in its header files, so compiling ghc givesSimon Marlow2009-07-231-0/+2
| | | | | | redefinition warnings for all files that are including includes/Rts.h. Contributed by: Krister Walfridsson <krister.walfridsson@gmail.com>
* Stop building the rts against gmpDuncan Coutts2009-06-131-7/+0
| | | | Nothing from gmp is used in the rts anymore.
* Remove the implementation of gmp primops from the rtsDuncan Coutts2009-06-131-1/+0
|
* Remove the unused remains of __decodeFloatIan Lynagh2009-06-021-1/+0
|
* Remove old GUM/GranSim codeSimon Marlow2009-06-021-19/+0
|
* pad step_workspace to 64 bytes, to speed up access to gct->steps[]Simon Marlow2008-04-161-0/+6
|
* add ROUNDUP_BYTES_TO_WDSsimonmar@microsoft.com2008-02-151-1/+3
|