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.158 2003/11/15 16:40:04 grubba Exp $ + || $Id: opcodes.c,v 1.159 2003/11/17 14:39:47 grubba Exp $   */      #include "global.h" - RCSID("$Id: opcodes.c,v 1.158 2003/11/15 16:40:04 grubba Exp $"); + RCSID("$Id: opcodes.c,v 1.159 2003/11/17 14:39:47 grubba 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:285:   { "lvalue_list", F_LVALUE_LIST,0 NULLADDR },   { "label", F_LABEL,I_HASARG NULLADDR },   { "align", F_ALIGN, I_HASARG NULLADDR },   { "nop", F_NOP,0 NULLADDR },   { "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)   {    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);
pike.git/src/opcodes.c:390:    }   #endif       instrs[instr_names[i].token - F_OFFSET].name = instr_names[i].word;    instrs[instr_names[i].token - F_OFFSET].flags=instr_names[i].flags;   #ifdef PIKE_USE_MACHINE_CODE    instrs[instr_names[i].token - F_OFFSET].address=instr_names[i].address;   #endif    }    + #ifdef PIKE_USE_MACHINE_CODE +  instrs_checksum = hash_mem(instrs, sizeof(instrs), sizeof(instrs)); + #endif /* PIKE_USE_MACHINE_CODE */ +    #ifdef PIKE_DEBUG    for(i=1; i<F_MAX_OPCODE-F_OFFSET;i++)    {    if(!instrs[i].name)    {    fprintf(stderr,"Opcode %d does not have a name.\n",i);    fatal_later++;    }    }    if(fatal_later)