Branch: Tag:

2002-11-10

2002-11-10 20:19:18 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Added OPCODE{0,1,2}_ALIAS() to simplify opcode alias handling in --with-machine-code.

Rev: src/interpret.c:1.278
Rev: src/interpret_functions.h:1.114
Rev: src/interpreter.h:1.80
Rev: src/lex.c:1.112
Rev: src/opcodes.h:1.32

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.111 2002/11/04 17:04:01 marcus Exp $ + || $Id: lex.c,v 1.112 2002/11/10 20:19:18 grubba Exp $   */      #include "global.h" - RCSID("$Id: lex.c,v 1.111 2002/11/04 17:04:01 marcus Exp $"); + RCSID("$Id: lex.c,v 1.112 2002/11/10 20:19:18 grubba Exp $");   #include "language.h"   #include "array.h"   #include "lex.h"
150:   #ifdef PIKE_USE_MACHINE_CODE   #define ADDR(X) , (void *)PIKE_CONCAT(opcode_,X)   #define NULLADDR , 0 + #define ALIASADDR(X) , (void *)(X)      #define OPCODE0(OP,DESC,FLAGS) void PIKE_CONCAT(opcode_,OP)(void);   #define OPCODE1(OP,DESC,FLAGS) void PIKE_CONCAT(opcode_,OP)(INT32);
174:   #define OPCODE1_TAILRETURN(OP, DESC, FLAGS) OPCODE1_TAIL(OP, DESC, FLAGS)   #define OPCODE2_TAILRETURN(OP, DESC, FLAGS) OPCODE2_TAIL(OP, DESC, FLAGS)    + #define OPCODE0_ALIAS(OP, DESC, FLAGS, ADDR) + #define OPCODE1_ALIAS(OP, DESC, FLAGS, ADDR) + #define OPCODE2_ALIAS(OP, DESC, FLAGS, ADDR) +    #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);
217:   #undef OPCODE1_TAILRETURN   #undef OPCODE2_TAILRETURN    + #undef OPCODE0_ALIAS + #undef OPCODE1_ALIAS + #undef OPCODE2_ALIAS +    #undef OPCODE0_BRANCH   #undef OPCODE1_BRANCH   #undef OPCODE2_BRANCH
228:   #define ADDR(X)   #define BRANCHADDR(X)   #define NULLADDR + #define ALIASADDR(X)   #endif      #define OPCODE0(OP,DESC,FLAGS) { DESC, OP, FLAGS ADDR(OP) },
252:   #define OPCODE1_TAILRETURN(OP, DESC, FLAGS) OPCODE1_TAIL(OP, DESC, FLAGS)   #define OPCODE2_TAILRETURN(OP, DESC, FLAGS) OPCODE2_TAIL(OP, DESC, FLAGS)    + #define OPCODE0_ALIAS(OP, DESC, FLAGS, A) { DESC, OP, FLAGS ALIASADDR(A) }, + #define OPCODE1_ALIAS(OP, DESC, FLAGS, A) { DESC, OP, FLAGS | I_HASARG ALIASADDR(A) }, + #define OPCODE2_ALIAS(OP, DESC, FLAGS, A) { DESC, OP, FLAGS | I_TWO_ARGS ALIASADDR(A) }, +    #define OPCODE0_BRANCH(OP,DESC,FLAGS) { DESC, OP, FLAGS | I_ISBRANCH BRANCHADDR(OP) },   #define OPCODE1_BRANCH(OP,DESC,FLAGS) { DESC, OP, FLAGS | I_ISBRANCHARG BRANCHADDR(OP) },   #define OPCODE2_BRANCH(OP,DESC,FLAGS) { DESC, OP, FLAGS | I_ISBRANCHARGS BRANCHADDR(OP) },