Back to index

plt-scheme  4.2.1
Defines | Functions
funcs.h File Reference

Go to the source code of this file.

Defines

#define _jit   (*jit)

Functions

static void jit_notify_freed_code (void)
static void _jit_epilog (jit_state *jit)
static void _jit_prolog (jit_state *jit, int n)

Define Documentation

#define _jit   (*jit)

Definition at line 91 of file funcs.h.


Function Documentation

static void _jit_epilog ( jit_state jit) [static]

Definition at line 94 of file funcs.h.

{
  int n = _jitl.nbArgs;
  int frame_size, ofs;
  int first_saved_reg = JIT_AUX - n;
  int num_saved_regs = 32 - first_saved_reg;

  frame_size = 24 + 32 + 12 + num_saved_regs * 4;       /* r24..r31 + args             */
  frame_size += 15;                /* the stack must be quad-word     */
  frame_size &= ~15;               /* aligned                     */

#ifdef _CALL_DARWIN
  LWZrm(0, frame_size + 8, 1);     /* lwz   r0, x+8(r1)  (ret.addr.)  */
#else
  LWZrm(0, frame_size + 4, 1);     /* lwz   r0, x+4(r1)  (ret.addr.)  */
#endif
  MTLRr(0);                        /* mtspr LR, r0                       */

  ofs = frame_size - num_saved_regs * 4;
  LMWrm(first_saved_reg, ofs, 1);  /* lmw   rI, ofs(r1)           */
  ADDIrri(1, 1, frame_size);              /* addi  r1, r1, x             */
  BLR();                           /* blr                         */
}
static void _jit_prolog ( jit_state jit,
int  n 
) [static]

Definition at line 139 of file funcs.h.

{
  int frame_size;
  int ofs;
  int first_saved_reg = JIT_AUX - n;
  int num_saved_regs = 32 - first_saved_reg;

  _jitl.nextarg_geti = 3;
  _jitl.nextarg_getd = 1;
  _jitl.nbArgs = n;

  frame_size = 24 + 32 + 12 + num_saved_regs * 4;       /* r27..r31 + args             */
  frame_size += 15;                /* the stack must be quad-word     */
  frame_size &= ~15;               /* aligned                     */

  MFLRr(0);
  STWUrm(1, -frame_size, 1);              /* stwu  r1, -x(r1)            */

  ofs = frame_size - num_saved_regs * 4;
  STMWrm(first_saved_reg, ofs, 1);        /* stmw  rI, ofs(r1)           */
#ifdef _CALL_DARWIN
  STWrm(0, frame_size + 8, 1);            /* stw   r0, x+8(r1)           */
#else
  STWrm(0, frame_size + 4, 1);            /* stw   r0, x+4(r1)           */
#endif

#if 0
  for (i = 0; i < n; i++)
    MRrr(JIT_AUX-1-i, 3+i);        /* save parameters below r24          */
#endif
}
static void jit_notify_freed_code ( void  ) [static]

Definition at line 38 of file funcs.h.

{
}