pike.git / src / interpret.c

version» Context lines:

pike.git/src/interpret.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   /**/   #include "global.h" - RCSID("$Id: interpret.c,v 1.157 2000/07/07 01:24:14 hubbe Exp $"); + RCSID("$Id: interpret.c,v 1.158 2000/07/28 17:16:55 hubbe Exp $");   #include "interpret.h"   #include "object.h"   #include "program.h"   #include "svalue.h"   #include "array.h"   #include "mapping.h"   #include "error.h"   #include "language.h"   #include "stralloc.h"   #include "constants.h"
pike.git/src/interpret.c:55:    * Define the default evaluator stack size, used for just about everything.    */   #define EVALUATOR_STACK_SIZE 100000      #define TRACE_LEN (100 + t_flag * 10)         /* Pike_sp points to first unused value on stack    * (much simpler than letting it point at the last used value.)    */ - struct Pike_interpreter Pike_interpreter; - int stack_size = EVALUATOR_STACK_SIZE; + PMOD_EXPORT struct Pike_interpreter Pike_interpreter; + PMOD_EXPORT int stack_size = EVALUATOR_STACK_SIZE;         /* mark stack, used to store markers into the normal stack */   int mark_stack_malloced = 0;      void push_sp_mark(void)   {    if(Pike_mark_sp == Pike_interpreter.mark_stack + stack_size)    error("No more mark stack!\n");    *Pike_mark_sp++=Pike_sp;
pike.git/src/interpret.c:259:    break;       default:    if(IS_ZERO(lval))    index_error(0,0,0,lval,lval+1,"Indexing the NULL value.\n");    else    index_error(0,0,0,lval,lval+1,"Indexing a basic type.\n");    }   }    - void assign_lvalue(struct svalue *lval,struct svalue *from) + PMOD_EXPORT void assign_lvalue(struct svalue *lval,struct svalue *from)   {   #ifdef PIKE_SECURITY    if(lval->type <= MAX_COMPLEX)    if(!CHECK_DATA_SECURITY(lval->u.array, SECURITY_BIT_SET_INDEX))    error("Assign index permission denied.\n");   #endif       switch(lval->type)    {    case T_ARRAY_LVALUE:
pike.git/src/interpret.c:661: Inside #if defined(PIKE_SECURITY)
     #ifdef PIKE_SECURITY   /* Magic trick */   static      #else   #define mega_apply2 mega_apply   #endif       - void mega_apply2(enum apply_type type, INT32 args, void *arg1, void *arg2) + PMOD_EXPORT void mega_apply2(enum apply_type type, INT32 args, void *arg1, void *arg2)   {    struct object *o;    struct pike_frame *scope=0;    int fun, tailrecurse=-1;    struct svalue *save_sp=Pike_sp-args;      #ifdef PROFILING   #ifdef HAVE_GETHRTIME    long long children_base = Pike_interpreter.accounted_time;    long long start_time = gethrtime() - Pike_interpreter.time_base;
pike.git/src/interpret.c:1175:   }      #ifdef PIKE_SECURITY   static void restore_creds(struct object *creds)   {    if(Pike_interpreter.current_creds)    free_object(Pike_interpreter.current_creds);    Pike_interpreter.current_creds = creds;   }    - void mega_apply(enum apply_type type, INT32 args, void *arg1, void *arg2) + PMOD_EXPORT void mega_apply(enum apply_type type, INT32 args, void *arg1, void *arg2)   {    ONERROR tmp;    if(Pike_interpreter.current_creds)    add_ref(Pike_interpreter.current_creds);       SET_ONERROR(tmp, restore_creds, Pike_interpreter.current_creds);    mega_apply2(type, args, arg1, arg2);    CALL_AND_UNSET_ONERROR(tmp);   }   #endif
pike.git/src/interpret.c:1222:    fatal("mark Pike_sp underflow in catch.\n");   #endif    Pike_mark_sp=save_mark_sp;    Pike_fp->expendible=expendible;    if(x!=-1) mega_apply(APPLY_STACK, x, 0,0);    UNSETJMP(tmp);    return 1;    }   }    - void f_call_function(INT32 args) + PMOD_EXPORT void f_call_function(INT32 args)   {    mega_apply(APPLY_STACK,args,0,0);   }    - int apply_low_safe_and_stupid(struct object *o, INT32 offset) + PMOD_EXPORT int apply_low_safe_and_stupid(struct object *o, INT32 offset)   {    JMP_BUF tmp;    struct pike_frame *new_frame=alloc_pike_frame();    int ret;       new_frame->next = Pike_fp;    new_frame->current_object = o;    new_frame->context=o->prog->inherits[0];    new_frame->locals = Pike_interpreter.evaluator_stack;    new_frame->expendible=new_frame->locals;
pike.git/src/interpret.c:1272:   #endif    ret=0;    }    UNSETJMP(tmp);       POP_PIKE_FRAME();       return ret;   }    - void safe_apply_low(struct object *o,int fun,int args) + PMOD_EXPORT void safe_apply_low(struct object *o,int fun,int args)   {    JMP_BUF recovery;       Pike_sp-=args;    free_svalue(& throw_value);    throw_value.type=T_INT;    if(SETJMP(recovery))    {    if(throw_value.type == T_ARRAY)    {
pike.git/src/interpret.c:1320:    Pike_sp->u.integer = 0;    Pike_sp->subtype=NUMBER_NUMBER;    Pike_sp->type = T_INT;    Pike_sp++;    }    }    UNSETJMP(recovery);   }       - void safe_apply(struct object *o, char *fun ,INT32 args) + PMOD_EXPORT void safe_apply(struct object *o, char *fun ,INT32 args)   {   #ifdef PIKE_DEBUG    if(!o->prog) fatal("Apply safe on destructed object.\n");   #endif    safe_apply_low(o, find_identifier(fun, o->prog), args);   }    - void apply_lfun(struct object *o, int fun, int args) + PMOD_EXPORT void apply_lfun(struct object *o, int fun, int args)   {   #ifdef PIKE_DEBUG    if(fun < 0 || fun >= NUM_LFUNS)    fatal("Apply lfun on illegal value!\n");   #endif    if(!o->prog)    PIKE_ERROR("destructed object", "Apply on destructed object.\n", Pike_sp, args);       apply_low(o, (int)FIND_LFUN(o->prog,fun), args);   }    - void apply_shared(struct object *o, + PMOD_EXPORT void apply_shared(struct object *o,    struct pike_string *fun,    int args)   {    apply_low(o, find_shared_string_identifier(fun, o->prog), args);   }    - void apply(struct object *o, char *fun, int args) + PMOD_EXPORT void apply(struct object *o, char *fun, int args)   {    apply_low(o, find_identifier(fun, o->prog), args);   }       - void apply_svalue(struct svalue *s, INT32 args) + PMOD_EXPORT void apply_svalue(struct svalue *s, INT32 args)   {    if(s->type==T_INT)    {    pop_n_elems(args);    push_int(0);    }else{    INT32 expected_stack=Pike_sp-args+1 - Pike_interpreter.evaluator_stack;       strict_apply_svalue(s,args);    if(Pike_sp > (expected_stack + Pike_interpreter.evaluator_stack))