Commit fcc9fa26 authored by simonmar's avatar simonmar
Browse files

[project @ 2000-02-04 11:15:04 by simonmar]

Fix bug #1 in the unregisterised RTS:

Now that catch# is a fully-fledged IO operation, it has to respect the
return convention for IO, in particular if we don't have an R1
(eg. when unregisterised) then the return value goes on the stack.

The return convention could be better, after all we use R1 when
returning normal values, but I'll just fix it for now.
parent 1aa0765b
/* -----------------------------------------------------------------------------
* $Id: Exception.hc,v 1.6 2000/01/30 10:25:28 simonmar Exp $
* $Id: Exception.hc,v 1.7 2000/02/04 11:15:04 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
......@@ -199,6 +199,7 @@ FN_(killThreadzh_fast)
Catch frames
-------------------------------------------------------------------------- */
#ifdef REG_R1
#define CATCH_FRAME_ENTRY_TEMPLATE(label,ret) \
FN_(label); \
FN_(label) \
......@@ -209,16 +210,38 @@ FN_(killThreadzh_fast)
JMP_(ret); \
FE_ \
}
#else
#define CATCH_FRAME_ENTRY_TEMPLATE(label,ret) \
FN_(label); \
FN_(label) \
{ \
StgWord rval; \
FB_ \
rval = Sp[0]; \
Sp++; \
Su = ((StgCatchFrame *)Sp)->link; \
Sp += sizeofW(StgCatchFrame) - 1; \
Sp[0] = rval; \
JMP_(ret); \
FE_ \
}
#endif
#ifdef REG_R1
#define SP_OFF 0
#else
#define SP_OFF 1
#endif
CATCH_FRAME_ENTRY_TEMPLATE(catch_frame_entry,ENTRY_CODE(Sp[0]));
CATCH_FRAME_ENTRY_TEMPLATE(catch_frame_0_entry,RET_VEC(Sp[0],0));
CATCH_FRAME_ENTRY_TEMPLATE(catch_frame_1_entry,RET_VEC(Sp[0],1));
CATCH_FRAME_ENTRY_TEMPLATE(catch_frame_2_entry,RET_VEC(Sp[0],2));
CATCH_FRAME_ENTRY_TEMPLATE(catch_frame_3_entry,RET_VEC(Sp[0],3));
CATCH_FRAME_ENTRY_TEMPLATE(catch_frame_4_entry,RET_VEC(Sp[0],4));
CATCH_FRAME_ENTRY_TEMPLATE(catch_frame_5_entry,RET_VEC(Sp[0],5));
CATCH_FRAME_ENTRY_TEMPLATE(catch_frame_6_entry,RET_VEC(Sp[0],6));
CATCH_FRAME_ENTRY_TEMPLATE(catch_frame_7_entry,RET_VEC(Sp[0],7));
CATCH_FRAME_ENTRY_TEMPLATE(catch_frame_entry,ENTRY_CODE(Sp[SP_OFF]));
CATCH_FRAME_ENTRY_TEMPLATE(catch_frame_0_entry,RET_VEC(Sp[SP_OFF],0));
CATCH_FRAME_ENTRY_TEMPLATE(catch_frame_1_entry,RET_VEC(Sp[SP_OFF],1));
CATCH_FRAME_ENTRY_TEMPLATE(catch_frame_2_entry,RET_VEC(Sp[SP_OFF],2));
CATCH_FRAME_ENTRY_TEMPLATE(catch_frame_3_entry,RET_VEC(Sp[SP_OFF],3));
CATCH_FRAME_ENTRY_TEMPLATE(catch_frame_4_entry,RET_VEC(Sp[SP_OFF],4));
CATCH_FRAME_ENTRY_TEMPLATE(catch_frame_5_entry,RET_VEC(Sp[SP_OFF],5));
CATCH_FRAME_ENTRY_TEMPLATE(catch_frame_6_entry,RET_VEC(Sp[SP_OFF],6));
CATCH_FRAME_ENTRY_TEMPLATE(catch_frame_7_entry,RET_VEC(Sp[SP_OFF],7));
#ifdef PROFILING
#define CATCH_FRAME_BITMAP 7
......
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