Branch: Tag:

2002-11-02

2002-11-02 15:26:19 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Added support for OPCODE_INLINE_BRANCH.

Rev: src/interpret.c:1.275
Rev: src/lex.c:1.110

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: lex.c,v 1.109 2002/11/02 13:43:51 grubba Exp $ + || $Id: lex.c,v 1.110 2002/11/02 15:26:19 grubba Exp $   */      #include "global.h" - RCSID("$Id: lex.c,v 1.109 2002/11/02 13:43:51 grubba Exp $"); + RCSID("$Id: lex.c,v 1.110 2002/11/02 15:26:19 grubba Exp $");   #include "language.h"   #include "array.h"   #include "lex.h"
173:   #define OPCODE1_TAILRETURN(OP, DESC, FLAGS) OPCODE1_TAIL(OP, DESC, FLAGS)   #define OPCODE2_TAILRETURN(OP, DESC, FLAGS) OPCODE2_TAIL(OP, DESC, FLAGS)    + #ifdef OPCODE_INLINE_BRANCH   #define OPCODE0_BRANCH(OP,DESC,FLAGS) int PIKE_CONCAT(test_opcode_,OP)(void);   #define OPCODE1_BRANCH(OP,DESC,FLAGS) int PIKE_CONCAT(test_opcode_,OP)(INT32);   #define OPCODE2_BRANCH(OP,DESC,FLAGS) int PIKE_CONCAT(test_opcode_,OP)(INT32,INT32);   #define OPCODE0_TAILBRANCH(OP,DESC,FLAGS) int PIKE_CONCAT(test_opcode_,OP)(void);   #define OPCODE1_TAILBRANCH(OP,DESC,FLAGS) int PIKE_CONCAT(test_opcode_,OP)(INT32);   #define OPCODE2_TAILBRANCH(OP,DESC,FLAGS) int PIKE_CONCAT(test_opcode_,OP)(INT32,INT32); -  + #else /* !OPCODE_INLINE_BRANCH */ + #define OPCODE0_BRANCH OPCODE0_JUMP + #define OPCODE1_BRANCH OPCODE1_JUMP + #define OPCODE2_BRANCH OPCODE2_JUMP + #define OPCODE0_TAILBRANCH OPCODE0_TAILJUMP + #define OPCODE1_TAILBRANCH OPCODE1_TAILJUMP + #define OPCODE2_TAILBRANCH OPCODE2_TAILJUMP + #endif /* OPCODE_INLINE_BRANCH */      #include "interpret_protos.h"   
228:   #define OPCODE0_JUMP(OP,DESC,FLAGS) { DESC, OP, FLAGS | I_ISJUMP ADDR(OP) },   #define OPCODE1_JUMP(OP,DESC,FLAGS) { DESC, OP, FLAGS | I_ISJUMPARG ADDR(OP) },   #define OPCODE2_JUMP(OP,DESC,FLAGS) { DESC, OP, FLAGS | I_ISJUMPARGS ADDR(OP) }, -  +    #define OPCODE0_TAILJUMP(OP,DESC,FLAGS) { DESC, OP, FLAGS | I_ISJUMP ADDR(OP) },   #define OPCODE1_TAILJUMP(OP,DESC,FLAGS) { DESC, OP, FLAGS | I_ISJUMPARG ADDR(OP) },   #define OPCODE2_TAILJUMP(OP,DESC,FLAGS) { DESC, OP, FLAGS | I_ISJUMPARGS ADDR(OP) },
240:   #define OPCODE1_TAILRETURN(OP, DESC, FLAGS) OPCODE1_TAIL(OP, DESC, FLAGS)   #define OPCODE2_TAILRETURN(OP, DESC, FLAGS) OPCODE2_TAIL(OP, DESC, FLAGS)    + #define OPCODE0_BRANCH(OP,DESC,FLAGS) { DESC, OP, FLAGS | I_ISBRANCH ADDR(OP) }, + #define OPCODE1_BRANCH(OP,DESC,FLAGS) { DESC, OP, FLAGS | I_ISBRANCHARG ADDR(OP) }, + #define OPCODE2_BRANCH(OP,DESC,FLAGS) { DESC, OP, FLAGS | I_ISBRANCHARGS ADDR(OP) }, + #define OPCODE0_TAILBRANCH(OP,DESC,FLAGS) { DESC, OP, FLAGS | I_ISBRANCH ADDR(OP) }, + #define OPCODE1_TAILBRANCH(OP,DESC,FLAGS) { DESC, OP, FLAGS | I_ISBRANCHARG ADDR(OP) }, + #define OPCODE2_TAILBRANCH(OP,DESC,FLAGS) { DESC, OP, FLAGS | I_ISBRANCHARGS ADDR(OP) }, +    #define LEXER      struct keyword instr_names[]=