1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-26 03:51:32 +00:00
Files
Interlisp.maiko/inc/tosret.h
Bruce Mitchener 0a057dec6b Delete code related to NATIVETRAN feature. (#232)
* Delete code related to NATIVETRAN feature.

This was obsolete work that had been done for generating
native code from the bytecode.

Closes Interlisp/medley#89.

* Remove unused SaveD6.
2021-01-19 17:57:53 -08:00

80 lines
3.0 KiB
C

#ifndef TOSRET_H
#define TOSRET_H 1
/* $Id: tosret.h,v 1.2 1999/01/03 02:06:28 sybalsky Exp $ (C) Copyright Venue, All Rights Reserved */
/************************************************************************/
/* */
/* (C) Copyright 1989, 1990, 1998 Venue. All Rights Reserved. */
/* Manufactured in the United States of America. */
/* */
/************************************************************************/
/************************************************************************/
/* */
/* t o s r e t m a c r o . h */
/* */
/* Implements RETURN for the inner evaluation loop. There are */
/* two versions--one for when hand optimization has been done, */
/* and one for the naive case. To use the hand-optimization */
/* version, you'll need to define an inline function or macro */
/* called opreturn(). It must fall thru if alink is odd, but */
/* must handle all other cases. You can rely on check_interrupt */
/* being a defined label. */
/* */
/************************************************************************/
#if ((defined(ISC) || defined(SUN3_OS3_OR_OS4_IL)) && !(defined(NOASMFNCALL)) )
/* JDS 22 May 96 CSTKPTR >- Irq... was just >, but got overflows with last
frame right against endofstack, causing 0-long free blocks, inf loops... */
#define OPRETURN \
{ opreturn(); \
EXT; if(slowreturn()) goto stackoverflow_help; RET; \
Irq_Stk_Check = STK_END_COMPUTE(EndSTKP,FuncObj); \
if (((UNSIGNED)(CSTKPTR) >= Irq_Stk_Check) || (Irq_Stk_End <= 0)) \
{ goto check_interrupt; } \
Irq_Stk_End = (UNSIGNED) EndSTKP; \
}
#else
#define OPRETURN { \
register struct frameex2 *returnFX ; \
register int alink; \
FNCHECKER(struct frameex2 *old_bce_fx = (struct frameex2 *) BCE_CURRENTFX); \
alink = ((struct frameex2 *) BCE_CURRENTFX)->alink; \
FNTPRINT(("RETURN = 0x%x, ", TOPOFSTACK)); \
FNTRACER(prindatum(TOPOFSTACK); printf("\n"); fflush(stdout);) \
if (alink & 1) { EXT; if(slowreturn()) goto stackoverflow_help; RET; \
Irq_Stk_Check = STK_END_COMPUTE(EndSTKP,FuncObj); \
if (((UNSIGNED)(CSTKPTR) >= Irq_Stk_Check) || (Irq_Stk_End <= 0)) \
{ goto check_interrupt; } \
Irq_Stk_End = (UNSIGNED) EndSTKP; \
goto retxit; \
}; \
CSTKPTRL = (LispPTR *) IVAR; \
returnFX = (struct frameex2 *) \
((DLword *) \
(PVARL = (DLword *) Addr68k_from_StkOffset(alink)) \
- FRAMESIZE); \
IVARL = (DLword *) \
Addr68k_from_StkOffset(GETWORD((DLword *)returnFX -1)); \
/* Get PC from Returnee's pc slot in FX */ \
PCMACL = returnFX->pc + (ByteCode *) \
(FuncObj = (struct fnhead *) \
Addr68k_from_LADDR(SWAP_FNHEAD(returnFX->fnheader) & POINTERMASK)) + 1;\
Irq_Stk_Check = STK_END_COMPUTE(EndSTKP,FuncObj); \
FNCHECKER(if (quick_stack_check()) printf("In RETURN.\n")); \
if (((UNSIGNED)(CSTKPTR) >= Irq_Stk_Check) || (Irq_Stk_End <= 0)) \
{ goto check_interrupt; } \
Irq_Stk_End = (UNSIGNED) EndSTKP; \
retxit: {} \
} /* OPRETURN end */
#endif
#endif /* TOSRET_H */