| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
#include "eaccelerator.h" |
|---|
| 29 |
|
|---|
| 30 |
#ifdef HAVE_EACCELERATOR |
|---|
| 31 |
|
|---|
| 32 |
#define EXT_MASK 0x0ff00 |
|---|
| 33 |
#define EXT_UNUSED 0x0ff00 |
|---|
| 34 |
#define EXT_STD 0x00000 |
|---|
| 35 |
#define EXT_OPLINE 0x00100 |
|---|
| 36 |
#define EXT_FCALL 0x00200 |
|---|
| 37 |
#define EXT_ARG 0x00300 |
|---|
| 38 |
#define EXT_SEND 0x00400 |
|---|
| 39 |
#define EXT_CAST 0x00500 |
|---|
| 40 |
#define EXT_INIT_FCALL 0x00600 |
|---|
| 41 |
#define EXT_FETCH 0x00700 |
|---|
| 42 |
#define EXT_DECLARE 0x00800 |
|---|
| 43 |
#define EXT_SEND_NOREF 0x00900 |
|---|
| 44 |
#define EXT_FCLASS 0x00a00 |
|---|
| 45 |
#define EXT_IFACE 0x00b00 |
|---|
| 46 |
#define EXT_ISSET 0x00c00 |
|---|
| 47 |
#define EXT_BIT 0x00d00 |
|---|
| 48 |
#define EXT_CLASS 0x00e00 |
|---|
| 49 |
#define EXT_ASSIGN 0x00f00 |
|---|
| 50 |
#define EXT_FE 0x01000 |
|---|
| 51 |
|
|---|
| 52 |
#define OP1_MASK 0x000f0 |
|---|
| 53 |
#define OP1_UNUSED 0x000f0 |
|---|
| 54 |
#define OP1_STD 0x00000 |
|---|
| 55 |
#define OP1_OPLINE 0x00010 |
|---|
| 56 |
#define OP1_ARG 0x00020 |
|---|
| 57 |
#define OP1_BRK 0x00030 |
|---|
| 58 |
#define OP1_CONT 0x00040 |
|---|
| 59 |
#define OP1_JMPADDR 0x00050 |
|---|
| 60 |
#define OP1_CLASS 0x00060 |
|---|
| 61 |
#define OP1_VAR 0x00070 |
|---|
| 62 |
#define OP1_TMP 0x00080 |
|---|
| 63 |
#define OP1_UCLASS 0x00090 |
|---|
| 64 |
|
|---|
| 65 |
#define OP2_MASK 0x0000f |
|---|
| 66 |
#define OP2_UNUSED 0x0000f |
|---|
| 67 |
#define OP2_STD 0x00000 |
|---|
| 68 |
#define OP2_OPLINE 0x00001 |
|---|
| 69 |
#define OP2_FETCH 0x00002 |
|---|
| 70 |
#define OP2_INCLUDE 0x00003 |
|---|
| 71 |
#define OP2_ARG 0x00004 |
|---|
| 72 |
#define OP2_ISSET 0x00005 |
|---|
| 73 |
#define OP2_JMPADDR 0x00006 |
|---|
| 74 |
#define OP2_CLASS 0x00007 |
|---|
| 75 |
#define OP2_VAR 0x00008 |
|---|
| 76 |
#define OP2_TMP 0x00009 |
|---|
| 77 |
|
|---|
| 78 |
#define RES_MASK 0xf0000 |
|---|
| 79 |
#define RES_UNUSED 0xf0000 |
|---|
| 80 |
#define RES_STD 0x00000 |
|---|
| 81 |
#define RES_CLASS 0x10000 |
|---|
| 82 |
#define RES_TMP 0x20000 |
|---|
| 83 |
#define RES_VAR 0x30000 |
|---|
| 84 |
#define RES_OPLINE 0x40000 |
|---|
| 85 |
|
|---|
| 86 |
#define OPS_STD EXT_STD | OP1_STD | OP2_STD | RES_STD |
|---|
| 87 |
|
|---|
| 88 |
#ifdef ZEND_ENGINE_2 |
|---|
| 89 |
# define VAR_NUM(var) ((unsigned int)(((temp_variable *)((intptr_t) var))-((temp_variable *)NULL))) |
|---|
| 90 |
# define VAR_VAL(var) ((unsigned int)((var)*sizeof(temp_variable))) |
|---|
| 91 |
#else |
|---|
| 92 |
# define VAR_NUM(var) ((unsigned int)(var)) |
|---|
| 93 |
# define VAR_VAL(var) ((unsigned int)(var)) |
|---|
| 94 |
#endif |
|---|
| 95 |
|
|---|
| 96 |
typedef struct { |
|---|
| 97 |
#ifdef WITH_EACCELERATOR_DISASSEMBLER |
|---|
| 98 |
const char* opname; |
|---|
| 99 |
#endif |
|---|
| 100 |
unsigned int ops; |
|---|
| 101 |
} opcode_dsc; |
|---|
| 102 |
|
|---|
| 103 |
const opcode_dsc* get_opcode_dsc(unsigned int n); |
|---|
| 104 |
|
|---|
| 105 |
#ifdef ZEND_ENGINE_2 |
|---|
| 106 |
opcode_handler_t get_opcode_handler(zend_uchar opcode TSRMLS_DC); |
|---|
| 107 |
#endif |
|---|
| 108 |
|
|---|
| 109 |
#endif |
|---|