Branch: Tag:

2001-07-09

2001-07-09 14:19:16 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Almost working computed goto mode.

Rev: src/interpret.c:1.218
Rev: src/interpreter.h:1.64
Rev: src/lex.c:1.96
Rev: src/lex.h:1.18
Rev: src/peep.c:1.53
Rev: src/program.h:1.136

17:   #include "builtin_functions.h"   #include "constants.h"    - RCSID("$Id: peep.c,v 1.52 2001/07/09 12:50:18 grubba Exp $"); + RCSID("$Id: peep.c,v 1.53 2001/07/09 14:19:16 grubba Exp $");      static void asm_opt(void);   
360:    case F_START_FUNCTION:    break;    case F_ALIGN: + #ifndef HAVE_COMPUTED_GOTO    while(PC % c->arg) add_to_program(0); -  + #endif /* HAVE_COMPUTED_GOTO */    break;       case F_BYTE:
447: Inside #if defined(PIKE_DEBUG)
   fatal("Hyperspace error: unknown jump point %ld at %d (pc=%x).\n",    PTRDIFF_T_TO_LONG(e), labels[e], jumps[e]);   #endif + #ifdef HAVE_COMPUTED_GOTO +  tmp = (int)(ptrdiff_t)(Pike_compiler->new_program->program[jumps[e]]); +  Pike_compiler->new_program->program[jumps[e]] = +  (PIKE_OPCODE_T)(ptrdiff_t)(tmp2 - jumps[e]); +  jumps[e] = tmp; + #else /* !HAVE_COMPUTED_GOTO */    tmp=read_int(jumps[e]);    upd_int(jumps[e], tmp2 - jumps[e]);    jumps[e]=tmp; -  + #endif /* HAVE_COMPUTED_GOTO */    }    }