[commit: ghc] master: primops: Add haddocks to BCO primops (c526e09)

git at git.haskell.org git at git.haskell.org
Mon Jul 20 15:06:13 UTC 2015


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

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

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

commit c526e095c5762cc6feb3066779c2f919d66d40e5
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Mon Jul 20 16:45:01 2015 +0200

    primops: Add haddocks to BCO primops
    
    Test Plan: none
    
    Reviewers: simonmar, austin, hvr
    
    Subscribers: hvr, thomie
    
    Differential Revision: https://phabricator.haskell.org/D1082
    
    GHC Trac Issues: #10640


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

c526e095c5762cc6feb3066779c2f919d66d40e5
 compiler/prelude/primops.txt.pp | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/compiler/prelude/primops.txt.pp b/compiler/prelude/primops.txt.pp
index 162063e..d8ae6d6 100644
--- a/compiler/prelude/primops.txt.pp
+++ b/compiler/prelude/primops.txt.pp
@@ -2439,7 +2439,11 @@ primop  TagToEnumOp "tagToEnum#" GenPrimOp
 
 ------------------------------------------------------------------------
 section "Bytecode operations"
-        {Support for the bytecode interpreter and linker.}
+        {Support for manipulating bytecode objects used by the interpreter and
+        linker.
+
+        Bytecode objects are heap objects which represent top-level bindings and
+        contain a list of instructions and data needed by these instructions.}
 ------------------------------------------------------------------------
 
 primtype BCO#
@@ -2453,11 +2457,17 @@ primop   AddrToAnyOp "addrToAny#" GenPrimOp
 
 primop   MkApUpd0_Op "mkApUpd0#" GenPrimOp
    BCO# -> (# a #)
+   {Wrap a BCO in a {\tt AP_UPD} thunk which will be updated with the vaule of
+   the BCO when evaluated.}
    with
    out_of_line = True
 
 primop  NewBCOOp "newBCO#" GenPrimOp
    ByteArray# -> ByteArray# -> Array# a -> Int# -> ByteArray# -> State# s -> (# State# s, BCO# #)
+   {{\tt newBCO\#} instrs lits ptrs arity bitmap} creates a new bytecode object. The
+   resulting object encodes a function of the given arity with the instructions
+   encoded in {\tt instrs}, and a static reference table usage bitmap given by
+   {\tt bitmap}.}
    with
    has_side_effects = True
    out_of_line      = True



More information about the ghc-commits mailing list