root/eaccelerator/tags/start/opcodes.h

Revision 5, 4.0 kB (checked in by anonymous, 4 years ago)

This commit was manufactured by cvs2svn to create branch 'eAccelerator'.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 /*
2    +----------------------------------------------------------------------+
3    | Turck MMCache for PHP Version 4                                      |
4    +----------------------------------------------------------------------+
5    | Copyright (c) 2002-2003 TurckSoft, St. Petersburg                    |
6    | http://www.turcksoft.com                                             |
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    | Author: Dmitry Stogov <mmcache@turckware.ru>                         |
26    +----------------------------------------------------------------------+
27    $Id$
28 */
29
30 #include "eaccelerator.h"
31
32 #ifdef HAVE_EACCELERATOR
33
34 #define EXT_MASK       0x0ff00
35 #define EXT_UNUSED     0x0ff00
36 #define EXT_STD        0x00000
37 #define EXT_OPLINE     0x00100
38 #define EXT_FCALL      0x00200
39 #define EXT_ARG        0x00300
40 #define EXT_SEND       0x00400
41 #define EXT_CAST       0x00500
42 #define EXT_INIT_FCALL 0x00600
43 #define EXT_FETCH      0x00700
44 #define EXT_DECLARE    0x00800
45 #define EXT_SEND_NOREF 0x00900
46 #define EXT_FCLASS     0x00a00
47 #define EXT_IFACE      0x00b00
48 #define EXT_ISSET      0x00c00
49 #define EXT_BIT        0x00d00
50 #define EXT_CLASS      0x00e00
51 #define EXT_ASSIGN     0x00f00
52
53 #define OP1_MASK       0x000f0
54 #define OP1_UNUSED     0x000f0
55 #define OP1_STD        0x00000
56 #define OP1_OPLINE     0x00010
57 #define OP1_ARG        0x00020
58 #define OP1_BRK        0x00030
59 #define OP1_CONT       0x00040
60 #define OP1_JMPADDR    0x00050
61 #define OP1_CLASS      0x00060
62 #define OP1_VAR        0x00070
63 #define OP1_TMP        0x00080
64 #define OP1_UCLASS     0x00090
65
66 #define OP2_MASK       0x0000f
67 #define OP2_UNUSED     0x0000f
68 #define OP2_STD        0x00000
69 #define OP2_OPLINE     0x00001
70 #define OP2_FETCH      0x00002
71 #define OP2_INCLUDE    0x00003
72 #define OP2_ARG        0x00004
73 #define OP2_ISSET      0x00005
74 #define OP2_JMPADDR    0x00006
75 #define OP2_CLASS      0x00007
76 #define OP2_VAR        0x00008
77 #define OP2_TMP        0x00009
78
79 #define RES_MASK       0xf0000
80 #define RES_UNUSED     0xf0000
81 #define RES_STD        0x00000
82 #define RES_CLASS      0x10000
83 #define RES_TMP        0x20000
84 #define RES_VAR        0x30000
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 *)(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
Note: See TracBrowser for help on using the browser.