Branch: Tag:

2014-12-04

2014-12-04 19:24:02 by Per Hedbor <ph@opera.com>

Instead of returning 1, return the branch-to address

This makes jumps marginally more efficient (saves one instruction and some memory reading)

2234:    {    LOCAL_VAR(struct svalue tmp);    LOCAL_VAR(struct svalue tmp2); -  +  LOCAL_VAR(void *p);    SET_SVAL(tmp, PIKE_T_STRING, 1, string,    Pike_fp->context->prog->strings[arg1]);   
2243:    move_svalue (s, &tmp2);    print_return_value();    -  if(low_mega_apply(APPLY_STACK, args, 0, 0)) +  if(p = low_mega_apply(APPLY_STACK, args, 0, 0))    {    Pike_fp->flags |= PIKE_FRAME_RETURN_INTERNAL; -  DO_JUMP_TO(Pike_fp->pc); +  DO_JUMP_TO(p);    }    else {    DO_JUMP_TO_NEXT;
2293:    {    LOCAL_VAR(struct svalue tmp);    LOCAL_VAR(struct svalue tmp2); +  LOCAL_VAR(void *p);       SET_SVAL(tmp, PIKE_T_STRING, 1, string,    Pike_fp->context->prog->strings[arg1]);
2302:    move_svalue (s, &tmp2);    print_return_value();    -  if(low_mega_apply(APPLY_STACK, args, 0, 0)) +  if(p = low_mega_apply(APPLY_STACK, args, 0, 0))    {    Pike_fp->flags |= PIKE_FRAME_RETURN_INTERNAL | PIKE_FRAME_RETURN_POP; -  DO_JUMP_TO(Pike_fp->pc); +  DO_JUMP_TO(p);    }    else {    pop_stack();
2352:    {    LOCAL_VAR(struct svalue tmp);    LOCAL_VAR(struct svalue tmp2); -  +  LOCAL_VAR(void *p);    SET_SVAL(tmp, PIKE_T_STRING, 1, string,    Pike_fp->context->prog->strings[arg1]);   
2361:    move_svalue (s, &tmp2);    print_return_value();    -  if(low_mega_apply(APPLY_STACK, args, 0, 0)) +  if(p = low_mega_apply(APPLY_STACK, 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_JUMP_TO(p);    }    DO_DUMB_RETURN;    }