Branch: Tag:

2002-05-10

2002-05-10 22:28:28 by Martin Stjernholm <mast@lysator.liu.se>

Added a flag field to the opcode macros and an instruction flag I_PC_AT_NEXT
to use for opcodes that update Pike_fp->pc to the address of the next
opcode.

Rev: src/interpret.c:1.258
Rev: src/interpret_functions.h:1.101
Rev: src/interpreter.h:1.75
Rev: src/lex.c:1.103
Rev: src/lex.h:1.21
Rev: src/opcodes.h:1.27
Rev: src/strip_opcodes:1.3

261:      #define INTERPRETER    - #define OPCODE0(OP, DESC, CODE) CASE(OP); CODE; DONE - #define OPCODE1(OP, DESC, CODE) CASE(OP); { \ + #define OPCODE0(OP, DESC, FLAGS, CODE) CASE(OP); CODE; DONE + #define OPCODE1(OP, DESC, FLAGS, CODE) CASE(OP); { \    INT32 arg1=GET_ARG(); \    FETCH; \    CODE; \    } DONE    - #define OPCODE2(OP, DESC, CODE) CASE(OP); { \ + #define OPCODE2(OP, DESC, FLAGS, CODE) CASE(OP); { \    INT32 arg1=GET_ARG(); \    INT32 arg2=GET_ARG2(); \    FETCH; \    CODE; \    } DONE    - #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 + #define OPCODE0_TAIL(OP, DESC, FLAGS, CODE) CASE(OP); CODE + #define OPCODE1_TAIL(OP, DESC, FLAGS, CODE) CASE(OP); CODE + #define OPCODE2_TAIL(OP, DESC, FLAGS, CODE) CASE(OP); CODE    - #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) + #define OPCODE0_RETURN(OP, DESC, FLAGS, CODE) OPCODE0(OP, DESC, FLAGS, CODE) + #define OPCODE1_RETURN(OP, DESC, FLAGS, CODE) OPCODE1(OP, DESC, FLAGS, CODE) + #define OPCODE2_RETURN(OP, DESC, FLAGS, CODE) OPCODE2(OP, DESC, FLAGS, CODE) + #define OPCODE0_TAILRETURN(OP, DESC, FLAGS, CODE) OPCODE0_TAIL(OP, DESC, FLAGS, CODE) + #define OPCODE1_TAILRETURN(OP, DESC, FLAGS, CODE) OPCODE1_TAIL(OP, DESC, FLAGS, CODE) + #define OPCODE2_TAILRETURN(OP, DESC, FLAGS, CODE) OPCODE2_TAIL(OP, DESC, FLAGS, CODE)    - #define OPCODE0_JUMP(OP, DESC, CODE) CASE(OP); CODE; DONE - #define OPCODE0_TAILJUMP(OP, DESC, CODE) CASE(OP); CODE + #define OPCODE0_JUMP(OP, DESC, FLAGS, CODE) CASE(OP); CODE; DONE + #define OPCODE0_TAILJUMP(OP, DESC, FLAGS, CODE) CASE(OP); CODE      /* These are something of a special case as they    * requires a POINTER stored explicitly after    * the instruction itself.    */ - #define OPCODE1_JUMP(OP, DESC, CODE) CASE(OP); { \ + #define OPCODE1_JUMP(OP, DESC, FLAGS, CODE) CASE(OP); { \    INT32 arg1=GET_ARG(); \    FETCH; \    CODE; \    } DONE    - #define OPCODE2_JUMP(OP, DESC, CODE) CASE(OP); { \ + #define OPCODE2_JUMP(OP, DESC, FLAGS, CODE) CASE(OP); { \    INT32 arg1=GET_ARG(); \    INT32 arg2=GET_ARG2(); \    FETCH; \    CODE; \    } DONE    - #define OPCODE1_TAILJUMP(OP, DESC, CODE) CASE(OP); CODE - #define OPCODE2_TAILJUMP(OP, DESC, CODE) CASE(OP); CODE + #define OPCODE1_TAILJUMP(OP, DESC, FLAGS, CODE) CASE(OP); CODE + #define OPCODE2_TAILJUMP(OP, DESC, FLAGS, CODE) CASE(OP); CODE      #include "interpret_functions.h"