Changeset 1440 in svn for trunk/processor/processor.m4


Ignore:
Timestamp:
2013-11-05T18:17:07+01:00 (21 months ago)
Author:
Xuefer
Message:

adds ptrmove

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/processor/processor.m4

    r1438 r1440  
    194194                    ', `
    195195                        zval_ptr pzv = dst[0];
    196                         FIXPOINTER_EX(zval, pzv)
     196                        FIXPOINTER_EX(zval, pzv, dst[0])
    197197                    ')
    198198                    if (zend_hash_add(&processor->zvalptrs, (char *) &src[0], sizeof(src[0]), (void *) &pzv, sizeof(pzv), NULL) == SUCCESS) {
     
    210210            IFDPRINT(`INDENT()`'fprintf(stderr, "[%p] ", (void *) src[0]);')
    211211            STRUCT_P_EX(zval, dst[0], src[0], `[0]', `', ` ')
    212             FIXPOINTER_EX(zval, dst[0])
     212            FIXPOINTER_EX(zval, dst[0], src[0])
    213213        } while (0);
    214214    ')
     
    336336        ALLOC(dst[0], zend_trait_alias)
    337337        STRUCT_P_EX(zend_trait_alias, dst[0], src[0], `[0]', `', ` ')
    338         FIXPOINTER_EX(zend_trait_alias, dst[0])
     338        FIXPOINTER_EX(zend_trait_alias, dst[0], src[0])
    339339    ')
    340340    DONE_SIZE(sizeof(zend_trait_alias))
     
    349349        ALLOC(dst[0], zend_trait_precedence)
    350350        STRUCT_P_EX(zend_trait_precedence, dst[0], src[0], `[0]', `', ` ')
    351         FIXPOINTER_EX(zend_trait_precedence, dst[0])
     351        FIXPOINTER_EX(zend_trait_precedence, dst[0], src[0])
    352352    ')
    353353    DONE_SIZE(sizeof(zend_trait_precedence))
     
    366366#ifndef ZEND_ENGINE_2
    367367        /* just copy parent and resolve on install_class */
    368         COPY(parent)
     368        COPYPOINTER(parent)
    369369#else
    370370        PROC_CLASS_ENTRY_P(parent)
     
    458458    /* # NOT DONE */
    459459#   ifdef ZEND_ENGINE_2_1
    460     COPY(serialize_func)
    461     COPY(unserialize_func)
    462 #   endif
    463     COPY(iterator_funcs)
    464     COPY(create_object)
    465     COPY(get_iterator)
    466     COPY(interface_gets_implemented)
     460    PROCESS_CTEXTPOINTER(serialize_func)
     461    PROCESS_CTEXTPOINTER(unserialize_func)
     462#   endif
     463    PROCESS_CTEXTPOINTER(iterator_funcs)
     464    PROCESS_CTEXTPOINTER(create_object)
     465    PROCESS_CTEXTPOINTER(get_iterator)
     466    PROCESS_CTEXTPOINTER(interface_gets_implemented)
    467467#   ifdef ZEND_ENGINE_2_3
    468     COPY(get_static_method)
     468    PROCESS_CTEXTPOINTER(get_static_method)
    469469#   endif
    470470#   ifdef ZEND_ENGINE_2_1
    471     COPY(serialize)
    472     COPY(unserialize)
     471    PROCESS_CTEXTPOINTER(serialize)
     472    PROCESS_CTEXTPOINTER(unserialize)
    473473#   endif
    474474    /* deal with it inside xc_fix_method */
    475475    SETNULL(constructor)
    476     COPY(destructor)
    477     COPY(clone)
    478     COPY(__get)
    479     COPY(__set)
     476    PROCESS_CTEXTPOINTER(destructor)
     477    PROCESS_CTEXTPOINTER(clone)
     478    PROCESS_CTEXTPOINTER(__get)
     479    PROCESS_CTEXTPOINTER(__set)
    480480/* should be >5.1 */
    481481#   ifdef ZEND_ENGINE_2_1
    482     COPY(__unset)
    483     COPY(__isset)
     482    PROCESS_CTEXTPOINTER(__unset)
     483    PROCESS_CTEXTPOINTER(__isset)
    484484#    if defined(ZEND_ENGINE_2_2) || PHP_MAJOR_VERSION >= 6
    485     COPY(__tostring)
     485    PROCESS_CTEXTPOINTER(__tostring)
    486486#    endif
    487487#   endif
    488     COPY(__call)
     488    PROCESS_CTEXTPOINTER(__call)
    489489#   ifdef ZEND_CALLSTATIC_FUNC_NAME
    490     COPY(__callstatic)
     490    PROCESS_CTEXTPOINTER(__callstatic)
    491491#   endif
    492492#   ifndef ZEND_ENGINE_2_4
    493493    /* # NOT DONE */
    494     COPY(module)
     494    PROCESS_CTEXTPOINTER(module)
    495495#   endif
    496496#else /* ZEND_ENGINE_2 */
    497     COPY(handle_function_call)
    498     COPY(handle_property_get)
    499     COPY(handle_property_set)
     497    PROCESS_CTEXTPOINTER(handle_function_call)
     498    PROCESS_CTEXTPOINTER(handle_property_get)
     499    PROCESS_CTEXTPOINTER(handle_property_set)
    500500#endif
    501501    dnl must do after SETNULL(constructor) and dst->parent
     
    674674                assert(Z_OP(DST(`op1')).jmp_addr >= processor->active_op_array_dst->opcodes);
    675675                assert(Z_OP(DST(`op1')).jmp_addr - processor->active_op_array_dst->opcodes < processor->active_op_array_dst->last);
    676                 FIXPOINTER_EX(zend_op, `Z_OP(DST(`op1')).jmp_addr')
     676                FIXPOINTER_EX(zend_op, `Z_OP(DST(`op1')).jmp_addr', `Z_OP(SRC(`op1')).jmp_addr')
    677677                break;
    678678
     
    692692                assert(Z_OP(DST(`op2')).jmp_addr >= processor->active_op_array_dst->opcodes);
    693693                assert(Z_OP(DST(`op2')).jmp_addr - processor->active_op_array_dst->opcodes < processor->active_op_array_dst->last);
    694                 FIXPOINTER_EX(zend_op, `Z_OP(DST(`op2')).jmp_addr')
     694                FIXPOINTER_EX(zend_op, `Z_OP(DST(`op2')).jmp_addr', `Z_OP(SRC(`op2')).jmp_addr')
    695695                break;
    696696
     
    884884#endif
    885885
     886    IFSTORE(`pushdef(`FIXPOINTER')')
    886887    STRUCT_P(zend_uint, refcount)
    887888    IFSTORE(`
    888         UNFIXPOINTER(zend_uint, refcount)
     889        popdef(`FIXPOINTER')
    889890        DST(`refcount[0]') = 1;
    890891        FIXPOINTER(zend_uint, refcount)
     
    944945
    945946#ifndef ZEND_ENGINE_2_4
    946     COPY(start_op)
     947    COPYPOINTER(start_op)
    947948    PROCESS(int, backpatch_count)
    948949#endif
     
    962963#ifdef IS_UNICODE
    963964    IFRESTORE(`
    964         COPY(script_encoding)
     965        COPYPOINTER(script_encoding)
    965966    ', `
    966967        PROC_STRING(script_encoding)
     
    10511052    PROCESS(zend_uchar, type)
    10521053#endif
    1053     IFRESTORE(`COPY(key)', `
     1054    IFRESTORE(`COPYPOINTER(key)', `
    10541055        PROC_ZSTRING_N(type, key, key_size)
    10551056    ')
     
    10811082    PROCESS(zend_uchar, type)
    10821083#endif
    1083     IFRESTORE(`COPY(key)', `
     1084    IFRESTORE(`COPYPOINTER(key)', `
    10841085        PROC_ZSTRING_N(type, key, key_size)
    10851086    ')
    10861087    PROCESS(ulong, h)
    1087     IFRESTORE(`COPY(op_array_info)', `
     1088    IFRESTORE(`COPYPOINTER(op_array_info)', `
    10881089        STRUCT(xc_op_array_info_t, op_array_info)
    10891090    ')
     
    11001101    PROCESS(zend_uchar, type)
    11011102#endif
    1102     IFRESTORE(`COPY(key)', `
     1103    IFRESTORE(`COPYPOINTER(key)', `
    11031104        PROC_ZSTRING_N(type, key, key_size)
    11041105    ')
    11051106    PROCESS(ulong, h)
    11061107    PROCESS(zend_uint, methodinfo_cnt)
    1107     IFRESTORE(`COPY(methodinfos)', `
     1108    IFRESTORE(`COPYPOINTER(methodinfos)', `
    11081109        STRUCT_ARRAY(zend_uint, methodinfo_cnt, xc_op_array_info_t, methodinfos)
    11091110    ')
     
    11291130    PROCESS(zend_uchar, type)
    11301131#endif
    1131     IFRESTORE(`COPY(key)', `
     1132    IFRESTORE(`COPYPOINTER(key)', `
    11321133        PROC_ZSTRING_L(type, key, key_len)
    11331134    ')
     
    11631164    PROCESS(size_t, size)
    11641165
    1165     IFRESTORE(`COPY(op_array_info)', `
     1166    IFRESTORE(`COPYPOINTER(op_array_info)', `
    11661167        STRUCT(xc_op_array_info_t, op_array_info)
    11671168    ')
     
    11851186    PROCESS(zend_uint, autoglobal_cnt)
    11861187    IFRESTORE(`
    1187         COPY(autoglobals)
     1188        COPYPOINTER(autoglobals)
    11881189    ', `
    11891190        STRUCT_ARRAY(zend_uint, autoglobal_cnt, xc_autoglobal_t, autoglobals)
     
    11931194    PROCESS(zend_uint, compilererror_cnt)
    11941195    IFRESTORE(`
    1195         COPY(compilererrors)
     1196        COPYPOINTER(compilererrors)
    11961197    ', `
    11971198        STRUCT_ARRAY(zend_uint, compilererror_cnt, xc_compilererror_t, compilererrors)
     
    12211222    DISABLECHECK(`
    12221223        PROCESS(int, entry.name.str.len)
    1223         IFRESTORE(`COPY(entry.name.str.val)', `
     1224        IFRESTORE(`COPYPOINTER(entry.name.str.val)', `
    12241225            PROC_STRING_L(entry.name.str.val, entry.name.str.len)
    12251226        ')
    12261227    ')
    12271228
    1228     IFCALCCOPY(`COPY(php)', `STRUCT_P(xc_entry_data_php_t, php)')
     1229    IFCALCCOPY(`COPYPOINTER(php)', `STRUCT_P(xc_entry_data_php_t, php)')
    12291230
    12301231    IFSTORE(`DST(`refcount') = 0; DONE(refcount)', `PROCESS(long, refcount)')
     
    12351236
    12361237    PROCESS(size_t, filepath_len)
    1237     IFRESTORE(`COPY(filepath)', `PROC_STRING_L(filepath, filepath_len)')
     1238    IFRESTORE(`COPYPOINTER(filepath)', `PROC_STRING_L(filepath, filepath_len)')
    12381239    PROCESS(size_t, dirpath_len)
    1239     IFRESTORE(`COPY(dirpath)', `PROC_STRING_L(dirpath, dirpath_len)')
     1240    IFRESTORE(`COPYPOINTER(dirpath)', `PROC_STRING_L(dirpath, dirpath_len)')
    12401241#ifdef IS_UNICODE
    12411242    PROCESS(int, ufilepath_len)
    1242     IFRESTORE(`COPY(ufilepath)', `PROC_USTRING_L(ufilepath, ufilepath_len)')
     1243    IFRESTORE(`COPYPOINTER(ufilepath)', `PROC_USTRING_L(ufilepath, ufilepath_len)')
    12431244    PROCESS(int, udirpath_len)
    1244     IFRESTORE(`COPY(udirpath)', `PROC_USTRING_L(udirpath, udirpath_len)')
     1245    IFRESTORE(`COPYPOINTER(udirpath)', `PROC_USTRING_L(udirpath, udirpath_len)')
    12451246#endif
    12461247')
     
    12641265        PROCESS(int, entry.name.str.len)
    12651266#endif
    1266         IFRESTORE(`COPY(entry.name.str.val)', `
     1267        IFRESTORE(`COPYPOINTER(entry.name.str.val)', `
    12671268#ifdef IS_UNICODE
    12681269            PROC_ZSTRING_L(name_type, entry.name.uni.val, entry.name.uni.len)
Note: See TracChangeset for help on using the changeset viewer.