Branch: Tag:

2014-08-15

2014-08-15 14:05:39 by Per Hedbor <ph@opera.com>

Removed CLEAR_2_LOCAL & CLEAR_4_LOCAL, added CLEAR_N_LOCAL

This simplifies things a bit, and reduces codesize at times.

The record I have seen while running the testsuite was a clear_n_local(23).

549:    Pike_sp++;   });    - OPCODE1(F_CLEAR_2_LOCAL, "clear 2 local", 0, { -  free_mixed_svalues(Pike_fp->locals + arg1, 2); -  SET_SVAL(Pike_fp->locals[arg1], PIKE_T_INT, NUMBER_NUMBER, integer, 0); -  SET_SVAL(Pike_fp->locals[arg1+1], PIKE_T_INT, NUMBER_NUMBER, integer, 0); - }); -  - OPCODE1(F_CLEAR_4_LOCAL, "clear 4 local", 0, { + OPCODE2(F_CLEAR_N_LOCAL, "clear n local", 0, {    struct svalue *locals = Pike_fp->locals;    int e; -  free_mixed_svalues(locals + arg1, 4); -  for(e = 0; e < 4; e++) +  free_mixed_svalues(locals + arg1, arg2); +  for(e = 0; e < arg2; e++)    {    SET_SVAL(locals[arg1+e], PIKE_T_INT, NUMBER_NUMBER, integer, 0);    }