pike.git / src / opcodes.h

version» Context lines:

pike.git/src/opcodes.h:83:    * I_ISPTRJUMPARGS Jump instruction with pointer and two arguments.    */      #ifdef PIKE_DEBUG   #define INSTR_PROFILING   #endif         struct instr   { - #ifdef PIKE_DEBUG -  long compiles; - #endif +     const char *name;    int flags;   #ifdef PIKE_USE_MACHINE_CODE    void *address;   #endif   };      #ifdef PIKE_DEBUG - #define ADD_COMPILED(X) instrs[(X)-F_OFFSET].compiles++ + extern unsigned long pike_instrs_compiles[]; + #define ADD_COMPILED(X) pike_instrs_compiles[(X)-F_OFFSET]++   #ifdef INSTR_PROFILING   extern void add_runned(PIKE_INSTR_T);   #define ADD_RUNNED(X) add_runned(X)   #else   #define ADD_RUNNED(X)   #endif   #else   #define ADD_COMPILED(X)   #define ADD_RUNNED(X)   #endif
pike.git/src/opcodes.h:116:   #ifndef STRUCT_HASH_ENTRY_DECLARED   #define STRUCT_HASH_ENTRY_DECLARED   struct hash_entry;   #endif      #ifndef STRUCT_HASH_TABLE_DECLARED   #define STRUCT_HASH_TABLE_DECLARED   struct hash_table;   #endif    - extern struct instr instrs[]; + extern const struct instr instrs[];   #ifdef PIKE_USE_MACHINE_CODE   extern size_t instrs_checksum;   #endif /* PIKE_USE_MACHINE_CODE */      /* Opcode enum */      #define OPCODE0(X,Y,F) X,   #define OPCODE1(X,Y,F) X,   #define OPCODE2(X,Y,F) X,   #define OPCODE0_TAIL(X,Y,F) X,
pike.git/src/opcodes.h:157:   #define OPCODE0_BRANCH(X,Y,F) X,   #define OPCODE1_BRANCH(X,Y,F) X,   #define OPCODE2_BRANCH(X,Y,F) X,   #define OPCODE0_TAILBRANCH(X,Y,F) X,   #define OPCODE1_TAILBRANCH(X,Y,F) X,   #define OPCODE2_TAILBRANCH(X,Y,F) X,   #define OPCODE0_ALIAS(X,Y,F,A) X,   #define OPCODE1_ALIAS(X,Y,F,A) X,   #define OPCODE2_ALIAS(X,Y,F,A) X,    + #define OPCODE_NOCODE(DESC, OP, FLAGS) OP, +    enum Pike_opcodes   { -  /* -  * These values are used by the stack machine, and can not be directly -  * called from Pike. -  */ +     F_OFFSET = 257, -  F_PREFIX_256, -  F_PREFIX_512, -  F_PREFIX_768, -  F_PREFIX_1024, -  F_PREFIX_CHARX256, -  F_PREFIX_WORDX256, -  F_PREFIX_24BITX256, -  F_PREFIX2_256, -  F_PREFIX2_512, -  F_PREFIX2_768, -  F_PREFIX2_1024, -  F_PREFIX2_CHARX256, -  F_PREFIX2_WORDX256, -  F_PREFIX2_24BITX256, -  -  /* -  * These are the predefined functions that can be accessed from Pike. -  */ -  - #include "interpret_protos.h" -  -  /* Used to mark an entry point from eval_instruction(). */ -  F_ENTRY, -  -  /* These two are only used for dumping. */ -  F_FILENAME, -  F_LINE, -  -  /* Alias for F_EXTERNAL when the identifier is a getter/setter. */ -  F_GET_SET, -  -  /* -  * These are token values that needn't have an associated code for the -  * compiled file -  */ -  F_MAX_OPCODE, -  -  F_ADD_EQ, -  F_AND_EQ, -  F_ARG_LIST, -  F_COMMA_EXPR, -  F_BREAK, -  F_CASE, -  F_CASE_RANGE, -  F_CONTINUE, -  F_DEFAULT, -  F_DIV_EQ, -  F_DO, -  F_EFUN_CALL, -  F_FOR, -  F_LSH_EQ, -  F_LVALUE_LIST, -  F_MOD_EQ, -  F_MULT_EQ, -  F_OR_EQ, -  F_POW_EQ, -  F_RSH_EQ, -  F_SUB_EQ, -  F_VAL_LVAL, -  F_XOR_EQ, -  F_MULTI_ASSIGN, -  F_NOP, -  F_RANGE_FROM_BEG, /* a[i.. */ -  F_RANGE_FROM_END, /* a[<i.. */ -  F_RANGE_OPEN, /* a[.. */ -  F_VERSION, -  -  F_ALIGN, -  F_POINTER, -  F_LABEL, -  F_NORMAL_STMT_LABEL, -  F_CUSTOM_STMT_LABEL, -  F_DATA, -  F_START_FUNCTION, -  F_BYTE, -  F_NOTREACHED, -  F_AUTO_MAP_MARKER, -  F_AUTO_MAP, -  -  /* Alias for F_RETURN, but cannot be optimized into a tail recursion call */ -  F_VOLATILE_RETURN, -  -  /* Alias for F_ASSIGN, used when LHS has side-effects that should -  * only be evaluated once. */ -  F_ASSIGN_SELF, -  -  F_MAX_INSTR, + #include "opcode_list.h"   };      #undef OPCODE0   #undef OPCODE1   #undef OPCODE2   #undef OPCODE0_TAIL   #undef OPCODE1_TAIL   #undef OPCODE2_TAIL   #undef OPCODE0_PTRJUMP   #undef OPCODE1_PTRJUMP
pike.git/src/opcodes.h:286:   #undef OPCODE2_TAILBRANCH   #undef OPCODE0_JUMP   #undef OPCODE1_JUMP   #undef OPCODE2_JUMP   #undef OPCODE0_TAILJUMP   #undef OPCODE1_TAILJUMP   #undef OPCODE2_TAILJUMP   #undef OPCODE0_ALIAS   #undef OPCODE1_ALIAS   #undef OPCODE2_ALIAS + #undef OPCODE_NOCODE      #ifdef PIKE_DEBUG   const char *low_get_f_name(int n,struct program *p);   const char *get_f_name(int n);   #ifdef HAVE_COMPUTED_GOTO   const char *get_opcode_name(PIKE_INSTR_T n);   #else /* !HAVE_COMPUTED_GOTO */   #define get_opcode_name(n) get_f_name(n + F_OFFSET)   #endif /* HAVE_COMPUTED_GOTO */   #endif   const char *get_token_name(int n);   void init_opcodes(void);   void exit_opcodes(void);      #endif /* !OPCODES_H */