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


Ignore:
Timestamp:
2013-07-08T08:00:36Z (2 years ago)
Author:
Xuefer
Message:

remove php 4 support completely

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/processor/processor.m4

    r1240 r1281  
    1212DECL_STRUCT_P_FUNC(`xc_entry_var_t')
    1313DECL_STRUCT_P_FUNC(`xc_entry_php_t')
    14 #ifdef ZEND_ENGINE_2
    1514DECL_STRUCT_P_FUNC(`zend_property_info')
    16 #endif
    1715/* }}} */
    1816dnl ====================================================
     
    3432')
    3533dnl }}}
    36 #ifndef ZEND_ENGINE_2
    37 DEF_STRUCT_P_FUNC(`int', , `dnl {{{
    38     IFCOPY(`*dst = *src;')
    39     IFDPRINT(`
    40         INDENT()
    41         fprintf(stderr, "%d\n", src[0]);
    42     ')
    43     DONE_SIZE(sizeof(src[0]))
    44 ')
    45 dnl }}}
    46 #endif
    47 #ifdef ZEND_ENGINE_2
    4834DEF_STRUCT_P_FUNC(`zend_try_catch_element', , `dnl {{{
    4935    PROCESS(zend_uint, try_op)
     
    5541')
    5642dnl }}}
    57 #endif
    5843DEF_STRUCT_P_FUNC(`zend_brk_cont_element', , `dnl {{{
    5944#ifdef ZEND_ENGINE_2_2
     
    6752DEF_HASH_TABLE_FUNC(`HashTable_zval_ptr',           `zval_ptr')
    6853DEF_HASH_TABLE_FUNC(`HashTable_zend_function',      `zend_function')
    69 #ifdef ZEND_ENGINE_2
    7054DEF_HASH_TABLE_FUNC(`HashTable_zend_property_info', `zend_property_info')
    71 #endif
    7255DEF_STRUCT_P_FUNC(`zval', , `dnl {{{
    7356    IFDASM(`do {
     
    133116                IFNOTMEMCPY(`IFCOPY(`memcpy(dst, src, sizeof(src[0]));')')
    134117                dnl STRUCT(value.obj)
    135 #ifndef ZEND_ENGINE_2
    136                 STRUCT_P(zend_class_entry, value.obj.ce)
    137                 STRUCT_P(HashTable, value.obj.properties, HashTable_zval_ptr)
    138 #endif
    139118                break;
    140119
     
    154133#ifdef ZEND_ENGINE_2_3
    155134        PROCESS(zend_uint, refcount__gc)
    156 #elif defined(ZEND_ENGINE_2)
     135#else
    157136        PROCESS(zend_uint, refcount)
    158 #else
    159         PROCESS(zend_ushort, refcount)
    160137#endif
    161138    ')dnl IFDASM
     
    226203')
    227204dnl }}}
    228 #ifdef ZEND_ENGINE_2
    229205DEF_STRUCT_P_FUNC(`zend_arg_info', , `dnl {{{
    230206    PROCESS(zend_uint, name_len)
     
    245221')
    246222dnl }}}
    247 #endif
    248223#ifdef HAVE_XCACHE_CONSTANT
    249224DEF_STRUCT_P_FUNC(`zend_constant', , `dnl {{{
     
    279254')
    280255dnl }}}
    281 #ifdef ZEND_ENGINE_2
    282256DEF_STRUCT_P_FUNC(`zend_property_info', , `dnl {{{
    283257    PROCESS(zend_uint, flags)
     
    298272')
    299273dnl }}}
    300 #endif
    301274#ifdef ZEND_ENGINE_2_4
    302275DEF_STRUCT_P_FUNC(`zend_trait_method_reference', , `dnl {{{
     
    361334    PROCESS(zend_uint, name_length)
    362335    PROC_ZSTRING_L(, name, name_length)
    363     IFRESTORE(`
    364 #ifndef ZEND_ENGINE_2
    365         /* just copy parent and resolve on install_class */
    366         COPY(parent)
    367 #else
    368         PROC_CLASS_ENTRY_P(parent)
    369 #endif
    370     ', `
    371         PROC_CLASS_ENTRY_P(parent)
    372     ')
    373 #ifdef ZEND_ENGINE_2
     336    PROC_CLASS_ENTRY_P(parent)
    374337    PROCESS(int, refcount)
    375 #else
    376     STRUCT_P(int, refcount)
    377 #endif
    378338#ifndef ZEND_ENGINE_2_4
    379339    PROCESS(zend_bool, constants_updated)
    380340#endif
    381 #ifdef ZEND_ENGINE_2
    382341    PROCESS(zend_uint, ce_flags)
    383 #endif
    384 
    385 #ifdef ZEND_ENGINE_2
     342
    386343    STRUCT(HashTable, properties_info, HashTable_zend_property_info)
    387 #endif
    388344
    389345#ifdef ZEND_ENGINE_2_4
     
    402358    IFCOPY(`dst->static_members = &dst->default_static_members;')
    403359    DONE(static_members)
    404 #   elif defined(ZEND_ENGINE_2)
     360#   else
    405361    STRUCT_P(HashTable, static_members, HashTable_zval_ptr)
    406362#   endif
    407363#endif /* ZEND_ENGINE_2_4 */
    408364
    409 #ifdef ZEND_ENGINE_2
    410365    STRUCT(HashTable, constants_table, HashTable_zval_ptr)
    411366
     
    490445    COPY(module)
    491446#   endif
    492 #else /* ZEND_ENGINE_2 */
    493     COPY(handle_function_call)
    494     COPY(handle_property_get)
    495     COPY(handle_property_set)
    496 #endif
    497447    dnl must do after SETNULL(constructor) and dst->parent
    498448    STRUCT(HashTable, function_table, HashTable_zend_function)
     
    601551            IFDASM(`PROCESS(zend_uint, u.var)')
    602552            PROCESS(zend_uint, u.opline_num)
    603 #ifndef ZEND_ENGINE_2
    604             PROCESS(zend_uint, u.fetch_type)
    605 #endif
    606553            PROCESS(zend_uint, u.EA.type)
    607554            break;
     
    665612            case ZEND_FAST_CALL:
    666613#endif
    667 #ifdef ZEND_ENGINE_2
    668614                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);
    669615                Z_OP(dst->op1).jmp_addr = processor->active_op_array_dst->opcodes + (Z_OP(src->op1).jmp_addr - processor->active_op_array_src->opcodes);
    670616                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);
    671 #endif
    672617                break;
    673618
     
    682627            case ZEND_JMP_SET_VAR:
    683628#endif
    684 #ifdef ZEND_ENGINE_2
    685629                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);
    686630                Z_OP(dst->op2).jmp_addr = processor->active_op_array_dst->opcodes + (Z_OP(src->op2).jmp_addr - processor->active_op_array_src->opcodes);
    687631                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);
    688 #endif
    689632                break;
    690633
     
    741684        /* deep */
    742685        STRUCT_P(HashTable, static_variables, HashTable_zval_ptr)
    743 #ifdef ZEND_ENGINE_2
    744686        STRUCT_ARRAY(zend_uint, num_args, zend_arg_info, arg_info)
    745687        gc_arg_info = 1;
    746 #endif
    747688        dst->filename = processor->entry_php_src->filepath;
    748689#ifdef ZEND_ENGINE_2_4
     
    788729                    case ZEND_FAST_CALL:
    789730#endif
    790 #ifdef ZEND_ENGINE_2
    791731                        Z_OP(opline->op1).jmp_addr = &dst->opcodes[Z_OP(opline->op1).jmp_addr - src->opcodes];
    792 #endif
    793732                        break;
    794733
     
    803742            case ZEND_JMP_SET_VAR:
    804743#endif
    805 #ifdef ZEND_ENGINE_2
    806744                        Z_OP(opline->op2).jmp_addr = &dst->opcodes[Z_OP(opline->op2).jmp_addr - src->opcodes];
    807 #endif
    808745                        break;
    809746
     
    819756        ) {
    820757            xc_gc_op_array_t gc_op_array;
    821 #ifdef ZEND_ENGINE_2
    822758            gc_op_array.num_args = gc_arg_info ? dst->num_args : 0;
    823759            gc_op_array.arg_info = gc_arg_info ? dst->arg_info : NULL;
    824 #endif
    825760            gc_op_array.opcodes  = gc_opcodes ? dst->opcodes : NULL;
    826761#ifdef ZEND_ENGINE_2_4
     
    839774    PROCESS(zend_uchar, type)
    840775    PROC_ZSTRING(, function_name)
    841 #ifdef ZEND_ENGINE_2
    842776    PROCESS(zend_uint, fn_flags)
    843777    STRUCT_ARRAY(zend_uint, num_args, zend_arg_info, arg_info)
     
    847781    PROCESS(zend_bool, pass_rest_by_reference)
    848782#   endif
    849 #else
    850     if (src->arg_types) {
    851         ALLOC(dst->arg_types, zend_uchar, src->arg_types[0] + 1)
    852         IFCOPY(`memcpy(dst->arg_types, src->arg_types, sizeof(src->arg_types[0]) * (src->arg_types[0]+1));')
    853         IFDASM(`do {
    854             int i;
    855             zval *zv;
    856             ALLOC_INIT_ZVAL(zv);
    857             array_init(zv);
    858             for (i = 0; i < src->arg_types[0]; i ++) {
    859                 add_next_index_long(zv, src->arg_types[i + 1]);
    860             }
    861             add_assoc_zval_ex(dst, ZEND_STRS("arg_types"), zv);
    862         } while (0);')
    863         DONE(arg_types)
    864     }
    865     else {
    866         COPYNULL(arg_types)
    867     }
    868 #endif
    869783#ifndef ZEND_ENGINE_2_4
    870784    PROCESS(unsigned char, return_reference)
     
    917831    PROCESS(zend_uint, current_brk_cont)
    918832#endif
    919 #ifndef ZEND_ENGINE_2
    920     PROCESS(zend_bool, uses_globals)
    921 #endif
    922 
    923 #ifdef ZEND_ENGINE_2
     833
    924834    STRUCT_ARRAY(int, last_try_catch, zend_try_catch_element, try_catch_array)
    925835    PROCESS(int, last_try_catch)
    926 #endif
    927836#ifdef ZEND_ENGINE_2_5
    928837    PROCESS(zend_bool, has_finally_block)
     
    955864    ')
    956865#endif
    957 #ifdef ZEND_ENGINE_2
    958866    PROCESS(zend_uint, line_start)
    959867    PROCESS(zend_uint, line_end)
    960868    PROCESS(int, doc_comment_len)
    961869    PROC_ZSTRING_L(, doc_comment, doc_comment_len)
    962 #endif
    963870#ifdef ZEND_COMPILE_DELAYED_BINDING
    964871    PROCESS(zend_uint, early_binding);
     
    977884    IFRESTORE(`xc_fix_op_array_info(processor->entry_php_src, processor->php_src, dst, shallow_copy, op_array_info TSRMLS_CC);')
    978885
    979 #ifdef ZEND_ENGINE_2
    980886    dnl mark it as -1 on store, and lookup parent on restore
    981887    IFSTORE(`dst->prototype = (processor->active_class_entry_src && src->prototype) ? (zend_function *) -1 : NULL;', `
     
    1006912    DONE(prototype)
    1007913
    1008 #endif
    1009 
    1010 #ifdef ZEND_ENGINE_2
    1011914    PROC_CLASS_ENTRY_P(scope)
    1012915    IFCOPY(`
     
    1015918        }
    1016919    ')
    1017 #endif
    1018920
    1019921    IFRESTORE(`
     
    11001002        processor->active_op_array_index = 0;
    11011003    ')
    1102 #ifdef ZEND_ENGINE_2
    1103     STRUCT_P(zend_class_entry, cest)
    1104 #else
    1105     STRUCT(zend_class_entry, cest)
    1106 #endif
     1004    STRUCT_P(zend_class_entry, class_entry)
    11071005#ifndef ZEND_COMPILE_DELAYED_BINDING
    11081006    PROCESS(int, oplineno)
Note: See TracChangeset for help on using the changeset viewer.