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.163 2003/12/03 14:39:19 grubba Exp $ + || $Id: interpret_functions.h,v 1.164 2004/03/12 21:56:52 mast Exp $   */      /*    * Opcode definitions for the interpreter.    */      #include "global.h"      #undef CJUMP   #undef AUTO_BIGNUM_LOOP_TEST
pike.git/src/interpret_functions.h:160:    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 (Pike_interpreter.trace_level > 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 (Pike_interpreter.trace_level > 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:1237:    PIKE_OPCODE_T *next_addr;    JUMP_SET_TO_PC_AT_NEXT (next_addr);    check_c_stack(8192);    switch (o_catch((PIKE_OPCODE_T *)(((INT32 *)next_addr)+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", I_PC_AT_NEXT, { -  JUMP_SET_TO_PC_AT_NEXT (Pike_fp->pc); + OPCODE0_RETURN(F_ESCAPE_CATCH, "escape catch", 0, { +  JUMP_SET_TO_PC_AT_NEXT (Pike_fp->return_addr);    INTER_ESCAPE_CATCH;   });    - OPCODE0_RETURN(F_EXIT_CATCH, "exit catch", I_PC_AT_NEXT|I_UPDATE_SP, { + OPCODE0_RETURN(F_EXIT_CATCH, "exit catch", I_UPDATE_SP, {    push_undefined(); -  JUMP_SET_TO_PC_AT_NEXT (Pike_fp->pc); +  JUMP_SET_TO_PC_AT_NEXT (Pike_fp->return_addr);    INTER_ESCAPE_CATCH;   });      OPCODE1_JUMP(F_SWITCH, "switch", I_UPDATE_ALL, {    INT32 tmp;    PIKE_OPCODE_T *addr;    JUMP_SET_TO_PC_AT_NEXT (addr);    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 *)
pike.git/src/interpret_functions.h:1830:   });      OPCODE1(F_SIZEOF_LOCAL, "sizeof local", I_UPDATE_SP, {    push_int(pike_sizeof(Pike_fp->locals+arg1));   });      OPCODE1_ALIAS(F_SSCANF, "sscanf", I_UPDATE_SP, o_sscanf);      #define MKAPPLY(OP,OPCODE,NAME,TYPE, ARG2, ARG3) \    PIKE_CONCAT(OP,_JUMP)(PIKE_CONCAT(F_,OPCODE),NAME, \ -  I_PC_AT_NEXT|I_UPDATE_ALL, { \ - JUMP_SET_TO_PC_AT_NEXT (Pike_fp->pc); \ +  I_UPDATE_ALL, { \ + JUMP_SET_TO_PC_AT_NEXT (Pike_fp->return_addr); \   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); \   } \   else { \    DO_JUMP_TO_NEXT; \   } \   }); \    \    PIKE_CONCAT(OP,_JUMP)(PIKE_CONCAT3(F_,OPCODE,_AND_POP),NAME " & pop", \ -  I_PC_AT_NEXT|I_UPDATE_ALL, { \ -  JUMP_SET_TO_PC_AT_NEXT (Pike_fp->pc); \ +  I_UPDATE_ALL, { \ +  JUMP_SET_TO_PC_AT_NEXT (Pike_fp->return_addr); \    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(); \    DO_JUMP_TO_NEXT; \    } \   }); \
pike.git/src/interpret_functions.h:1878:    DO_DUMB_RETURN; \    } \   })         #define MKAPPLY2(OP,OPCODE,NAME,TYPE, ARG2, ARG3) \    \   MKAPPLY(OP,OPCODE,NAME,TYPE, ARG2, ARG3); \    \   PIKE_CONCAT(OP,_JUMP)(PIKE_CONCAT(F_MARK_,OPCODE),"mark, " NAME, \ -  I_PC_AT_NEXT|I_UPDATE_ALL, { \ -  JUMP_SET_TO_PC_AT_NEXT (Pike_fp->pc); \ +  I_UPDATE_ALL, { \ +  JUMP_SET_TO_PC_AT_NEXT (Pike_fp->return_addr); \    if(low_mega_apply(TYPE, 0, \    ARG2, ARG3)) \    { \    Pike_fp->flags |= PIKE_FRAME_RETURN_INTERNAL; \    DO_JUMP_TO(Pike_fp->pc); \    } \    else { \    DO_JUMP_TO_NEXT; \    } \   }); \    \   PIKE_CONCAT(OP,_JUMP)(PIKE_CONCAT3(F_MARK_,OPCODE,_AND_POP), \    "mark, " NAME " & pop", \ -  I_PC_AT_NEXT|I_UPDATE_ALL, { \ -  JUMP_SET_TO_PC_AT_NEXT (Pike_fp->pc); \ +  I_UPDATE_ALL, { \ +  JUMP_SET_TO_PC_AT_NEXT (Pike_fp->return_addr); \    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(); \    DO_JUMP_TO_NEXT; \    } \   }); \
pike.git/src/interpret_functions.h:1931:      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_JUMP(F_CALL_OTHER,"call other", I_PC_AT_NEXT|I_UPDATE_ALL, { + OPCODE1_JUMP(F_CALL_OTHER,"call other", I_UPDATE_ALL, {    INT32 args=DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp));    struct svalue *s=Pike_sp-args; -  JUMP_SET_TO_PC_AT_NEXT (Pike_fp->pc); +  JUMP_SET_TO_PC_AT_NEXT (Pike_fp->return_addr);    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:1985:    {    Pike_fp->flags |= PIKE_FRAME_RETURN_INTERNAL;    DO_JUMP_TO(Pike_fp->pc);    }    else {    DO_JUMP_TO_NEXT;    }    }   });    - OPCODE1_JUMP(F_CALL_OTHER_AND_POP,"call other & pop", I_PC_AT_NEXT|I_UPDATE_ALL, { + OPCODE1_JUMP(F_CALL_OTHER_AND_POP,"call other & pop", I_UPDATE_ALL, {    INT32 args=DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp));    struct svalue *s=Pike_sp-args; -  JUMP_SET_TO_PC_AT_NEXT (Pike_fp->pc); +  JUMP_SET_TO_PC_AT_NEXT (Pike_fp->return_addr);    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:2198:    \    fast_check_threads_etc(6); \    check_stack(256); \    \    new_frame=alloc_pike_frame(); \    \    new_frame->refs=1; /* FIXME: Is this needed? */ \    new_frame->next=Pike_fp; \    \    JUMP_SET_TO_PC_AT_NEXT (addr); \ -  Pike_fp->pc = (PIKE_OPCODE_T *)(((INT32 *) addr) + 1); \ +  Pike_fp->return_addr = (PIKE_OPCODE_T *)(((INT32 *) addr) + 1); \    addr += 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:2244:    \    DO_IF_SECURITY(if(!CHECK_DATA_SECURITY(Pike_fp->current_object, \    SECURITY_BIT_NOT_SETUID)) \    SET_CURRENT_CREDS(Pike_fp->current_object->prot)); \    \    FETCH; \    JUMP_DONE; \   }while(0)      /* Assume that the number of arguments is correct */ - OPCODE1_PTRJUMP(F_COND_RECUR, "recur if not overloaded", I_PC_AT_NEXT|I_UPDATE_ALL, { + OPCODE1_PTRJUMP(F_COND_RECUR, "recur if not overloaded", I_UPDATE_ALL, {    struct program *p = Pike_fp->current_object->prog;    PIKE_OPCODE_T *addr;    JUMP_SET_TO_PC_AT_NEXT (addr); -  Pike_fp->pc = (PIKE_OPCODE_T *)(((INT32 *)addr) + 1); +  Pike_fp->return_addr = (PIKE_OPCODE_T *)(((INT32 *)addr) + 1);       /* 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