1 | #include "xcache.h" |
---|
2 | #include "xc_compatibility.h" |
---|
3 | |
---|
4 | typedef zend_op_array *(zend_compile_file_t)(zend_file_handle *h, int type TSRMLS_DC); |
---|
5 | |
---|
6 | typedef struct _xc_compilererror_t { |
---|
7 | int type; |
---|
8 | uint lineno; |
---|
9 | int error_len; |
---|
10 | char *error; |
---|
11 | } xc_compilererror_t; |
---|
12 | |
---|
13 | typedef struct _xc_compile_result_t { |
---|
14 | zend_op_array *op_array; |
---|
15 | HashTable *function_table; |
---|
16 | HashTable *class_table; |
---|
17 | } xc_compile_result_t; |
---|
18 | |
---|
19 | xc_compile_result_t *xc_compile_result_init(xc_compile_result_t *cr, |
---|
20 | zend_op_array *op_array, |
---|
21 | HashTable *function_table, |
---|
22 | HashTable *class_table); |
---|
23 | void xc_compile_result_free(xc_compile_result_t *cr); |
---|
24 | xc_compile_result_t *xc_compile_result_init_cur(xc_compile_result_t *cr, zend_op_array *op_array TSRMLS_DC); |
---|
25 | /* apply func */ |
---|
26 | int xc_apply_op_array(xc_compile_result_t *cr, apply_func_t applyer TSRMLS_DC); |
---|
27 | |
---|
28 | int xc_undo_pass_two(zend_op_array *op_array TSRMLS_DC); |
---|
29 | int xc_redo_pass_two(zend_op_array *op_array TSRMLS_DC); |
---|
30 | int xc_fix_opcode(zend_op_array *op_array TSRMLS_DC); |
---|
31 | int xc_undo_fix_opcode(zend_op_array *op_array TSRMLS_DC); |
---|
32 | zend_uchar xc_get_fixed_opcode(zend_uchar opcode, int line); |
---|
33 | |
---|
34 | typedef void (*xc_foreach_early_binding_class_cb)(zend_op *opline, int oplineno, void *data TSRMLS_DC); |
---|
35 | int xc_foreach_early_binding_class(zend_op_array *op_array, xc_foreach_early_binding_class_cb callback, void *data TSRMLS_DC); |
---|
36 | |
---|
37 | /* installer */ |
---|
38 | #ifdef HAVE_XCACHE_CONSTANT |
---|
39 | void xc_install_constant(ZEND_24(NOTHING, const) char *filename, zend_constant *constant, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC); |
---|
40 | #endif |
---|
41 | void xc_install_function(ZEND_24(NOTHING, const) char *filename, zend_function *func, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC); |
---|
42 | void xc_install_class(ZEND_24(NOTHING, const) char *filename, zend_class_entry *class_entry, int oplineno, zend_uchar type, const24_zstr key, uint len, ulong h TSRMLS_DC); |
---|
43 | |
---|
44 | typedef zend_bool (*xc_if_func_t)(void *data); |
---|
45 | |
---|
46 | void xc_hash_copy_if(HashTable *target, HashTable *source, copy_ctor_func_t pCopyConstructor, void *tmp, uint size, xc_if_func_t checker); |
---|
47 | #ifdef HAVE_XCACHE_CONSTANT |
---|
48 | void xc_zend_constant_ctor(zend_constant *c); |
---|
49 | void xc_zend_constant_dtor(zend_constant *c); |
---|
50 | void xc_copy_internal_zend_constants(HashTable *target, HashTable *source); |
---|
51 | #endif |
---|
52 | |
---|
53 | #ifndef ZEND_COMPILE_DELAYED_BINDING |
---|
54 | int xc_do_early_binding(zend_op_array *op_array, HashTable *class_table, int oplineno TSRMLS_DC); |
---|
55 | #endif |
---|