7951942000-04-20Fredrik Hübinette (Hubbe) 
eff6212001-07-09Henrik Grubbström (Grubba) #undef LOW_GET_ARG #undef LOW_GET_JUMP #undef LOW_SKIPJUMP
7d7d7e1999-01-31Fredrik Hübinette (Hubbe) #undef GET_ARG #undef GET_ARG2
388f0d2001-01-31Martin Stjernholm #undef GET_JUMP #undef SKIPJUMP
68296f2001-07-07Henrik Grubbström (Grubba) #undef DOJUMP
61e9832001-07-08Henrik Grubbström (Grubba) #undef CASE #undef BREAK #undef DONE #ifdef HAVE_COMPUTED_GOTO
2454752001-07-10Henrik Grubbström (Grubba) #define CASE(OP) PIKE_CONCAT(LABEL_,OP): FETCH
f822262001-07-16Fredrik Hübinette (Hubbe) #define FETCH (instr = PROG_COUNTER[0])
61e9832001-07-08Henrik Grubbström (Grubba) #ifdef PIKE_DEBUG #define DONE continue #else /* !PIKE_DEBUG */
88149c2001-07-08Henrik Grubbström (Grubba) #define DONE do { \
f822262001-07-16Fredrik Hübinette (Hubbe)  Pike_fp->pc = PROG_COUNTER++; \
88149c2001-07-08Henrik Grubbström (Grubba)  goto *instr; \ } while(0)
61e9832001-07-08Henrik Grubbström (Grubba) #endif /* PIKE_DEBUG */
88149c2001-07-08Henrik Grubbström (Grubba) 
f822262001-07-16Fredrik Hübinette (Hubbe) #define LOW_GET_ARG() ((INT32)(ptrdiff_t)(*(PROG_COUNTER++))) #define LOW_GET_JUMP() ((INT32)(ptrdiff_t)(*(PROG_COUNTER))) #define LOW_SKIPJUMP() (instr = (++PROG_COUNTER)[0])
88149c2001-07-08Henrik Grubbström (Grubba) 
eff6212001-07-09Henrik Grubbström (Grubba) #define GET_ARG() LOW_GET_ARG() #define GET_ARG2() LOW_GET_ARG()
61e9832001-07-08Henrik Grubbström (Grubba) #else /* !HAVE_COMPUTED_GOTO */
88149c2001-07-08Henrik Grubbström (Grubba) #define CASE(X) case (X)-F_OFFSET: #define DONE break
2454752001-07-10Henrik Grubbström (Grubba) #define FETCH
88149c2001-07-08Henrik Grubbström (Grubba) 
f822262001-07-16Fredrik Hübinette (Hubbe) #define LOW_GET_ARG() ((PROG_COUNTER++)[0])
c696242001-07-18Henrik Grubbström (Grubba) #if defined(PIKE_USE_MACHINE_CODE) && defined(sparc) #define LOW_GET_JUMP() (PROG_COUNTER[0]) #define LOW_SKIPJUMP() (++PROG_COUNTER) #else /* !(PIKE_USE_MACHINE_CODE && sparc) */
f822262001-07-16Fredrik Hübinette (Hubbe) #define LOW_GET_JUMP() EXTRACT_INT(PROG_COUNTER) #define LOW_SKIPJUMP() (PROG_COUNTER += sizeof(INT32))
c696242001-07-18Henrik Grubbström (Grubba) #endif /* PIKE_USE_MACHINE_CODE && sparc */
7d7d7e1999-01-31Fredrik Hübinette (Hubbe)  #ifdef PIKE_DEBUG #define GET_ARG() (backlog[backlogp].arg=(\ instr=prefix,\ prefix=0,\
88149c2001-07-08Henrik Grubbström (Grubba)  instr += LOW_GET_ARG(),\ (t_flag>3 ? sprintf(trace_buffer, "- Arg = %ld\n", \ (long)instr), \ write_to_stderr(trace_buffer,strlen(trace_buffer)) : 0),\
7d7d7e1999-01-31Fredrik Hübinette (Hubbe)  instr))
a96ce92000-04-19Fredrik Hübinette (Hubbe) 
c7ef072000-04-21Fredrik Hübinette (Hubbe) #define GET_ARG2() (backlog[backlogp].arg2=(\
a96ce92000-04-19Fredrik Hübinette (Hubbe)  instr=prefix2,\ prefix2=0,\
88149c2001-07-08Henrik Grubbström (Grubba)  instr += LOW_GET_ARG(),\ (t_flag>3 ? sprintf(trace_buffer, "- Arg2 = %ld\n", \ (long)instr), \ write_to_stderr(trace_buffer,strlen(trace_buffer)) : 0),\
c7ef072000-04-21Fredrik Hübinette (Hubbe)  instr))
7d7d7e1999-01-31Fredrik Hübinette (Hubbe) 
eff6212001-07-09Henrik Grubbström (Grubba) #else /* !PIKE_DEBUG */ #define GET_ARG() (instr=prefix,prefix=0,instr+LOW_GET_ARG()) #define GET_ARG2() (instr=prefix2,prefix2=0,instr+LOW_GET_ARG()) #endif /* PIKE_DEBUG */ #endif /* HAVE_COMPUTED_GOTO */
d49add2001-04-25Fredrik Hübinette (Hubbe) #ifndef STEP_BREAK_LINE #define STEP_BREAK_LINE #endif
610d052001-07-06Henrik Grubbström (Grubba) static int eval_instruction(PIKE_OPCODE_T *pc)
7d7d7e1999-01-31Fredrik Hübinette (Hubbe) {
61e9832001-07-08Henrik Grubbström (Grubba) #ifdef HAVE_COMPUTED_GOTO
88149c2001-07-08Henrik Grubbström (Grubba)  static void *strap = &&init_strap;
eff6212001-07-09Henrik Grubbström (Grubba)  void *instr = NULL;
61e9832001-07-08Henrik Grubbström (Grubba) #else /* !HAVE_COMPUTED_GOTO */
afea002001-07-12Per Hedbor  unsigned INT32 prefix2=0,prefix=0;
61e9832001-07-08Henrik Grubbström (Grubba)  unsigned INT32 instr; #endif /* HAVE_COMPUTED_GOTO */
88149c2001-07-08Henrik Grubbström (Grubba) #ifdef HAVE_COMPUTED_GOTO goto *strap; normal_strap: #endif /* HAVE_COMPUTED_GOTO */
a2ad152000-02-16Fredrik Hübinette (Hubbe)  debug_malloc_touch(Pike_fp);
7d7d7e1999-01-31Fredrik Hübinette (Hubbe)  while(1) {
2454752001-07-10Henrik Grubbström (Grubba)  instr = pc[0]; Pike_fp->pc = pc++;
7d7d7e1999-01-31Fredrik Hübinette (Hubbe) 
d49add2001-04-25Fredrik Hübinette (Hubbe)  STEP_BREAK_LINE
7d7d7e1999-01-31Fredrik Hübinette (Hubbe) #ifdef PIKE_DEBUG
610d052001-07-06Henrik Grubbström (Grubba) 
388f0d2001-01-31Martin Stjernholm  if(t_flag > 2) { char *file, *f;
50edc82001-07-13Henrik Grubbström (Grubba)  struct pike_string *filep;
388f0d2001-01-31Martin Stjernholm  INT32 linep;
50edc82001-07-13Henrik Grubbström (Grubba)  filep = get_line(pc-1,Pike_fp->context.prog,&linep); file = filep->str; while((f=STRCHR(file,'/'))) file=f+1;
388f0d2001-01-31Martin Stjernholm  fprintf(stderr,"- %s:%4ld:(%lx): %-25s %4ld %4ld\n", file,(long)linep, DO_NOT_WARN((long)(pc-Pike_fp->context.prog->program-1)),
61e9832001-07-08Henrik Grubbström (Grubba) #ifdef HAVE_COMPUTED_GOTO
afa1c62001-07-09Henrik Grubbström (Grubba)  get_opcode_name(instr),
61e9832001-07-08Henrik Grubbström (Grubba) #else /* !HAVE_COMPUTED_GOTO */
388f0d2001-01-31Martin Stjernholm  get_f_name(instr + F_OFFSET),
61e9832001-07-08Henrik Grubbström (Grubba) #endif /* HAVE_COMPUTED_GOTO */
388f0d2001-01-31Martin Stjernholm  DO_NOT_WARN((long)(Pike_sp-Pike_interpreter.evaluator_stack)), DO_NOT_WARN((long)(Pike_mark_sp-Pike_interpreter.mark_stack)));
50edc82001-07-13Henrik Grubbström (Grubba)  free_string(filep);
388f0d2001-01-31Martin Stjernholm  }
eff6212001-07-09Henrik Grubbström (Grubba) #ifdef HAVE_COMPUTED_GOTO
afa1c62001-07-09Henrik Grubbström (Grubba)  if (instr) ADD_RUNNED(instr);
d7ec822001-07-09Henrik Grubbström (Grubba)  else fatal("NULL Instruction!\n");
eff6212001-07-09Henrik Grubbström (Grubba) #else /* !HAVE_COMPUTED_GOTO */
388f0d2001-01-31Martin Stjernholm  if(instr + F_OFFSET < F_MAX_OPCODE) ADD_RUNNED(instr + F_OFFSET);
eff6212001-07-09Henrik Grubbström (Grubba) #endif /* HAVE_COMPUTED_GOTO */
388f0d2001-01-31Martin Stjernholm 
7d7d7e1999-01-31Fredrik Hübinette (Hubbe)  if(d_flag) {
388f0d2001-01-31Martin Stjernholm  backlogp++; if(backlogp >= BACKLOG) backlogp=0; if(backlog[backlogp].program) free_program(backlog[backlogp].program); backlog[backlogp].program=Pike_fp->context.prog; add_ref(Pike_fp->context.prog); backlog[backlogp].instruction=instr; backlog[backlogp].pc=pc; backlog[backlogp].stack = Pike_sp - Pike_interpreter.evaluator_stack; backlog[backlogp].mark_stack = Pike_mark_sp - Pike_interpreter.mark_stack; #ifdef _REENTRANT backlog[backlogp].thread_id=Pike_interpreter.thread_id; #endif
dcbfa71999-05-07Fredrik Hübinette (Hubbe) #ifdef _REENTRANT
c91f892000-04-19Martin Stjernholm  CHECK_INTERPRETER_LOCK();
61e9832001-07-08Henrik Grubbström (Grubba)  if(OBJ2THREAD(Pike_interpreter.thread_id)->state.thread_id != Pike_interpreter.thread_id)
f077582000-07-06Fredrik Hübinette (Hubbe)  fatal("Arglebargle glop glyf, thread swap problem!\n"); if(d_flag>1 && thread_for_id(th_self()) != Pike_interpreter.thread_id) fatal("thread_for_id() (or Pike_interpreter.thread_id) failed in interpreter.h! %p != %p\n",thread_for_id(th_self()),Pike_interpreter.thread_id);
dcbfa71999-05-07Fredrik Hübinette (Hubbe) #endif
a2ad152000-02-16Fredrik Hübinette (Hubbe)  Pike_sp[0].type=99; /* an invalid type */ Pike_sp[1].type=99; Pike_sp[2].type=99; Pike_sp[3].type=99;
7d7d7e1999-01-31Fredrik Hübinette (Hubbe) 
61e9832001-07-08Henrik Grubbström (Grubba)  if(Pike_sp<Pike_interpreter.evaluator_stack || Pike_mark_sp < Pike_interpreter.mark_stack || Pike_fp->locals>Pike_sp)
a4a1722000-12-05Per Hedbor  fatal("Stack error (generic) sp=%p/%p mark_sp=%p/%p locals=%p.\n",
c7ef072000-04-21Fredrik Hübinette (Hubbe)  Pike_sp,
f077582000-07-06Fredrik Hübinette (Hubbe)  Pike_interpreter.evaluator_stack,
17f08c2000-07-06Fredrik Hübinette (Hubbe)  Pike_mark_sp,
f077582000-07-06Fredrik Hübinette (Hubbe)  Pike_interpreter.mark_stack,
c7ef072000-04-21Fredrik Hübinette (Hubbe)  Pike_fp->locals);
7d7d7e1999-01-31Fredrik Hübinette (Hubbe) 
17f08c2000-07-06Fredrik Hübinette (Hubbe)  if(Pike_mark_sp > Pike_interpreter.mark_stack+Pike_stack_size)
a4a1722000-12-05Per Hedbor  fatal("Mark Stack error (overflow).\n");
f077582000-07-06Fredrik Hübinette (Hubbe) 
17f08c2000-07-06Fredrik Hübinette (Hubbe)  if(Pike_mark_sp < Pike_interpreter.mark_stack)
a4a1722000-12-05Per Hedbor  fatal("Mark Stack error (underflow).\n");
f077582000-07-06Fredrik Hübinette (Hubbe)  if(Pike_sp > Pike_interpreter.evaluator_stack+Pike_stack_size)
a4a1722000-12-05Per Hedbor  fatal("stack error (overflow).\n");
7d7d7e1999-01-31Fredrik Hübinette (Hubbe) 
a96ce92000-04-19Fredrik Hübinette (Hubbe)  if(/* Pike_fp->fun>=0 && */ Pike_fp->current_object->prog &&
a2ad152000-02-16Fredrik Hübinette (Hubbe)  Pike_fp->locals+Pike_fp->num_locals > Pike_sp)
a4a1722000-12-05Per Hedbor  fatal("Stack error (stupid!).\n");
7d7d7e1999-01-31Fredrik Hübinette (Hubbe) 
61e9832001-07-08Henrik Grubbström (Grubba)  if(Pike_interpreter.recoveries && (Pike_sp-Pike_interpreter.evaluator_stack < Pike_interpreter.recoveries->stack_pointer))
a4a1722000-12-05Per Hedbor  fatal("Stack error (underflow).\n");
7d7d7e1999-01-31Fredrik Hübinette (Hubbe) 
61e9832001-07-08Henrik Grubbström (Grubba)  if(Pike_mark_sp > Pike_interpreter.mark_stack && Pike_mark_sp[-1] > Pike_sp)
a4a1722000-12-05Per Hedbor  fatal("Stack error (underflow?)\n");
7d7d7e1999-01-31Fredrik Hübinette (Hubbe)  if(d_flag > 9) do_debug();
a2ad152000-02-16Fredrik Hübinette (Hubbe)  debug_malloc_touch(Pike_fp->current_object);
b040a21999-09-14Fredrik Hübinette (Hubbe)  switch(d_flag) { default: case 3:
a2ad152000-02-16Fredrik Hübinette (Hubbe)  check_object(Pike_fp->current_object);
8f29a31999-09-15Fredrik Hübinette (Hubbe) /* break; */
b040a21999-09-14Fredrik Hübinette (Hubbe)  case 2:
a2ad152000-02-16Fredrik Hübinette (Hubbe)  check_object_context(Pike_fp->current_object, Pike_fp->context.prog,
60d9872000-03-23Fredrik Hübinette (Hubbe)  CURRENT_STORAGE);
b040a21999-09-14Fredrik Hübinette (Hubbe)  case 1: case 0: break; }
7d7d7e1999-01-31Fredrik Hübinette (Hubbe)  } #endif
61e9832001-07-08Henrik Grubbström (Grubba) #ifdef HAVE_COMPUTED_GOTO goto *instr; #else /* !HAVE_COMPUTED_GOTO */
7d7d7e1999-01-31Fredrik Hübinette (Hubbe)  switch(instr) {
eff6212001-07-09Henrik Grubbström (Grubba)  /* NOTE: The prefix handling is not needed in computed-goto mode. */
7d7d7e1999-01-31Fredrik Hübinette (Hubbe)  /* Support to allow large arguments */
61e9832001-07-08Henrik Grubbström (Grubba)  CASE(F_PREFIX_256); prefix+=256; DONE; CASE(F_PREFIX_512); prefix+=512; DONE; CASE(F_PREFIX_768); prefix+=768; DONE; CASE(F_PREFIX_1024); prefix+=1024; DONE;
7d7d7e1999-01-31Fredrik Hübinette (Hubbe)  CASE(F_PREFIX_24BITX256);
61e9832001-07-08Henrik Grubbström (Grubba)  prefix += (pc++)[0]<<24;
7d7d7e1999-01-31Fredrik Hübinette (Hubbe)  CASE(F_PREFIX_WORDX256);
61e9832001-07-08Henrik Grubbström (Grubba)  prefix += (pc++)[0]<<16;
7d7d7e1999-01-31Fredrik Hübinette (Hubbe)  CASE(F_PREFIX_CHARX256);
61e9832001-07-08Henrik Grubbström (Grubba)  prefix += (pc++)[0]<<8; DONE;
7d7d7e1999-01-31Fredrik Hübinette (Hubbe) 
a96ce92000-04-19Fredrik Hübinette (Hubbe)  /* Support to allow large arguments */
61e9832001-07-08Henrik Grubbström (Grubba)  CASE(F_PREFIX2_256); prefix2+=256; DONE; CASE(F_PREFIX2_512); prefix2+=512; DONE; CASE(F_PREFIX2_768); prefix2+=768; DONE; CASE(F_PREFIX2_1024); prefix2+=1024; DONE;
a96ce92000-04-19Fredrik Hübinette (Hubbe)  CASE(F_PREFIX2_24BITX256);
61e9832001-07-08Henrik Grubbström (Grubba)  prefix2 += (pc++)[0]<<24;
a96ce92000-04-19Fredrik Hübinette (Hubbe)  CASE(F_PREFIX2_WORDX256);
61e9832001-07-08Henrik Grubbström (Grubba)  prefix2 += (pc++)[0]<<16;
a96ce92000-04-19Fredrik Hübinette (Hubbe)  CASE(F_PREFIX2_CHARX256);
61e9832001-07-08Henrik Grubbström (Grubba)  prefix2 += (pc++)[0]<<8; DONE;
eff6212001-07-09Henrik Grubbström (Grubba) #endif /* HAVE_COMPUTED_GOTO */
7d7d7e1999-01-31Fredrik Hübinette (Hubbe) 
87c7592000-04-18Fredrik Hübinette (Hubbe) #define INTERPRETER
7d7d7e1999-01-31Fredrik Hübinette (Hubbe) 
61e9832001-07-08Henrik Grubbström (Grubba) #define OPCODE0(OP, DESC, CODE) CASE(OP); CODE; DONE
610d052001-07-06Henrik Grubbström (Grubba) #define OPCODE1(OP, DESC, CODE) CASE(OP); { \ INT32 arg1=GET_ARG(); \
2454752001-07-10Henrik Grubbström (Grubba)  FETCH; \
610d052001-07-06Henrik Grubbström (Grubba)  CODE; \
61e9832001-07-08Henrik Grubbström (Grubba)  } DONE
7d7d7e1999-01-31Fredrik Hübinette (Hubbe) 
610d052001-07-06Henrik Grubbström (Grubba) #define OPCODE2(OP, DESC, CODE) CASE(OP); { \ INT32 arg1=GET_ARG(); \ INT32 arg2=GET_ARG2(); \
2454752001-07-10Henrik Grubbström (Grubba)  FETCH; \
610d052001-07-06Henrik Grubbström (Grubba)  CODE; \
61e9832001-07-08Henrik Grubbström (Grubba)  } DONE
7d7d7e1999-01-31Fredrik Hübinette (Hubbe) 
610d052001-07-06Henrik Grubbström (Grubba) #define OPCODE0_TAIL(OP, DESC, CODE) CASE(OP); CODE #define OPCODE1_TAIL(OP, DESC, CODE) CASE(OP); CODE #define OPCODE2_TAIL(OP, DESC, CODE) CASE(OP); CODE
7951942000-04-20Fredrik Hübinette (Hubbe) 
7997532001-07-27Henrik Grubbström (Grubba) #define OPCODE0_RETURN(OP, DESC, CODE) OPCODE0(OP, DESC, CODE) #define OPCODE1_RETURN(OP, DESC, CODE) OPCODE1(OP, DESC, CODE) #define OPCODE2_RETURN(OP, DESC, CODE) OPCODE2(OP, DESC, CODE) #define OPCODE0_TAILRETURN(OP, DESC, CODE) OPCODE0_TAIL(OP, DESC, CODE) #define OPCODE1_TAILRETURN(OP, DESC, CODE) OPCODE1_TAIL(OP, DESC, CODE) #define OPCODE2_TAILRETURN(OP, DESC, CODE) OPCODE2_TAIL(OP, DESC, CODE)
61e9832001-07-08Henrik Grubbström (Grubba) #define OPCODE0_JUMP(OP, DESC, CODE) CASE(OP); CODE; DONE
610d052001-07-06Henrik Grubbström (Grubba) #define OPCODE0_TAILJUMP(OP, DESC, CODE) CASE(OP); CODE
7951942000-04-20Fredrik Hübinette (Hubbe)  /* These are something of a special case as they * requires a POINTER stored explicitly after * the instruction itself. */
610d052001-07-06Henrik Grubbström (Grubba) #define OPCODE1_JUMP(OP, DESC, CODE) CASE(OP); { \ INT32 arg1=GET_ARG(); \
2454752001-07-10Henrik Grubbström (Grubba)  FETCH; \
610d052001-07-06Henrik Grubbström (Grubba)  CODE; \
61e9832001-07-08Henrik Grubbström (Grubba)  } DONE
610d052001-07-06Henrik Grubbström (Grubba)  #define OPCODE2_JUMP(OP, DESC, CODE) CASE(OP); { \ INT32 arg1=GET_ARG(); \ INT32 arg2=GET_ARG2(); \
2454752001-07-10Henrik Grubbström (Grubba)  FETCH; \
610d052001-07-06Henrik Grubbström (Grubba)  CODE; \
61e9832001-07-08Henrik Grubbström (Grubba)  } DONE
610d052001-07-06Henrik Grubbström (Grubba)  #define OPCODE1_TAILJUMP(OP, DESC, CODE) CASE(OP); CODE #define OPCODE2_TAILJUMP(OP, DESC, CODE) CASE(OP); CODE
7951942000-04-20Fredrik Hübinette (Hubbe) 
87c7592000-04-18Fredrik Hübinette (Hubbe) #include "interpret_functions.h"
61e9832001-07-08Henrik Grubbström (Grubba)  #ifndef HAVE_COMPUTED_GOTO
7d7d7e1999-01-31Fredrik Hübinette (Hubbe)  default: fatal("Strange instruction %ld\n",(long)instr); }
61e9832001-07-08Henrik Grubbström (Grubba) #endif /* !HAVE_COMPUTED_GOTO */
7d7d7e1999-01-31Fredrik Hübinette (Hubbe)  }
7965d72001-01-24Fredrik Hübinette (Hubbe) 
88149c2001-07-08Henrik Grubbström (Grubba)  /* NOT_REACHED */ #ifdef HAVE_COMPUTED_GOTO #undef OPCODE0 #undef OPCODE1 #undef OPCODE2 #undef OPCODE0_TAIL #undef OPCODE1_TAIL #undef OPCODE2_TAIL #undef OPCODE0_JUMP #undef OPCODE1_JUMP #undef OPCODE2_JUMP #undef OPCODE0_TAILJUMP #undef OPCODE1_TAILJUMP #undef OPCODE2_TAILJUMP #undef LABEL
eff6212001-07-09Henrik Grubbström (Grubba) #define LABEL(OP) &&PIKE_CONCAT(LABEL_,OP) #define NULL_LABEL(OP) NULL #define OPCODE0(OP,DESC) LABEL(OP), #define OPCODE1(OP,DESC) LABEL(OP), #define OPCODE2(OP,DESC) LABEL(OP), #define OPCODE0_TAIL(OP,DESC) LABEL(OP), #define OPCODE1_TAIL(OP,DESC) LABEL(OP), #define OPCODE2_TAIL(OP,DESC) LABEL(OP), #define OPCODE0_JUMP(OP,DESC) LABEL(OP), #define OPCODE1_JUMP(OP,DESC) LABEL(OP), #define OPCODE2_JUMP(OP,DESC) LABEL(OP), #define OPCODE0_TAILJUMP(OP,DESC) LABEL(OP), #define OPCODE1_TAILJUMP(OP,DESC) LABEL(OP), #define OPCODE2_TAILJUMP(OP,DESC) LABEL(OP),
7997532001-07-27Henrik Grubbström (Grubba) #define OPCODE0_RETURN(OP,DESC) LABEL(OP), #define OPCODE1_RETURN(OP,DESC) LABEL(OP), #define OPCODE2_RETURN(OP,DESC) LABEL(OP), #define OPCODE0_TAILRETURN(OP,DESC) LABEL(OP), #define OPCODE1_TAILRETURN(OP,DESC) LABEL(OP), #define OPCODE2_TAILRETURN(OP,DESC) LABEL(OP),
88149c2001-07-08Henrik Grubbström (Grubba)  init_strap: strap = &&normal_strap; { static void *table[] = {
c9745c2001-07-09Henrik Grubbström (Grubba)  NULL_LABEL(F_OFFSET),
eff6212001-07-09Henrik Grubbström (Grubba)  NULL_LABEL(F_PREFIX_256), NULL_LABEL(F_PREFIX_512), NULL_LABEL(F_PREFIX_768), NULL_LABEL(F_PREFIX_1024), NULL_LABEL(F_PREFIX_CHARX256), NULL_LABEL(F_PREFIX_WORDX256), NULL_LABEL(F_PREFIX_24BITX256), NULL_LABEL(F_PREFIX2_256), NULL_LABEL(F_PREFIX2_512), NULL_LABEL(F_PREFIX2_768), NULL_LABEL(F_PREFIX2_1024), NULL_LABEL(F_PREFIX2_CHARX256), NULL_LABEL(F_PREFIX2_WORDX256), NULL_LABEL(F_PREFIX2_24BITX256),
88149c2001-07-08Henrik Grubbström (Grubba)  #include "interpret_protos.h" };
afa1c62001-07-09Henrik Grubbström (Grubba)  static struct op_2_f lookup[] = { #undef LABEL #define LABEL(OP) { &&PIKE_CONCAT(LABEL_, OP), OP } #undef NULL_LABEL #define NULL_LABEL(OP) { NULL, OP } NULL_LABEL(F_OFFSET), NULL_LABEL(F_PREFIX_256), NULL_LABEL(F_PREFIX_512), NULL_LABEL(F_PREFIX_768), NULL_LABEL(F_PREFIX_1024), NULL_LABEL(F_PREFIX_CHARX256), NULL_LABEL(F_PREFIX_WORDX256), NULL_LABEL(F_PREFIX_24BITX256), NULL_LABEL(F_PREFIX2_256), NULL_LABEL(F_PREFIX2_512), NULL_LABEL(F_PREFIX2_768), NULL_LABEL(F_PREFIX2_1024), NULL_LABEL(F_PREFIX2_CHARX256), NULL_LABEL(F_PREFIX2_WORDX256), NULL_LABEL(F_PREFIX2_24BITX256), #include "interpret_protos.h" };
88149c2001-07-08Henrik Grubbström (Grubba) #ifdef PIKE_DEBUG
c9745c2001-07-09Henrik Grubbström (Grubba)  if (sizeof(table) != (F_MAX_OPCODE-F_OFFSET)*sizeof(void *))
88149c2001-07-08Henrik Grubbström (Grubba)  fatal("opcode_to_label out of sync: 0x%08lx != 0x%08lx\n", DO_NOT_WARN((long)sizeof(table)),
c9745c2001-07-09Henrik Grubbström (Grubba)  DO_NOT_WARN((long)((F_MAX_OPCODE-F_OFFSET)*sizeof(void *))));
88149c2001-07-08Henrik Grubbström (Grubba) #endif /* PIKE_DEBUG */ fcode_to_opcode = table;
afa1c62001-07-09Henrik Grubbström (Grubba)  opcode_to_fcode = lookup; qsort(lookup, F_MAX_OPCODE-F_OFFSET, sizeof(struct op_2_f), lookup_sort_fun);
88149c2001-07-08Henrik Grubbström (Grubba)  return 0; } #endif /* HAVE_COMPUTED_GOTO */ }