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.126 2003/09/11 19:23:54 mast Exp $ + || $Id: interpret_functions.h,v 1.127 2004/03/12 21:58:28 mast Exp $   */      /*    * Opcode definitions for the interpreter.    */      #include "global.h"      #undef CJUMP   #undef AUTO_BIGNUM_LOOP_TEST
pike.git/src/interpret_functions.h:151:    if(Pike_fp -> flags & PIKE_FRAME_RETURN_INTERNAL) \    { \    int f=Pike_fp->flags; \    if(f & PIKE_FRAME_RETURN_POP) \    low_return_pop(); \    else \    low_return(); \    \    DO_IF_DEBUG(if (t_flag > 5) \    fprintf(stderr, "Returning to 0x%p\n", \ -  Pike_fp->pc)); \ -  DO_JUMP_TO(Pike_fp->pc); \ +  Pike_fp->return_addr)); \ +  DO_JUMP_TO(Pike_fp->return_addr); \    } \    DO_IF_DEBUG(if (t_flag > 5) \    fprintf(stderr, "Inter return\n")); \    INTER_RETURN; \   }      #undef DO_RETURN   #ifndef PIKE_DEBUG   #define DO_RETURN DO_DUMB_RETURN   #else
pike.git/src/interpret_functions.h:1187:    */   OPCODE0_JUMP(F_CATCH, "catch", 0, {    check_c_stack(8192);    switch (o_catch((PIKE_OPCODE_T *)(((INT32 *)PROG_COUNTER)+1)))    {    case 1:    /* There was a return inside the evaluated code */    DO_DUMB_RETURN;    case 2:    /* Escape catch, continue after the escape instruction. */ -  DO_JUMP_TO(Pike_fp->pc); +  DO_JUMP_TO(Pike_fp->return_addr);    break;    default:    DOJUMP();    }    /* NOT_REACHED in byte-code and computed goto cases. */   });      OPCODE0_RETURN(F_ESCAPE_CATCH, "escape catch", 0, { -  Pike_fp->pc = PROG_COUNTER; +  Pike_fp->return_addr = PROG_COUNTER;    INTER_ESCAPE_CATCH;   });      OPCODE0_RETURN(F_EXIT_CATCH, "exit catch", 0, {    push_undefined(); -  Pike_fp->pc = PROG_COUNTER; +  Pike_fp->return_addr = PROG_COUNTER;    INTER_ESCAPE_CATCH;   });      OPCODE1(F_SWITCH, "switch", 0, {    INT32 tmp;    PIKE_OPCODE_T *addr = PROG_COUNTER;    tmp=switch_lookup(Pike_fp->context.prog->    constants[arg1].sval.u.array,Pike_sp-1);    addr = DO_IF_ELSE_COMPUTED_GOTO(addr, (PIKE_OPCODE_T *)    DO_ALIGN(addr,((ptrdiff_t)sizeof(INT32))));
pike.git/src/interpret_functions.h:1766:    push_int(val);   });      OPCODE1(F_SIZEOF_LOCAL, "sizeof local", 0, {    push_int(pike_sizeof(Pike_fp->locals+arg1));   });      OPCODE1_ALIAS(F_SSCANF, "sscanf", 0, o_sscanf);      #define MKAPPLY(OP,OPCODE,NAME,TYPE, ARG2, ARG3) \ - OP(PIKE_CONCAT(F_,OPCODE),NAME, I_PC_AT_NEXT, { \ - Pike_fp->pc=PROG_COUNTER; \ + OP(PIKE_CONCAT(F_,OPCODE),NAME, 0, { \ + Pike_fp->return_addr=PROG_COUNTER; \   if(low_mega_apply(TYPE,DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp)), \    ARG2, ARG3)) \   { \    Pike_fp->flags |= PIKE_FRAME_RETURN_INTERNAL; \    DO_JUMP_TO(Pike_fp->pc); \   } \   }); \    \ - OP(PIKE_CONCAT3(F_,OPCODE,_AND_POP),NAME " & pop", I_PC_AT_NEXT, { \ -  Pike_fp->pc=PROG_COUNTER; \ + OP(PIKE_CONCAT3(F_,OPCODE,_AND_POP),NAME " & pop", 0, { \ +  Pike_fp->return_addr=PROG_COUNTER; \    if(low_mega_apply(TYPE, DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp)), \    ARG2, ARG3)) \    { \    Pike_fp->flags |= PIKE_FRAME_RETURN_INTERNAL | PIKE_FRAME_RETURN_POP; \    DO_JUMP_TO(Pike_fp->pc); \    }else{ \    pop_stack(); \    } \   }); \    \
pike.git/src/interpret_functions.h:1807:    }else{ \    DO_DUMB_RETURN; \    } \   }); \         #define MKAPPLY2(OP,OPCODE,NAME,TYPE, ARG2, ARG3) \    \   MKAPPLY(OP,OPCODE,NAME,TYPE, ARG2, ARG3) \    \ - OP(PIKE_CONCAT(F_MARK_,OPCODE),"mark, " NAME, I_PC_AT_NEXT, { \ -  Pike_fp->pc=PROG_COUNTER; \ + OP(PIKE_CONCAT(F_MARK_,OPCODE),"mark, " NAME, 0, { \ +  Pike_fp->return_addr=PROG_COUNTER; \    if(low_mega_apply(TYPE,0, \    ARG2, ARG3)) \    { \    Pike_fp->flags |= PIKE_FRAME_RETURN_INTERNAL; \    DO_JUMP_TO(Pike_fp->pc); \    } \   }); \    \ - OP(PIKE_CONCAT3(F_MARK_,OPCODE,_AND_POP),"mark, " NAME " & pop", I_PC_AT_NEXT, { \ -  Pike_fp->pc=PROG_COUNTER; \ + OP(PIKE_CONCAT3(F_MARK_,OPCODE,_AND_POP),"mark, " NAME " & pop", 0, { \ +  Pike_fp->return_addr=PROG_COUNTER; \    if(low_mega_apply(TYPE, 0, \    ARG2, ARG3)) \    { \    Pike_fp->flags |= PIKE_FRAME_RETURN_INTERNAL | PIKE_FRAME_RETURN_POP; \    DO_JUMP_TO(Pike_fp->pc); \    }else{ \    pop_stack(); \    } \   }); \    \
pike.git/src/interpret_functions.h:1853:      MKAPPLY2(OPCODE1,CALL_LFUN,"call lfun",APPLY_LOW,    Pike_fp->current_object,    (void *)(ptrdiff_t)(arg1+Pike_fp->context.identifier_level));      MKAPPLY2(OPCODE1,APPLY,"apply",APPLY_SVALUE_STRICT,    &((Pike_fp->context.prog->constants + arg1)->sval),0);      MKAPPLY(OPCODE0,CALL_FUNCTION,"call function",APPLY_STACK, 0,0);    - OPCODE1(F_CALL_OTHER,"call other", I_PC_AT_NEXT, { + OPCODE1(F_CALL_OTHER,"call other", 0, {    INT32 args=DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp));    struct svalue *s=Pike_sp-args; -  Pike_fp->pc=PROG_COUNTER; +  Pike_fp->return_addr=PROG_COUNTER;    if(s->type == T_OBJECT)    {    struct object *o=s->u.object;    struct program *p;    if((p=o->prog))    {    if(FIND_LFUN(p, LFUN_ARROW) == -1)    {    int fun;    fun=find_shared_string_identifier(Pike_fp->context.prog->strings[arg1],
pike.git/src/interpret_functions.h:1905:       if(low_mega_apply(APPLY_STACK, args, 0, 0))    {    Pike_fp->flags |= PIKE_FRAME_RETURN_INTERNAL;    DO_JUMP_TO(Pike_fp->pc);    }    DONE;    }   });    - OPCODE1(F_CALL_OTHER_AND_POP,"call other & pop", I_PC_AT_NEXT, { + OPCODE1(F_CALL_OTHER_AND_POP,"call other & pop", 0, {    INT32 args=DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp));    struct svalue *s=Pike_sp-args; -  Pike_fp->pc=PROG_COUNTER; +  Pike_fp->return_addr=PROG_COUNTER;    if(s->type == T_OBJECT)    {    struct object *o=s->u.object;    struct program *p;    if((p=o->prog))    {    if(FIND_LFUN(p, LFUN_ARROW) == -1)    {    int fun;    fun=find_shared_string_identifier(Pike_fp->context.prog->strings[arg1],
pike.git/src/interpret_functions.h:2108:    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); \ +  Pike_fp->return_addr = (PIKE_OPCODE_T *)(((INT32 *)PROG_COUNTER) + 1); \    addr = PROG_COUNTER+GET_JUMP(); \    \    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; \    \
pike.git/src/interpret_functions.h:2146:    if(new_frame->context.parent) \    add_ref(new_frame->context.parent); \    Pike_fp=new_frame; \    new_frame->flags=PIKE_FRAME_RETURN_INTERNAL | XFLAGS; \    \    FETCH; \    DONE; \   }while(0)      /* Assume that the number of arguments is correct */ - OPCODE1_JUMP(F_COND_RECUR, "recur if not overloaded", I_PC_AT_NEXT, { + OPCODE1_JUMP(F_COND_RECUR, "recur if not overloaded", 0, {    struct program *p = Pike_fp->current_object->prog;    PIKE_OPCODE_T *addr = (PIKE_OPCODE_T *)(((INT32 *)PROG_COUNTER) + 1); -  Pike_fp->pc=addr; +  Pike_fp->return_addr=addr;       /* Test if the function is overloaded.    *    * Note: The second part of the test is sufficient, but    * the since first case is much simpler to test and    * is common, it should offer a speed improvement.    * /grubba 2002-11-14    *    * Also test if the function uses scoping. DO_RECUR() doesn't    * adjust fp->expendible which will make eg RETURN_LOCAL fail.