Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
3e39d84d
Commit
3e39d84d
authored
Dec 14, 2000
by
sewardj
Browse files
[project @ 2000-12-14 16:32:40 by sewardj]
more interpreter itbl hackery
parent
87690c34
Changes
1
Show whitespace changes
Inline
Side-by-side
ghc/rts/StgMiscClosures.hc
View file @
3e39d84d
/* -----------------------------------------------------------------------------
* $Id: StgMiscClosures.hc,v 1.5
4
2000/12/14 1
5:19
:4
8
sewardj Exp $
* $Id: StgMiscClosures.hc,v 1.5
5
2000/12/14 1
6:32
:4
0
sewardj Exp $
*
* (c) The GHC Team, 1998-2000
*
...
...
@@ -53,26 +53,26 @@ STGFUN(stg_##type##_entry) \
#ifdef GHCI
/* 9 bits of return code for constructors created by
mci_make_const
r. */
FN_(stg_
bco
_constr_entry)
/* 9 bits of return code for constructors created by
the interprete
r. */
FN_(stg_
interp
_constr_entry)
{
/* R1 points at the constructor */
FB_
STGCALL2(fprintf,stderr,"stg_
bco
_constr_entry (direct return)!\n");
STGCALL2(fprintf,stderr,"stg_
interp
_constr_entry (direct return)!\n");
/* Pointless, since SET_TAG doesn't do anything */
SET_TAG( GET_TAG(GET_INFO(R1.cl)));
JMP_(ENTRY_CODE((P_)(*Sp)));
FE_
}
FN_(stg_
bco
_constr1_entry) { FB_ JMP_(RET_VEC((P_)(*Sp),0)); FE_ }
FN_(stg_
bco
_constr2_entry) { FB_ JMP_(RET_VEC((P_)(*Sp),1)); FE_ }
FN_(stg_
bco
_constr3_entry) { FB_ JMP_(RET_VEC((P_)(*Sp),2)); FE_ }
FN_(stg_
bco
_constr4_entry) { FB_ JMP_(RET_VEC((P_)(*Sp),3)); FE_ }
FN_(stg_
bco
_constr5_entry) { FB_ JMP_(RET_VEC((P_)(*Sp),4)); FE_ }
FN_(stg_
bco
_constr6_entry) { FB_ JMP_(RET_VEC((P_)(*Sp),5)); FE_ }
FN_(stg_
bco
_constr7_entry) { FB_ JMP_(RET_VEC((P_)(*Sp),6)); FE_ }
FN_(stg_
bco
_constr8_entry) { FB_ JMP_(RET_VEC((P_)(*Sp),7)); FE_ }
FN_(stg_
interp
_constr1_entry) { FB_ JMP_(RET_VEC((P_)(*Sp),0)); FE_ }
FN_(stg_
interp
_constr2_entry) { FB_ JMP_(RET_VEC((P_)(*Sp),1)); FE_ }
FN_(stg_
interp
_constr3_entry) { FB_ JMP_(RET_VEC((P_)(*Sp),2)); FE_ }
FN_(stg_
interp
_constr4_entry) { FB_ JMP_(RET_VEC((P_)(*Sp),3)); FE_ }
FN_(stg_
interp
_constr5_entry) { FB_ JMP_(RET_VEC((P_)(*Sp),4)); FE_ }
FN_(stg_
interp
_constr6_entry) { FB_ JMP_(RET_VEC((P_)(*Sp),5)); FE_ }
FN_(stg_
interp
_constr7_entry) { FB_ JMP_(RET_VEC((P_)(*Sp),6)); FE_ }
FN_(stg_
interp
_constr8_entry) { FB_ JMP_(RET_VEC((P_)(*Sp),7)); FE_ }
/* Some info tables to be used when compiled code returns a value to
the interpreter, i.e. the interpreter pushes one of these onto the
...
...
@@ -109,7 +109,7 @@ FN_(stg_bco_constr8_entry) { FB_ JMP_(RET_VEC((P_)(*Sp),7)); FE_ }
*/
/* When the returned value is in R1 ... */
#define STG_
BCO
RET_R1_Template(label) \
#define STG_
CtoI_
RET_R1_Template(label) \
IFN_(label) \
{ \
StgPtr bco; \
...
...
@@ -123,17 +123,39 @@ FN_(stg_bco_constr8_entry) { FB_ JMP_(RET_VEC((P_)(*Sp),7)); FE_ }
FE_ \
}
STG_BCORET_R1_Template(stg_bcoret_R1_entry);
STG_BCORET_R1_Template(stg_bcoret_R1_0_entry);
STG_BCORET_R1_Template(stg_bcoret_R1_1_entry);
STG_BCORET_R1_Template(stg_bcoret_R1_2_entry);
STG_BCORET_R1_Template(stg_bcoret_R1_3_entry);
STG_BCORET_R1_Template(stg_bcoret_R1_4_entry);
STG_BCORET_R1_Template(stg_bcoret_R1_5_entry);
STG_BCORET_R1_Template(stg_bcoret_R1_6_entry);
STG_BCORET_R1_Template(stg_bcoret_R1_7_entry);
VEC_POLY_INFO_TABLE(stg_bcoret_R1,0, NULL/*srt*/, 0/*srt_off*/, 0/*srt_len*/, RET_BCO,, EF_);
STG_CtoI_RET_R1_Template(stg_ctoi_ret_R1_entry);
STG_CtoI_RET_R1_Template(stg_ctoi_ret_R1_0_entry);
STG_CtoI_RET_R1_Template(stg_ctoi_ret_R1_1_entry);
STG_CtoI_RET_R1_Template(stg_ctoi_ret_R1_2_entry);
STG_CtoI_RET_R1_Template(stg_ctoi_ret_R1_3_entry);
STG_CtoI_RET_R1_Template(stg_ctoi_ret_R1_4_entry);
STG_CtoI_RET_R1_Template(stg_ctoi_ret_R1_5_entry);
STG_CtoI_RET_R1_Template(stg_ctoi_ret_R1_6_entry);
STG_CtoI_RET_R1_Template(stg_ctoi_ret_R1_7_entry);
VEC_POLY_INFO_TABLE(stg_ctoi_ret_R1,0, NULL/*srt*/, 0/*srt_off*/, 0/*srt_len*/, RET_BCO,, EF_);
/* When the returned value is in F1 ... */
/* TODO */
/* When the returned value is in D1 ... */
/* TODO */
/* The other way round: when the interpreter returns a value to
compiled code. The stack looks like this:
return info table (pushed by compiled code)
return value (pushed by interpreter)
If the value is ptr-rep'd, the interpreter simply returns to the
scheduler, instructing it to ThreadEnterGHC.
Otherwise (unboxed return value), we replace the top stack word,
which must be the tag, with stg_gc_unbx_r1_info (or f1_info or d1_info),
and return to the scheduler, instructing it to ThreadRunGHC.
No supporting code needed!
*/
/* Entering a BCO. Heave it on the stack and defer to the
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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