source: trunk/processor/processor.m4 @ 1281

Last change on this file since 1281 was 1281, checked in by moo, 16 months ago

remove php 4 support completely

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