-----------------------------------------------------------------------
--- $Id: primops.txt,v 1.13 2001/01/03 16:44:29 sewardj Exp $
+-- $Id: primops.txt,v 1.14 2001/01/15 09:55:41 sewardj Exp $
--
-- Primitive Operations
--
------------------------------------------------------------------------
---- Support for the bytecode linker ---
+--- Support for the bytecode interpreter and linker ---
------------------------------------------------------------------------
-- Convert an Addr# to a followable type
primop AddrToHValueOp "addrToHValue#" GenPrimOp
Addr# -> (# a #)
+primop MkApUpd0_Op "mkApUpd0#" GenPrimOp
+ a -> (# a #)
+ with
+ out_of_line = True
+
+primop NewBCOOp "newBCO#" GenPrimOp
+ ByteArr# -> ByteArr# -> Array# a -> ByteArr# -> State# s -> (# State# s, BCO# #)
+ with
+ has_side_effects = True
+ out_of_line = True
+
------------------------------------------------------------------------
--- Addr# ---
with
strictness = { \ arity -> StrictnessInfo [wwLazy, wwPrim] False }
-------------------------------------------------------------------------
---- Bytecode objects ---
-------------------------------------------------------------------------
-
-primop NewBCOOp "newBCO#" GenPrimOp
- ByteArr# -> ByteArr# -> Array# a -> ByteArr# -> State# s -> (# State# s, BCO# #)
- with
- has_side_effects = True
- out_of_line = True
-
------------------------------------------------------------------------
--- Weak pointers ---
/* -----------------------------------------------------------------------------
- * $Id: PrimOps.h,v 1.71 2001/01/03 16:44:29 sewardj Exp $
+ * $Id: PrimOps.h,v 1.72 2001/01/15 09:55:41 sewardj Exp $
*
* (c) The GHC Team, 1998-2000
*
/* tagToEnum# is handled directly by the code generator. */
/* -----------------------------------------------------------------------------
- BCOs
+ BCOs and BCO linkery
-------------------------------------------------------------------------- */
EXTFUN_RTS(newBCOzh_fast);
+EXTFUN_RTS(mkApUpd0zh_fast);
/* -----------------------------------------------------------------------------
Signal processing. Not really primops, but called directly from
newBCOzh
BCOzh
+ mkApUpd0zh
unsafeCoercezh
addrToHValuezh
* Copyright (c) 1994-2000.
*
* $RCSfile: Interpreter.c,v $
- * $Revision: 1.11 $
- * $Date: 2001/01/12 12:06:24 $
+ * $Revision: 1.12 $
+ * $Date: 2001/01/15 09:55:41 $
* ---------------------------------------------------------------------------*/
#ifdef GHCI
//fprintf(stderr, "---PACK p %d, np %d\n",
// (int) itbl->layout.payload.ptrs,
// (int) itbl->layout.payload.nptrs );
+ ASSERT( itbl->layout.payload.ptrs + itbl->layout.payload.nptrs > 0);
SET_HDR(con, BCO_ITBL(o_itbl), CCS_SYSTEM/*ToDo*/);
for (i = 0; i < n_words; i++)
con->payload[i] = (StgClosure*)StackWord(i);
/* -----------------------------------------------------------------------------
- * $Id: PrimOps.hc,v 1.66 2000/12/20 15:17:55 rrt Exp $
+ * $Id: PrimOps.hc,v 1.67 2001/01/15 09:55:41 sewardj Exp $
*
* (c) The GHC Team, 1998-2000
*
RET_P(bco);
FE_
}
+
+FN_(mkApUpd0zh_fast)
+{
+ /* R1.p = the fn for the AP_UPD
+ */
+ StgAP_UPD* ap;
+ FB_
+ HP_CHK_GEN_TICKY(AP_sizeW(0), R1_PTR, mkApUpd0zh_fast,);
+ TICK_ALLOC_PRIM(sizeofW(StgHeader), AP_sizeW(0)-sizeofW(StgHeader), 0);
+ CCS_ALLOC(CCCS,AP_sizeW(0)); /* ccs prof */
+ ap = (StgAP_UPD *) (Hp + 1 - AP_sizeW(0));
+ SET_HDR(ap, &stg_AP_UPD_info, CCCS);
+
+ ap->n_args = 0;
+ ap->fun = R1.cl;
+
+ TICK_RET_UNBOXED_TUP(1);
+ RET_P(ap);
+ FE_
+}
#endif
/* -----------------------------------------------------------------------------