pike.git / src / interpret.c

version» Context lines:

pike.git/src/interpret.c:1086:    Pike_fatal ("Not in catching eval.\n"); \    if (!cc) \    Pike_fatal ("Catch context dropoff.\n"); \    if (cc->frame != Pike_fp) \    Pike_fatal ("Catch context doesn't belong to this frame.\n"); \    if (Pike_mark_sp != cc->recovery.mark_sp + Pike_interpreter.mark_stack) \    Pike_fatal ("Mark sp diff in catch context pop.\n"); \    ); \    debug_malloc_touch (cc); \    UNSETJMP (cc->recovery); \ -  Pike_fp->expendible = cc->save_expendible; \ +  frame_set_expendible(Pike_fp, cc->save_expendible); \    Pike_interpreter.catch_ctx = cc->prev; \    really_free_catch_context (cc); \    } while (0)      static struct catch_context *free_catch_context;   static int num_catch_ctx, num_free_catch_ctx;      PMOD_EXPORT void really_free_catch_context( struct catch_context *data )   {    if( num_free_catch_ctx > 100 && free_catch_context )
pike.git/src/interpret.c:1213: Inside #if defined(PIKE_USE_MACHINE_CODE) and #if defined(OPCODE_INLINE_RETURN)
   }   #endif    {    struct catch_context *new_catch_ctx = alloc_catch_context();   #ifdef PIKE_DEBUG    new_catch_ctx->frame = Pike_fp;    init_recovery (&new_catch_ctx->recovery, 0, 0, PERR_LOCATION());   #else    init_recovery (&new_catch_ctx->recovery, 0);   #endif -  new_catch_ctx->save_expendible = Pike_fp->expendible; +  new_catch_ctx->save_expendible = frame_get_expendible(Pike_fp);    new_catch_ctx->continue_reladdr = (INT32)get_unaligned32(addr)    /* We need to run the entry prologue... */    - ENTRY_PROLOGUE_SIZE;       new_catch_ctx->next_addr = addr;    new_catch_ctx->prev = Pike_interpreter.catch_ctx;    Pike_interpreter.catch_ctx = new_catch_ctx;    DO_IF_DEBUG({    TRACE((3,"- Pushed catch context %p\n", new_catch_ctx));    });    }    -  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. */    addr = (PIKE_OPCODE_T *) ((INT32 *) addr + 1);       if (Pike_interpreter.catching_eval_jmpbuf) {    /* There's already a catching_eval_instruction around our    * eval_instruction, so we can just continue. */    debug_malloc_touch_named (Pike_interpreter.catch_ctx, "(1)");    /* Skip past the entry prologue... */
pike.git/src/interpret.c:1290: Inside #if defined(PIKE_USE_MACHINE_CODE)
      DO_IF_DEBUG ({    TRACE((3,"- Caught exception. catch context: %p\n", cc));    if (!cc) Pike_fatal ("Catch context dropoff.\n");    if (cc->frame != Pike_fp)    Pike_fatal ("Catch context doesn't belong to this frame.\n");    });       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();       if (cc->continue_reladdr < 0)    FAST_CHECK_THREADS_ON_BRANCH();    addr = cc->next_addr + cc->continue_reladdr;       DO_IF_DEBUG({    TRACE((3,"- Popping catch context %p ==> %p\n",
pike.git/src/interpret.c:1922:    free_pike_scope(X->scope);    DO_IF_DEBUG(    if(X->flags & PIKE_FRAME_MALLOCED_LOCALS)    Pike_fatal("Pike frame is not supposed to have malloced locals here!\n"));    DO_IF_DMALLOC(    X->current_program=0;    X->context=0;    X->scope=0;    X->current_object=0;    X->flags=0; -  X->expendible=0; +  X->expendible_offset=0;    X->locals=0;    );    X->next = free_pike_frame;    PIKE_MEMPOOL_FREE(&free_pike_frame, X, sizeof(struct pike_frame));    free_pike_frame = X;   }      struct pike_frame *alloc_pike_frame(void)   {    struct pike_frame *res;
pike.git/src/interpret.c:2062: Inside #if defined(PROFILING)
   " %" PRINT_CPU_TIME "\n",    Pike_interpreter.thread_state,    new_frame->start_time,    new_frame->children_base);   #endif    new_frame->next = Pike_fp;    add_ref(new_frame->current_object = o);    add_ref(new_frame->current_program = p);    new_frame->context = context;    new_frame->fun = (unsigned INT16)fun; -  new_frame->expendible = new_frame->locals = save_sp; +  new_frame->locals = save_sp;    new_frame->args = args; -  new_frame->save_sp = save_sp; +  new_frame->save_sp_offset = 0; +  new_frame->expendible_offset = 0;      #ifdef PIKE_DEBUG    if (Pike_in_gc > GC_PASS_PREPARE && Pike_in_gc < GC_PASS_FREE)    Pike_fatal("Pike code called within gc.\n");   #endif       Pike_fp = new_frame;    debug_malloc_touch(Pike_fp);   #ifdef PROFILING    function->num_calls++;
pike.git/src/interpret.c:2475:    Pike_fatal("Stack error (also simple).\n"); \    ) \    \    Pike_mark_sp=Pike_fp->save_mark_sp; \    \    POP_PIKE_FRAME()         void low_return(void)   { -  struct svalue *save_sp = Pike_fp->save_sp+1; +  struct svalue *save_sp = frame_get_save_sp(Pike_fp)+1;    struct object *o = Pike_fp->current_object;    int fun = Pike_fp->fun;       if (PIKE_FN_DONE_ENABLED()) {    /* DTrace leave probe    arg0: function name    */    char *fn = "(unknown)";    if (o && o->prog) {    struct identifier *id = ID_FROM_INT(o->prog, fun);
pike.git/src/interpret.c:2527:    if(UNLIKELY(Pike_interpreter.trace_level>1))    do_trace_func_return (1, o, fun);      #if defined (PIKE_USE_MACHINE_CODE) && defined (OPCODE_RETURN_JUMPADDR)    free_object (o);   #endif   }      void low_return_pop(void)   { -  struct svalue *save_sp = Pike_fp->save_sp; +  struct svalue *save_sp = frame_get_save_sp(Pike_fp);   #if defined (PIKE_USE_MACHINE_CODE) && defined (OPCODE_RETURN_JUMPADDR)    /* See note above. */    struct object *o = Pike_fp->current_object;    add_ref (o);   #endif       if (PIKE_FN_DONE_ENABLED()) {    /* DTrace leave probe    arg0: function name    */
pike.git/src/interpret.c:2584: Inside #if defined(PIKE_DEBUG)
   {    while(rec->frame_pointer == current) rec=rec->previous;    /* FIXME: Wouldn't a simple return be ok? */    if(rec->frame_pointer == current->next)    Pike_fatal("You can't touch this!\n");    }    }   #endif    /* Save various fields from the previous frame.    */ -  current->save_sp=prev->save_sp; +  frame_set_save_sp(current, frame_get_save_sp(prev));    current->save_mark_sp=prev->save_mark_sp;    current->flags = prev->flags;       /* Unlink the top frame temporarily. */    Pike_interpreter.frame_pointer=prev;      #ifdef PROFILING    {    /* We must update the profiling info of the previous frame    * to account for that the current frame has gone away.
pike.git/src/interpret.c:2858:    fun = prog->num_identifier_references;    add_to_identifier_references(dummy_ref);    }       /* FIXME: Is this up-to-date with mega_apply? */    new_frame->next = Pike_fp;    add_ref(new_frame->current_object = o);    add_ref(new_frame->current_program = prog);    new_frame->context = prog->inherits;    new_frame->locals = Pike_sp; -  new_frame->expendible=new_frame->locals; +  new_frame->expendible_offset=0;    new_frame->args = 0;    new_frame->num_args=0;    new_frame->num_locals=0;    new_frame->fun = fun;    new_frame->pc = 0;    new_frame->current_storage=o->storage;      #ifdef PIKE_DEBUG    if (Pike_fp && (new_frame->locals < Pike_fp->locals)) {    Pike_fatal("New locals below old locals: %p < %p\n",