pike.git / src / interpret.c

version» Context lines:

pike.git/src/interpret.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: interpret.c,v 1.271 2002/10/16 13:56:52 marcus Exp $ + || $Id: interpret.c,v 1.272 2002/10/16 15:08:15 marcus Exp $   */      #include "global.h" - RCSID("$Id: interpret.c,v 1.271 2002/10/16 13:56:52 marcus Exp $"); + RCSID("$Id: interpret.c,v 1.272 2002/10/16 15:08:15 marcus Exp $");   #include "interpret.h"   #include "object.h"   #include "program.h"   #include "svalue.h"   #include "array.h"   #include "mapping.h"   #include "pike_error.h"   #include "language.h"   #include "stralloc.h"   #include "constants.h"
pike.git/src/interpret.c:233: Inside #if defined(PIKE_DEBUG)
   }    }   #endif   #ifdef PROFILING   #ifdef HAVE_GETHRTIME    Pike_interpreter.time_base = gethrtime();    Pike_interpreter.accounted_time =0;   #endif   #endif   #if defined(HAVE_COMPUTED_GOTO) || defined(PIKE_USE_MACHINE_CODE) +  { +  static int tables_need_init=1; +  if(tables_need_init) {    /* Initialize the fcode_to_opcode table / jump labels. */    eval_instruction(NULL); - #endif /* HAVE_COMPUTED_GOTO || PIKE_USE_MACHINE_CODE */ +    #if defined(PIKE_USE_MACHINE_CODE) && !defined(PIKE_DEBUG)    /* Simple operator opcodes... */   #define SET_INSTR_ADDRESS(X, Y) (instrs[(X)-F_OFFSET].address = (void *)Y)    SET_INSTR_ADDRESS(F_COMPL, o_compl); -  SET_INSTR_ADDRESS(F_LSH, o_lsh); -  SET_INSTR_ADDRESS(F_RSH, o_rsh); +  SET_INSTR_ADDRESS(F_LSH, o_lsh); +  SET_INSTR_ADDRESS(F_RSH, o_rsh);    SET_INSTR_ADDRESS(F_SUBTRACT, o_subtract); -  SET_INSTR_ADDRESS(F_AND, o_and); -  SET_INSTR_ADDRESS(F_OR, o_or); -  SET_INSTR_ADDRESS(F_XOR, o_xor); +  SET_INSTR_ADDRESS(F_AND, o_and); +  SET_INSTR_ADDRESS(F_OR, o_or); +  SET_INSTR_ADDRESS(F_XOR, o_xor);    SET_INSTR_ADDRESS(F_MULTIPLY, o_multiply);    SET_INSTR_ADDRESS(F_DIVIDE, o_divide); -  SET_INSTR_ADDRESS(F_MOD, o_mod); -  SET_INSTR_ADDRESS(F_CAST, f_cast); -  SET_INSTR_ADDRESS(F_CAST_TO_INT, o_cast_to_int); +  SET_INSTR_ADDRESS(F_MOD, o_mod); +  SET_INSTR_ADDRESS(F_CAST, f_cast); +  SET_INSTR_ADDRESS(F_CAST_TO_INT, o_cast_to_int);    SET_INSTR_ADDRESS(F_CAST_TO_STRING, o_cast_to_string);    SET_INSTR_ADDRESS(F_RANGE, o_range);    SET_INSTR_ADDRESS(F_SSCANF, o_sscanf);   #endif /* PIKE_USE_MACHINE_CODE && !PIKE_DEBUG */ -  +  tables_need_init=0;    } -  +  } + #endif /* HAVE_COMPUTED_GOTO || PIKE_USE_MACHINE_CODE */ + }         /*    * lvalues are stored in two svalues in one of these formats:    * array[index] : { array, index }    * mapping[index] : { mapping, index }    * multiset[index] : { multiset, index }    * object[index] : { object, index }    * local variable : { svalue_pointer, nothing }    * global variable : { svalue_pointer/short_svalue_pointer, nothing }
pike.git/src/interpret.c:778:   #define EVAL_INSTR_RET_CHECK(x)   #endif         #ifdef PIKE_USE_MACHINE_CODE      /* Labels to jump to to cause eval_instruction to return */   /* FIXME: Replace these with assembler lables */   void *do_inter_return_label = NULL;   void *do_escape_catch_label; - void *dummy_label; + void *dummy_label = NULL;      #ifndef DEF_PROG_COUNTER   #define DEF_PROG_COUNTER   #endif /* !DEF_PROG_COUNTER */      #ifndef CALL_MACHINE_CODE   #define CALL_MACHINE_CODE(pc) \    do { \    /* The test is needed to get the labels to work... */ \    if (pc) { \
pike.git/src/interpret.c:853: Inside #if defined(__GNUC__)
  static int eval_instruction(PIKE_OPCODE_T *pc)   {    if(pc == NULL) {       if(do_inter_return_label != NULL)    Pike_fatal("eval_instruction called with NULL (twice).\n");       do_inter_return_label = && inter_return_label;    do_escape_catch_label = && inter_escape_catch_label;    +  /* Trick optimizer */ +  if(!dummy_label)    return 0;    }      #ifdef PIKE_DEBUG    if (t_flag) {    int i;    fprintf(stderr, "Calling code at 0x%p:\n", pc);   #ifdef PIKE_OPCODE_ALIGN    if (((INT32)pc) % PIKE_OPCODE_ALIGN) {    Pike_fatal("Odd offset!\n");