C-side support for FFI in GHCi (foreign import only).
/* -----------------------------------------------------------------------------
- * $Id: Bytecodes.h,v 1.6 2001/03/21 10:56:04 sewardj Exp $
+ * $Id: Bytecodes.h,v 1.7 2001/08/02 17:01:33 sewardj Exp $
*
* (c) The GHC Team, 1998-2000
*
#define bci_RETURN 25
#define bci_STKCHECK 26
#define bci_JMP 27
+#define bci_CCALL 28
/* If a BCO definitely requires less than this many words of stack,
* Copyright (c) 1994-1998.
*
* $RCSfile: Disassembler.c,v $
- * $Revision: 1.21 $
- * $Date: 2001/05/01 13:11:16 $
+ * $Revision: 1.22 $
+ * $Date: 2001/08/02 17:01:33 $
* ---------------------------------------------------------------------------*/
#ifdef DEBUG
StgInfoTable** itbls = (StgInfoTable**)(&itbls_arr->payload[0]);
switch (instrs[pc++]) {
+ case bci_CCALL:
+ fprintf(stderr, "CCALL marshaller at 0x%x\n",
+ literals[instrs[pc+1]] );
+ pc += 1; break;
case bci_STKCHECK:
fprintf(stderr, "STKCHECK %d\n", instrs[pc] );
pc += 1; break;
* Copyright (c) 1994-2000.
*
* $RCSfile: Interpreter.c,v $
- * $Revision: 1.24 $
- * $Date: 2001/05/27 06:08:24 $
+ * $Revision: 1.25 $
+ * $Date: 2001/08/02 17:01:33 $
* ---------------------------------------------------------------------------*/
#include "Rts.h"
}
}
}
-
+ case bci_CCALL: {
+ int o_itbl = BCO_NEXT;
+ void(*marshall_fn)(void*) = BCO_LIT(o_itbl);
+ marshall_fn ( (void*)(& StackWord(0) ) );
+ goto nextInsn;
+ }
case bci_JMP: {
/* BCO_NEXT modifies bciPtr, so be conservative. */
int nextpc = BCO_NEXT;