source: trunk/processor/processor.m4 @ 1297

Last change on this file since 1297 was 1297, checked in by moo, 15 months ago

fix PHP 5.0 build

  • Property svn:eol-style set to native
File size: 29.1 KB
RevLine 
[1]1dnl ================
2/* {{{ Pre-declare */
3DECL_STRUCT_P_FUNC(`zval')
4DECL_STRUCT_P_FUNC(`zval_ptr')
[825]5DECL_STRUCT_P_FUNC(`zval_ptr_nullable')
[1]6DECL_STRUCT_P_FUNC(`zend_op_array')
7DECL_STRUCT_P_FUNC(`zend_class_entry')
[95]8#ifdef HAVE_XCACHE_CONSTANT
9DECL_STRUCT_P_FUNC(`zend_constant')
10#endif
[1]11DECL_STRUCT_P_FUNC(`zend_function')
[856]12DECL_STRUCT_P_FUNC(`xc_entry_var_t')
13DECL_STRUCT_P_FUNC(`xc_entry_php_t')
[1]14DECL_STRUCT_P_FUNC(`zend_property_info')
15/* }}} */
16dnl ====================================================
17#ifdef IS_CV
[837]18DEF_STRUCT_P_FUNC(`zend_compiled_variable', , `dnl {{{
[843]19    PROCESS(int, name_len)
[103]20    PROC_ZSTRING_L(, name, name_len)
[843]21    PROCESS(ulong, hash_value)
[1]22')
23dnl }}}
[837]24#endif
25DEF_STRUCT_P_FUNC(`zend_uint', , `dnl {{{
[1]26    IFCOPY(`dst[0] = src[0];')
27    IFDPRINT(`
28        INDENT()
29        fprintf(stderr, "%u\n", src[0]);
30    ')
31    DONE_SIZE(sizeof(src[0]))
32')
33dnl }}}
[837]34DEF_STRUCT_P_FUNC(`zend_try_catch_element', , `dnl {{{
[843]35    PROCESS(zend_uint, try_op)
36    PROCESS(zend_uint, catch_op)
[1213]37#ifdef ZEND_ENGINE_2_5
38    PROCESS(zend_uint, finally_op)
39    PROCESS(zend_uint, finally_end)
40#endif
[1]41')
42dnl }}}
[837]43DEF_STRUCT_P_FUNC(`zend_brk_cont_element', , `dnl {{{
[194]44#ifdef ZEND_ENGINE_2_2
[843]45    PROCESS(int, start)
[194]46#endif
[843]47    PROCESS(int, cont)
48    PROCESS(int, brk)
49    PROCESS(int, parent)
[1]50')
51dnl }}}
52DEF_HASH_TABLE_FUNC(`HashTable_zval_ptr',           `zval_ptr')
53DEF_HASH_TABLE_FUNC(`HashTable_zend_function',      `zend_function')
54DEF_HASH_TABLE_FUNC(`HashTable_zend_property_info', `zend_property_info')
55DEF_STRUCT_P_FUNC(`zval', , `dnl {{{
56    IFDASM(`do {
57        zval_dtor(dst);
58        *dst = *src;
59        zval_copy_ctor(dst);
[487]60        Z_SET_REFCOUNT(*dst, 1);
[1]61        DONE(value)
62        DONE(type)
[485]63#ifdef ZEND_ENGINE_2_3
64        DONE(is_ref__gc)
65        DONE(refcount__gc)
66#else
[1]67        DONE(is_ref)
[485]68        DONE(refcount)
[482]69#endif
[1]70    } while(0);
71    ', `
72        dnl IFDASM else
73        /* Variable information */
74dnl {{{ zvalue_value
75        DISABLECHECK(`
[491]76        switch ((Z_TYPE_P(src) & IS_CONSTANT_TYPE_MASK)) {
[1]77            case IS_LONG:
78            case IS_RESOURCE:
79            case IS_BOOL:
[843]80                PROCESS(long, value.lval)
[1]81                break;
82            case IS_DOUBLE:
[843]83                PROCESS(double, value.dval)
[1]84                break;
85            case IS_NULL:
86                IFDPRINT(`INDENT()`'fprintf(stderr, "\tNULL\n");')
87                break;
88
89            case IS_CONSTANT:
90#ifdef IS_UNICODE
91                if (UG(unicode)) {
92                    goto proc_unicode;
93                }
94#endif
95            case IS_STRING:
96#ifdef FLAG_IS_BC
97            case FLAG_IS_BC:
98#endif
[843]99                PROCESS(int, value.str.len)
[1]100                PROC_STRING_L(value.str.val, value.str.len)
101                break;
102#ifdef IS_UNICODE
103            case IS_UNICODE:
104proc_unicode:
[843]105                PROCESS(int32_t, value.uni.len)
[103]106                PROC_ZSTRING_L(1, value.uni.val, value.uni.len)
[1]107                break;
108#endif
109
110            case IS_ARRAY:
111            case IS_CONSTANT_ARRAY:
112                STRUCT_P(HashTable, value.ht, HashTable_zval_ptr)
113                break;
114
115            case IS_OBJECT:
116                IFNOTMEMCPY(`IFCOPY(`memcpy(dst, src, sizeof(src[0]));')')
117                dnl STRUCT(value.obj)
118                break;
119
120            default:
121                assert(0);
122        }
123        ')
124dnl }}}
125        DONE(value)
[917]126        PROCESS(xc_zval_type_t, type)
[485]127#ifdef ZEND_ENGINE_2_3
[843]128        PROCESS(zend_uchar, is_ref__gc)
[485]129#else
[843]130        PROCESS(zend_uchar, is_ref)
[485]131#endif
132
133#ifdef ZEND_ENGINE_2_3
[843]134        PROCESS(zend_uint, refcount__gc)
[484]135#else
[1281]136        PROCESS(zend_uint, refcount)
[484]137#endif
[1]138    ')dnl IFDASM
139')
140dnl }}}
141DEF_STRUCT_P_FUNC(`zval_ptr', , `dnl {{{
142    IFDASM(`
143        pushdefFUNC_NAME(`zval')
[930]144        FUNC_NAME (dasm, dst, src[0] TSRMLS_CC);
[1]145        popdef(`FUNC_NAME')
146    ', `
147        do {
148            IFCALCCOPY(`
149                if (processor->reference) {
150                    zval_ptr *ppzv;
[231]151                    if (zend_hash_find(&processor->zvalptrs, (char *) &src[0], sizeof(src[0]), (void **) &ppzv) == SUCCESS) {
[1]152                        IFCOPY(`
153                            dst[0] = *ppzv;
154                            /* *dst is updated */
[877]155                            dnl fprintf(stderr, "*dst is set to %p, PROCESSOR_TYPE is_shm %d\n", dst[0], xc_is_shm(dst[0]));
[1]156                        ')
[233]157                        IFCALCSTORE(`processor->have_references = 1;')
[1]158                        IFSTORE(`assert(xc_is_shm(dst[0]));')
159                        IFRESTORE(`assert(!xc_is_shm(dst[0]));')
160                        break;
161                    }
162                }
163            ')
164           
165            ALLOC(dst[0], zval)
166            IFCALCCOPY(`
167                if (processor->reference) {
168                    IFCALC(`
169                        /* make dummy */
170                        zval_ptr pzv = (zval_ptr)-1;
171                    ', `
172                        zval_ptr pzv = dst[0];
[248]173                        FIXPOINTER_EX(zval, pzv)
[1]174                    ')
[231]175                    if (zend_hash_add(&processor->zvalptrs, (char *) &src[0], sizeof(src[0]), (void *) &pzv, sizeof(pzv), NULL) == SUCCESS) {
[1]176                        /* first add, go on */
177                        dnl fprintf(stderr, "mark[%p] = %p\n", src[0], pzv);
178                    }
179                    else {
180                        assert(0);
181                    }
182                }
183            ')
184            IFCOPY(`
185                dnl fprintf(stderr, "copy from %p to %p\n", src[0], dst[0]);
186            ')
[534]187            IFDPRINT(`INDENT()`'fprintf(stderr, "[%p] ", src[0]);')
[4]188            STRUCT_P_EX(zval, dst[0], src[0], `[0]', `', ` ')
[248]189            FIXPOINTER_EX(zval, dst[0])
[1]190        } while (0);
191    ')
192    DONE_SIZE(sizeof(zval_ptr))
193')
194dnl }}}
[825]195DEF_STRUCT_P_FUNC(`zval_ptr_nullable', , `dnl {{{
196    if (src[0]) {
[1287]197        pushdef(`DASM_STRUCT_DIRECT')
[825]198        STRUCT_P_EX(zval_ptr, dst, src, `', `', ` ')
[1287]199        popdef(`DASM_STRUCT_DIRECT')
[825]200    }
201    else {
202        IFCOPY(`COPYNULL_EX(src[0], src)')
203    }
204    DONE_SIZE(sizeof(zval_ptr_nullable))
205')
206dnl }}}
[837]207DEF_STRUCT_P_FUNC(`zend_arg_info', , `dnl {{{
[843]208    PROCESS(zend_uint, name_len)
[645]209    PROC_ZSTRING_L(, name, name_len)
[843]210    PROCESS(zend_uint, class_name_len)
[645]211    PROC_ZSTRING_L(, class_name, class_name_len)
[716]212#ifdef ZEND_ENGINE_2_4
[843]213    PROCESS(zend_uchar, type_hint)
[1297]214#elif defined(ZEND_ENGINE_2_1)
[843]215    PROCESS(zend_bool, array_type_hint)
[716]216#endif
[843]217    PROCESS(zend_bool, allow_null)
218    PROCESS(zend_bool, pass_by_reference)
[716]219#ifndef ZEND_ENGINE_2_4
[843]220    PROCESS(zend_bool, return_reference)
221    PROCESS(int, required_num_args)
[716]222#endif
[1]223')
224dnl }}}
[95]225#ifdef HAVE_XCACHE_CONSTANT
226DEF_STRUCT_P_FUNC(`zend_constant', , `dnl {{{
227    STRUCT(zval, value)
[843]228    PROCESS(int, flags)
229    PROCESS(uint, name_len)
[828]230    pushdef(`estrndup', `zend_strndup')
[505]231    PROC_ZSTRING_N(, name, name_len)
[828]232    popdef(`estrndup')
[843]233    PROCESS(int, module_number)
[95]234')
235dnl }}}
236#endif
[1]237DEF_STRUCT_P_FUNC(`zend_function', , `dnl {{{
238    DISABLECHECK(`
239    switch (src->type) {
240    case ZEND_INTERNAL_FUNCTION:
241    case ZEND_OVERLOADED_FUNCTION:
242        IFNOTMEMCPY(`IFCOPY(`memcpy(dst, src, sizeof(src[0]));')')
243        break;
244
245    case ZEND_USER_FUNCTION:
246    case ZEND_EVAL_CODE:
247        DONE(type)
248        STRUCT(zend_op_array, op_array)
249        break;
250
251    default:
252        assert(0);
253    }
254    ')
255    DONE_SIZE(sizeof(src[0]))
256')
257dnl }}}
[837]258DEF_STRUCT_P_FUNC(`zend_property_info', , `dnl {{{
[843]259    PROCESS(zend_uint, flags)
260    PROCESS(int, name_length)
[103]261    PROC_ZSTRING_L(, name, name_length)
[843]262    PROCESS(ulong, h)
[716]263#ifdef ZEND_ENGINE_2_4
[843]264    PROCESS(int, offset)
[716]265#endif
[56]266#ifdef ZEND_ENGINE_2_1
[843]267    PROCESS(int, doc_comment_len)
[272]268    PROC_ZSTRING_L(, doc_comment, doc_comment_len)
[56]269#endif
[78]270    dnl isnt in php6 yet
[504]271#if defined(ZEND_ENGINE_2_2)
[78]272    PROC_CLASS_ENTRY_P(ce)
273#endif
[1]274')
[837]275dnl }}}
276#ifdef ZEND_ENGINE_2_4
277DEF_STRUCT_P_FUNC(`zend_trait_method_reference', , `dnl {{{
[843]278    PROCESS(unsigned int, mname_len)
[837]279    PROC_STRING_L(method_name, mname_len)
280    COPYNULL(ce)
[843]281    PROCESS(unsigned int, cname_len)
[837]282    PROC_STRING_L(class_name, cname_len)
283')
[1]284dnl }}}
[837]285DEF_STRUCT_P_FUNC(`zend_trait_alias', , `dnl {{{
286    STRUCT_P(zend_trait_method_reference, trait_method)
[843]287    PROCESS(unsigned int, alias_len)
[837]288    PROC_STRING_L(alias, alias_len)
[843]289    PROCESS(zend_uint, modifiers)
[1232]290#ifndef ZEND_ENGINE_2_5
[837]291    COPYNULL(function)
[1232]292#endif
[837]293')
294dnl }}}
295DEF_STRUCT_P_FUNC(`zend_trait_precedence', , `dnl {{{
296    STRUCT_P(zend_trait_method_reference, trait_method)
[843]297    PROCESS_ARRAY(, xc_ztstring, exclude_from_classes, zend_class_entry*)
[1232]298#ifndef ZEND_ENGINE_2_5
[837]299    COPYNULL(function)
[1232]300#endif
[837]301')
302dnl }}}
303DEF_STRUCT_P_FUNC(`zend_trait_alias_ptr', , `dnl {{{
304    IFDASM(`
305        pushdefFUNC_NAME(`zend_trait_alias')
[930]306        FUNC_NAME (dasm, dst, src[0] TSRMLS_CC);
[837]307        popdef(`FUNC_NAME')
308    ', `
309        ALLOC(dst[0], zend_trait_alias)
310        STRUCT_P_EX(zend_trait_alias, dst[0], src[0], `[0]', `', ` ')
311        FIXPOINTER_EX(zend_trait_alias, dst[0])
312    ')
313    DONE_SIZE(sizeof(zend_trait_alias))
314')
315dnl }}}
316DEF_STRUCT_P_FUNC(`zend_trait_precedence_ptr', , `dnl {{{
317    IFDASM(`
318        pushdefFUNC_NAME(`zend_trait_precedence')
[930]319        FUNC_NAME (dasm, dst, src[0] TSRMLS_CC);
[837]320        popdef(`FUNC_NAME')
321    ', `
322        ALLOC(dst[0], zend_trait_precedence)
323        STRUCT_P_EX(zend_trait_precedence, dst[0], src[0], `[0]', `', ` ')
324        FIXPOINTER_EX(zend_trait_precedence, dst[0])
325    ')
326    DONE_SIZE(sizeof(zend_trait_precedence))
327')
328dnl }}}
329#endif
[1]330DEF_STRUCT_P_FUNC(`zend_class_entry', , `dnl {{{
[199]331    IFCALCCOPY(`
[1]332        processor->active_class_entry_src = src;
[199]333        IFCOPY(`processor->active_class_entry_dst = dst;')
[1]334    ')
[843]335    PROCESS(char, type)
336    PROCESS(zend_uint, name_length)
[103]337    PROC_ZSTRING_L(, name, name_length)
[1281]338    PROC_CLASS_ENTRY_P(parent)
[843]339    PROCESS(int, refcount)
[716]340#ifndef ZEND_ENGINE_2_4
[843]341    PROCESS(zend_bool, constants_updated)
[716]342#endif
[843]343    PROCESS(zend_uint, ce_flags)
[1]344
[721]345    STRUCT(HashTable, properties_info, HashTable_zend_property_info)
346
[716]347#ifdef ZEND_ENGINE_2_4
[917]348    STRUCT_ARRAY(int, default_properties_count, zval_ptr_nullable, default_properties_table)
[843]349    PROCESS(int, default_properties_count)
[917]350    STRUCT_ARRAY(int, default_static_members_count, zval_ptr_nullable, default_static_members_table)
[843]351    PROCESS(int, default_static_members_count)
[730]352    IFCOPY(`dst->static_members_table = dst->default_static_members_table;')
[716]353    DONE(static_members_table)
354#else
[1]355    IFCOPY(`dst->builtin_functions = src->builtin_functions;')
356    DONE(builtin_functions)
[716]357    STRUCT(HashTable, default_properties, HashTable_zval_ptr)
[721]358#   ifdef ZEND_ENGINE_2_1
[233]359    STRUCT(HashTable, default_static_members, HashTable_zval_ptr)
[1]360    IFCOPY(`dst->static_members = &dst->default_static_members;')
361    DONE(static_members)
[1281]362#   else
[233]363    STRUCT_P(HashTable, static_members, HashTable_zval_ptr)
[1]364#   endif
[716]365#endif /* ZEND_ENGINE_2_4 */
366
[1]367    STRUCT(HashTable, constants_table, HashTable_zval_ptr)
368
[837]369#ifdef ZEND_ENGINE_2_2
[1]370    dnl runtime binding: ADD_INTERFACE will deal with it
[837]371    COPYNULL(`interfaces')
[844]372    COPYZERO(`num_interfaces')
[837]373
374#   ifdef ZEND_ENGINE_2_4
[716]375    dnl runtime binding: ADD_TRAIT will deal with it
[837]376    COPYNULL(traits)
[844]377    COPYZERO(num_traits)
[917]378    STRUCT_ARRAY(, , zend_trait_alias_ptr, trait_aliases)
379    STRUCT_ARRAY(, , zend_trait_precedence_ptr, trait_precedences)
[837]380#   endif
381#else
[1]382    IFRESTORE(`
383        if (src->num_interfaces) {
384            CALLOC(dst->interfaces, zend_class_entry*, src->num_interfaces)
[4]385            DONE(`interfaces')
[825]386        }
387        else {
388            COPYNULL(`interfaces')
389        }
[837]390    ', `
391        DONE(`interfaces')
[1]392    ')
[843]393    PROCESS(zend_uint, num_interfaces)
[837]394#endif
[1]395
[716]396#   ifdef ZEND_ENGINE_2_4
397    DISABLECHECK(`
[851]398    IFRESTORE(`dst->info.user.filename = processor->entry_php_src->filepath;', `PROC_STRING(info.user.filename)')
[843]399    PROCESS(zend_uint, info.user.line_start)
400    PROCESS(zend_uint, info.user.line_end)
401    PROCESS(zend_uint, info.user.doc_comment_len)
[716]402    PROC_ZSTRING_L(, info.user.doc_comment, info.user.doc_comment_len)
403    ')
404    DONE(info)
405#   else
[851]406    IFRESTORE(`dst->filename = processor->entry_php_src->filepath;DONE(filename)', `PROC_STRING(filename)')
[843]407    PROCESS(zend_uint, line_start)
408    PROCESS(zend_uint, line_end)
409    PROCESS(zend_uint, doc_comment_len)
[272]410    PROC_ZSTRING_L(, doc_comment, doc_comment_len)
[716]411#   endif
412
[1]413    /* # NOT DONE */
[1297]414#   ifdef ZEND_ENGINE_2_1
[1]415    COPY(serialize_func)
416    COPY(unserialize_func)
[1297]417#   endif
[1]418    COPY(iterator_funcs)
419    COPY(create_object)
420    COPY(get_iterator)
421    COPY(interface_gets_implemented)
[716]422#   ifdef ZEND_ENGINE_2_3
[480]423    COPY(get_static_method)
[716]424#   endif
[1297]425#   ifdef ZEND_ENGINE_2_1
[1]426    COPY(serialize)
427    COPY(unserialize)
[1297]428#   endif
[1]429    /* deal with it inside xc_fix_method */
430    SETNULL(constructor)
431    COPY(destructor)
432    COPY(clone)
433    COPY(__get)
434    COPY(__set)
435/* should be >5.1 */
[716]436#   ifdef ZEND_ENGINE_2_1
[1]437    COPY(__unset)
438    COPY(__isset)
[716]439#    if defined(ZEND_ENGINE_2_2) || PHP_MAJOR_VERSION >= 6
[1]440    COPY(__tostring)
[716]441#    endif
442#   endif
[1]443    COPY(__call)
[716]444#   ifdef ZEND_CALLSTATIC_FUNC_NAME
[480]445    COPY(__callstatic)
[716]446#   endif
447#   ifndef ZEND_ENGINE_2_4
[1]448    /* # NOT DONE */
449    COPY(module)
[716]450#   endif
[89]451    dnl must do after SETNULL(constructor) and dst->parent
[1]452    STRUCT(HashTable, function_table, HashTable_zend_function)
[99]453    IFRESTORE(`dst->function_table.pDestructor = ZEND_FUNCTION_DTOR;')
[199]454    IFCALCCOPY(`
[89]455        processor->active_class_entry_src = NULL;
[199]456        IFCOPY(`processor->active_class_entry_dst = NULL;')
[89]457    ')
[1]458')
459dnl }}}
[716]460#ifdef ZEND_ENGINE_2_4
461undefine(`UNION_znode_op')
462define(`UNION_znode_op', `dnl {{{
[822]463#ifndef NDEBUG
464    switch ((src->$1_type ifelse($1, `result', & ~EXT_TYPE_UNUSED))) {
[721]465    case IS_CONST:
466    case IS_VAR:
467    case IS_CV:
468    case IS_TMP_VAR:
469    case IS_UNUSED:
470        break;
471
472    default:
473        assert(0);
474    }
[822]475#endif
[721]476
[716]477    dnl dirty dispatch
478    DISABLECHECK(`
[822]479    switch ((src->$1_type ifelse($1, `result', & ~EXT_TYPE_UNUSED))) {
[716]480        case IS_CONST:
[822]481            ifelse($1, `result', `
[843]482                PROCESS(zend_uint, $1.constant)
[822]483            ', `
484                IFDASM(`{
485                    zval *zv;
486                    ALLOC_INIT_ZVAL(zv);
[930]487                    *zv = dasm->active_op_array_src->literals[src->$1.constant].constant;
[822]488                    zval_copy_ctor(zv);
489                    add_assoc_zval_ex(dst, ZEND_STRS("$1.constant"), zv);
[716]490                }
[822]491                ', `
492                    IFCOPY(`
493                        dst->$1 = src->$1;
494                    ', `
[843]495                        PROCESS(zend_uint, $1.constant)
[822]496                    ')
497                ')
[716]498            ')
499            break;
500        IFCOPY(`
501            IFNOTMEMCPY(`
502                default:
[822]503                    $1 = $2;
[716]504            ')
505        ', `
506        case IS_VAR:
507        case IS_TMP_VAR:
508        case IS_CV:
[843]509            PROCESS(zend_uint, $1.var)
[716]510            break;
511        case IS_UNUSED:
[843]512            IFDASM(`PROCESS(zend_uint, $1.var)')
513            PROCESS(zend_uint, $1.opline_num)
[716]514            break;
515        ')
516    }
517    ')
518    DONE($1)
519')
520dnl }}}
521#else
[1]522DEF_STRUCT_P_FUNC(`znode', , `dnl {{{
[843]523    PROCESS(xc_op_type, op_type)
[1]524
525#ifdef IS_CV
[11]526#   define XCACHE_IS_CV IS_CV
[1]527#else
[11]528/* compatible with zend optimizer */
529#   define XCACHE_IS_CV 16
[1]530#endif
[11]531    assert(src->op_type == IS_CONST ||
532        src->op_type == IS_VAR ||
533        src->op_type == XCACHE_IS_CV ||
[1]534        src->op_type == IS_TMP_VAR ||
535        src->op_type == IS_UNUSED);
536    dnl dirty dispatch
537    DISABLECHECK(`
538    switch (src->op_type) {
539        case IS_CONST:
540            STRUCT(zval, u.constant)
541            break;
542        IFCOPY(`
543            IFNOTMEMCPY(`
544                default:
545                    memcpy(&dst->u, &src->u, sizeof(src->u));
546            ')
547        ', `
548        case IS_VAR:
549        case IS_TMP_VAR:
[310]550        case XCACHE_IS_CV:
[843]551            PROCESS(zend_uint, u.var)
552            PROCESS(zend_uint, u.EA.type)
[1]553            break;
554        case IS_UNUSED:
[843]555            IFDASM(`PROCESS(zend_uint, u.var)')
556            PROCESS(zend_uint, u.opline_num)
557            PROCESS(zend_uint, u.EA.type)
[1]558            break;
559        ')
560    }
561    ')
562    DONE(u)
[716]563#if 0
564    DONE(EA)
565#endif
[310]566#undef XCACHE_IS_CV
[1]567')
568dnl }}}
[716]569#endif
[1]570DEF_STRUCT_P_FUNC(`zend_op', , `dnl {{{
[843]571    PROCESS(xc_opcode, opcode)
[716]572#ifdef ZEND_ENGINE_2_4
[830]573    IFRESTORE(`', `
574    switch (src->opcode) {
575    case ZEND_BIND_TRAITS:
576        ((zend_op *) src)->op2_type = IS_UNUSED;
577        break;
578    }
579    ')
[716]580    UNION_znode_op(result)
581    UNION_znode_op(op1)
582    UNION_znode_op(op2)
583#else
[1]584    STRUCT(znode, result)
585    STRUCT(znode, op1)
586    STRUCT(znode, op2)
[716]587#endif
[843]588    PROCESS(ulong, extended_value)
589    PROCESS(uint, lineno)
[716]590#ifdef ZEND_ENGINE_2_4
[843]591    PROCESS(zend_uchar, op1_type)
592    PROCESS(zend_uchar, op2_type)
593    PROCESS(zend_uchar, result_type)
[716]594#endif
[1]595    IFCOPY(`
[873]596        assert(processor->active_op_array_src);
597        assert(processor->active_op_array_dst);
[832]598#ifdef ZEND_ENGINE_2_4
[822]599        pushdef(`UNION_znode_op_literal', `
[832]600            if (src->$1_type == IS_CONST) {
601                dst->$1.constant = src->$1.literal - processor->active_op_array_src->literals;
602                dst->$1.literal = &processor->active_op_array_dst->literals[dst->$1.constant];
[822]603            }
604        ')
605        UNION_znode_op_literal(op1)
606        UNION_znode_op_literal(op2)
[832]607#endif
[822]608        popdef(`UNION_znode_op_literal')
[1]609        switch (src->opcode) {
[515]610#ifdef ZEND_GOTO
611            case ZEND_GOTO:
612#endif
[1]613            case ZEND_JMP:
[1213]614#ifdef ZEND_FAST_CALL
615            case ZEND_FAST_CALL:
616#endif
[873]617                assert(Z_OP(src->op1).jmp_addr >= processor->active_op_array_src->opcodes && Z_OP(src->op1).jmp_addr - processor->active_op_array_src->opcodes < processor->active_op_array_src->last);
618                Z_OP(dst->op1).jmp_addr = processor->active_op_array_dst->opcodes + (Z_OP(src->op1).jmp_addr - processor->active_op_array_src->opcodes);
619                assert(Z_OP(dst->op1).jmp_addr >= processor->active_op_array_dst->opcodes && Z_OP(dst->op1).jmp_addr - processor->active_op_array_dst->opcodes < processor->active_op_array_dst->last);
[1]620                break;
621
622            case ZEND_JMPZ:
623            case ZEND_JMPNZ:
624            case ZEND_JMPZ_EX:
625            case ZEND_JMPNZ_EX:
[485]626#ifdef ZEND_JMP_SET
627            case ZEND_JMP_SET:
628#endif
[875]629#ifdef ZEND_JMP_SET_VAR
630            case ZEND_JMP_SET_VAR:
631#endif
[873]632                assert(Z_OP(src->op2).jmp_addr >= processor->active_op_array_src->opcodes && Z_OP(src->op2).jmp_addr - processor->active_op_array_src->opcodes < processor->active_op_array_src->last);
633                Z_OP(dst->op2).jmp_addr = processor->active_op_array_dst->opcodes + (Z_OP(src->op2).jmp_addr - processor->active_op_array_src->opcodes);
634                assert(Z_OP(dst->op2).jmp_addr >= processor->active_op_array_dst->opcodes && Z_OP(dst->op2).jmp_addr - processor->active_op_array_dst->opcodes < processor->active_op_array_dst->last);
[1]635                break;
636
637            default:
638                break;
639        }
640    ')
[843]641    PROCESS(opcode_handler_t, handler)
[1]642')
643dnl }}}
[716]644#ifdef ZEND_ENGINE_2_4
645DEF_STRUCT_P_FUNC(`zend_literal', , `dnl {{{
646    STRUCT(zval, constant)
[843]647    PROCESS(zend_ulong, hash_value)
648    PROCESS(zend_uint,  cache_slot)
[716]649')
650dnl }}}
651#endif
[1]652DEF_STRUCT_P_FUNC(`zend_op_array', , `dnl {{{
[873]653    IFCOPY(`
654        processor->active_op_array_dst = dst;
655        processor->active_op_array_src = src;
656    ')
[930]657    IFDASM(`
658        dasm->active_op_array_src = src;
659    ')
[873]660    {
[1]661    IFRESTORE(`
[771]662    const xc_op_array_info_t *op_array_info = &processor->active_op_array_infos_src[processor->active_op_array_index++];
[212]663    dnl shadow copy must NOT meet:
664    dnl readonly_protection=on
665    dnl main op_array && have early binding
[548]666#ifdef ZEND_COMPILE_DELAYED_BINDING
667    zend_bool need_early_binding = 0;
668#else
669    zend_bool need_early_binding = processor->php_src->have_early_binding;
670#endif
[662]671    zend_bool shallow_copy = !processor->readonly_protection && !(src == processor->php_src->op_array && need_early_binding);
672    if (shallow_copy) {
673        zend_bool gc_arg_info = 0;
[822]674        zend_bool gc_opcodes  = 0;
[1238]675#ifdef ZEND_ENGINE_2_4
676        zend_bool gc_literals = 0;
677#endif
[1]678        /* really fast shallow copy */
679        memcpy(dst, src, sizeof(src[0]));
680        dst->refcount[0] = 1000;
[1196]681#ifdef ZEND_ACC_ALIAS
682        if ((processor->active_class_entry_src && (processor->active_class_entry_src->ce_flags & ZEND_ACC_TRAIT))) {
683            PROC_ZSTRING(, function_name)
684        }
685#endif
[1]686        /* deep */
687        STRUCT_P(HashTable, static_variables, HashTable_zval_ptr)
[917]688        STRUCT_ARRAY(zend_uint, num_args, zend_arg_info, arg_info)
[662]689        gc_arg_info = 1;
[851]690        dst->filename = processor->entry_php_src->filepath;
[822]691#ifdef ZEND_ENGINE_2_4
[1238]692        if (src->literals) {
[822]693            gc_opcodes = 1;
[1238]694            if (op_array_info->literalinfo_cnt) {
695                gc_literals = 1;
696            }
[822]697        }
698#else
[662]699        if (op_array_info->oplineinfo_cnt) {
[822]700            gc_opcodes = 1;
701        }
702#endif
[1238]703#ifdef ZEND_ENGINE_2_4
704        if (gc_literals) {
705            dnl used when copying opcodes
706            COPY_N_EX(last_literal, zend_literal, literals)
707        }
708#endif
[822]709        if (gc_opcodes) {
[779]710            zend_op *opline, *end;
[662]711            COPY_N_EX(last, zend_op, opcodes)
[779]712
713            for (opline = dst->opcodes, end = opline + src->last; opline < end; ++opline) {
[822]714#ifdef ZEND_ENGINE_2_4
715                pushdef(`UNION_znode_op_literal', `
716                    if (opline->$1_type == IS_CONST) {
[930]717                        opline->$1.literal = &dst->literals[opline->$1.literal - src->literals];
[822]718                    }
719                ')
720                UNION_znode_op_literal(op1)
721                UNION_znode_op_literal(op2)
722                popdef(`UNION_znode_op_literal')
723#endif
724
[779]725                switch (opline->opcode) {
726#ifdef ZEND_GOTO
727                    case ZEND_GOTO:
728#endif
729                    case ZEND_JMP:
[1213]730#ifdef ZEND_FAST_CALL
731                    case ZEND_FAST_CALL:
732#endif
[930]733                        Z_OP(opline->op1).jmp_addr = &dst->opcodes[Z_OP(opline->op1).jmp_addr - src->opcodes];
[779]734                        break;
735
736                    case ZEND_JMPZ:
737                    case ZEND_JMPNZ:
738                    case ZEND_JMPZ_EX:
739                    case ZEND_JMPNZ_EX:
740#ifdef ZEND_JMP_SET
741                    case ZEND_JMP_SET:
742#endif
[875]743#ifdef ZEND_JMP_SET_VAR
744            case ZEND_JMP_SET_VAR:
745#endif
[930]746                        Z_OP(opline->op2).jmp_addr = &dst->opcodes[Z_OP(opline->op2).jmp_addr - src->opcodes];
[779]747                        break;
748
749                    default:
750                        break;
751                }
752            }
[662]753        }
[1240]754        if (gc_arg_info || gc_opcodes
755#ifdef ZEND_ENGINE_2_4
756         || gc_literals
757#endif
758        ) {
[662]759            xc_gc_op_array_t gc_op_array;
760            gc_op_array.num_args = gc_arg_info ? dst->num_args : 0;
761            gc_op_array.arg_info = gc_arg_info ? dst->arg_info : NULL;
762            gc_op_array.opcodes  = gc_opcodes ? dst->opcodes : NULL;
[1238]763#ifdef ZEND_ENGINE_2_4
764            gc_op_array.literals = gc_literals ? dst->literals : NULL;
765#endif
[662]766            xc_gc_add_op_array(&gc_op_array TSRMLS_CC);
767        }
[880]768        IFAUTOCHECK(`xc_autocheck_skip = 1;')
[1]769    }
770    else
771    ')
772    do {
773    dnl RESTORE is done above!
774
775    /* Common elements */
[843]776    PROCESS(zend_uchar, type)
[103]777    PROC_ZSTRING(, function_name)
[843]778    PROCESS(zend_uint, fn_flags)
[917]779    STRUCT_ARRAY(zend_uint, num_args, zend_arg_info, arg_info)
[843]780    PROCESS(zend_uint, num_args)
781    PROCESS(zend_uint, required_num_args)
[716]782#   ifndef ZEND_ENGINE_2_4
[843]783    PROCESS(zend_bool, pass_rest_by_reference)
[716]784#   endif
785#ifndef ZEND_ENGINE_2_4
[843]786    PROCESS(unsigned char, return_reference)
[716]787#endif
[1]788    /* END of common elements */
789#ifdef IS_UNICODE
[103]790    dnl SETNULL(u_twin)
[1]791#endif
792
793    STRUCT_P(zend_uint, refcount)
794    UNFIXPOINTER(zend_uint, refcount)
[221]795    IFSTORE(`dst->refcount[0] = 1;')
[1]796
[822]797#ifdef ZEND_ENGINE_2_4
[873]798    dnl used when copying opcodes
[917]799    STRUCT_ARRAY(int, last_literal, zend_literal, literals)
[843]800    PROCESS(int, last_literal)
[822]801#endif
802
[873]803    dnl uses literals
[917]804    STRUCT_ARRAY(zend_uint, last, zend_op, opcodes)
[843]805    PROCESS(zend_uint, last)
[716]806#ifndef ZEND_ENGINE_2_4
[843]807    IFCOPY(`dst->size = src->last;DONE(size)', `PROCESS(zend_uint, size)')
[716]808#endif
[1]809
810#ifdef IS_CV
[917]811    STRUCT_ARRAY(int, last_var, zend_compiled_variable, vars)
[843]812    PROCESS(int, last_var)
[716]813#   ifndef ZEND_ENGINE_2_4
[843]814    IFCOPY(`dst->size_var = src->last_var;DONE(size_var)', `PROCESS(zend_uint, size_var)')
[716]815#   endif
[1]816#else
817    dnl zend_cv.m4 is illegal to be made public, don not ask me for it
818    IFDASM(`
[4]819        sinclude(srcdir`/processor/zend_cv.m4')
[1]820        ')
821#endif
822
[843]823    PROCESS(zend_uint, T)
[1]824
[1214]825#ifdef ZEND_ENGINE_2_5
[1213]826    PROCESS(zend_uint, nested_calls)
827    PROCESS(zend_uint, used_stack)
828#endif
829
[917]830    STRUCT_ARRAY(last_brk_cont_t, last_brk_cont, zend_brk_cont_element, brk_cont_array)
831    PROCESS(last_brk_cont_t, last_brk_cont)
[716]832#ifndef ZEND_ENGINE_2_4
[843]833    PROCESS(zend_uint, current_brk_cont)
[716]834#endif
[1]835
[917]836    STRUCT_ARRAY(int, last_try_catch, zend_try_catch_element, try_catch_array)
[843]837    PROCESS(int, last_try_catch)
[1213]838#ifdef ZEND_ENGINE_2_5
839    PROCESS(zend_bool, has_finally_block)
840#endif
[1]841
842    STRUCT_P(HashTable, static_variables, HashTable_zval_ptr)
843
[716]844#ifndef ZEND_ENGINE_2_4
[95]845    COPY(start_op)
[843]846    PROCESS(int, backpatch_count)
[716]847#endif
[562]848#ifdef ZEND_ENGINE_2_3
[843]849    PROCESS(zend_uint, this_var)
[562]850#endif
[1]851
[716]852#ifndef ZEND_ENGINE_2_4
[843]853    PROCESS(zend_bool, done_pass_two)
[716]854#endif
[562]855    /* 5.0 <= ver < 5.3 */
856#if defined(ZEND_ENGINE_2) && !defined(ZEND_ENGINE_2_3)
[843]857    PROCESS(zend_bool, uses_this)
[1]858#endif
859
[851]860    IFRESTORE(`dst->filename = processor->entry_php_src->filepath;DONE(filename)', `PROC_STRING(filename)')
[1]861#ifdef IS_UNICODE
[267]862    IFRESTORE(`
863        COPY(script_encoding)
864    ', `
865        PROC_STRING(script_encoding)
866    ')
[1]867#endif
[843]868    PROCESS(zend_uint, line_start)
869    PROCESS(zend_uint, line_end)
870    PROCESS(int, doc_comment_len)
[272]871    PROC_ZSTRING_L(, doc_comment, doc_comment_len)
[548]872#ifdef ZEND_COMPILE_DELAYED_BINDING
[843]873    PROCESS(zend_uint, early_binding);
[548]874#endif
[1]875
876    /* reserved */
877    DONE(reserved)
878#if defined(HARDENING_PATCH) && HARDENING_PATCH
[843]879    PROCESS(zend_bool, created_by_eval)
[1]880#endif
[724]881#ifdef ZEND_ENGINE_2_4
[839]882    SETNULL(run_time_cache)
[843]883    PROCESS(int, last_cache_slot)
[724]884#endif
[1]885    } while (0);
[851]886    IFRESTORE(`xc_fix_op_array_info(processor->entry_php_src, processor->php_src, dst, shallow_copy, op_array_info TSRMLS_CC);')
[189]887
[219]888    dnl mark it as -1 on store, and lookup parent on restore
[839]889    IFSTORE(`dst->prototype = (processor->active_class_entry_src && src->prototype) ? (zend_function *) -1 : NULL;', `
890        IFRESTORE(`do {
891            zend_function *parent;
892            if (src->prototype != NULL
893             && zend_u_hash_find(&(processor->active_class_entry_dst->parent->function_table),
894                    UG(unicode) ? IS_UNICODE : IS_STRING,
895                    src->function_name, xc_zstrlen(UG(unicode) ? IS_UNICODE : IS_STRING, src->function_name) + 1,
896                    (void **) &parent) == SUCCESS) {
897                /* see do_inherit_method_check() */
898                if ((parent->common.fn_flags & ZEND_ACC_ABSTRACT)) {
899                    dst->prototype = parent;
900                } else if (!(parent->common.fn_flags & ZEND_ACC_CTOR) || (parent->common.prototype && (parent->common.prototype->common.scope->ce_flags & ZEND_ACC_INTERFACE))) {
901                    /* ctors only have a prototype if it comes from an interface */
902                    dst->prototype = parent->common.prototype ? parent->common.prototype : parent;
[219]903                }
904                else {
905                    dst->prototype = NULL;
906                }
[839]907            }
908            else {
909                dst->prototype = NULL;
910            }
911        } while (0);
912        ')
[219]913    ')
[839]914    DONE(prototype)
[716]915
[507]916    PROC_CLASS_ENTRY_P(scope)
917    IFCOPY(`
[219]918        if (src->scope) {
[507]919            xc_fix_method(processor, dst TSRMLS_CC);
[189]920        }
921    ')
922
923    IFRESTORE(`
924        if (xc_have_op_array_ctor) {
925            zend_llist_apply_with_argument(&zend_extensions, (llist_apply_with_arg_func_t) xc_zend_extension_op_array_ctor_handler, dst TSRMLS_CC);
926        }
927    ')
[873]928    }
929    IFCOPY(`
930        processor->active_op_array_dst = NULL;
931        processor->active_op_array_src = NULL;
932    ')
[930]933    IFDASM(`
934        dasm->active_op_array_src = NULL;
935    ')
[1]936')
937dnl }}}
938
[95]939#ifdef HAVE_XCACHE_CONSTANT
940DEF_STRUCT_P_FUNC(`xc_constinfo_t', , `dnl {{{
[843]941    PROCESS(zend_uint, key_size)
[95]942#ifdef IS_UNICODE
[843]943    PROCESS(zend_uchar, type)
[95]944#endif
945    IFRESTORE(`COPY(key)', `
[103]946        PROC_ZSTRING_N(type, key, key_size)
[95]947    ')
[843]948    PROCESS(ulong, h)
[95]949    STRUCT(zend_constant, constant)
950')
951dnl }}}
952#endif
[877]953IFRESTORE(`', `
[832]954DEF_STRUCT_P_FUNC(`xc_op_array_info_detail_t', , `dnl {{{
[843]955    PROCESS(zend_uint, index)
956    PROCESS(zend_uint, info)
[832]957')
958dnl }}}
[662]959DEF_STRUCT_P_FUNC(`xc_op_array_info_t', , `dnl {{{
[721]960#ifdef ZEND_ENGINE_2_4
[843]961    PROCESS(zend_uint, literalinfo_cnt)
[917]962    STRUCT_ARRAY(zend_uint, literalinfo_cnt, xc_op_array_info_detail_t, literalinfos)
[721]963#else
[843]964    PROCESS(zend_uint, oplineinfo_cnt)
[917]965    STRUCT_ARRAY(zend_uint, oplineinfo_cnt, xc_op_array_info_detail_t, oplineinfos)
[721]966#endif
[662]967')
968dnl }}}
[877]969')
[1]970DEF_STRUCT_P_FUNC(`xc_funcinfo_t', , `dnl {{{
[843]971    PROCESS(zend_uint, key_size)
[1]972#ifdef IS_UNICODE
[843]973    PROCESS(zend_uchar, type)
[1]974#endif
975    IFRESTORE(`COPY(key)', `
[103]976        PROC_ZSTRING_N(type, key, key_size)
[1]977    ')
[843]978    PROCESS(ulong, h)
[662]979    IFRESTORE(`COPY(op_array_info)', `
980        STRUCT(xc_op_array_info_t, op_array_info)
981    ')
982    IFRESTORE(`
[666]983        processor->active_op_array_infos_src = &src->op_array_info;
[662]984        processor->active_op_array_index = 0;
985    ')
[1]986    STRUCT(zend_function, func)
987')
988dnl }}}
989DEF_STRUCT_P_FUNC(`xc_classinfo_t', , `dnl {{{
[843]990    PROCESS(zend_uint, key_size)
[1]991#ifdef IS_UNICODE
[843]992    PROCESS(zend_uchar, type)
[1]993#endif
994    IFRESTORE(`COPY(key)', `
[103]995        PROC_ZSTRING_N(type, key, key_size)
[1]996    ')
[843]997    PROCESS(ulong, h)
998    PROCESS(zend_uint, methodinfo_cnt)
[662]999    IFRESTORE(`COPY(methodinfos)', `
[917]1000        STRUCT_ARRAY(zend_uint, methodinfo_cnt, xc_op_array_info_t, methodinfos)
[662]1001    ')
1002    IFRESTORE(`
[666]1003        processor->active_op_array_infos_src = src->methodinfos;
[662]1004        processor->active_op_array_index = 0;
1005    ')
[1281]1006    STRUCT_P(zend_class_entry, class_entry)
[548]1007#ifndef ZEND_COMPILE_DELAYED_BINDING
[843]1008    PROCESS(int, oplineno)
[548]1009#endif
[1]1010')
1011dnl }}}
[877]1012IFRESTORE(`', `
[268]1013#ifdef ZEND_ENGINE_2_1
1014DEF_STRUCT_P_FUNC(`xc_autoglobal_t', , `dnl {{{
[843]1015    PROCESS(zend_uint, key_len)
[268]1016#ifdef IS_UNICODE
[843]1017    PROCESS(zend_uchar, type)
[268]1018#endif
1019    IFRESTORE(`COPY(key)', `
1020        PROC_ZSTRING_L(type, key, key_len)
1021    ')
[843]1022    PROCESS(ulong, h)
[268]1023')
1024dnl }}}
1025#endif
[877]1026')
1027IFRESTORE(`', `
[1051]1028#ifdef XCACHE_ERROR_CACHING
[496]1029DEF_STRUCT_P_FUNC(`xc_compilererror_t', , `dnl {{{
[843]1030    PROCESS(int, type)
1031    PROCESS(uint, lineno)
1032    PROCESS(int, error_len)
[496]1033    PROC_STRING_L(error, error_len)
1034')
1035dnl }}}
1036#endif
[877]1037')
[1]1038DEF_STRUCT_P_FUNC(`xc_entry_data_php_t', , `dnl {{{
[311]1039    IFCOPY(`
1040        processor->php_dst = dst;
1041        processor->php_src = src;
1042    ')
1043
1044    /* skip */
1045    DONE(next)
[854]1046    PROCESS(xc_hash_value_t, hvalue)
[843]1047    PROCESS(xc_md5sum_t, md5)
1048    PROCESS(zend_ulong, refcount)
[311]1049
[843]1050    PROCESS(zend_ulong, hits)
1051    PROCESS(size_t, size)
[1]1052
[662]1053    IFRESTORE(`COPY(op_array_info)', `
1054        STRUCT(xc_op_array_info_t, op_array_info)
1055    ')
1056    IFRESTORE(`
1057        processor->active_op_array_infos_src = &dst->op_array_info;
1058        processor->active_op_array_index = 0;
1059    ')
[1]1060    STRUCT_P(zend_op_array, op_array)
1061
[95]1062#ifdef HAVE_XCACHE_CONSTANT
[843]1063    PROCESS(zend_uint, constinfo_cnt)
[917]1064    STRUCT_ARRAY(zend_uint, constinfo_cnt, xc_constinfo_t, constinfos)
[95]1065#endif
1066
[843]1067    PROCESS(zend_uint, funcinfo_cnt)
[917]1068    STRUCT_ARRAY(zend_uint, funcinfo_cnt, xc_funcinfo_t, funcinfos)
[1]1069
[843]1070    PROCESS(zend_uint, classinfo_cnt)
[917]1071    STRUCT_ARRAY(zend_uint, classinfo_cnt, xc_classinfo_t, classinfos, , IFRESTORE(`processor->active_class_index'))
[268]1072#ifdef ZEND_ENGINE_2_1
[843]1073    PROCESS(zend_uint, autoglobal_cnt)
[495]1074    IFRESTORE(`
1075        COPY(autoglobals)
1076    ', `
[917]1077        STRUCT_ARRAY(zend_uint, autoglobal_cnt, xc_autoglobal_t, autoglobals)
[495]1078    ')
[268]1079#endif
[1051]1080#ifdef XCACHE_ERROR_CACHING
[843]1081    PROCESS(zend_uint, compilererror_cnt)
[496]1082    IFRESTORE(`
1083        COPY(compilererrors)
1084    ', `
[917]1085        STRUCT_ARRAY(zend_uint, compilererror_cnt, xc_compilererror_t, compilererrors)
[496]1086    ')
1087#endif
[548]1088#ifndef ZEND_COMPILE_DELAYED_BINDING
[843]1089    PROCESS(zend_bool, have_early_binding)
[548]1090#endif
[843]1091    PROCESS(zend_bool, have_references)
[1]1092')
1093dnl }}}
[837]1094DEF_STRUCT_P_FUNC(`xc_entry_t', , `dnl {{{
[1]1095    /* skip */
1096    DONE(next)
[851]1097    PROCESS(size_t, size)
[1]1098
[843]1099    PROCESS(time_t, ctime)
1100    PROCESS(time_t, atime)
1101    PROCESS(time_t, dtime)
1102    PROCESS(long, ttl)
1103    PROCESS(zend_ulong, hits)
[866]1104    DONE(name) dnl handle in xc_entry_php_t and xc_entry_var_t
[851]1105')
1106dnl }}}
1107DEF_STRUCT_P_FUNC(`xc_entry_php_t', , `dnl {{{
1108    STRUCT(xc_entry_t, entry)
[866]1109    DISABLECHECK(`
1110        PROCESS(int, entry.name.str.len)
1111        IFRESTORE(`COPY(entry.name.str.val)', `
1112            PROC_STRING_L(entry.name.str.val, entry.name.str.len)
1113        ')
1114    ')
1115
[854]1116    IFCALCCOPY(`COPY(php)', `STRUCT_P(xc_entry_data_php_t, php)')
[851]1117
1118    IFSTORE(`dst->refcount = 0; DONE(refcount)', `PROCESS(long, refcount)')
1119    PROCESS(time_t, file_mtime)
[859]1120    PROCESS(size_t, file_size)
[1201]1121    PROCESS(size_t, file_device)
1122    PROCESS(size_t, file_inode)
[684]1123
[1201]1124    PROCESS(size_t, filepath_len)
[854]1125    IFRESTORE(`COPY(filepath)', `PROC_STRING_L(filepath, filepath_len)')
[1201]1126    PROCESS(size_t, dirpath_len)
[854]1127    IFRESTORE(`COPY(dirpath)', `PROC_STRING_L(dirpath, dirpath_len)')
[684]1128#ifdef IS_UNICODE
[854]1129    PROCESS(int, ufilepath_len)
1130    IFRESTORE(`COPY(ufilepath)', `PROC_USTRING_L(ufilepath, ufilepath_len)')
1131    PROCESS(int, udirpath_len)
1132    IFRESTORE(`COPY(udirpath)', `PROC_USTRING_L(udirpath, udirpath_len)')
[684]1133#endif
[1]1134')
1135dnl }}}
[854]1136DEF_STRUCT_P_FUNC(`xc_entry_var_t', , `dnl {{{
1137    STRUCT(xc_entry_t, entry)
1138
[866]1139#ifdef IS_UNICODE
1140    PROCESS(zend_uchar, name_type)
1141#endif
1142    dnl {{{ entry.name
1143    DISABLECHECK(`
1144#ifdef IS_UNICODE
1145        if (src->name_type == IS_UNICODE) {
1146            PROCESS(int32_t, entry.name.ustr.len)
1147        }
1148        else {
1149            PROCESS(int, entry.name.str.len)
1150        }
1151#else
1152        PROCESS(int, entry.name.str.len)
1153#endif
1154        IFRESTORE(`COPY(entry.name.str.val)', `
1155#ifdef IS_UNICODE
1156            PROC_ZSTRING_L(name_type, entry.name.uni.val, entry.name.uni.len)
1157#else
1158            PROC_STRING_L(entry.name.str.val, entry.name.str.len)
1159#endif
1160        ')
1161    ')
1162    dnl }}}
1163
[854]1164    IFDPRINT(`INDENT()`'fprintf(stderr, "zval:value");')
1165    STRUCT_P_EX(zval_ptr, dst->value, src->value, `value', `', `&')
1166    PROCESS(zend_bool, have_references)
1167    DONE(value)
1168')
1169dnl }}}
[1]1170dnl ====================================================
Note: See TracBrowser for help on using the repository browser.