[commit: ghc] master: Implement -XStaticValues (fc45f32)

git at git.haskell.org git at git.haskell.org
Wed Dec 10 01:58:39 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/fc45f32491313d2a44e72d8d59cdf95b1660189d/ghc

>---------------------------------------------------------------

commit fc45f32491313d2a44e72d8d59cdf95b1660189d
Author: Facundo Domínguez <facundo.dominguez at tweag.io>
Date:   Tue Dec 9 18:10:18 2014 -0600

    Implement -XStaticValues
    
    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 at tweag.io>
    Authored-by: Mathieu Boespflug <m at tweag.io>
    Authored-by: Alexander Vershilov <alexander.vershilov at 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


>---------------------------------------------------------------

fc45f32491313d2a44e72d8d59cdf95b1660189d
 compiler/deSugar/Coverage.hs                       |   3 +
 compiler/deSugar/Desugar.hs                        |  12 +-
 compiler/deSugar/DsExpr.hs                         | 109 ++++++++++++++++++
 compiler/deSugar/DsMeta.hs                         |   9 +-
 compiler/deSugar/DsMonad.hs                        |  25 ++++-
 compiler/deSugar/StaticPtrTable.hs                 |  75 +++++++++++++
 compiler/ghc.cabal.in                              |   1 +
 compiler/hsSyn/Convert.hs                          |   1 +
 compiler/hsSyn/HsExpr.hs                           |   7 ++
 compiler/main/DynFlags.hs                          |   2 +
 compiler/parser/Lexer.x                            |   7 ++
 compiler/parser/Parser.y                           |   2 +
 compiler/prelude/PrelNames.hs                      |  50 +++++++++
 compiler/rename/RnExpr.hs                          |  37 ++++++
 compiler/typecheck/TcBinds.hs                      |   2 +-
 compiler/typecheck/TcExpr.hs                       |  22 ++++
 compiler/typecheck/TcHsSyn.hs                      |   4 +
 compiler/typecheck/TcRnDriver.hs                   |  21 +++-
 compiler/typecheck/TcRnMonad.hs                    |   4 +-
 compiler/typecheck/TcRnTypes.hs                    |   8 +-
 docs/users_guide/glasgow_exts.xml                  | 125 +++++++++++++++++++++
 includes/HsFFI.h                                   |   4 +
 includes/Rts.h                                     |   1 +
 includes/rts/StaticPtrTable.h                      |  32 ++++++
 libraries/base/GHC/StaticPtr.hs                    | 122 ++++++++++++++++++++
 libraries/base/base.cabal                          |   1 +
 libraries/template-haskell/Language/Haskell/TH.hs  |   2 +-
 .../template-haskell/Language/Haskell/TH/Lib.hs    |   4 +
 .../template-haskell/Language/Haskell/TH/Ppr.hs    |   2 +
 .../template-haskell/Language/Haskell/TH/Syntax.hs |   1 +
 rts/Hash.c                                         |  23 ++++
 rts/Hash.h                                         |   7 ++
 rts/Linker.c                                       |   4 +
 rts/RtsStartup.c                                   |   4 +
 rts/StaticPtrTable.c                               |  57 ++++++++++
 rts/StaticPtrTable.h                               |  19 ++++
 .../tests/codeGen/should_run/CgStaticPointers.hs   |  36 ++++++
 .../codeGen/should_run/CgStaticPointers.stdout     |   5 +
 testsuite/tests/codeGen/should_run/all.T           |   3 +
 .../tests/deSugar/should_run/DsStaticPointers.hs   |  30 +++++
 .../deSugar/should_run/DsStaticPointers.stdout     |   5 +
 testsuite/tests/deSugar/should_run/all.T           |   2 +
 testsuite/tests/driver/T4437.hs                    |   3 +-
 .../parser/should_compile/RdrNoStaticPointers01.hs |   7 ++
 testsuite/tests/parser/should_compile/all.T        |   1 +
 .../rename/should_fail/RnStaticPointersFail01.hs   |   5 +
 .../should_fail/RnStaticPointersFail01.stderr      |   6 +
 .../rename/should_fail/RnStaticPointersFail02.hs   |   7 ++
 .../should_fail/RnStaticPointersFail02.stderr      |   8 ++
 .../rename/should_fail/RnStaticPointersFail03.hs   |   5 +
 .../should_fail/RnStaticPointersFail03.stderr      |   6 +
 testsuite/tests/rename/should_fail/all.T           |   6 +
 testsuite/tests/rts/GcStaticPointers.hs            |  33 ++++++
 testsuite/tests/rts/GcStaticPointers.stdout        |   3 +
 testsuite/tests/rts/ListStaticPointers.hs          |  26 +++++
 testsuite/tests/rts/all.T                          |   7 ++
 testsuite/tests/th/TH_StaticPointers.hs            |  11 ++
 testsuite/tests/th/TH_StaticPointers.stdout        |   1 +
 testsuite/tests/th/TH_StaticPointers02.hs          |  21 ++++
 testsuite/tests/th/TH_StaticPointers02.stderr      |  10 ++
 testsuite/tests/th/all.T                           |   6 +
 .../typecheck/should_compile/TcStaticPointers01.hs |  17 +++
 .../typecheck/should_compile/TcStaticPointers02.hs |  37 ++++++
 testsuite/tests/typecheck/should_compile/all.T     |   2 +
 .../should_fail/TcStaticPointersFail01.hs          |  11 ++
 .../should_fail/TcStaticPointersFail01.stderr      |   6 +
 .../should_fail/TcStaticPointersFail02.hs          |  12 ++
 .../should_fail/TcStaticPointersFail02.stderr      |  14 +++
 .../should_fail/TcStaticPointersFail03.hs          |   9 ++
 .../should_fail/TcStaticPointersFail03.stderr      |   6 +
 testsuite/tests/typecheck/should_fail/all.T        |   6 +
 71 files changed, 1163 insertions(+), 19 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc fc45f32491313d2a44e72d8d59cdf95b1660189d


More information about the ghc-commits mailing list