Branch: Tag:

2016-04-15

2016-04-15 17:31:44 by Arne Goedeke <el@laramies.com>

Interpret: free locals once during return

3598:       CALL_AND_UNSET_ONERROR(uwp);    +  // NOTE: we need to update the frame, since +  // tail recursion might have replaced it +  frame = Pike_fp; +     break;    }    case FRAME_PARENT_CLONE: {
3632:    }      #ifdef PIKE_DEBUG -  frame_check_all(Pike_fp); - #endif -  -  if (save_sp+1 > Pike_sp) { -  //fprintf(stderr, "function did not return.\n"); -  push_int(0); -  } else { -  if (save_sp+1 < Pike_sp) { -  //fprintf(stderr, "function left %d items on the stack\n", (int)(Pike_sp - save_sp - 1)); -  assign_svalue(save_sp,Pike_sp-1); -  pop_n_elems(Pike_sp-save_sp-1); -  /* consider using a flag for immediate destruct instead... */ -  low_destruct_objects_to_destruct(); -  } -  } -  -  if (type == FRAME_PIKE_FUNCTION) return; -  - #ifdef PIKE_DEBUG +     frame_check_all(frame);    assert(frame == Pike_fp);   #endif
3799:    Pike_mark_sp = frame->save_mark_sp;    }    // pop all locals +  if (save_sp > Pike_sp) { +  push_int(0); +  } else {    stack_pop_n_elems_keep_top (Pike_sp - save_sp); -  +  }       {    /* consider using a flag for immediate destruct instead... */
3846:    really_free_pike_frame(frame);    }    +  if (save_sp > Pike_sp) { +  push_int(0); +  } else {    stack_pop_n_elems_keep_top (Pike_sp - save_sp); -  +  }          {