Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 548 lines (410 sloc) 16.138 kB
573b460 @andigutmans Zend Library
andigutmans authored
1 /*
2 +----------------------------------------------------------------------+
3 | Zend Engine |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
6 +----------------------------------------------------------------------+
7 | This source file is subject to the Zend license, that is bundled |
8 | with this package in the file LICENSE. If you did not receive a |
9 | copy of the Zend license, please mail us at zend@zend.com so we can |
10 | send you a copy immediately. |
11 +----------------------------------------------------------------------+
12 | Authors: Andi Gutmans <andi@zend.com> |
13 | Zeev Suraski <zeev@zend.com> |
14 +----------------------------------------------------------------------+
15 */
16
17 #ifndef _COMPILE_H
18 #define _COMPILE_H
19
20 #include "zend.h"
fa76f0c @zsuraski Compile fix
zsuraski authored
21
22 #if HAVE_STDARG_H
23 #include <stdarg.h>
24 #endif
25
573b460 @andigutmans Zend Library
andigutmans authored
26 #include "zend_llist.h"
27 #define YYSTYPE znode
28 #include "zend-parser.h"
29
30 #define DEBUG_ZEND 0
fcaf734 @andigutmans - Don't support interactive mode when thread safe.
andigutmans authored
31
32 #ifndef ZTS
573b460 @andigutmans Zend Library
andigutmans authored
33 #define SUPPORT_INTERACTIVE 1
fcaf734 @andigutmans - Don't support interactive mode when thread safe.
andigutmans authored
34 #else
35 #define SUPPORT_INTERACTIVE 0
36 #endif
573b460 @andigutmans Zend Library
andigutmans authored
37
38 #define FREE_PNODE(znode) zval_dtor(&znode->u.constant);
39 #define FREE_OP(op, should_free) if (should_free) zval_dtor(&Ts[(op)->u.var].tmp_var);
40
41
42 #if SUPPORT_INTERACTIVE
43 #define INC_BPC(op_array) ((op_array)->backpatch_count++)
44 #define DEC_BPC(op_array) ((op_array)->backpatch_count--)
45 #define HANDLE_INTERACTIVE() if (EG(interactive)) { execute_new_code(CLS_C); }
46 #else
47 #define INC_BPC(op_array)
48 #define DEC_BPC(op_array)
49 #define HANDLE_INTERACTIVE()
50 #endif
51
52 typedef struct _zend_op_array zend_op_array;
53
1250c43 @zsuraski * Add struct name to all typedef's so that they can be debugged with …
zsuraski authored
54 typedef struct _znode {
573b460 @andigutmans Zend Library
andigutmans authored
55 int op_type;
56 union {
57 zval constant;
58
59 int var;
60 int opline_num;
61 zend_op_array *op_array;
62 struct {
63 int var; /* dummy */
64 int type;
65 } EA;
66 } u;
67 } znode;
68
69
70 typedef struct _zend_op {
71 int opcode;
72 znode result;
73 znode op1;
74 znode op2;
39a7f4c @zsuraski This patch is a go. Not fully optimized yet, but working properly.
zsuraski authored
75 ulong extended_value;
573b460 @andigutmans Zend Library
andigutmans authored
76 char *filename;
77 uint lineno;
78 } zend_op;
79
80
1250c43 @zsuraski * Add struct name to all typedef's so that they can be debugged with …
zsuraski authored
81 typedef struct _zend_brk_cont_element {
573b460 @andigutmans Zend Library
andigutmans authored
82 int cont;
83 int brk;
84 int parent;
85 } zend_brk_cont_element;
86
87
88 struct _zend_op_array {
89 int type; /* MUST be the first element of this struct! */
90
91 unsigned char *arg_types; /* MUST be the second element of this struct! */
92
93 int *refcount;
94
95 zend_op *opcodes;
96 int last, size;
97
98 int T;
99
100 char *function_name;
101
102 zend_brk_cont_element *brk_cont_array;
103 int last_brk_cont;
104 int current_brk_cont;
1b4b5c4 @zsuraski New $GLOBALS init
zsuraski authored
105 unsigned char uses_globals;
573b460 @andigutmans Zend Library
andigutmans authored
106
107 /* static variables support */
108 HashTable *static_variables;
109
110 #if SUPPORT_INTERACTIVE
111 int start_op_number, end_op_number;
112 int last_executed_op_number;
113 int backpatch_count;
114 #endif
115
116 void *reserved[4];
117 };
118
119
1250c43 @zsuraski * Add struct name to all typedef's so that they can be debugged with …
zsuraski authored
120 typedef struct _zend_internal_function {
573b460 @andigutmans Zend Library
andigutmans authored
121 int type; /* MUST be the first element of this struct! */
122
123 unsigned char *arg_types; /* MUST be the second element of this struct */
124
125 void (*handler)(INTERNAL_FUNCTION_PARAMETERS);
126 char *function_name;
127 } zend_internal_function;
128
129
1250c43 @zsuraski * Add struct name to all typedef's so that they can be debugged with …
zsuraski authored
130 typedef union _zend_function {
573b460 @andigutmans Zend Library
andigutmans authored
131 int type; /* MUST be the first element of this struct! */
132 struct {
133 int type; /* never used */
134 unsigned char *arg_types;
135 } common;
136
137 zend_op_array op_array;
138 zend_internal_function internal_function;
139 } zend_function;
140
141
9cb2cf1 @zsuraski Optimize allocations into uninitialized_zval assignments
zsuraski authored
142 typedef struct _zend_function_state {
573b460 @andigutmans Zend Library
andigutmans authored
143 HashTable *function_symbol_table;
144 zend_function *function;
145 void *reserved[4];
146 } zend_function_state;
147
148
1250c43 @zsuraski * Add struct name to all typedef's so that they can be debugged with …
zsuraski authored
149 typedef struct _zend_switch_entry {
573b460 @andigutmans Zend Library
andigutmans authored
150 znode cond;
151 int default_case;
152 int control_var;
153 } zend_switch_entry;
154
155
1250c43 @zsuraski * Add struct name to all typedef's so that they can be debugged with …
zsuraski authored
156 typedef struct _list_llist_element {
573b460 @andigutmans Zend Library
andigutmans authored
157 znode var;
158 zend_llist dimensions;
159 znode value;
160 } list_llist_element;
161
162
39f9487 @andigutmans -Tiny patches
andigutmans authored
163 typedef struct _zend_file_handle {
573b460 @andigutmans Zend Library
andigutmans authored
164 int type;
165 char *filename;
166 union {
167 int fd;
168 FILE *fp;
169 #ifdef __cplusplus
170 istream *is;
171 #endif
172 } handle;
173 } zend_file_handle;
174
175
176 #include "zend_globals.h"
177
178 #define IS_CONST (1<<0)
179 #define IS_TMP_VAR (1<<1)
180 #define IS_VAR (1<<2)
181 #define IS_UNUSED (1<<3) /* Unused variable */
182
183
184 #define EXT_TYPE_UNUSED (1<<0)
185
186 void init_compiler(CLS_D ELS_DC);
187 void shutdown_compiler(CLS_D);
188
1aa2c5c @zsuraski Ok, call me crazy, because I probably am.
zsuraski authored
189 BEGIN_EXTERN_C()
39f9487 @andigutmans -Tiny patches
andigutmans authored
190 extern ZEND_API zend_op_array *(*zend_compile_files)(int mark_as_ref CLS_DC, int file_count, ...);
573b460 @andigutmans Zend Library
andigutmans authored
191
ed06a70 @zsuraski * Centralized shutdown
zsuraski authored
192 void zend_activate(CLS_D ELS_DC);
193 void zend_deactivate(CLS_D ELS_DC);
194
573b460 @andigutmans Zend Library
andigutmans authored
195 int lex_scan(zval *zendlval CLS_DC);
196 void startup_scanner(CLS_D);
197 void shutdown_scanner(CLS_D);
198
199 ZEND_API void zend_set_compiled_filename(char *new_compiled_filename);
200 ZEND_API void zend_restore_compiled_filename(char *original_compiled_filename);
201 ZEND_API char *zend_get_compiled_filename();
202
1aa2c5c @zsuraski Ok, call me crazy, because I probably am.
zsuraski authored
203 #ifdef ZTS
204 const char *zend_get_zendtext(CLS_D);
205 int zend_get_zendleng(CLS_D);
206 #endif
207
208 END_EXTERN_C()
573b460 @andigutmans Zend Library
andigutmans authored
209
210 /* parser-driven code generators */
211 void do_binary_op(int op, znode *result, znode *op1, znode *op2 CLS_DC);
212 void do_unary_op(int op, znode *result, znode *op1 CLS_DC);
213 void do_binary_assign_op(int op, znode *result, znode *op1, znode *op2 CLS_DC);
214 void do_assign(znode *result, znode *variable, znode *value CLS_DC);
215 void do_assign_ref(znode *result, znode *lvar, znode *rvar CLS_DC);
216 void fetch_simple_variable(znode *result, znode *varname, int bp CLS_DC);
217 void do_indirect_references(znode *result, znode *num_references, znode *variable CLS_DC);
218 void do_fetch_global_or_static_variable(znode *varname, znode *static_assignment, int fetch_type CLS_DC);
7a87fcb @zsuraski Thread safety patch. We're still not quite there but it compiles aga…
zsuraski authored
219 void do_fetch_globals(znode *varname CLS_DC);
573b460 @andigutmans Zend Library
andigutmans authored
220
221 void fetch_array_begin(znode *result, znode *varname, znode *first_dim CLS_DC);
222 void fetch_array_dim(znode *result, znode *parent, znode *dim CLS_DC);
223 void do_print(znode *result, znode *arg CLS_DC);
224 void do_echo(znode *arg CLS_DC);
8802964 * fix some casts
Sascha Schumann authored
225 typedef int (*unary_op_type)(zval *, zval *);
226 ZEND_API unary_op_type get_unary_op(int opcode);
573b460 @andigutmans Zend Library
andigutmans authored
227 ZEND_API void *get_binary_op(int opcode);
228
229 void do_while_cond(znode *expr, znode *close_bracket_token CLS_DC);
230 void do_while_end(znode *while_token, znode *close_bracket_token CLS_DC);
231 void do_do_while_begin(CLS_D);
232 void do_do_while_end(znode *do_token, znode *expr CLS_DC);
233
234
235 void do_if_cond(znode *cond, znode *closing_bracket_token CLS_DC);
236 void do_if_after_statement(znode *closing_bracket_token, unsigned char initialize CLS_DC);
237 void do_if_end(CLS_D);
238
239 void do_for_cond(znode *expr, znode *second_semicolon_token CLS_DC);
240 void do_for_before_statement(znode *cond_start, znode *second_semicolon_token CLS_DC);
241 void do_for_end(znode *second_semicolon_token CLS_DC);
242
243 void do_pre_incdec(znode *result, znode *op1, int op CLS_DC);
244 void do_post_incdec(znode *result, znode *op1, int op CLS_DC);
245
246 void do_begin_variable_parse(CLS_D);
247 void do_end_variable_parse(int type CLS_DC);
248
249 void do_free(znode *op1 CLS_DC);
250
7a87fcb @zsuraski Thread safety patch. We're still not quite there but it compiles aga…
zsuraski authored
251 void do_init_string(znode *result CLS_DC);
573b460 @andigutmans Zend Library
andigutmans authored
252 void do_add_char(znode *result, znode *op1, znode *op2 CLS_DC);
253 void do_add_string(znode *result, znode *op1, znode *op2 CLS_DC);
254 void do_add_variable(znode *result, znode *op1, znode *op2 CLS_DC);
255
256 void do_begin_function_declaration(znode *function_token, znode *function_name, int is_method CLS_DC);
257 void do_end_function_declaration(znode *function_token CLS_DC);
258 void do_receive_arg(int op, znode *var, znode *offset, znode *initialization, unsigned char pass_type CLS_DC);
259 void do_begin_function_call(znode *function_name CLS_DC);
260 void do_begin_dynamic_function_call(znode *function_name CLS_DC);
261 void do_begin_class_member_function_call(znode *class_name, znode *function_name CLS_DC);
39a7f4c @zsuraski This patch is a go. Not fully optimized yet, but working properly.
zsuraski authored
262 void do_end_function_call(znode *function_name, znode *result, znode *argument_list, int is_method CLS_DC);
573b460 @andigutmans Zend Library
andigutmans authored
263 void do_return(znode *expr CLS_DC);
3facf7c @andigutmans - Updates we did today
andigutmans authored
264 ZEND_API void do_bind_function_or_class(zend_op *opline, HashTable *function_table, HashTable *class_table);
b0bfa45 @zsuraski * Fix all hash checks that checked Bucket.arKey for NULL, when it was…
zsuraski authored
265 void do_early_binding(CLS_D);
573b460 @andigutmans Zend Library
andigutmans authored
266
267 void do_pass_param(znode *param, int op, int offset CLS_DC);
268
269
270 void do_boolean_or_begin(znode *expr1, znode *op_token CLS_DC);
271 void do_boolean_or_end(znode *result, znode *expr1, znode *expr2, znode *op_token CLS_DC);
272 void do_boolean_and_begin(znode *expr1, znode *op_token CLS_DC);
273 void do_boolean_and_end(znode *result, znode *expr1, znode *expr2, znode *op_token CLS_DC);
274
275 void do_brk_cont(int op, znode *expr CLS_DC);
276
277 void do_switch_cond(znode *cond CLS_DC);
278 void do_switch_end(znode *case_list CLS_DC);
279 void do_case_before_statement(znode *case_list, znode *case_token, znode *case_expr CLS_DC);
280 void do_case_after_statement(znode *result, znode *case_token CLS_DC);
281 void do_default_before_statement(znode *case_list, znode *default_token CLS_DC);
282
283 void do_begin_class_declaration(znode *class_name, znode *parent_class_name CLS_DC);
284 void do_end_class_declaration(CLS_D);
285 void do_declare_property(znode *var_name, znode *value CLS_DC);
286
287 void do_fetch_property(znode *result, znode *object, znode *property CLS_DC);
288
289
290 void do_push_object(znode *object CLS_DC);
291 void do_pop_object(znode *object CLS_DC);
292
293
294 void do_begin_new_object(znode *result, znode *variable, znode *new_token, znode *class_name CLS_DC);
39a7f4c @zsuraski This patch is a go. Not fully optimized yet, but working properly.
zsuraski authored
295 void do_end_new_object(znode *class_name, znode *new_token, znode *argument_list CLS_DC);
573b460 @andigutmans Zend Library
andigutmans authored
296
297 void do_fetch_constant(znode *result, znode *constant_name, int mode CLS_DC);
298
299 void do_shell_exec(znode *result, znode *cmd CLS_DC);
300
301 void do_init_array(znode *result, znode *expr, znode *offset CLS_DC);
302 void do_add_array_element(znode *result, znode *expr, znode *offset CLS_DC);
7ed4923 @andigutmans - Fix the static array() initializing
andigutmans authored
303 void do_add_static_array_element(znode *result, znode *offset, znode *expr);
573b460 @andigutmans Zend Library
andigutmans authored
304 void do_list_init();
305 void do_list_end(znode *result, znode *expr CLS_DC);
306 void do_add_list_element(znode *element CLS_DC);
307 void do_new_list_begin(CLS_D);
308 void do_new_list_end(CLS_D);
309
310 void do_cast(znode *result, znode *expr, int type CLS_DC);
311 void do_include_or_eval(int type, znode *result, znode *op1 CLS_DC);
312
313 void do_unset(znode *variable CLS_DC);
314 void do_isset_or_isempty(int type, znode *result, znode *variable CLS_DC);
315
316 void do_foreach_begin(znode *foreach_token, znode *array, znode *open_brackets_token, znode *as_token CLS_DC);
317 void do_foreach_cont(znode *value, znode *key, znode *as_token CLS_DC);
318 void do_foreach_end(znode *foreach_token, znode *open_brackets_token CLS_DC);
319
320 void do_end_heredoc(CLS_D);
321
322 void do_exit(znode *result, znode *message CLS_DC);
323
324 void do_begin_silence(znode *strudel_token CLS_DC);
325 void do_end_silence(znode *strudel_token CLS_DC);
326
327 void do_begin_qm_op(znode *cond, znode *qm_token CLS_DC);
328 void do_qm_true(znode *true_value, znode *qm_token, znode *colon_token CLS_DC);
329 void do_qm_false(znode *result, znode *false_value, znode *qm_token, znode *colon_token CLS_DC);
330
331 void do_extended_info(CLS_D);
332 void do_extended_fcall_begin(CLS_D);
333 void do_extended_fcall_end(CLS_D);
334
7c4a083 @zsuraski Various thread safety fixes and DLL updates
zsuraski authored
335 #define INITIAL_OP_ARRAY_SIZE 64
336
573b460 @andigutmans Zend Library
andigutmans authored
337
338 /* helper functions in zend-scanner.l */
1aa2c5c @zsuraski Ok, call me crazy, because I probably am.
zsuraski authored
339 BEGIN_EXTERN_C()
573b460 @andigutmans Zend Library
andigutmans authored
340 ZEND_API int require_file(zend_file_handle *file_handle CLS_DC);
341 ZEND_API int require_filename(char *filename CLS_DC);
342 ZEND_API zend_op_array *compile_files(int mark_as_ref CLS_DC, int file_count, ...);
7a87fcb @zsuraski Thread safety patch. We're still not quite there but it compiles aga…
zsuraski authored
343 ZEND_API zend_op_array *v_compile_files(int mark_as_ref CLS_DC, int file_count, va_list files);
573b460 @andigutmans Zend Library
andigutmans authored
344 ZEND_API zend_op_array *compile_string(zval *source_string CLS_DC);
345 ZEND_API zend_op_array *compile_filename(zval *filename CLS_DC);
7c4a083 @zsuraski Various thread safety fixes and DLL updates
zsuraski authored
346 ZEND_API inline int open_file_for_scanning(zend_file_handle *file_handle CLS_DC);
573b460 @andigutmans Zend Library
andigutmans authored
347 ZEND_API void init_op_array(zend_op_array *op_array, int initial_ops_size);
348 ZEND_API void destroy_op_array(zend_op_array *op_array);
87ba08d @zsuraski Avoid leaking fd's in case of failures
zsuraski authored
349 ZEND_API void zend_close_file_handle(zend_file_handle *file_handle CLS_DC);
350 ZEND_API void zend_open_file_dtor(void *f);
1aa2c5c @zsuraski Ok, call me crazy, because I probably am.
zsuraski authored
351 END_EXTERN_C()
573b460 @andigutmans Zend Library
andigutmans authored
352
81d901b @zsuraski Step 1 in nuking the garbage collector:
zsuraski authored
353 ZEND_API int destroy_zend_function(zend_function *function);
354 ZEND_API int destroy_zend_class(zend_class_entry *ce);
7c4a083 @zsuraski Various thread safety fixes and DLL updates
zsuraski authored
355 void zend_class_add_ref(zend_class_entry *ce);
356
81d901b @zsuraski Step 1 in nuking the garbage collector:
zsuraski authored
357 #define ZEND_FUNCTION_DTOR (int (*)(void *)) destroy_zend_function
358 #define ZEND_CLASS_DTOR (int (*)(void *)) destroy_zend_class
359
573b460 @andigutmans Zend Library
andigutmans authored
360 zend_op *get_next_op(zend_op_array *op_array CLS_DC);
361 int get_next_op_number(zend_op_array *op_array);
362 int print_class(zend_class_entry *class_entry);
363 void print_op_array(zend_op_array *op_array, int optimizations);
1aa2c5c @zsuraski Ok, call me crazy, because I probably am.
zsuraski authored
364 BEGIN_EXTERN_C()
573b460 @andigutmans Zend Library
andigutmans authored
365 int pass_two(zend_op_array *op_array);
366 void pass_include_eval(zend_op_array *op_array);
1aa2c5c @zsuraski Ok, call me crazy, because I probably am.
zsuraski authored
367 END_EXTERN_C()
573b460 @andigutmans Zend Library
andigutmans authored
368 zend_brk_cont_element *get_next_brk_cont_element(zend_op_array *op_array);
369
370
371 int zendlex(znode *zendlval CLS_DC);
372
373
374 #define ZEND_NOP 0
375
376 #define ZEND_ADD 1
377 #define ZEND_SUB 2
378 #define ZEND_MUL 3
379 #define ZEND_DIV 4
380 #define ZEND_MOD 5
381 #define ZEND_SL 6
382 #define ZEND_SR 7
383 #define ZEND_CONCAT 8
384 #define ZEND_BW_OR 9
385 #define ZEND_BW_AND 10
386 #define ZEND_BW_XOR 11
387 #define ZEND_BW_NOT 12
388 #define ZEND_BOOL_NOT 13
389 #define ZEND_BOOL_XOR 14
5a5806e @zsuraski Cleanups, remove old ts code
zsuraski authored
390 #define ZEND_IS_EQUAL 15
391 #define ZEND_IS_NOT_EQUAL 16
573b460 @andigutmans Zend Library
andigutmans authored
392 #define ZEND_IS_SMALLER 17
5a5806e @zsuraski Cleanups, remove old ts code
zsuraski authored
393 #define ZEND_IS_SMALLER_OR_EQUAL 18
573b460 @andigutmans Zend Library
andigutmans authored
394 #define ZEND_CAST 19
395 #define ZEND_QM_ASSIGN 20
396
5a5806e @zsuraski Cleanups, remove old ts code
zsuraski authored
397 #define ZEND_ASSIGN_ADD 21
398 #define ZEND_ASSIGN_SUB 22
399 #define ZEND_ASSIGN_MUL 23
400 #define ZEND_ASSIGN_DIV 24
401 #define ZEND_ASSIGN_MOD 25
402 #define ZEND_ASSIGN_SL 26
403 #define ZEND_ASSIGN_SR 27
404 #define ZEND_ASSIGN_CONCAT 28
405 #define ZEND_ASSIGN_BW_OR 29
406 #define ZEND_ASSIGN_BW_AND 30
407 #define ZEND_ASSIGN_BW_XOR 31
573b460 @andigutmans Zend Library
andigutmans authored
408
409 #define ZEND_PRE_INC 32
410 #define ZEND_PRE_DEC 33
411 #define ZEND_POST_INC 34
412 #define ZEND_POST_DEC 35
413
5a5806e @zsuraski Cleanups, remove old ts code
zsuraski authored
414 #define ZEND_ASSIGN 36
415 #define ZEND_ASSIGN_REF 37
573b460 @andigutmans Zend Library
andigutmans authored
416
5a5806e @zsuraski Cleanups, remove old ts code
zsuraski authored
417 #define ZEND_ECHO 38
418 #define ZEND_PRINT 39
573b460 @andigutmans Zend Library
andigutmans authored
419
420 #define ZEND_JMP 40
421 #define ZEND_JMPZ 41
422 #define ZEND_JMPNZ 42
423 #define ZEND_JMPZNZ 43
424 #define ZEND_JMPZ_EX 44
425 #define ZEND_JMPNZ_EX 45
426 #define ZEND_CASE 46
427 #define ZEND_BRK 47
428 #define ZEND_CONT 48
429 #define ZEND_BOOL 49
430
431 #define ZEND_INIT_STRING 50
432 #define ZEND_ADD_CHAR 51
433 #define ZEND_ADD_STRING 52
434 #define ZEND_ADD_VAR 53
435
436 #define ZEND_BEGIN_SILENCE 54
437 #define ZEND_END_SILENCE 55
438
04b2c1d @andigutmans * Fix a by-name call/method call bug
andigutmans authored
439 #define ZEND_INIT_FCALL_BY_NAME 56
440 #define ZEND_DO_FCALL 57
441 #define ZEND_DO_FCALL_BY_NAME 58
573b460 @andigutmans Zend Library
andigutmans authored
442 #define ZEND_RETURN 59
443
444 #define ZEND_RECV 60
445 #define ZEND_RECV_INIT 61
446
447 #define ZEND_SEND_VAL 62
448 #define ZEND_SEND_VAR 63
449 #define ZEND_SEND_REF 64
450
451 #define ZEND_NEW 65
452 #define ZEND_JMP_NO_CTOR 66
453 #define ZEND_FREE 67
454
455 #define ZEND_INIT_ARRAY 68
456 #define ZEND_ADD_ARRAY_ELEMENT 69
457
458 #define ZEND_INCLUDE_OR_EVAL 70
459
5a5806e @zsuraski Cleanups, remove old ts code
zsuraski authored
460 #define ZEND_UNSET_VAR 71
461 #define ZEND_UNSET_DIM_OBJ 72
573b460 @andigutmans Zend Library
andigutmans authored
462 #define ZEND_ISSET_ISEMPTY 73
463
464 #define ZEND_FE_RESET 74
465 #define ZEND_FE_FETCH 75
466
467 #define ZEND_EXIT 76
468
469
470 /* the following 12 opcodes are 4 groups of 3 opcodes each, and must
471 * remain in that order!
472 */
473 #define ZEND_FETCH_R 77
474 #define ZEND_FETCH_DIM_R 78
475 #define ZEND_FETCH_OBJ_R 79
476 #define ZEND_FETCH_W 80
477 #define ZEND_FETCH_DIM_W 81
478 #define ZEND_FETCH_OBJ_W 82
479 #define ZEND_FETCH_RW 83
480 #define ZEND_FETCH_DIM_RW 84
481 #define ZEND_FETCH_OBJ_RW 85
482 #define ZEND_FETCH_IS 86
483 #define ZEND_FETCH_DIM_IS 87
484 #define ZEND_FETCH_OBJ_IS 88
485
486 #define ZEND_FETCH_DIM_TMP_VAR 89
487 #define ZEND_FETCH_CONSTANT 90
17bdb70 @zsuraski $GLOBALS support
zsuraski authored
488
b0bfa45 @zsuraski * Fix all hash checks that checked Bucket.arKey for NULL, when it was…
zsuraski authored
489 #define ZEND_DECLARE_FUNCTION_OR_CLASS 91
17bdb70 @zsuraski $GLOBALS support
zsuraski authored
490
1b4b5c4 @zsuraski New $GLOBALS init
zsuraski authored
491 #define ZEND_EXT_STMT 92
492 #define ZEND_EXT_FCALL_BEGIN 93
493 #define ZEND_EXT_FCALL_END 94
494 #define ZEND_EXT_NOP 95
573b460 @andigutmans Zend Library
andigutmans authored
495
496 /* end of block */
497
498
499
500
501 /* global/local fetches */
502 #define ZEND_FETCH_GLOBAL 0
503 #define ZEND_FETCH_LOCAL 1
504 #define ZEND_FETCH_STATIC 2
505
506 /* var status for backpatching */
507 #define BP_VAR_R 0
508 #define BP_VAR_W 1
509 #define BP_VAR_RW 2
510 #define BP_VAR_IS 3
511 #define BP_VAR_NA 4 /* if not applicable */
512
513
514 #define ZEND_INTERNAL_FUNCTION 1
515 #define ZEND_USER_FUNCTION 2
516 #define ZEND_OVERLOADED_FUNCTION 3
2493f68 @zsuraski * Fix debugger+interactive mode bug
zsuraski authored
517 #define ZEND_EVAL_CODE 4
573b460 @andigutmans Zend Library
andigutmans authored
518
519 #define ZEND_INTERNAL_CLASS 1
520 #define ZEND_USER_CLASS 2
521
522 #define ZEND_EVAL (1<<0)
523 #define ZEND_INCLUDE (1<<1)
524
525 #define ZEND_ISSET (1<<0)
526 #define ZEND_ISEMPTY (1<<1)
527
528 #define ZEND_CT (1<<0)
529 #define ZEND_RT (1<<1)
530
531
532 #define ZEND_HANDLE_FILENAME 0
533 #define ZEND_HANDLE_FD 1
534 #define ZEND_HANDLE_FP 2
535 #define ZEND_HANDLE_ISTREAM 3
536
d894cf4 @zsuraski Support definition of classes that are derived from classes that are …
zsuraski authored
537 #define ZEND_DECLARE_CLASS 1
538 #define ZEND_DECLARE_FUNCTION 2
539 #define ZEND_DECLARE_INHERITED_CLASS 3
b0bfa45 @zsuraski * Fix all hash checks that checked Bucket.arKey for NULL, when it was…
zsuraski authored
540
1250c43 @zsuraski * Add struct name to all typedef's so that they can be debugged with …
zsuraski authored
541 #define ZEND_FETCH_STANDARD 0
542 #define ZEND_FETCH_NO_AI_COUNT 1
543
741b816 @zsuraski * Support getThis() for internal functions.
zsuraski authored
544 #define ZEND_MEMBER_FUNC_CALL 1<<0
545 #define ZEND_CTOR_CALL 1<<1
546
573b460 @andigutmans Zend Library
andigutmans authored
547 #endif /* _COMPILE_H */
Something went wrong with that request. Please try again.