Branch: Tag:

2016-07-27

2016-07-27 18:12:46 by Arne Goedeke <el@laramies.com>

Interpreter: simplify struct pike_frame

- expendibles and save_sp are usually only used during setup and frame
deallocation. It is enough to store them as offsets from 'locals'
- reordered the struct entries to avoid some padding

1518:    DO_IF_NOT_REAL_DEBUG (    init_recovery (&new_catch_ctx->recovery, 0);    ); -  new_catch_ctx->save_expendible = Pike_fp->expendible; +  new_catch_ctx->save_expendible = frame_get_expendible(Pike_fp);    JUMP_SET_TO_PC_AT_NEXT (addr);    new_catch_ctx->continue_reladdr = GET_JUMP()    /* We need to run the entry prologue... */
1532:    });    }    -  Pike_fp->expendible = Pike_fp->locals + Pike_fp->num_locals; +  Pike_fp->expendible_offset = Pike_fp->num_locals;       /* Need to adjust next_addr by sizeof(INT32) to skip past the jump    * address to the continue position after the catch block. */
1599:       debug_malloc_touch_named (cc, "(3)");    UNSETJMP (cc->recovery); -  Pike_fp->expendible = cc->save_expendible; +  frame_set_expendible(Pike_fp, cc->save_expendible);    move_svalue (Pike_sp++, &throw_value);    mark_free_svalue (&throw_value);    low_destruct_objects_to_destruct();
1801:    if(d_flag>3) do_gc(NULL, 0);    if(d_flag>4) do_debug();    ); -  if(Pike_fp->expendible <= Pike_fp->locals + arg1) +  if(Pike_fp->expendible_offset <= arg1)    {    pop_n_elems(Pike_sp-1 - (Pike_fp->locals + arg1));    DO_IF_DEBUG(Pike_fp->num_locals = arg1);
2464:    fun += o->prog->inherits[SUBTYPEOF(*s)].identifier_level;    if((addr = lower_mega_apply(args-1, o, fun)))    { -  Pike_fp->save_sp--; +  Pike_fp->save_sp_offset--;    Pike_fp->flags |= PIKE_FRAME_RETURN_INTERNAL;    DO_JUMP_TO(addr);    }
2522:    fun += o->prog->inherits[SUBTYPEOF(*s)].identifier_level;    if((addr = lower_mega_apply(args-1, o, fun)))    { -  Pike_fp->save_sp--; +  Pike_fp->save_sp_offset--;    Pike_fp->flags |=    PIKE_FRAME_RETURN_INTERNAL |    PIKE_FRAME_RETURN_POP;
2583:    fun += o->prog->inherits[SUBTYPEOF(*s)].identifier_level;    if((addr = lower_mega_apply(args-1, o, fun)))    { -  Pike_fp->save_sp--; +  Pike_fp->save_sp_offset--;    DO_IF_DEBUG(Pike_fp->next->pc=0);    unlink_previous_frame();    DO_JUMP_TO(addr);
2852:    addr += ENTRY_PROLOGUE_SIZE; \    \    new_frame->args = args; \ -  new_frame->locals=new_frame->save_sp=new_frame->expendible=Pike_sp-args; \ +  new_frame->locals=Pike_sp-args; \ +  new_frame->save_sp_offset = 0; \ +  new_frame->expendible_offset = 0; \    new_frame->save_mark_sp = Pike_mark_sp; \    DO_IF_DEBUG(new_frame->num_args=0;new_frame->num_locals=0;); \    SET_PROG_COUNTER(addr); \
3086:    });      OPCODE1(F_PROTECT_STACK, "protect_stack", 0, { -  Pike_fp->expendible = Pike_fp->locals + arg1; +  Pike_fp->expendible_offset = arg1;    });      OPCODE2(F_FILL_STACK, "fill_stack", I_UPDATE_SP, {