pike.git / src / opcodes.c

version» Context lines:

pike.git/src/opcodes.c:1:   /*   || 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: opcodes.c,v 1.162 2004/02/03 20:40:13 nilsson Exp $ + || $Id: opcodes.c,v 1.163 2004/09/18 20:18:20 per Exp $   */      #include "global.h" - RCSID("$Id: opcodes.c,v 1.162 2004/02/03 20:40:13 nilsson Exp $"); + RCSID("$Id: opcodes.c,v 1.163 2004/09/18 20:18:20 per Exp $");   #include "constants.h"   #include "interpret.h"   #include "opcodes.h"   #include "main.h"      #ifdef INSTR_PROFILING      /*    * If you have a 64 bit machine and 15+ Gb memory, this    * routine should handle -p4 nicely. -Hubbe
pike.git/src/opcodes.c:234:      #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) },   #define OPCODE0_TAILBRANCH(OP,DESC,FLAGS) OPCODE0_BRANCH(OP,DESC,FLAGS)   #define OPCODE1_TAILBRANCH(OP,DESC,FLAGS) OPCODE1_BRANCH(OP,DESC,FLAGS)   #define OPCODE2_TAILBRANCH(OP,DESC,FLAGS) OPCODE2_BRANCH(OP,DESC,FLAGS)      #define LEXER    - struct keyword instr_names[]= + const struct keyword instr_names[]=   {   #ifndef PIKE_PRECOMPILER   #include "interpret_protos.h"   #endif /* !PIKE_PRECOMPILER */   { "%=", F_MOD_EQ,0 NULLADDR },   { "&=", F_AND_EQ,0 NULLADDR },   { "|=", F_OR_EQ,0 NULLADDR },   { "*=", F_MULT_EQ,0 NULLADDR },   { "+=", F_ADD_EQ,0 NULLADDR },   { "-=", F_SUB_EQ,0 NULLADDR },
pike.git/src/opcodes.c:289:   { "entry", F_ENTRY,0 NULLADDR },   { "function start", F_START_FUNCTION,0 NULLADDR },   { "notreached!", F_NOTREACHED, 0 NULLADDR },   };      struct instr instrs[F_MAX_INSTR - F_OFFSET];   #ifdef PIKE_USE_MACHINE_CODE   size_t instrs_checksum;   #endif /* PIKE_USE_MACHINE_CODE */    - char *low_get_f_name(int n, struct program *p) + const char *low_get_f_name(int n, struct program *p)   {    static char buf[30];       if (n<F_MAX_OPCODE)    {    if ((n >= 0) && instrs[n-F_OFFSET].name)    return instrs[n-F_OFFSET].name;    sprintf(buf, "<OTHER %d>", n);    return buf;    }
pike.git/src/opcodes.c:313:    p->constants[n-F_MAX_OPCODE].sval.type==T_FUNCTION &&    (p->constants[n-F_MAX_OPCODE].sval.subtype == FUNCTION_BUILTIN) &&    p->constants[n-F_MAX_OPCODE].sval.u.efun) {    return p->constants[n-F_MAX_OPCODE].sval.u.efun->name->str;    }       sprintf(buf, "Call efun %d", n - F_MAX_OPCODE);    return buf;   }    - char *get_f_name(int n) + const char *get_f_name(int n)   {    if (Pike_fp && Pike_fp->context.prog)    return low_get_f_name(n, Pike_fp->context.prog);    return low_get_f_name(n, NULL);   }      #ifdef HAVE_COMPUTED_GOTO   char *get_opcode_name(PIKE_INSTR_T n)   {    int fcode;
pike.git/src/opcodes.c:348: Inside #if defined(HAVE_COMPUTED_GOTO)
   } else {    return get_f_name(opcode_to_fcode[mid].fcode);    }    }       sprintf(buf, "<Unknown opcode 0x%p>", n);    return buf;   }   #endif /* HAVE_COMPUTED_GOTO */    - char *get_token_name(int n) + const char *get_token_name(int n)   {    static char buf[30];    if (n<F_MAX_INSTR && instrs[n-F_OFFSET].name)    {    return instrs[n-F_OFFSET].name;    }else{    sprintf(buf, "<OTHER %d>", n);    return buf;    }   }