Branch: Tag:

2011-07-10

2011-07-10 09:25:54 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Interpreter mega patch: The global Pike_interpreter struct replaced with Pike_interpreter_pointer.

110:      int fast_check_threads_counter = 0;    + /* This is used for strapping the interpreter before the threads +  * are loaded, and when there's no support for threads. +  */ + static struct Pike_interpreter_struct static_pike_interpreter; +    /* Pike_sp points to first unused value on stack    * (much simpler than letting it point at the last used value.)    */ - PMOD_EXPORT struct Pike_interpreter Pike_interpreter; + PMOD_EXPORT struct Pike_interpreter_struct *Pike_interpreter_pointer = +  &static_pike_interpreter;   PMOD_EXPORT int Pike_stack_size = EVALUATOR_STACK_SIZE;      static void do_trace_call(INT32 args, dynamic_buffer *old_buf);
192:    */   static int eval_instruction(PIKE_OPCODE_T *pc);    - PMOD_EXPORT int low_init_interpreter(struct Pike_interpreter *interpreter) + PMOD_EXPORT int low_init_interpreter(struct Pike_interpreter_struct *interpreter)   {   #ifdef USE_MMAP_FOR_STACK    static int fd = -1;
291:      PMOD_EXPORT void init_interpreter(void)   { -  if (low_init_interpreter(&Pike_interpreter)) { +  if (low_init_interpreter(Pike_interpreter_pointer)) {    Pike_fatal("Out of memory initializing the interpreter stack.\n");    }   
3035: Inside #if defined(PIKE_DEBUG) and #if defined(PIKE_THREADS)
   fputs ("Not a Pike thread.\n", stderr);    return;    } -  if (ts->swapped) +     f = ts->state.frame_pointer; -  else -  f = Pike_fp; +    #else    f = Pike_fp;   #endif
3245:    }   }    - PMOD_EXPORT void low_cleanup_interpret(struct Pike_interpreter *interpreter) + PMOD_EXPORT void low_cleanup_interpret(struct Pike_interpreter_struct *interpreter)   {   #ifdef USE_MMAP_FOR_STACK    if(!interpreter->evaluator_stack_malloced)