Branch: Tag:

2003-08-06

2003-08-06 18:05:30 by Martin Stjernholm <mast@lysator.liu.se>

Added the possibility for opcodes to pass the jump address through the
return value instead of changing PROG_COUNTER directly. Any opcode which
might jump is now a JUMP opcode, and the old jump opcodes are now PTRJUMP.

Rev: bin/make_interpret_functions.pike:1.8
Rev: src/code/README.txt:1.21
Rev: src/interpret.c:1.318
Rev: src/interpret_functions.h:1.154
Rev: src/interpreter.h:1.85
Rev: src/lex.c:1.114
Rev: src/lex.h:1.28
Rev: src/opcodes.h:1.33
Rev: src/peep.c:1.87

2:   || 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: peep.c,v 1.86 2003/06/11 23:02:31 nilsson Exp $ + || $Id: peep.c,v 1.87 2003/08/06 18:05:27 mast Exp $   */      #include "global.h"
26:   #include "interpret.h"   #include "pikecode.h"    - RCSID("$Id: peep.c,v 1.86 2003/06/11 23:02:31 nilsson Exp $"); + RCSID("$Id: peep.c,v 1.87 2003/08/06 18:05:27 mast Exp $");      static void asm_opt(void);   
369:    default:    switch(instrs[c->opcode - F_OFFSET].flags & I_IS_MASK)    { -  case I_ISJUMP: +  case I_ISPTRJUMP:   #ifdef INS_F_JUMP    tmp=INS_F_JUMP(c->opcode);    if(tmp != -1)
391:    jumps[c->arg]=tmp;    break;    -  case I_ISJUMPARGS: +  case I_ISPTRJUMPARGS:   #ifdef INS_F_JUMP_WITH_TWO_ARGS    tmp = INS_F_JUMP_WITH_TWO_ARGS(c->opcode, c->arg, c->arg2);    if(tmp != -1)
423:    */       case I_TWO_ARGS: +  case I_ISJUMPARGS:    ins_f_byte_with_2_args(c->opcode, c->arg, c->arg2);    break;    -  case I_ISJUMPARG: +  case I_ISPTRJUMPARG:   #ifdef INS_F_JUMP_WITH_ARG    tmp = INS_F_JUMP_WITH_ARG(c->opcode, c->arg);    if(tmp != -1)
458:    */       case I_HASARG: +  case I_ISJUMPARG:    ins_f_byte_with_arg(c->opcode, c->arg);    break;       case 0: -  +  case I_ISJUMP:    ins_f_byte(c->opcode);    break;   
493: Inside #if defined(ALIGN_PIKE_JUMPS)
   if(e+1 < length)    {    /* FIXME: Note that this code won't work for opcodes of type -  * I_ISJUMPARG or I_ISJUMPARGS, since c may already +  * I_ISPTRJUMPARG or I_ISPTRJUMPARGS, since c may already    * have been advanced to the corresponding F_POINTER.    * With the current opcode set this is a non-issue, but...    * /grubba 2002-11-02