You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

608 lines
18 KiB

27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
26 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
26 years ago
27 years ago
  1. /*
  2. +----------------------------------------------------------------------+
  3. | Zend Engine |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1998, 1999 Andi Gutmans, Zeev Suraski |
  6. +----------------------------------------------------------------------+
  7. | This source file is subject to version 0.91 of the Zend license, |
  8. | that is bundled with this package in the file LICENSE, and is |
  9. | available at through the world-wide-web at |
  10. | http://www.zend.com/license/0_91.txt. |
  11. | If you did not receive a copy of the Zend license and are unable to |
  12. | obtain it through the world-wide-web, please send a note to |
  13. | license@zend.com so we can mail you a copy immediately. |
  14. +----------------------------------------------------------------------+
  15. | Authors: Andi Gutmans <andi@zend.com> |
  16. | Zeev Suraski <zeev@zend.com> |
  17. +----------------------------------------------------------------------+
  18. */
  19. #ifndef _COMPILE_H
  20. #define _COMPILE_H
  21. #include "zend.h"
  22. #ifdef HAVE_STDARG_H
  23. # include <stdarg.h>
  24. #endif
  25. #include "zend_llist.h"
  26. #define DEBUG_ZEND 0
  27. #ifndef ZTS
  28. # define SUPPORT_INTERACTIVE 1
  29. #else
  30. # define SUPPORT_INTERACTIVE 0
  31. #endif
  32. #define FREE_PNODE(znode) zval_dtor(&znode->u.constant);
  33. #define FREE_OP(op, should_free) if (should_free) zval_dtor(&Ts[(op)->u.var].tmp_var);
  34. #if SUPPORT_INTERACTIVE
  35. #define INC_BPC(op_array) ((op_array)->backpatch_count++)
  36. #define DEC_BPC(op_array) ((op_array)->backpatch_count--)
  37. #define HANDLE_INTERACTIVE() if (EG(interactive)) { execute_new_code(CLS_C); }
  38. #else
  39. #define INC_BPC(op_array)
  40. #define DEC_BPC(op_array)
  41. #define HANDLE_INTERACTIVE()
  42. #endif
  43. typedef struct _zend_op_array zend_op_array;
  44. typedef struct _znode {
  45. int op_type;
  46. union {
  47. zval constant;
  48. int var;
  49. int opline_num;
  50. int fetch_type;
  51. zend_op_array *op_array;
  52. struct {
  53. int var; /* dummy */
  54. int type;
  55. } EA;
  56. } u;
  57. } znode;
  58. typedef struct _zend_op {
  59. int opcode;
  60. znode result;
  61. znode op1;
  62. znode op2;
  63. ulong extended_value;
  64. char *filename;
  65. uint lineno;
  66. } zend_op;
  67. typedef struct _zend_brk_cont_element {
  68. int cont;
  69. int brk;
  70. int parent;
  71. } zend_brk_cont_element;
  72. struct _zend_op_array {
  73. int type; /* MUST be the first element of this struct! */
  74. unsigned char *arg_types; /* MUST be the second element of this struct! */
  75. char *function_name; /* MUST be the third element of this struct! */
  76. int *refcount;
  77. zend_op *opcodes;
  78. int last, size;
  79. int T;
  80. zend_brk_cont_element *brk_cont_array;
  81. int last_brk_cont;
  82. int current_brk_cont;
  83. unsigned char uses_globals;
  84. /* static variables support */
  85. HashTable *static_variables;
  86. #if SUPPORT_INTERACTIVE
  87. int start_op_number, end_op_number;
  88. int last_executed_op_number;
  89. int backpatch_count;
  90. #endif
  91. zend_bool return_reference;
  92. void *reserved[ZEND_MAX_RESERVED_RESOURCES];
  93. };
  94. typedef struct _zend_internal_function {
  95. int type; /* MUST be the first element of this struct! */
  96. unsigned char *arg_types; /* MUST be the second element of this struct */
  97. char *function_name; /* MUST be the third element of this struct */
  98. void (*handler)(INTERNAL_FUNCTION_PARAMETERS);
  99. } zend_internal_function;
  100. typedef union _zend_function {
  101. int type; /* MUST be the first element of this struct! */
  102. struct {
  103. int type; /* never used */
  104. unsigned char *arg_types;
  105. char *function_name;
  106. } common;
  107. zend_op_array op_array;
  108. zend_internal_function internal_function;
  109. } zend_function;
  110. typedef struct _zend_function_state {
  111. HashTable *function_symbol_table;
  112. zend_function *function;
  113. void *reserved[ZEND_MAX_RESERVED_RESOURCES];
  114. } zend_function_state;
  115. typedef struct _zend_switch_entry {
  116. znode cond;
  117. int default_case;
  118. int control_var;
  119. } zend_switch_entry;
  120. typedef struct _list_llist_element {
  121. znode var;
  122. zend_llist dimensions;
  123. znode value;
  124. } list_llist_element;
  125. typedef struct _zend_file_handle {
  126. int type;
  127. char *filename;
  128. char *opened_path;
  129. union {
  130. int fd;
  131. FILE *fp;
  132. #ifdef __cplusplus
  133. istream *is;
  134. #endif
  135. } handle;
  136. zend_bool free_filename;
  137. } zend_file_handle;
  138. #include "zend_globals.h"
  139. #define IS_CONST (1<<0)
  140. #define IS_TMP_VAR (1<<1)
  141. #define IS_VAR (1<<2)
  142. #define IS_UNUSED (1<<3) /* Unused variable */
  143. #define EXT_TYPE_UNUSED (1<<0)
  144. BEGIN_EXTERN_C()
  145. void init_compiler(CLS_D ELS_DC);
  146. void shutdown_compiler(CLS_D);
  147. extern ZEND_API zend_op_array *(*zend_compile_files)(int mark_as_ref CLS_DC, int file_count, ...);
  148. void zend_activate(CLS_D ELS_DC);
  149. void zend_deactivate(CLS_D ELS_DC);
  150. void zend_activate_modules();
  151. int lex_scan(zval *zendlval CLS_DC);
  152. void startup_scanner(CLS_D);
  153. void shutdown_scanner(CLS_D);
  154. ZEND_API char *zend_set_compiled_filename(char *new_compiled_filename);
  155. ZEND_API void zend_restore_compiled_filename(char *original_compiled_filename);
  156. ZEND_API char *zend_get_compiled_filename(CLS_D);
  157. ZEND_API int zend_get_compiled_lineno(CLS_D);
  158. #ifdef ZTS
  159. const char *zend_get_zendtext(CLS_D);
  160. int zend_get_zendleng(CLS_D);
  161. #endif
  162. /* parser-driven code generators */
  163. void do_binary_op(int op, znode *result, znode *op1, znode *op2 CLS_DC);
  164. void do_unary_op(int op, znode *result, znode *op1 CLS_DC);
  165. void do_binary_assign_op(int op, znode *result, znode *op1, znode *op2 CLS_DC);
  166. void do_assign(znode *result, znode *variable, znode *value CLS_DC);
  167. void do_assign_ref(znode *result, znode *lvar, znode *rvar CLS_DC);
  168. void fetch_simple_variable(znode *result, znode *varname, int bp CLS_DC);
  169. void fetch_simple_variable_ex(znode *result, znode *varname, int bp, int op CLS_DC);
  170. void do_indirect_references(znode *result, znode *num_references, znode *variable CLS_DC);
  171. void do_fetch_global_or_static_variable(znode *varname, znode *static_assignment, int fetch_type CLS_DC);
  172. void do_fetch_globals(znode *varname CLS_DC);
  173. void fetch_array_begin(znode *result, znode *varname, znode *first_dim CLS_DC);
  174. void fetch_array_dim(znode *result, znode *parent, znode *dim CLS_DC);
  175. void fetch_string_offset(znode *result, znode *parent, znode *offset CLS_DC);
  176. void do_print(znode *result, znode *arg CLS_DC);
  177. void do_echo(znode *arg CLS_DC);
  178. typedef int (*unary_op_type)(zval *, zval *);
  179. ZEND_API unary_op_type get_unary_op(int opcode);
  180. ZEND_API void *get_binary_op(int opcode);
  181. void do_while_cond(znode *expr, znode *close_bracket_token CLS_DC);
  182. void do_while_end(znode *while_token, znode *close_bracket_token CLS_DC);
  183. void do_do_while_begin(CLS_D);
  184. void do_do_while_end(znode *do_token, znode *expr_open_bracket, znode *expr CLS_DC);
  185. void do_if_cond(znode *cond, znode *closing_bracket_token CLS_DC);
  186. void do_if_after_statement(znode *closing_bracket_token, unsigned char initialize CLS_DC);
  187. void do_if_end(CLS_D);
  188. void do_for_cond(znode *expr, znode *second_semicolon_token CLS_DC);
  189. void do_for_before_statement(znode *cond_start, znode *second_semicolon_token CLS_DC);
  190. void do_for_end(znode *second_semicolon_token CLS_DC);
  191. void do_pre_incdec(znode *result, znode *op1, int op CLS_DC);
  192. void do_post_incdec(znode *result, znode *op1, int op CLS_DC);
  193. void do_begin_variable_parse(CLS_D);
  194. void do_end_variable_parse(int type, int arg_offset CLS_DC);
  195. void do_free(znode *op1 CLS_DC);
  196. void do_init_string(znode *result CLS_DC);
  197. void do_add_char(znode *result, znode *op1, znode *op2 CLS_DC);
  198. void do_add_string(znode *result, znode *op1, znode *op2 CLS_DC);
  199. void do_add_variable(znode *result, znode *op1, znode *op2 CLS_DC);
  200. void do_begin_function_declaration(znode *function_token, znode *function_name, int is_method, int return_reference CLS_DC);
  201. void do_end_function_declaration(znode *function_token CLS_DC);
  202. void do_receive_arg(int op, znode *var, znode *offset, znode *initialization, unsigned char pass_type CLS_DC);
  203. int do_begin_function_call(znode *function_name CLS_DC);
  204. void do_begin_dynamic_function_call(znode *function_name CLS_DC);
  205. void do_begin_class_member_function_call(znode *class_name, znode *function_name CLS_DC);
  206. void do_end_function_call(znode *function_name, znode *result, znode *argument_list, int is_method, int is_dynamic_fcall CLS_DC);
  207. void do_return(znode *expr, int do_end_vparse CLS_DC);
  208. ZEND_API int do_bind_function_or_class(zend_op *opline, HashTable *function_table, HashTable *class_table, int compile_time);
  209. void do_early_binding(CLS_D);
  210. void do_pass_param(znode *param, int op, int offset CLS_DC);
  211. void do_boolean_or_begin(znode *expr1, znode *op_token CLS_DC);
  212. void do_boolean_or_end(znode *result, znode *expr1, znode *expr2, znode *op_token CLS_DC);
  213. void do_boolean_and_begin(znode *expr1, znode *op_token CLS_DC);
  214. void do_boolean_and_end(znode *result, znode *expr1, znode *expr2, znode *op_token CLS_DC);
  215. void do_brk_cont(int op, znode *expr CLS_DC);
  216. void do_switch_cond(znode *cond CLS_DC);
  217. void do_switch_end(znode *case_list CLS_DC);
  218. void do_case_before_statement(znode *case_list, znode *case_token, znode *case_expr CLS_DC);
  219. void do_case_after_statement(znode *result, znode *case_token CLS_DC);
  220. void do_default_before_statement(znode *case_list, znode *default_token CLS_DC);
  221. void do_begin_class_declaration(znode *class_name, znode *parent_class_name CLS_DC);
  222. void do_end_class_declaration(CLS_D);
  223. void do_declare_property(znode *var_name, znode *value CLS_DC);
  224. void do_fetch_property(znode *result, znode *object, znode *property CLS_DC);
  225. void do_push_object(znode *object CLS_DC);
  226. void do_pop_object(znode *object CLS_DC);
  227. void do_begin_new_object(znode *new_token, znode *class_name CLS_DC);
  228. void do_end_new_object(znode *result, znode *class_name, znode *new_token, znode *argument_list CLS_DC);
  229. void do_fetch_constant(znode *result, znode *constant_name, int mode CLS_DC);
  230. void do_shell_exec(znode *result, znode *cmd CLS_DC);
  231. void do_init_array(znode *result, znode *expr, znode *offset, int is_ref CLS_DC);
  232. void do_add_array_element(znode *result, znode *expr, znode *offset, int is_ref CLS_DC);
  233. void do_add_static_array_element(znode *result, znode *offset, znode *expr);
  234. void do_list_init(CLS_D);
  235. void do_list_end(znode *result, znode *expr CLS_DC);
  236. void do_add_list_element(znode *element CLS_DC);
  237. void do_new_list_begin(CLS_D);
  238. void do_new_list_end(CLS_D);
  239. void do_cast(znode *result, znode *expr, int type CLS_DC);
  240. void do_include_or_eval(int type, znode *result, znode *op1 CLS_DC);
  241. void do_require(znode *filename CLS_DC);
  242. void do_unset(znode *variable CLS_DC);
  243. void do_isset_or_isempty(int type, znode *result, znode *variable CLS_DC);
  244. void do_foreach_begin(znode *foreach_token, znode *array, znode *open_brackets_token, znode *as_token CLS_DC);
  245. void do_foreach_cont(znode *value, znode *key, znode *as_token CLS_DC);
  246. void do_foreach_end(znode *foreach_token, znode *open_brackets_token CLS_DC);
  247. void do_declare_begin(CLS_D);
  248. void do_declare_stmt(znode *var, znode *val CLS_DC);
  249. void do_declare_end(CLS_D);
  250. void do_end_heredoc(CLS_D);
  251. void do_exit(znode *result, znode *message CLS_DC);
  252. void do_begin_silence(znode *strudel_token CLS_DC);
  253. void do_end_silence(znode *strudel_token CLS_DC);
  254. void do_begin_qm_op(znode *cond, znode *qm_token CLS_DC);
  255. void do_qm_true(znode *true_value, znode *qm_token, znode *colon_token CLS_DC);
  256. void do_qm_false(znode *result, znode *false_value, znode *qm_token, znode *colon_token CLS_DC);
  257. void do_extended_info(CLS_D);
  258. void do_extended_fcall_begin(CLS_D);
  259. void do_extended_fcall_end(CLS_D);
  260. void do_ticks(CLS_D);
  261. #define INITIAL_OP_ARRAY_SIZE 64
  262. /* helper functions in zend-scanner.l */
  263. ZEND_API int require_file(zend_file_handle *file_handle, zend_bool unique CLS_DC);
  264. ZEND_API int require_filename(char *filename CLS_DC);
  265. ZEND_API int use_filename(char *filename, uint filename_length CLS_DC);
  266. ZEND_API zend_op_array *compile_files(int mark_as_ref CLS_DC, int file_count, ...);
  267. ZEND_API zend_op_array *v_compile_files(int mark_as_ref CLS_DC, int file_count, va_list files);
  268. ZEND_API zend_op_array *compile_string(zval *source_string CLS_DC);
  269. ZEND_API zend_op_array *compile_filename(int mode, zval *filename CLS_DC ELS_DC);
  270. ZEND_API int open_file_for_scanning(zend_file_handle *file_handle CLS_DC);
  271. ZEND_API void init_op_array(zend_op_array *op_array, int initial_ops_size);
  272. ZEND_API void destroy_op_array(zend_op_array *op_array);
  273. ZEND_API void zend_close_file_handle(zend_file_handle *file_handle CLS_DC);
  274. ZEND_API void zend_open_file_dtor(zend_file_handle *fh);
  275. ZEND_API void destroy_zend_function(zend_function *function);
  276. ZEND_API void destroy_zend_class(zend_class_entry *ce);
  277. void zend_class_add_ref(zend_class_entry *ce);
  278. #define ZEND_FUNCTION_DTOR (void (*)(void *)) destroy_zend_function
  279. #define ZEND_CLASS_DTOR (void (*)(void *)) destroy_zend_class
  280. zend_op *get_next_op(zend_op_array *op_array CLS_DC);
  281. void init_op(zend_op *op CLS_DC);
  282. int get_next_op_number(zend_op_array *op_array);
  283. int print_class(zend_class_entry *class_entry);
  284. void print_op_array(zend_op_array *op_array, int optimizations);
  285. int pass_two(zend_op_array *op_array);
  286. void pass_include_eval(zend_op_array *op_array);
  287. zend_brk_cont_element *get_next_brk_cont_element(zend_op_array *op_array);
  288. ZEND_API zend_bool zend_is_compiling(void);
  289. int zendlex(znode *zendlval CLS_DC);
  290. #define ZEND_NOP 0
  291. #define ZEND_ADD 1
  292. #define ZEND_SUB 2
  293. #define ZEND_MUL 3
  294. #define ZEND_DIV 4
  295. #define ZEND_MOD 5
  296. #define ZEND_SL 6
  297. #define ZEND_SR 7
  298. #define ZEND_CONCAT 8
  299. #define ZEND_BW_OR 9
  300. #define ZEND_BW_AND 10
  301. #define ZEND_BW_XOR 11
  302. #define ZEND_BW_NOT 12
  303. #define ZEND_BOOL_NOT 13
  304. #define ZEND_BOOL_XOR 14
  305. #define ZEND_IS_IDENTICAL 15
  306. #define ZEND_IS_EQUAL 16
  307. #define ZEND_IS_NOT_EQUAL 17
  308. #define ZEND_IS_SMALLER 18
  309. #define ZEND_IS_SMALLER_OR_EQUAL 19
  310. #define ZEND_CAST 20
  311. #define ZEND_QM_ASSIGN 21
  312. #define ZEND_ASSIGN_ADD 22
  313. #define ZEND_ASSIGN_SUB 23
  314. #define ZEND_ASSIGN_MUL 24
  315. #define ZEND_ASSIGN_DIV 25
  316. #define ZEND_ASSIGN_MOD 26
  317. #define ZEND_ASSIGN_SL 27
  318. #define ZEND_ASSIGN_SR 28
  319. #define ZEND_ASSIGN_CONCAT 29
  320. #define ZEND_ASSIGN_BW_OR 30
  321. #define ZEND_ASSIGN_BW_AND 31
  322. #define ZEND_ASSIGN_BW_XOR 32
  323. #define ZEND_PRE_INC 33
  324. #define ZEND_PRE_DEC 34
  325. #define ZEND_POST_INC 35
  326. #define ZEND_POST_DEC 36
  327. #define ZEND_ASSIGN 37
  328. #define ZEND_ASSIGN_REF 38
  329. #define ZEND_ECHO 39
  330. #define ZEND_PRINT 40
  331. #define ZEND_JMP 41
  332. #define ZEND_JMPZ 42
  333. #define ZEND_JMPNZ 43
  334. #define ZEND_JMPZNZ 44
  335. #define ZEND_JMPZ_EX 45
  336. #define ZEND_JMPNZ_EX 46
  337. #define ZEND_CASE 47
  338. #define ZEND_SWITCH_FREE 48
  339. #define ZEND_BRK 49
  340. #define ZEND_CONT 50
  341. #define ZEND_BOOL 51
  342. #define ZEND_INIT_STRING 52
  343. #define ZEND_ADD_CHAR 53
  344. #define ZEND_ADD_STRING 54
  345. #define ZEND_ADD_VAR 55
  346. #define ZEND_BEGIN_SILENCE 56
  347. #define ZEND_END_SILENCE 57
  348. #define ZEND_INIT_FCALL_BY_NAME 58
  349. #define ZEND_DO_FCALL 59
  350. #define ZEND_DO_FCALL_BY_NAME 60
  351. #define ZEND_RETURN 61
  352. #define ZEND_RECV 62
  353. #define ZEND_RECV_INIT 63
  354. #define ZEND_SEND_VAL 64
  355. #define ZEND_SEND_VAR 65
  356. #define ZEND_SEND_REF 66
  357. #define ZEND_NEW 67
  358. #define ZEND_JMP_NO_CTOR 68
  359. #define ZEND_FREE 69
  360. #define ZEND_INIT_ARRAY 70
  361. #define ZEND_ADD_ARRAY_ELEMENT 71
  362. #define ZEND_INCLUDE_OR_EVAL 72
  363. #define ZEND_UNSET_VAR 73
  364. #define ZEND_UNSET_DIM_OBJ 74
  365. #define ZEND_ISSET_ISEMPTY 75
  366. #define ZEND_FE_RESET 76
  367. #define ZEND_FE_FETCH 77
  368. #define ZEND_EXIT 78
  369. /* the following 15 opcodes are 5 groups of 3 opcodes each, and must
  370. * remain in that order!
  371. */
  372. #define ZEND_FETCH_R 79
  373. #define ZEND_FETCH_DIM_R 80
  374. #define ZEND_FETCH_OBJ_R 81
  375. #define ZEND_FETCH_W 82
  376. #define ZEND_FETCH_DIM_W 83
  377. #define ZEND_FETCH_OBJ_W 84
  378. #define ZEND_FETCH_RW 85
  379. #define ZEND_FETCH_DIM_RW 86
  380. #define ZEND_FETCH_OBJ_RW 87
  381. #define ZEND_FETCH_IS 88
  382. #define ZEND_FETCH_DIM_IS 89
  383. #define ZEND_FETCH_OBJ_IS 90
  384. #define ZEND_FETCH_FUNC_ARG 91
  385. #define ZEND_FETCH_DIM_FUNC_ARG 92
  386. #define ZEND_FETCH_OBJ_FUNC_ARG 93
  387. #define ZEND_FETCH_DIM_TMP_VAR 94
  388. #define ZEND_FETCH_CONSTANT 95
  389. #define ZEND_DECLARE_FUNCTION_OR_CLASS 96
  390. #define ZEND_EXT_STMT 97
  391. #define ZEND_EXT_FCALL_BEGIN 98
  392. #define ZEND_EXT_FCALL_END 99
  393. #define ZEND_EXT_NOP 100
  394. #define ZEND_TICKS 101
  395. /* end of block */
  396. /* global/local fetches */
  397. #define ZEND_FETCH_GLOBAL 0
  398. #define ZEND_FETCH_LOCAL 1
  399. #define ZEND_FETCH_STATIC 2
  400. /* var status for backpatching */
  401. #define BP_VAR_R 0
  402. #define BP_VAR_W 1
  403. #define BP_VAR_RW 2
  404. #define BP_VAR_IS 3
  405. #define BP_VAR_NA 4 /* if not applicable */
  406. #define BP_VAR_FUNC_ARG 5
  407. #define ZEND_INTERNAL_FUNCTION 1
  408. #define ZEND_USER_FUNCTION 2
  409. #define ZEND_OVERLOADED_FUNCTION 3
  410. #define ZEND_EVAL_CODE 4
  411. #define ZEND_INTERNAL_CLASS 1
  412. #define ZEND_USER_CLASS 2
  413. #define ZEND_EVAL (1<<0)
  414. #define ZEND_INCLUDE (1<<1)
  415. #define ZEND_IMPORT (1<<2)
  416. #define ZEND_REQUIRE (1<<3)
  417. #define ZEND_ISSET (1<<0)
  418. #define ZEND_ISEMPTY (1<<1)
  419. #define ZEND_CT (1<<0)
  420. #define ZEND_RT (1<<1)
  421. #define ZEND_HANDLE_FILENAME 0
  422. #define ZEND_HANDLE_FD 1
  423. #define ZEND_HANDLE_FP 2
  424. #define ZEND_HANDLE_STDIOSTREAM 3
  425. #define ZEND_HANDLE_FSTREAM 4
  426. #define ZEND_DECLARE_CLASS 1
  427. #define ZEND_DECLARE_FUNCTION 2
  428. #define ZEND_DECLARE_INHERITED_CLASS 3
  429. #define ZEND_FETCH_STANDARD 0
  430. #define ZEND_FETCH_ADD_LOCK 1
  431. #define ZEND_MEMBER_FUNC_CALL 1<<0
  432. #define ZEND_CTOR_CALL 1<<1
  433. #define AI_USE_PTR(ai) \
  434. if ((ai).ptr_ptr) { \
  435. (ai).ptr = *((ai).ptr_ptr); \
  436. (ai).ptr_ptr = &((ai).ptr); \
  437. } else { \
  438. (ai).ptr = NULL; \
  439. }
  440. #define PZVAL_IS_REF(z) ((z)->is_ref)
  441. /* Lost In Stupid Parentheses */
  442. #define ARG_SHOULD_BE_SENT_BY_REF(offset, conduct_check, arg_types) \
  443. ( \
  444. conduct_check \
  445. && arg_types \
  446. && \
  447. ( \
  448. ( \
  449. offset<=arg_types[0] \
  450. && arg_types[offset]==BYREF_FORCE \
  451. ) \
  452. || ( \
  453. offset>=arg_types[0] \
  454. && arg_types[arg_types[0]]==BYREF_FORCE_REST \
  455. ) \
  456. ) \
  457. )
  458. #define ZEND_RETURN_VAL 0
  459. #define ZEND_RETURN_REF 1
  460. END_EXTERN_C()
  461. #endif /* _COMPILE_H */