pike.git / src / interpret_functions.h

version» Context lines:

pike.git/src/interpret_functions.h:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: interpret_functions.h,v 1.116 2002/11/11 16:16:09 grubba Exp $ + || $Id: interpret_functions.h,v 1.117 2002/11/12 11:48:20 grubba Exp $   */      /*    * Opcode definitions for the interpreter.    */      #include "global.h"      #undef CJUMP   #undef AUTO_BIGNUM_LOOP_TEST
pike.git/src/interpret_functions.h:2072:      OPCODE1(F_CALL_BUILTIN1, "call builtin 1", 0, {    DO_CALL_BUILTIN(1);   });      OPCODE1(F_CALL_BUILTIN1_AND_POP, "call builtin1 & pop", 0, {    DO_CALL_BUILTIN(1);    pop_stack();   });    + #ifndef ENTRY_PROLOGUE_SIZE + #define ENTRY_PROLOGUE_SIZE 0 + #endif /* !ENTRY_PROLOGUE_SIZE */ +    #define DO_RECUR(XFLAGS) do{ \    PIKE_OPCODE_T *addr; \    register struct pike_frame *new_frame; \    ptrdiff_t args; \    \    fast_check_threads_etc(6); \    check_stack(256); \    \    new_frame=alloc_pike_frame(); \    \    new_frame->refs=1; \    new_frame->next=Pike_fp; \    \    Pike_fp->pc = (PIKE_OPCODE_T *)(((INT32 *)PROG_COUNTER) + 1); \    addr = PROG_COUNTER+GET_JUMP(); \ -  args=addr[-1]; \ +     \ -  +  new_frame->num_locals = READ_INCR_BYTE(addr); \ +  args = READ_INCR_BYTE(addr); \ +  addr += ENTRY_PROLOGUE_SIZE; \ +  \    new_frame->num_args = new_frame->args = args; \    new_frame->locals=new_frame->save_sp=new_frame->expendible=Pike_sp-args; \    new_frame->save_mark_sp = new_frame->mark_sp_base = Pike_mark_sp; \    \ -  push_zeroes((new_frame->num_locals = (ptrdiff_t)addr[-2]) - args); \ +  push_zeroes(new_frame->num_locals - args); \    \    DO_IF_DEBUG({ \    if(t_flag > 3) \    fprintf(stderr,"- Allocating %d extra locals.\n", \    new_frame->num_locals - new_frame->num_args); \    }); \    \    \    SET_PROG_COUNTER(addr); \    new_frame->fun=Pike_fp->fun; \
pike.git/src/interpret_functions.h:2171:      /* Assume that the number of arguments is correct */   /* FIXME: adjust Pike_mark_sp */   OPCODE0_JUMP(F_TAIL_RECUR, "tail recursion", 0, {    INT32 num_locals;    PIKE_OPCODE_T *addr;    INT32 args;       fast_check_threads_etc(6);    -  addr=PROG_COUNTER+GET_JUMP(); -  args=addr[-1]; -  num_locals=addr[-2]; +  addr = PROG_COUNTER+GET_JUMP(); +  num_locals = READ_INCR_BYTE(addr); +  args = READ_INCR_BYTE(addr); +  addr += ENTRY_PROLOGUE_SIZE;       -  DO_IF_DEBUG({ -  if(args != EXTRACT_UCHAR(addr-1)) -  Pike_fatal("Wrong number of arguments in F_TAIL_RECUR %d != %d\n", -  args, EXTRACT_UCHAR(addr-1)); -  }); -  +     if(Pike_sp-args != Pike_fp->locals)    {    DO_IF_DEBUG({    if (Pike_sp < Pike_fp->locals + args)    Pike_fatal("Pike_sp (%p) < Pike_fp->locals (%p) + args (%d)\n",    Pike_sp, Pike_fp->locals, args);    });    assign_svalues(Pike_fp->locals, Pike_sp-args, args, BIT_MIXED);    pop_n_elems(Pike_sp - (Pike_fp->locals + args));    }