pike.git / src / interpret_functions.h

version» Context lines:

pike.git/src/interpret_functions.h:1:   /* -  * $Id: interpret_functions.h,v 1.32 2000/09/25 23:41:33 hubbe Exp $ +  * $Id: interpret_functions.h,v 1.33 2000/12/01 03:19:00 hubbe Exp $    *    * Opcode definitions for the interpreter.    */      OPCODE0(F_UNDEFINED,"push UNDEFINED")    push_int(0);    Pike_sp[-1].subtype=NUMBER_UNDEFINED;   BREAK;      OPCODE0(F_CONST0, "push 0")
pike.git/src/interpret_functions.h:866:    tmp=switch_lookup(Pike_fp->context.prog->    constants[arg1].sval.u.array,Pike_sp-1);    pc=(unsigned char *)DO_ALIGN(pc,sizeof(INT32));    pc+=(tmp>=0 ? 1+tmp*2 : 2*~tmp) * sizeof(INT32);    if(*(INT32*)pc < 0) fast_check_threads_etc(7);    pc+=*(INT32*)pc;    pop_stack();   }   BREAK;    + OPCODE1(F_SWITCH_ON_INDEX, "switch on index") + { +  INT32 tmp; +  struct svalue s; +  index_no_free(&s,Pike_sp-2,Pike_sp-1); +  Pike_sp++[0]=s; +  +  tmp=switch_lookup(Pike_fp->context.prog-> +  constants[arg1].sval.u.array,Pike_sp-1); +  pop_n_elems(3); +  pc=(unsigned char *)DO_ALIGN(pc,sizeof(INT32)); +  pc+=(tmp>=0 ? 1+tmp*2 : 2*~tmp) * sizeof(INT32); +  if(*(INT32*)pc < 0) fast_check_threads_etc(7); +  pc+=*(INT32*)pc; + } + BREAK; +  + OPCODE2(F_SWITCH_ON_LOCAL, "switch on local") + { +  INT32 tmp; +  tmp=switch_lookup(Pike_fp->context.prog-> +  constants[arg2].sval.u.array,Pike_fp->locals + arg1); +  pc=(unsigned char *)DO_ALIGN(pc,sizeof(INT32)); +  pc+=(tmp>=0 ? 1+tmp*2 : 2*~tmp) * sizeof(INT32); +  if(*(INT32*)pc < 0) fast_check_threads_etc(7); +  pc+=*(INT32*)pc; + } + BREAK; +  +     /* FIXME: Does this need bignum tests? /Fixed - Hubbe */    LOOP(F_INC_LOOP, 1, <, is_lt);    LOOP(F_DEC_LOOP, -1, >, is_gt);    LOOP(F_INC_NEQ_LOOP, 1, !=, !is_eq);    LOOP(F_DEC_NEQ_LOOP, -1, !=, !is_eq);       CASE(F_FOREACH) /* array, lvalue, X, i */    {    if(Pike_sp[-4].type != PIKE_T_ARRAY)    PIKE_ERROR("foreach", "Bad argument 1.\n", Pike_sp-3, 1);