| 1 |
/* |
|---|
| 2 |
+----------------------------------------------------------------------+ |
|---|
| 3 |
| eAccelerator project | |
|---|
| 4 |
+----------------------------------------------------------------------+ |
|---|
| 5 |
| Copyright (c) 2004 - 2006 eAccelerator | |
|---|
| 6 |
| http://eaccelerator.net | |
|---|
| 7 |
+----------------------------------------------------------------------+ |
|---|
| 8 |
| This program is free software; you can redistribute it and/or | |
|---|
| 9 |
| modify it under the terms of the GNU General Public License | |
|---|
| 10 |
| as published by the Free Software Foundation; either version 2 | |
|---|
| 11 |
| of the License, or (at your option) any later version. | |
|---|
| 12 |
| | |
|---|
| 13 |
| This program is distributed in the hope that it will be useful, | |
|---|
| 14 |
| but WITHOUT ANY WARRANTY; without even the implied warranty of | |
|---|
| 15 |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
|---|
| 16 |
| GNU General Public License for more details. | |
|---|
| 17 |
| | |
|---|
| 18 |
| You should have received a copy of the GNU General Public License | |
|---|
| 19 |
| along with this program; if not, write to the Free Software | |
|---|
| 20 |
| Foundation, Inc., 59 Temple Place - Suite 330, Boston, | |
|---|
| 21 |
| MA 02111-1307, USA. | |
|---|
| 22 |
| | |
|---|
| 23 |
| A copy is availble at http://www.gnu.org/copyleft/gpl.txt | |
|---|
| 24 |
+----------------------------------------------------------------------+ |
|---|
| 25 |
$Id: opcodes.h 176 2006-03-05 12:18:54Z bart $ |
|---|
| 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 |
|
|---|
| 85 |
#define OPS_STD EXT_STD | OP1_STD | OP2_STD | RES_STD |
|---|
| 86 |
|
|---|
| 87 |
#ifdef ZEND_ENGINE_2 |
|---|
| 88 |
# define VAR_NUM(var) ((unsigned int)(((temp_variable *)((intptr_t) var))-((temp_variable *)NULL))) |
|---|
| 89 |
# define VAR_VAL(var) ((unsigned int)((var)*sizeof(temp_variable))) |
|---|
| 90 |
#else |
|---|
| 91 |
# define VAR_NUM(var) ((unsigned int)(var)) |
|---|
| 92 |
# define VAR_VAL(var) ((unsigned int)(var)) |
|---|
| 93 |
#endif |
|---|
| 94 |
|
|---|
| 95 |
typedef struct { |
|---|
| 96 |
#ifdef WITH_EACCELERATOR_DISASSEMBLER |
|---|
| 97 |
const char* opname; |
|---|
| 98 |
#endif |
|---|
| 99 |
unsigned int ops; |
|---|
| 100 |
} opcode_dsc; |
|---|
| 101 |
|
|---|
| 102 |
const opcode_dsc* get_opcode_dsc(unsigned int n); |
|---|
| 103 |
|
|---|
| 104 |
#ifdef ZEND_ENGINE_2 |
|---|
| 105 |
opcode_handler_t get_opcode_handler(zend_uchar opcode TSRMLS_DC); |
|---|
| 106 |
#endif |
|---|
| 107 |
|
|---|
| 108 |
#endif |
|---|