pike.git / src / program.c

version» Context lines:

pike.git/src/program.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: program.c,v 1.449 2002/10/11 01:39:36 nilsson Exp $ + || $Id: program.c,v 1.450 2002/10/12 11:57:09 grubba Exp $   */      #include "global.h" - RCSID("$Id: program.c,v 1.449 2002/10/11 01:39:36 nilsson Exp $"); + RCSID("$Id: program.c,v 1.450 2002/10/12 11:57:09 grubba Exp $");   #include "program.h"   #include "object.h"   #include "dynamic_buffer.h"   #include "pike_types.h"   #include "stralloc.h"   #include "las.h"   #include "language.h"   #include "lex.h"   #include "pike_macros.h"   #include "fsort.h"
pike.git/src/program.c:5011:   }      extern void yyparse(void);      #ifdef PIKE_DEBUG   #define do_yyparse() do { \    struct svalue *save_sp=Pike_sp; \    yyparse(); /* Parse da program */ \    if(save_sp != Pike_sp) \    Pike_fatal("yyparse() left %"PRINTPTRDIFFT"d droppings on the stack!\n", \ -  Pike_sp - save_sp); \ +  Pike_sp - save_sp); \   }while(0)   #else   #define do_yyparse() yyparse()   #endif      struct Supporter *current_supporter=0;   int force_resolve = 0;         #ifdef PIKE_DEBUG
pike.git/src/program.c:5691:       debug_malloc_touch(c);    add_ref(c->prog=aprog);    if((c->handler=ahandler)) add_ref(ahandler);    c->major=amajor;    c->minor=aminor;    if((c->target=atarget)) add_ref(atarget);    if((c->placeholder=aplaceholder)) add_ref(aplaceholder);    c->default_module.type=T_INT;    -  if(c->handler) +  if (c->handler)    { -  safe_apply_handler ("get_default_module", c->handler, NULL, -  0, BIT_MAPPING|BIT_OBJECT|BIT_ZERO); +  if (safe_apply_handler ("get_default_module", c->handler, NULL, +  0, BIT_MAPPING|BIT_OBJECT|BIT_ZERO)) {    if(SAFE_IS_ZERO(Pike_sp-1))    {    pop_stack();    ref_push_mapping(get_builtin_constants());    } -  +  } else { +  ref_push_mapping(get_builtin_constants()); +  }    }else{    ref_push_mapping(get_builtin_constants());    }    free_svalue(& c->default_module);    c->default_module=Pike_sp[-1];    Pike_sp--;      #ifdef PIKE_DEBUG    SET_ONERROR(tmp, fatal_on_error,"Compiler exited with longjump!\n");   #endif
pike.git/src/program.c:6866:    loc.parent_identifier=Pike_fp->fun;    loc.inherit=INHERIT_FROM_INT(p, Pike_fp->fun);       find_external_context(&loc, depth);       return loc.o->storage + loc.inherit->storage_offset;   }      PMOD_EXPORT void change_compiler_compatibility(int major, int minor)   { +  STACK_LEVEL_START(0); +     if(major == PIKE_MAJOR_VERSION && minor == PIKE_MINOR_VERSION)    {    push_int(0); /* optimization */    } else {    if(major == Pike_compiler->compat_major &&    minor == Pike_compiler->compat_minor) {    /* Optimization -- reuse the current compat handler. */    if (compat_handler) {    ref_push_object(compat_handler);    } else {    push_int(0);    }    } else {    push_int(major);    push_int(minor);    SAFE_APPLY_MASTER("get_compilation_handler",2);    }    }    -  +  STACK_LEVEL_CHECK(1); +     if(compat_handler)    {    free_object(compat_handler); -  compat_handler=0; +  compat_handler = NULL;    }    -  if(sp[-1].type == T_OBJECT) +  if((Pike_sp[-1].type == T_OBJECT) && (Pike_sp[-1].u.object->prog))    { -  compat_handler = dmalloc_touch(struct object *, sp[-1].u.object); -  sp--; +  compat_handler = dmalloc_touch(struct object *, Pike_sp[-1].u.object); +  Pike_sp--; +  } else { +  pop_stack(); +  }    -  safe_apply_handler ("get_default_module", error_handler, compat_handler, -  0, BIT_MAPPING|BIT_OBJECT|BIT_ZERO); +  if (safe_apply_handler ("get_default_module", error_handler, compat_handler, +  0, BIT_MAPPING|BIT_OBJECT|BIT_ZERO)) {    if(Pike_sp[-1].type == T_INT)    {    pop_stack();    ref_push_mapping(get_builtin_constants());    } -  }else{ -  pop_stack(); -  safe_apply_handler ("get_default_module", error_handler, NULL, -  0, BIT_MAPPING|BIT_OBJECT|BIT_ZERO); -  if (Pike_sp[-1].type == T_INT) { -  pop_stack(); +  } else {    ref_push_mapping(get_builtin_constants());    } -  } +     -  +  STACK_LEVEL_CHECK(1);       if(Pike_compiler->num_used_modules)    {    free_svalue( (struct svalue *)used_modules.s.str );    ((struct svalue *)used_modules.s.str)[0]=sp[-1];    sp--;    dmalloc_touch_svalue(sp);    if(Pike_compiler->module_index_cache)    {    free_mapping(Pike_compiler->module_index_cache);    Pike_compiler->module_index_cache=0;    }    }else{    use_module(sp-1);    pop_stack();    }       Pike_compiler->compat_major=major;    Pike_compiler->compat_minor=minor; -  +  +  STACK_LEVEL_DONE(0);   }      #ifdef PIKE_USE_MACHINE_CODE      #ifdef HAVE_SYS_MMAN_H   #include <sys/mman.h>   #endif      void make_program_executable(struct program *p)   {    mprotect((void *)p->program, p->num_program*sizeof(p->program[0]),    PROT_EXEC | PROT_READ | PROT_WRITE);   #ifdef FLUSH_INSTRUCTION_CACHE    FLUSH_INSTRUCTION_CACHE(p->program,    p->num_program*sizeof(p->program[0]));   #endif /* FLUSH_INSTRUCTION_CACHE */   }   #endif