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.209 2008/06/30 13:46:05 mast Exp $ + || $Id: interpret_functions.h,v 1.210 2008/11/18 19:06:23 mast Exp $   */      /*    * Opcode definitions for the interpreter.    */      #include "global.h"      #undef CJUMP   #undef AUTO_BIGNUM_LOOP_TEST
pike.git/src/interpret_functions.h:129:   #endif /* PIKE_DEBUG */      #define DOJUMP() do { \    PIKE_OPCODE_T *addr; \    INT32 tmp; \    JUMP_SET_TO_PC_AT_NEXT (addr); \    tmp = GET_JUMP(); \    SET_PROG_COUNTER(addr + tmp); \    FETCH; \    if(tmp < 0) \ -  fast_check_threads_etc(6); \ +  FAST_CHECK_THREADS_ON_BRANCH(); \    } while(0)      #endif /* OVERRIDE_JUMPS */         /* WARNING:    * The surgeon general has stated that define code blocks    * without do{}while() can be hazardous to your health.    * However, in these cases it is required to handle break    * properly. -Hubbe
pike.git/src/interpret_functions.h:1377:    });       debug_malloc_touch_named (cc, "(3)");    UNSETJMP (cc->recovery);    Pike_fp->expendible = cc->save_expendible;    move_svalue (Pike_sp++, &throw_value);    mark_free_svalue (&throw_value);    low_destruct_objects_to_destruct();       if (cc->continue_reladdr < 0) -  fast_check_threads_etc(6); +  FAST_CHECK_THREADS_ON_BRANCH();    addr = cc->next_addr + cc->continue_reladdr;       DO_IF_DEBUG({    TRACE((3,"- Popping catch context %p ==> %p\n",    cc, cc->prev));    if (!addr) Pike_fatal ("Unexpected null continue addr.\n");    });       Pike_interpreter.catch_ctx = cc->prev;    really_free_catch_context (cc);
pike.git/src/interpret_functions.h:1414:   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 *)    DO_ALIGN(PTR_TO_INT(addr),    ((ptrdiff_t)sizeof(INT32))));    addr = (PIKE_OPCODE_T *)(((INT32 *)addr) + (tmp>=0 ? 1+tmp*2 : 2*~tmp)); -  if(*(INT32*)addr < 0) fast_check_threads_etc(7); +  if(*(INT32*)addr < 0) FAST_CHECK_THREADS_ON_BRANCH();    pop_stack();    DO_JUMP_TO(addr + *(INT32*)addr);   });      OPCODE1_JUMP(F_SWITCH_ON_INDEX, "switch on index", I_UPDATE_ALL, {    INT32 tmp;    PIKE_OPCODE_T *addr;    LOCAL_VAR(struct svalue tmp2);    JUMP_SET_TO_PC_AT_NEXT (addr);    index_no_free(&tmp2, Pike_sp-2, Pike_sp-1);    move_svalue (Pike_sp++, &tmp2);       tmp=switch_lookup(Pike_fp->context->prog->    constants[arg1].sval.u.array,Pike_sp-1);    pop_n_elems(3);    addr = DO_IF_ELSE_COMPUTED_GOTO(addr, (PIKE_OPCODE_T *)    DO_ALIGN(PTR_TO_INT(addr),    ((ptrdiff_t)sizeof(INT32))));    addr = (PIKE_OPCODE_T *)(((INT32 *)addr) + (tmp>=0 ? 1+tmp*2 : 2*~tmp)); -  if(*(INT32*)addr < 0) fast_check_threads_etc(7); +  if(*(INT32*)addr < 0) FAST_CHECK_THREADS_ON_BRANCH();    DO_JUMP_TO(addr + *(INT32*)addr);   });      OPCODE2_JUMP(F_SWITCH_ON_LOCAL, "switch on local", 0, {    INT32 tmp;    PIKE_OPCODE_T *addr;    JUMP_SET_TO_PC_AT_NEXT (addr);    tmp=switch_lookup(Pike_fp->context->prog->    constants[arg2].sval.u.array,Pike_fp->locals + arg1);    addr = DO_IF_ELSE_COMPUTED_GOTO(addr, (PIKE_OPCODE_T *)    DO_ALIGN(PTR_TO_INT(addr),    ((ptrdiff_t)sizeof(INT32))));    addr = (PIKE_OPCODE_T *)(((INT32 *)addr) + (tmp>=0 ? 1+tmp*2 : 2*~tmp)); -  if(*(INT32*)addr < 0) fast_check_threads_etc(7); +  if(*(INT32*)addr < 0) FAST_CHECK_THREADS_ON_BRANCH();    DO_JUMP_TO(addr + *(INT32*)addr);   });         #ifdef AUTO_BIGNUM   #define AUTO_BIGNUM_LOOP_TEST(X,Y) INT_TYPE_ADD_OVERFLOW(X,Y)   #else   #define AUTO_BIGNUM_LOOP_TEST(X,Y) 0   #endif   
pike.git/src/interpret_functions.h:2245:    DO_DUMB_RETURN;    }   });      #undef DO_CALL_BUILTIN   #ifdef PIKE_DEBUG   #define DO_CALL_BUILTIN(ARGS) do { \    int args_=(ARGS); \    struct svalue *expected_stack=Pike_sp-args_; \    LOCAL_VAR(struct svalue *s); \ +  FAST_CHECK_THREADS_ON_CALL(); \    s = &Pike_fp->context->prog->constants[arg1].sval; \    if(Pike_interpreter.trace_level) \    { \    LOCAL_VAR(dynamic_buffer save_buf); \    init_buf(&save_buf); \    if (s->u.efun->name->size_shift) \    my_strcat ("[widestring function name]"); \    else \    my_strcat (s->u.efun->name->str); \    do_trace_call(args_, &save_buf); \
pike.git/src/interpret_functions.h:2287:    init_buf(&save_buf); \    if (s->u.efun->name->size_shift) \    my_strcat ("[widestring function name]"); \    else \    my_strcat (s->u.efun->name->str); \    my_strcat ("() "); \    do_trace_return (Pike_sp>expected_stack, &save_buf); \    } \   }while(0)   #else - #define DO_CALL_BUILTIN(ARGS) \ - (*(Pike_fp->context->prog->constants[arg1].sval.u.efun->function))(ARGS) + #define DO_CALL_BUILTIN(ARGS) do { \ +  FAST_CHECK_THREADS_ON_CALL(); \ +  (*(Pike_fp->context->prog->constants[arg1].sval.u.efun->function))(ARGS); \ +  } while (0)   #endif      OPCODE1(F_CALL_BUILTIN, "call builtin", I_UPDATE_ALL, {    DO_CALL_BUILTIN(DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp)));   });      OPCODE1(F_CALL_BUILTIN_AND_POP,"call builtin & pop", I_UPDATE_ALL, {    DO_CALL_BUILTIN(DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp)));    pop_stack();   });
pike.git/src/interpret_functions.h:2427:      #define DO_RECUR(XFLAGS) do{ \    PIKE_OPCODE_T *addr; \    register struct pike_frame *new_frame; \    ptrdiff_t args; \    \    DO_IF_SECURITY(CHECK_DATA_SECURITY_OR_ERROR(Pike_fp->current_object, \    SECURITY_BIT_CALL, \    ("Function call permission denied.\n"))); \    \ -  fast_check_threads_etc(6); \ +  FAST_CHECK_THREADS_ON_CALL(); \    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->return_addr = (PIKE_OPCODE_T *)(((INT32 *) addr) + 1); \    addr += GET_JUMP(); \
pike.git/src/interpret_functions.h:2565:   });         /* Assume that the number of arguments is correct */   /* FIXME: adjust Pike_mark_sp */   OPCODE0_PTRJUMP(F_TAIL_RECUR, "tail recursion", I_UPDATE_ALL, {    INT32 num_locals;    PIKE_OPCODE_T *addr;    INT32 args;    -  fast_check_threads_etc(6); +  FAST_CHECK_THREADS_ON_CALL();       JUMP_SET_TO_PC_AT_NEXT (addr);    addr += GET_JUMP();    num_locals = READ_INCR_BYTE(addr);    args = READ_INCR_BYTE(addr);    addr += ENTRY_PROLOGUE_SIZE;    SET_PROG_COUNTER(addr);       if(Pike_sp-args != Pike_fp->locals)    {