From: simonpj Date: Tue, 13 May 2003 15:37:23 +0000 (+0000) Subject: [project @ 2003-05-13 15:37:23 by simonpj] X-Git-Tag: Approx_11550_changesets_converted~917 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=c31f1ba4885c89f989fd753c45468756b429f3c3;p=ghc-hetmet.git [project @ 2003-05-13 15:37:23 by simonpj] Add optimistic-eval page; not linked yet --- diff --git a/ghc/docs/comm/the-beast/optimistic.html b/ghc/docs/comm/the-beast/optimistic.html new file mode 100644 index 0000000..4d15802 --- /dev/null +++ b/ghc/docs/comm/the-beast/optimistic.html @@ -0,0 +1,65 @@ +

Architectural stuff

+ +New fields in the TSO: + + + +

Speculation frames

+ +The info table for a speculation frame points to the static spec-depth configuration +for that speculation point. (Points to, because the config is mutable, and the info +table has to be adjacent to the (immutable) code.) + + + +

Abortion

+ +Abortion is modelled by a special asynchronous exception ThreadAbort. + + + + +When tearing frames off the stack, we start a new chunk at every speculation frame, as well as every +update frame. We proceed down to the deepest speculation frame. +

+The AP_STACK closure built for a speculation frame must be careful not to enter the +next AP_STACK closure up, because that would re-enter a possible loop. +

+Delivering an asynch exception to a thread that is speculating. Invariant: there can be no catch frames +inside speculation (we abort in catch# when speculating. So the asynch exception just +tears off frames in the standard way until it gets to a catch frame, just as it would usually do. +

+Abortion can punish one or more of the speculation frames by decrementing their static config variables. + +

Synchronous exceptions

+ +Synchronous exceptions are treated similarly as before. The stack is discarded up to an update frame; the +thunk to be updated is overwritten with "raise x", and the process continues. Until a catch frame. +

+When we find a spec frame, we allocate a "raise x" object, and resume execution with the return address +in the spec frame. In that way the spec frame is like a catch frame; it stops the unwinding process. +

+It's essential that every hard failure is caught, else speculation is unsafe. In particular, divide by zero +is hard to catch using OS support, so we test explicitly in library code. You can shoot yourself in the foot +by writing x `div#` 0, side-stepping the test. + + +

Online profiling

+ +Sampling can be more frequent than minor GC (by jiggling the end-of-block code) but cannot +be less frequent, because GC doesn't expect to see profiling frames. \ No newline at end of file diff --git a/ghc/docs/comm/the-beast/prelude.html b/ghc/docs/comm/the-beast/prelude.html index f3aa206..64b607d 100644 --- a/ghc/docs/comm/the-beast/prelude.html +++ b/ghc/docs/comm/the-beast/prelude.html @@ -23,7 +23,7 @@ GHC recognises these main classes of baked-in-ness:
Primitive types.
Primitive types cannot be defined in Haskell, and are utterly baked into the compiler. -They are notionally defined in the fictional module GHC.Prim. The TyCons for these types are all defined +They are notionally defined in the fictional module GHC.Prim. The TyCons for these types are all defined in module TysPrim; for example,
   intPrimTyCon :: TyCon