Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
jberryman
GHC
Commits
a3621909
Commit
a3621909
authored
Aug 02, 2001
by
sewardj
Browse files
[project @ 2001-08-02 17:01:33 by sewardj]
C-side support for FFI in GHCi (foreign import only).
parent
e0521ba8
Changes
3
Hide whitespace changes
Inline
Side-by-side
ghc/includes/Bytecodes.h
View file @
a3621909
/* -----------------------------------------------------------------------------
* $Id: Bytecodes.h,v 1.
6
2001/0
3/21 10:56:04
sewardj Exp $
* $Id: Bytecodes.h,v 1.
7
2001/0
8/02 17:01:33
sewardj Exp $
*
* (c) The GHC Team, 1998-2000
*
...
...
@@ -52,6 +52,7 @@
#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,
...
...
ghc/rts/Disassembler.c
View file @
a3621909
...
...
@@ -5,8 +5,8 @@
* Copyright (c) 1994-1998.
*
* $RCSfile: Disassembler.c,v $
* $Revision: 1.2
1
$
* $Date: 2001/0
5
/0
1
1
3:11:16
$
* $Revision: 1.2
2
$
* $Date: 2001/0
8
/0
2
1
7:01:33
$
* ---------------------------------------------------------------------------*/
#ifdef DEBUG
...
...
@@ -44,6 +44,10 @@ int disInstr ( StgBCO *bco, int pc )
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
;
...
...
ghc/rts/Interpreter.c
View file @
a3621909
...
...
@@ -5,8 +5,8 @@
* Copyright (c) 1994-2000.
*
* $RCSfile: Interpreter.c,v $
* $Revision: 1.2
4
$
* $Date: 2001/0
5/27 06:08:24
$
* $Revision: 1.2
5
$
* $Date: 2001/0
8/02 17:01:33
$
* ---------------------------------------------------------------------------*/
#include
"Rts.h"
...
...
@@ -761,7 +761,12 @@ StgThreadReturnCode interpretBCO ( Capability* cap )
}
}
}
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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment