Commit 4ee658a7 authored by sewardj's avatar sewardj
Browse files

[project @ 2001-08-09 11:19:16 by sewardj]

C-side FFI support for Byte/Ptr arrays.
parent 70b37ccb
/* -----------------------------------------------------------------------------
* $Id: Bytecodes.h,v 1.7 2001/08/02 17:01:33 sewardj Exp $
* $Id: Bytecodes.h,v 1.8 2001/08/09 11:19:16 sewardj Exp $
*
* (c) The GHC Team, 1998-2000
*
......@@ -53,7 +53,7 @@
#define bci_STKCHECK 26
#define bci_JMP 27
#define bci_CCALL 28
#define bci_SWIZZLE 29
/* If a BCO definitely requires less than this many words of stack,
don't include an explicit STKCHECK insn in it. The interpreter
......
......@@ -5,8 +5,8 @@
* Copyright (c) 1994-1998.
*
* $RCSfile: Disassembler.c,v $
* $Revision: 1.22 $
* $Date: 2001/08/02 17:01:33 $
* $Revision: 1.23 $
* $Date: 2001/08/09 11:19:16 $
* ---------------------------------------------------------------------------*/
#ifdef DEBUG
......@@ -44,9 +44,13 @@ int disInstr ( StgBCO *bco, int pc )
StgInfoTable** itbls = (StgInfoTable**)(&itbls_arr->payload[0]);
switch (instrs[pc++]) {
case bci_SWIZZLE:
fprintf(stderr, "SWIZZLE stkoff %d by %d\n",
instrs[pc], (signed int)instrs[pc+1]);
pc += 2; break;
case bci_CCALL:
fprintf(stderr, "CCALL marshaller at 0x%x\n",
literals[instrs[pc+1]] );
literals[instrs[pc]] );
pc += 1; break;
case bci_STKCHECK:
fprintf(stderr, "STKCHECK %d\n", instrs[pc] );
......
......@@ -5,8 +5,8 @@
* Copyright (c) 1994-2000.
*
* $RCSfile: Interpreter.c,v $
* $Revision: 1.27 $
* $Date: 2001/08/07 09:02:02 $
* $Revision: 1.28 $
* $Date: 2001/08/09 11:19:16 $
* ---------------------------------------------------------------------------*/
#include "Rts.h"
......@@ -37,7 +37,7 @@
scheduler. Ie normally you don't want REFERENCE_INTERPRETER to be
defined. */
/* #define REFERENCE_INTERPRETER */
#define REFERENCE_INTERPRETER
/* Gather stats about entry, opcode, opcode-pair frequencies. For
tuning the interpreter. */
......@@ -763,6 +763,12 @@ StgThreadReturnCode interpretBCO ( Capability* cap )
}
}
}
case bci_SWIZZLE: {
int stkoff = BCO_NEXT;
signed short n = (signed short)(BCO_NEXT);
StackWord(stkoff) += (W_)n;
goto nextInsn;
}
case bci_CCALL: {
StgInt tok;
int o_itbl = BCO_NEXT;
......
/* -----------------------------------------------------------------------------
* $Id: Printer.c,v 1.43 2001/08/04 06:09:24 ken Exp $
* $Id: Printer.c,v 1.44 2001/08/09 11:19:16 sewardj Exp $
*
* (c) The GHC Team, 1994-2000.
*
......@@ -121,6 +121,12 @@ void printClosure( StgClosure *obj )
break;
}
case FOREIGN:
fprintf(stderr,"FOREIGN(");
printPtr((StgPtr)( ((StgForeignObj*)obj)->data ));
fprintf(stderr,")\n");
break;
case IND:
fprintf(stderr,"IND(");
printPtr((StgPtr)stgCast(StgInd*,obj)->indirectee);
......@@ -341,6 +347,7 @@ void printClosure( StgClosure *obj )
//barf("printClosure %d",get_itbl(obj)->type);
fprintf(stderr, "*** printClosure: unknown type %d ****\n",
get_itbl(obj)->type );
barf("printClosure %d",get_itbl(obj)->type);
return;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment