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.141 2003/03/14 15:50:44 grubba Exp $ + || $Id: interpret_functions.h,v 1.142 2003/03/18 18:25:06 grubba Exp $   */      /*    * Opcode definitions for the interpreter.    */      #include "global.h"      #undef CJUMP   #undef AUTO_BIGNUM_LOOP_TEST
pike.git/src/interpret_functions.h:1091:    }   });      OPCODE0_BRANCH(F_LAND, "&&", 0, {    if(!UNSAFE_IS_ZERO(Pike_sp-1))    {    DONT_BRANCH();    pop_stack();    }else{    DO_BRANCH(); +  pop_stack(); +  push_int(0);    }   });      OPCODE0_BRANCH(F_LOR, "||", 0, {    if(UNSAFE_IS_ZERO(Pike_sp-1))    {    DONT_BRANCH();    pop_stack();    }else{    DO_BRANCH();
pike.git/src/interpret_functions.h:1712:      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; \ - if(low_mega_apply(TYPE,DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp)), \ + if(low_mega_apply(TYPE,0,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; \ -  if(low_mega_apply(TYPE, DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp)), \ +  if(low_mega_apply(TYPE, 0, 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_CONCAT(OP,_RETURN)(PIKE_CONCAT3(F_,OPCODE,_AND_RETURN), \    NAME " & return", 0, { \ -  if(low_mega_apply(TYPE,DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp)), \ +  if(low_mega_apply(TYPE,0,DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp)), \    ARG2,ARG3)) \    { \    PIKE_OPCODE_T *addr = Pike_fp->pc; \    DO_IF_DEBUG(Pike_fp->next->pc=0); \    unlink_previous_frame(); \    DO_JUMP_TO(addr); \    }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; \ -  if(low_mega_apply(TYPE,0, \ +  if(low_mega_apply(TYPE,0, 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; \ -  if(low_mega_apply(TYPE, 0, \ +  if(low_mega_apply(TYPE, 0, 0, \    ARG2, ARG3)) \    { \    Pike_fp->flags |= PIKE_FRAME_RETURN_INTERNAL | PIKE_FRAME_RETURN_POP; \    DO_JUMP_TO(Pike_fp->pc); \    }else{ \    pop_stack(); \    } \   }); \    \   PIKE_CONCAT(OP,_RETURN)(PIKE_CONCAT3(F_MARK_,OPCODE,_AND_RETURN), \    "mark, " NAME " & return", 0, { \ -  if(low_mega_apply(TYPE,0, \ +  if(low_mega_apply(TYPE,0, 0, \    ARG2,ARG3)) \    { \    PIKE_OPCODE_T *addr = Pike_fp->pc; \    DO_IF_DEBUG(Pike_fp->next->pc=0); \    unlink_previous_frame(); \    DO_JUMP_TO(addr); \    }else{ \    DO_DUMB_RETURN; \    } \   })
pike.git/src/interpret_functions.h:1814:    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],    p);    if(fun >= 0)    { -  if(low_mega_apply(APPLY_LOW, args-1, o, (void *)(ptrdiff_t)fun)) +  if(low_mega_apply(APPLY_LOW, 0, args-1, o, (void *)(ptrdiff_t)fun))    {    Pike_fp->save_sp--;    Pike_fp->flags |= PIKE_FRAME_RETURN_INTERNAL;    DO_JUMP_TO(Pike_fp->pc);    }    stack_unlink(1);    DONE;    }    }    }
pike.git/src/interpret_functions.h:1840:       tmp.type=PIKE_T_STRING;    tmp.u.string=Pike_fp->context.prog->strings[arg1];    tmp.subtype=1;       index_no_free(&tmp2, s, &tmp);    free_svalue(s);    *s=tmp2;    print_return_value();    -  if(low_mega_apply(APPLY_STACK, args, 0, 0)) +  if(low_mega_apply(APPLY_STACK, 0, 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, {    INT32 args=DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp));
pike.git/src/interpret_functions.h:1866:    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],    p);    if(fun >= 0)    { -  if(low_mega_apply(APPLY_LOW, args-1, o, (void *)(ptrdiff_t)fun)) +  if(low_mega_apply(APPLY_LOW, 0, args-1, o, (void *)(ptrdiff_t)fun))    {    Pike_fp->save_sp--;    Pike_fp->flags |=    PIKE_FRAME_RETURN_INTERNAL |    PIKE_FRAME_RETURN_POP;    DO_JUMP_TO(Pike_fp->pc);    }    pop_2_elems();    DONE;    }
pike.git/src/interpret_functions.h:1894:       tmp.type=PIKE_T_STRING;    tmp.u.string=Pike_fp->context.prog->strings[arg1];    tmp.subtype=1;       index_no_free(&tmp2, s, &tmp);    free_svalue(s);    *s=tmp2;    print_return_value();    -  if(low_mega_apply(APPLY_STACK, args, 0, 0)) +  if(low_mega_apply(APPLY_STACK, 0, args, 0, 0))    {    Pike_fp->flags |= PIKE_FRAME_RETURN_INTERNAL | PIKE_FRAME_RETURN_POP;    DO_JUMP_TO(Pike_fp->pc);    }    pop_stack();    }   });      OPCODE1(F_CALL_OTHER_AND_RETURN,"call other & return", 0, {    INT32 args=DO_NOT_WARN((INT32)(Pike_sp - *--Pike_mark_sp));
pike.git/src/interpret_functions.h:1919:    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],    p);    if(fun >= 0)    { -  if(low_mega_apply(APPLY_LOW, args-1, o, (void *)(ptrdiff_t)fun)) +  if(low_mega_apply(APPLY_LOW, 0, args-1, o, (void *)(ptrdiff_t)fun))    {    PIKE_OPCODE_T *addr = Pike_fp->pc;    Pike_fp->save_sp--;    DO_IF_DEBUG(Pike_fp->next->pc=0);    unlink_previous_frame();    DO_JUMP_TO(addr);    }    stack_unlink(1);    DO_DUMB_RETURN;    }
pike.git/src/interpret_functions.h:1947:       tmp.type=PIKE_T_STRING;    tmp.u.string=Pike_fp->context.prog->strings[arg1];    tmp.subtype=1;       index_no_free(&tmp2, s, &tmp);    free_svalue(s);    *s=tmp2;    print_return_value();    -  if(low_mega_apply(APPLY_STACK, args, 0, 0)) +  if(low_mega_apply(APPLY_STACK, 0, args, 0, 0))    {    PIKE_OPCODE_T *addr = Pike_fp->pc;    DO_IF_DEBUG(Pike_fp->next->pc=0);    unlink_previous_frame();    DO_JUMP_TO(addr);    }    DO_DUMB_RETURN;    }   });   
pike.git/src/interpret_functions.h:2109:   OPCODE1_JUMP(F_COND_RECUR, "recur if not overloaded", I_PC_AT_NEXT, {    struct program *p = Pike_fp->current_object->prog;    PIKE_OPCODE_T *addr = (PIKE_OPCODE_T *)(((INT32 *)PROG_COUNTER) + 1);    Pike_fp->pc=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. +  * +  * /grubba 2003-03-25    */ -  if((p != Pike_fp->context.prog) && +  if(((p != Pike_fp->context.prog) &&    (p->inherits[p->identifier_references[Pike_fp->context.identifier_level +    arg1].inherit_offset].prog != -  Pike_fp->context.prog)) +  Pike_fp->context.prog)) || +  (ID_FROM_INT(p, arg1+Pike_fp->context.identifier_level)-> +  identifier_flags & IDENTIFIER_SCOPE_USED))    {    PIKE_OPCODE_T *faddr = PROG_COUNTER+GET_JUMP();    ptrdiff_t num_locals = READ_INCR_BYTE(faddr); /* ignored */    ptrdiff_t args = READ_INCR_BYTE(faddr);    -  if(low_mega_apply(APPLY_LOW, +  if(low_mega_apply(APPLY_LOW, 0,    args,    Pike_fp->current_object,    (void *)(ptrdiff_t)(arg1+    Pike_fp->context.identifier_level)))    {    Pike_fp->flags |= PIKE_FRAME_RETURN_INTERNAL;    addr = Pike_fp->pc;    }    DO_JUMP_TO(addr);    }