-----------------------------------------------------------------------
--- $Id: primops.txt,v 1.7 2000/12/04 12:31:19 simonmar Exp $
+-- $Id: primops.txt,v 1.8 2000/12/11 12:56:14 simonmar Exp $
--
-- Primitive Operations
--
------------------------------------------------------------------------
primop NewBCOOp "newBCO#" GenPrimOp
- Int# -> Int# -> Int# -> a -> State# RealWorld -> (# State# RealWorld, BCO# #)
+ ByteArr# -> ByteArr# -> MutArr# s a -> State# s -> (# State# s, BCO# #)
with
has_side_effects = True
out_of_line = True
- strictness = { \ arity -> StrictnessInfo
- [wwPrim, wwPrim, wwPrim, wwLazy, wwPrim] False }
- usage = { mangle NewBCOOp [mkP, mkP, mkP, mkM, mkP] mkR }
-
-primop WriteBCOPtrOp "writeBCOPtr#" GenPrimOp
- BCO# -> Int# -> o -> State# RealWorld -> State# RealWorld
- with
- usage = { mangle WriteBCOPtrOp [mkP, mkP, mkM, mkP] mkR }
- strictness = { \ arity -> StrictnessInfo
- [wwPrim, wwPrim, wwLazy, wwPrim] False }
- has_side_effects = True
-
-primop WriteBCONonPtrOp "writeBCONonPtr#" GenPrimOp
- BCO# -> Int# -> Word# -> State# RealWorld -> State# RealWorld
- with
- has_side_effects = True
-
-primop WriteBCOInstrOp "writeBCOInstr#" GenPrimOp
- BCO# -> Int# -> Word# -> State# RealWorld -> State# RealWorld
- with
- has_side_effects = True
-
-primop ReadBCOPtrOp "readBCOPtr#" GenPrimOp
- BCO# -> Int# -> State# RealWorld -> (# State# RealWorld, Word# #)
- with
- usage = { mangle ReadBCOPtrOp [mkP, mkP] mkM }
-
-primop ReadBCONonPtrOp "readBCONonPtr#" GenPrimOp
- BCO# -> Int# -> State# RealWorld -> (# State# RealWorld, Word# #)
-
-primop ReadBCOInstrOp "readBCOInstr#" GenPrimOp
- BCO# -> Int# -> State# RealWorld -> (# State# RealWorld, Word# #)
-
-primop SameBCOOp "sameBCO#" GenPrimOp
- BCO# -> BCO# -> Bool
- with
- -- is this usage right?
- usage = { mangle SameMutableArrayOp [mkP, mkP] mkM }
+primop GetBCOPtrsOp "getBCOPtrs#" GenPrimOp
+ BCO# -> State# s -> (# State# s, MutArr# s a #)
------------------------------------------------------------------------
--- Weak pointers ---
/* -----------------------------------------------------------------------------
- * $Id: PrimOps.h,v 1.68 2000/12/04 12:31:20 simonmar Exp $
+ * $Id: PrimOps.h,v 1.69 2000/12/11 12:56:14 simonmar Exp $
*
* (c) The GHC Team, 1998-2000
*
/* tagToEnum# is handled directly by the code generator. */
/* -----------------------------------------------------------------------------
+ BCOs
+ -------------------------------------------------------------------------- */
+
+EXTFUN_RTS(newBCOzh_fast);
+#define getBCOPtrszh(r,bco) r=((StgBCO *)bco)->ptrs
+
+/* -----------------------------------------------------------------------------
Signal processing. Not really primops, but called directly from
Haskell.
-------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------------
- * $Id: PrimOps.hc,v 1.60 2000/12/04 12:31:21 simonmar Exp $
+ * $Id: PrimOps.hc,v 1.61 2000/12/11 12:56:14 simonmar Exp $
*
* (c) The GHC Team, 1998-2000
*
}
/* -----------------------------------------------------------------------------
+ Bytecode object primitives
+ ------------------------------------------------------------------------- */
+
+FN_(newBCOzh_fast)
+{
+ /* R1.p = instrs
+ R2.p = literals
+ R3.p = ptrs
+ */
+ StgBCO *bco;
+ FB_
+
+ HP_CHK_GEN_TICKY(sizeofW(StgBCO),R1_PTR|R2_PTR|R3_PTR, newBCOzh_fast,);
+ TICK_ALLOC_PRIM(sizeofW(StgHeader), sizeofW(StgBCO)-sizeofW(StgHeader), 0);
+ CCS_ALLOC(CCCS,sizeofW(StgBCO)); /* ccs prof */
+
+ bco = (StgBCO *) (Hp + 1 - sizeof(StgBCO));
+ SET_HDR(w, &stg_BCO_info, CCCS);
+
+ w->instrs = R1.cl;
+ w->literals = R2.cl;
+ w->ptrs = R3.cl;
+
+ TICK_RET_UNBOXED_TUP(1);
+ RET_P(w);
+ FE_
+}
+
+/* -----------------------------------------------------------------------------
Thread I/O blocking primitives
-------------------------------------------------------------------------- */