Changeset 657 in svn for trunk/optimizer.c


Ignore:
Timestamp:
2009-07-31T14:43:19+02:00 (6 years ago)
Author:
Xuefer
Message:

compile against PHP 4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/optimizer.c

    r543 r657  
    3636
    3737    bbid_t     fall;
     38#ifdef ZEND_ENGINE_2
    3839    bbid_t     catch;
     40#endif
    3941
    4042    int        opnum; /* opnum after joining basic block */
     
    133135    /* break=will fall */
    134136    switch (opline->opcode) {
     137#ifdef ZEND_HANDLE_EXCEPTION
    135138    case ZEND_HANDLE_EXCEPTION:
     139#endif
    136140    case ZEND_RETURN:
    137141    case ZEND_EXIT:
     
    253257
    254258    bb->fall       = BBID_INVALID;
     259#ifdef ZEND_ENGINE_2
    255260    bb->catch      = BBID_INVALID;
     261#endif
    256262
    257263    if (opcodes) {
     
    284290    op_flowinfo_t fi;
    285291    zend_op *last = bb->opcodes + bb->count - 1;
     292    bbid_t catchbbid;
     293#ifdef ZEND_ENGINE_2
     294    catchbbid = BBID_INVALID;
     295#else
     296    catchbbid = bb->catch;
     297#endif
    286298
    287299    op_get_flowinfo(&fi, last);
     
    293305            , bb->id, bb->count, bb->alloc ? -1 : line
    294306            , bb->used ? 'U' : ' ', bb->alloc ? 'A' : ' '
    295             , fi.jmpout_op1, fi.jmpout_op2, fi.jmpout_ext, bb->fall, bb->catch, xc_get_opcode(last->opcode)
     307            , fi.jmpout_op1, fi.jmpout_op2, fi.jmpout_ext, bb->fall, catchbbid, xc_get_opcode(last->opcode)
    296308            );
    297309    op_print(line, bb->opcodes, last + 1);
     
    354366    ALLOCA_FLAG(use_heap_markbbhead)
    355367    bbid_t *bbids          = my_do_alloca(count * sizeof(bbid_t),    use_heap_bbids);
     368#ifdef ZEND_ENGINE_2
    356369    bbid_t *catchbbids     = my_do_alloca(count * sizeof(bbid_t),    use_heap_catchbbids);
     370#endif
    357371    zend_bool *markbbhead  = my_do_alloca(count * sizeof(zend_bool), use_heap_markbbhead);
    358372
     
    377391        }
    378392    }
     393#ifdef ZEND_ENGINE_2
    379394    /* mark try start */
    380395    for (i = 0; i < op_array->last_try_catch; i ++) {
    381396        markbbhead[op_array->try_catch_array[i].try_op] = 1;
    382397    }
     398#endif
    383399    /* }}} */
    384400    /* {{{ fill op lines with newly allocated id */
     
    396412    }
    397413    /* }}} */
     414#ifdef ZEND_ENGINE_2
    398415    /* {{{ fill op lines with catch id */
    399416    for (i = 0; i < count; i ++) {
     
    414431#endif
    415432    /* }}} */
     433#endif
    416434    /* {{{ create basic blocks */
    417435    start = 0;
     
    425443        opline = op_array->opcodes + start;
    426444        pbb = bbs_new_bb_ex(bbs, opline, i - start);
     445#ifdef ZEND_ENGINE_2
    427446        pbb->catch = catchbbids[start];
     447#endif
    428448
    429449        /* last */
     
    457477
    458478    my_free_alloca(markbbhead, use_heap_markbbhead);
     479#ifdef ZEND_ENGINE_2
    459480    my_free_alloca(catchbbids, use_heap_catchbbids);
     481#endif
    460482    my_free_alloca(bbids,      use_heap_bbids);
    461483    return SUCCESS;
     
    465487{
    466488    int i;
     489#ifdef ZEND_ENGINE_2
    467490    bbid_t lasttrybbid;
    468491    bbid_t lastcatchbbid;
     492#endif
    469493
    470494    for (i = 0; i < bbs_count(bbs); i ++) {
     
    489513    }
    490514
     515#ifdef ZEND_ENGINE_2
    491516    lasttrybbid   = BBID_INVALID;
    492517    lastcatchbbid = BBID_INVALID;
     
    508533    }
    509534    /* it is impossible to have last bb catched */
     535#endif
    510536}
    511537/* }}} */
Note: See TracChangeset for help on using the changeset viewer.