Changeset 617 in svn


Ignore:
Timestamp:
2009-07-05T08:30:54+02:00 (6 years ago)
Author:
Xuefer
Message:

PHP 5.3 support

Location:
branches/1.3
Files:
9 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/1.3

    • Property svn:mergeinfo changed
      /trunkmerged: 485
  • branches/1.3/const_string.c

    r394 r617  
    8989/* {{{ xc_get_opcode */
    9090#if PHP_MAJOR_VERSION >= 6
    91 #   include     "const_string_opcodes_php6.x.h"
    92 #else
    93 #   ifdef ZEND_ENGINE_2_1
    94 #       include     "const_string_opcodes_php5.1.h"
    95 #   else
    96 #       ifdef ZEND_ENGINE_2
    97 #           include "const_string_opcodes_php5.0.h"
    98 #       else
    99 #           include "const_string_opcodes_php4.x.h"
    100 #       endif
    101 #   endif
     91#   include "const_string_opcodes_php6.x.h"
     92#elif defined(ZEND_ENGINE_2_3)
     93#   include "const_string_opcodes_php5.3.h"
     94#elif defined(ZEND_ENGINE_2_1)
     95#   include "const_string_opcodes_php5.1.h"
     96#elif defined(ZEND_ENGINE_2)
     97#   include "const_string_opcodes_php5.0.h"
    10298#endif
    10399
  • branches/1.3/coverager.c

    r615 r617  
    3636    char *fullpath;
    3737    struct stat st;
     38    ALLOCA_FLAG(use_heap)
    3839
    3940    TRACE("mkdirs %s %d %s %d", root, rootlen, path, pathlen);
    40     fullpath = do_alloca(rootlen + pathlen + 1);
     41    fullpath = my_do_alloca(rootlen + pathlen + 1, use_heap);
    4142    memcpy(fullpath, root, rootlen);
    4243    memcpy(fullpath + rootlen, path, pathlen);
     
    5960#endif
    6061    }
    61     free_alloca(fullpath);
     62    my_free_alloca(fullpath, use_heap);
    6263}
    6364/* }}} */
  • branches/1.3/prepare.devel

    r604 r617  
    2828    make_const_string_opcodes_php5.0.h
    2929    make_const_string_opcodes_php5.1.h
     30    make_const_string_opcodes_php5.3.h
    3031    make_const_string_opcodes_php6.x.h
    3132}
     
    4647make_const_string_opcodes_php5.1.h() {
    4748    precheck const_string_opcodes_php5.1.h "${PHP5_1_DIR}/Zend/zend_vm_def.h"  && "$AWK" -f ./mkopcode.awk < "$I" > "$O.tmp" && mv "$O.tmp" "$O"
     49}
     50
     51make_const_string_opcodes_php5.3.h() {
     52    precheck const_string_opcodes_php5.3.h "${PHP5_3_DIR}/Zend/zend_vm_def.h"  && "$AWK" -f ./mkopcode.awk < "$I" > "$O.tmp" && mv "$O.tmp" "$O"
    4853}
    4954
  • branches/1.3/prepare.devel.inc.example

    r604 r617  
    33PHP5_0_DIR=
    44PHP5_1_DIR=
     5PHP5_3_DIR=
    56PHP6_x_DIR=
    67
  • branches/1.3/processor/processor.m4

    r616 r617  
    8181        ZVAL_REFCOUNT(dst) = 1;
    8282        DONE(value)
     83        DONE(type)
     84#ifdef ZEND_ENGINE_2_3
     85        DONE(is_ref__gc)
     86        DONE(refcount__gc)
     87#else
     88        DONE(is_ref)
    8389        DONE(refcount)
    84         DONE(type)
    85         DONE(is_ref)
    86 #ifdef ZEND_ENGINE_2_3
    87         COPY(idx_type)
    8890#endif
    8991    } while(0);
     
    149151        DONE(value)
    150152        DISPATCH(zval_data_type, type)
     153#ifdef ZEND_ENGINE_2_3
     154        DISPATCH(zend_uchar, is_ref__gc)
     155#else
    151156        DISPATCH(zend_uchar, is_ref)
    152 #ifdef ZEND_ENGINE_2
     157#endif
     158
     159#ifdef ZEND_ENGINE_2_3
     160        DISPATCH(zend_uint, refcount__gc)
     161#elif defined(ZEND_ENGINE_2)
    153162        DISPATCH(zend_uint, refcount)
    154163#else
    155164        DISPATCH(zend_ushort, refcount)
    156 #endif
    157 #ifdef ZEND_ENGINE_2_3
    158         DISPATCH(zend_uchar, idx_type)
    159165#endif
    160166    ')dnl IFDASM
     
    479485            case ZEND_JMPZ_EX:
    480486            case ZEND_JMPNZ_EX:
     487#ifdef ZEND_JMP_SET
     488            case ZEND_JMP_SET:
     489#endif
    481490                dst->op2.u.jmp_addr = processor->active_opcodes_dst + (src->op2.u.jmp_addr - processor->active_opcodes_src);
    482491                break;
  • branches/1.3/utils.c

    r600 r617  
    2020
    2121#define OP_ZVAL_DTOR(op) do { \
    22     (op).u.constant.is_ref = 0; \
     22    Z_UNSET_ISREF((op).u.constant); \
    2323    zval_dtor(&(op).u.constant); \
    2424} while(0)
     
    152152            case ZEND_JMPZ_EX:
    153153            case ZEND_JMPNZ_EX:
     154#ifdef ZEND_JMP_SET
     155            case ZEND_JMP_SET:
     156#endif
    154157                opline->op2.u.opline_num = opline->op2.u.jmp_addr - op_array->opcodes;
    155158                assert(opline->op2.u.opline_num < op_array->last);
     
    181184    while (opline < end) {
    182185        if (opline->op1.op_type == IS_CONST) {
    183             opline->op1.u.constant.is_ref = 1;
    184             opline->op1.u.constant.refcount = 2; /* Make sure is_ref won't be reset */
     186            Z_SET_ISREF(opline->op1.u.constant);
     187            Z_SET_REFCOUNT(opline->op1.u.constant, 2); /* Make sure is_ref won't be reset */
     188
    185189        }
    186190        if (opline->op2.op_type == IS_CONST) {
    187             opline->op2.u.constant.is_ref = 1;
    188             opline->op2.u.constant.refcount = 2;
     191            Z_SET_ISREF(opline->op2.u.constant);
     192            Z_SET_REFCOUNT(opline->op2.u.constant, 2);
    189193        }
    190194#ifdef ZEND_ENGINE_2_1
     
    198202            case ZEND_JMPZ_EX:
    199203            case ZEND_JMPNZ_EX:
     204#ifdef ZEND_JMP_SET
     205            case ZEND_JMP_SET:
     206#endif
    200207                assert(opline->op2.u.opline_num < op_array->last);
    201208                opline->op2.u.jmp_addr = op_array->opcodes + opline->op2.u.opline_num;
     
    299306            case ZEND_JMPZ_EX:
    300307            case ZEND_JMPNZ_EX:
     308#ifdef ZEND_JMP_SET
     309            case ZEND_JMP_SET:
     310#endif
    301311                next = begin + opline->op2.u.opline_num;
    302312                break;
  • branches/1.3/xcache.c

    r602 r617  
    542542    xc_entry_data_php_t *p = xce->data.php;
    543543    zend_op_array *old_active_op_array = CG(active_op_array);
     544    ALLOCA_FLAG(use_heap)
     545
    544546#ifndef ZEND_ENGINE_2
    545547    /* new ptr which is stored inside CG(class_table) */
    546     xc_cest_t **new_cest_ptrs = (xc_cest_t **)do_alloca(sizeof(xc_cest_t*) * p->classinfo_cnt);
     548    xc_cest_t **new_cest_ptrs = (xc_cest_t **)my_do_alloca(sizeof(xc_cest_t*) * p->classinfo_cnt, use_heap);
    547549#endif
    548550
     
    605607
    606608#ifndef ZEND_ENGINE_2
    607     free_alloca(new_cest_ptrs);
     609    my_free_alloca(new_cest_ptrs, use_heap);
    608610#endif
    609611    CG(active_op_array) = old_active_op_array;
     
    649651    int size = strlen(include_path) + 1;
    650652    char tokens[] = { DEFAULT_DIR_SEPARATOR, '\0' };
    651 
    652     paths = (char *)do_alloca(size);
     653    ALLOCA_FLAG(use_heap)
     654
     655    paths = (char *)my_do_alloca(size, use_heap);
    653656    memcpy(paths, include_path, size);
    654657
     
    658661        }
    659662        if (VCWD_STAT(filepath, pbuf) == 0) {
    660             free_alloca(paths);
     663            my_free_alloca(paths, use_heap);
    661664            return SUCCESS;
    662665        }
    663666    }
    664667
    665     free_alloca(paths);
     668    my_free_alloca(paths, use_heap);
    666669
    667670    return FAILURE;
  • branches/1.3/xcache.h

    r610 r617  
    1010#include <zend_compile.h>
    1111#include <zend_API.h>
     12#include <zend.h>
    1213#include "php_ini.h"
    1314#include "zend_hash.h"
     
    3637#else
    3738#   define ZESW(v1, v2) v2
     39#endif
     40
     41#ifdef ALLOCA_FLAG
     42#   define my_do_alloca(size, use_heap) do_alloca(size, use_heap)
     43#   define my_free_alloca(size, use_heap) free_alloca(size, use_heap)
     44#else
     45#   define my_do_alloca(size, use_heap) do_alloca(size)
     46#   define my_free_alloca(size, use_heap) free_alloca(size)
     47#   define ALLOCA_FLAG(x)
     48#endif
     49#ifndef Z_SET_ISREF
     50#   define Z_SET_ISREF(z) (z).is_ref = 1;
     51#endif
     52#ifndef Z_UNSET_ISREF
     53#   define Z_UNSET_ISREF(z) (z).is_ref = 0;
     54#endif
     55#ifndef Z_SET_REFCOUNT
     56#   define Z_SET_REFCOUNT(z, rc) (z).refcount = rc;
    3857#endif
    3958
Note: See TracChangeset for help on using the changeset viewer.