pike.git / src / program.c

version» Context lines:

pike.git/src/program.c:1481:    *! @seealso    *! @[compile_error()]    */      /*! @endclass    */      struct program *first_program = 0;   static int current_program_id = PROG_DYNAMIC_ID_START;    - struct program *null_program=0; -  +    struct program *gc_internal_program = 0;   static struct program *gc_mark_program_pos = 0;      #define CHECK_FILE_ENTRY(PROG, STRNO) \    do { \    if ((STRNO < 0) || (STRNO >= PROG->num_strings)) \    Pike_fatal ("Invalid file entry in linenumber info.\n"); \    } while (0)      INT_TYPE get_small_number(char **q);
pike.git/src/program.c:8546: Inside #if defined(PIKE_DEBUG) and #if defined(FIND_FUNCTION_HASHSIZE)
   if(cache[e].fun < -1 || cache[e].fun > 65536)    Pike_fatal("Error in find_function_cache[%ld].fun\n",(long)e);    }    }    }   #endif      }   #endif    - /* This placeholder should be used -  * in the first compiler pass to take the place -  * of unknown things -  */ - struct program *placeholder_program; - struct object *placeholder_object; +     - void placeholder_index(INT32 args) - { -  pop_n_elems(args); -  ref_push_object(Pike_fp->current_object); - } -  - static void placeholder_sprintf (INT32 args) - { -  struct pike_string *s; -  -  if (!args || TYPEOF(sp[-args]) != T_INT || sp[-args].u.integer != 'O') { -  pop_n_elems (args); -  push_int (0); -  return; -  } -  -  pop_n_elems (args); -  MAKE_CONST_STRING (s, "__placeholder_object"); -  ref_push_string (s); - } -  +    void init_program(void)   {    size_t i;    struct svalue key;    struct svalue val;    struct svalue id;       MAKE_CONST_STRING(this_function_string,"this_function");    MAKE_CONST_STRING(this_program_string,"this_program");    MAKE_CONST_STRING(this_string,"this");
pike.git/src/program.c:8611:    free_type(val.u.type);    }       lfun_getter_type_string = make_pike_type(tFuncV(tNone, tVoid, tMix));    lfun_setter_type_string = make_pike_type(tFuncV(tZero, tVoid, tVoid));       init_pike_compiler();       enter_compiler(NULL, 0);    -  -  /*! @decl constant __null_program -  *! -  *! Program used internally by the compiler to create objects -  *! that are later modified into instances of the compiled program -  *! by the compiler. -  *! -  *! @seealso -  *! @[__placeholder_object] -  */ -  { -  struct svalue s; -  debug_start_new_program(0, "__null_program"); -  null_program=end_program(); -  SET_SVAL(s, T_PROGRAM, 0, program, null_program); -  low_add_constant("__null_program",&s); -  debug_malloc_touch(null_program); -  } -  -  /*! @decl constant __placeholder_object -  *! -  *! Object used internally by the compiler. -  *! -  *! @seealso -  *! @[__null_program] -  */ -  { -  struct svalue s; -  start_new_program(); -  ADD_FUNCTION("`()", placeholder_index, tFuncV(tNone,tMix,tObj), 0); -  ADD_FUNCTION("`[]", placeholder_index, tFunc(tMix,tObj), 0); -  ADD_FUNCTION("_sprintf", placeholder_sprintf, -  tFunc(tInt tOr(tMapping,tVoid),tStr), 0); -  placeholder_program=end_program(); -  placeholder_object=fast_clone_object(placeholder_program); -  -  SET_SVAL(s, T_OBJECT, 0, object, placeholder_object); -  low_add_constant("__placeholder_object",&s); -  debug_malloc_touch(placeholder_object); -  } -  +     exit_compiler();   }      void cleanup_program(void)   {    size_t e;       free_type(lfun_setter_type_string);    free_type(lfun_getter_type_string);    free_mapping(lfun_types);