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.211 2009/04/01 20:41:32 mast Exp $ + || $Id$   */      /*    * Opcode definitions for the interpreter.    */      #include "global.h"      #undef CJUMP   #undef AUTO_BIGNUM_LOOP_TEST
pike.git/src/interpret_functions.h:2244:    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:2288:    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) 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, { -  +  FAST_CHECK_THREADS_ON_CALL();    DO_CALL_BUILTIN(DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp)));   });      OPCODE1(F_CALL_BUILTIN_AND_POP,"call builtin & pop", I_UPDATE_ALL, { -  +  FAST_CHECK_THREADS_ON_CALL();    DO_CALL_BUILTIN(DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp)));    pop_stack();   });      OPCODE1_RETURN(F_CALL_BUILTIN_AND_RETURN,"call builtin & return", I_UPDATE_ALL, { -  +  FAST_CHECK_THREADS_ON_CALL();    DO_CALL_BUILTIN(DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp)));    DO_DUMB_RETURN;   });         OPCODE1(F_MARK_CALL_BUILTIN, "mark, call builtin", I_UPDATE_ALL, { -  +  FAST_CHECK_THREADS_ON_CALL();    DO_CALL_BUILTIN(0);   });      OPCODE1(F_MARK_CALL_BUILTIN_AND_POP, "mark, call builtin & pop", 0, { -  +  FAST_CHECK_THREADS_ON_CALL();    DO_CALL_BUILTIN(0);    pop_stack();   });      OPCODE1_RETURN(F_MARK_CALL_BUILTIN_AND_RETURN, "mark, call builtin & return", I_UPDATE_ALL, { -  +  FAST_CHECK_THREADS_ON_CALL();    DO_CALL_BUILTIN(0);    DO_DUMB_RETURN;   });         OPCODE1(F_CALL_BUILTIN1, "call builtin 1", I_UPDATE_ALL, { -  +  FAST_CHECK_THREADS_ON_CALL();    DO_CALL_BUILTIN(1);   });      OPCODE1(F_CALL_BUILTIN1_AND_POP, "call builtin1 & pop", I_UPDATE_ALL, { -  +  FAST_CHECK_THREADS_ON_CALL();    DO_CALL_BUILTIN(1);    pop_stack();   });      OPCODE1(F_LTOSVAL_CALL_BUILTIN_AND_ASSIGN, "ltosval, call builtin & assign",    I_UPDATE_ALL, {    INT32 args = DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp));    ONERROR uwp;    -  +  /* Give other threads a chance to run now, before we temporarily +  * clear the svalue, in case another thread looks at it. */ +  FAST_CHECK_THREADS_ON_CALL(); +     /* FIXME: Assert that args > 0 */       STACK_LEVEL_START(args+2);       free_svalue(Pike_sp-args);    mark_free_svalue (Pike_sp - args);    lvalue_to_svalue_no_free(Pike_sp-args, Pike_sp-args-2);    /* This is so that foo = efun(foo,...) (and similar things) will be faster.    * It's done by freeing the old reference to foo after it has been    * pushed on the stack. That way foo can have only 1 reference if we
pike.git/src/interpret_functions.h:2381:    move_svalue(Pike_sp - 3, Pike_sp - 1);    Pike_sp-=2;    STACK_LEVEL_DONE(1);   });      OPCODE1(F_LTOSVAL_CALL_BUILTIN_AND_ASSIGN_POP,    "ltosval, call builtin, assign & pop", I_UPDATE_ALL, {    INT32 args = DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp));    ONERROR uwp;    +  /* Give other threads a chance to run now, before we temporarily +  * clear the svalue, in case another thread looks at it. */ +  FAST_CHECK_THREADS_ON_CALL(); +     /* FIXME: Assert that args > 0 */       STACK_LEVEL_START(args+2);       free_svalue(Pike_sp-args);    mark_free_svalue (Pike_sp - args);    lvalue_to_svalue_no_free(Pike_sp-args, Pike_sp-args-2);    /* This is so that foo = efun(foo,...) (and similar things) will be faster.    * It's done by freeing the old reference to foo after it has been    * pushed on the stack. That way foo can have only 1 reference if we