Changeset 982 in svn


Ignore:
Timestamp:
2012-07-17T08:35:45Z (3 years ago)
Author:
Xuefer
Message:

move files to subdirs

Location:
trunk
Files:
10 added
7 edited
1 copied
44 moved

Legend:

Unmodified
Added
Removed
  • trunk/Makefile.frag

    r981 r982  
    11XCACHE_PROC_SRC=$(srcdir)/processor/main.m4
    22XCACHE_PROC_OUT=$(builddir)/processor.out
    3 XCACHE_PROC_C=$(builddir)/processor_real.c
    4 XCACHE_PROC_H=$(builddir)/processor.h
     3XCACHE_PROC_C=$(builddir)/main/xc_processor_real.c
     4XCACHE_PROC_H=$(builddir)/main/xc_processor.h
    55XCACHE_INCLUDES_SRC=$(srcdir)/includes.c
    66XCACHE_INCLUDES_I=$(builddir)/includes.i
     
    1010    $(CC) -I. -I$(srcdir) $(COMMON_FLAGS) $(CFLAGS_CLEAN) $(EXTRA_CFLAGS) -E $(XCACHE_INCLUDES_SRC) -o $(XCACHE_INCLUDES_I)
    1111
    12 $(XCACHE_STRUCTINFO_OUT): $(XCACHE_INCLUDES_I) $(srcdir)/mkstructinfo.awk
     12$(XCACHE_STRUCTINFO_OUT): $(XCACHE_INCLUDES_I) $(srcdir)/gen_structinfo.awk
    1313    @echo $(XCACHE_STRUCTINFO_OUT) is optional if XCache test is not enabled, feel free if it awk failed to produce it
    14     -$(XCACHE_AWK) -f $(srcdir)/mkstructinfo.awk < $(XCACHE_INCLUDES_I) > $(XCACHE_STRUCTINFO_OUT).tmp && mv $(XCACHE_STRUCTINFO_OUT).tmp $(XCACHE_STRUCTINFO_OUT)
     14    -$(XCACHE_AWK) -f $(srcdir)/gen_structinfo.awk < $(XCACHE_INCLUDES_I) > $(XCACHE_STRUCTINFO_OUT).tmp && mv $(XCACHE_STRUCTINFO_OUT).tmp $(XCACHE_STRUCTINFO_OUT)
    1515
    1616$(XCACHE_PROC_OUT): $(XCACHE_PROC_SRC) $(XCACHE_STRUCTINFO_OUT) $(XCACHE_PROC_SOURCES)
     
    2626    -$(XCACHE_INDENT) < $(XCACHE_PROC_OUT) > $(XCACHE_PROC_C).tmp && mv $(XCACHE_PROC_C).tmp $(XCACHE_PROC_C)
    2727
    28 $(builddir)/processor.lo: $(XCACHE_PROC_C) $(XCACHE_PROC_H) $(srcdir)/processor.c
     28$(builddir)/main/xc_processor.lo: $(XCACHE_PROC_C) $(XCACHE_PROC_H) $(srcdir)/main/xc_processor.c
    2929
    30 $(builddir)/disassembler.lo: $(XCACHE_PROC_H) $(srcdir)/processor.c
     30$(builddir)/submodules/xc_disassembler.lo: $(XCACHE_PROC_H) $(srcdir)/main/xc_processor.c
    3131
    32 $(builddir)/opcode_spec.lo: $(srcdir)/xcache.h $(srcdir)/opcode_spec.c $(srcdir)/opcode_spec_def.h $(srcdir)/const_string.h
     32$(builddir)/xc_opcode_spec.lo: $(srcdir)/xcache.h $(srcdir)/xc_opcode_spec.c $(srcdir)/xc_opcode_spec_def.h $(srcdir)/xc_const_string.h
    3333
    34 $(builddir)/xcache.lo: $(XCACHE_PROC_H) $(srcdir)/xc_shm.h $(srcdir)/stack.h $(srcdir)/xcache_globals.h $(srcdir)/xcache.c $(srcdir)/foreachcoresig.h $(srcdir)/utils.h
     34$(builddir)/xcache.lo: $(XCACHE_PROC_H) $(srcdir)/main/xc_shm.h $(srcdir)/util/xc_stack.h $(srcdir)/xcache_globals.h $(srcdir)/xcache.c $(srcdir)/util/xc_foreachcoresig.h $(srcdir)/main/xc_utils.h
    3535
    3636xcachesvnclean: clean
  • trunk/bin/phpdc.phpr

    r976 r982  
    33
    44$srcdir = dirname(__FILE__);
    5 require_once("$srcdir/Decompiler.class.php");
     5require_once("$srcdir/../lib/Decompiler.class.php");
    66if (file_exists("$srcdir/phpdc.debug.php")) {
    77    include("$srcdir/phpdc.debug.php");
  • trunk/bin/phpdop.phpr

    r976 r982  
    33
    44$srcdir = dirname(__FILE__);
    5 require_once("$srcdir/Decompiler.class.php");
     5require_once("$srcdir/../lib/Decompiler.class.php");
    66if (file_exists("$srcdir/phpdc.debug.php")) {
    77    include("$srcdir/phpdc.debug.php");
  • trunk/config.m4

    r842 r982  
    11dnl vim:ts=2:sw=2:expandtab
    22
    3 AC_DEFUN([XCACHE_OPTION], [
     3AC_DEFUN([XCACHE_MODULE], [
    44  PHP_ARG_ENABLE(xcache-$1, for XCache $1,
    55  [  --enable-xcache-$2    XCache: $4], no, no)
    66  if test "$PHP_$3" != "no"; then
    7     xcache_sources="$xcache_sources $1.c"
     7    xcache_sources="$xcache_sources submodules/xc_$1.c"
    88    XCACHE_MODULES="$XCACHE_MODULES $1"
    99    HAVE_$3=1
     
    1818
    1919if test "$PHP_XCACHE" != "no"; then
    20     PHP_ARG_ENABLE(xcache-constant, for XCache handle of compile time constant,
     20  PHP_ARG_ENABLE(xcache-constant, for XCache handle of compile time constant,
    2121  [  --enable-xcache-constant        XCache: Handle new constants made by php compiler (e.g.: for __halt_compiler)], yes, no)
    22     if test "$PHP_XCACHE_CONSTANT" != "no"; then
    23         AC_DEFINE([HAVE_XCACHE_CONSTANT], 1, [Define to enable XCache handling of compile time constants])
    24     fi
     22  if test "$PHP_XCACHE_CONSTANT" != "no"; then
     23    AC_DEFINE([HAVE_XCACHE_CONSTANT], 1, [Define to enable XCache handling of compile time constants])
     24  fi
    2525
    26   xcache_sources="processor.c \
     26  xcache_sources="
     27                  main/xc_const_string.c \
     28                  main/xc_lock.c \
     29                  main/xc_mem.c \
     30                  main/xc_opcode_spec.c \
     31                  main/xc_processor.c \
     32                  main/xc_shm.c \
     33                  main/xc_shm_mmap.c \
     34                  main/xc_utils.c \
     35                  util/xc_stack.c \
    2736                  xcache.c \
    28                   mmap.c \
    29                   mem.c \
    30                   xc_shm.c \
    31                   const_string.c \
    32                   opcode_spec.c \
    33                   stack.c \
    34                   utils.c \
    35                   lock.c \
    3637                  "
    3738  XCACHE_MODULES="cacher"
    38   XCACHE_OPTION([optimizer],    [optimizer   ], [XCACHE_OPTIMIZER],    [(N/A)])
    39   XCACHE_OPTION([coverager],    [coverager   ], [XCACHE_COVERAGER],    [Enable code coverage dumper, useful for testing php scripts])
    40   XCACHE_OPTION([assembler],    [assembler   ], [XCACHE_ASSEMBLER],    [(N/A)])
    41   XCACHE_OPTION([disassembler], [disassembler], [XCACHE_DISASSEMBLER], [Enable opcode to php variable dumper, NOT for production server])
    42   XCACHE_OPTION([encoder],      [encoder     ], [XCACHE_ENCODER],      [(N/A)])
    43   XCACHE_OPTION([decoder],      [decoder     ], [XCACHE_DECODER],      [(N/A)])
     39  XCACHE_MODULE([optimizer],    [optimizer   ], [XCACHE_OPTIMIZER],    [(N/A)])
     40  XCACHE_MODULE([coverager],    [coverager   ], [XCACHE_COVERAGER],    [Enable code coverage dumper, useful for testing php scripts])
     41  XCACHE_MODULE([assembler],    [assembler   ], [XCACHE_ASSEMBLER],    [(N/A)])
     42  XCACHE_MODULE([disassembler], [disassembler], [XCACHE_DISASSEMBLER], [Enable opcode to php variable dumper, NOT for production server])
     43  XCACHE_MODULE([encoder],      [encoder     ], [XCACHE_ENCODER],      [(N/A)])
     44  XCACHE_MODULE([decoder],      [decoder     ], [XCACHE_DECODER],      [(N/A)])
    4445  AC_DEFINE_UNQUOTED([XCACHE_MODULES], "$XCACHE_MODULES", [Define what modules is built with XCache])
    4546
     
    4849  if test "$PHP_XCACHE_TEST" != "no"; then
    4950    XCACHE_ENABLE_TEST=-DXCACHE_ENABLE_TEST
    50     xcache_sources="$xcache_sources xc_malloc.c"
     51    xcache_sources="$xcache_sources main/xc_malloc.c"
    5152    AC_DEFINE([HAVE_XCACHE_TEST], 1, [Define to enable XCache self test])
    5253  else
     
    116117  XCACHE_PROC_SOURCES=`ls $ac_srcdir/processor/*.m4`
    117118  PHP_SUBST([XCACHE_PROC_SOURCES])
    118 
    119   AC_MSG_CHECKING(if you have opcode_spec_def.h for XCache)
    120   if test -e "$ac_srcdir/opcode_spec_def.h" ; then
    121     AC_DEFINE([HAVE_XCACHE_OPCODE_SPEC_DEF], 1, [Define if you have opcode_spec_def.h for XCache])
    122     AC_MSG_RESULT(yes)
    123   else
    124     dnl check for features depend on opcode_spec_def.h
    125     AC_MSG_RESULT(no)
    126     define([ERROR], [
    127       AC_MSG_ERROR([cannot build with $1, $ac_srcdir/opcode_spec_def.h required])
    128     ])
    129     if test "$PHP_XCACHE_DISASSEMBLER" != "no" ; then
    130       ERROR(disassembler)
    131     fi
    132     undefine([ERROR])
    133   fi
    134119fi
  • trunk/config.w32

    r694 r982  
    1212    // }}}
    1313
    14     var xcache_sources = "processor.c \
     14    var xcache_sources = "
     15                          main/xc_processor.c \
     16                          main/xc_const_string.c \
     17                          main/xc_lock.c \
     18                          main/xc_mem.c \
     19                          main/xc_opcode_spec.c \
     20                          main/xc_shm.c \
     21                          main/xc_shm_mmap.c \
     22                          main/xc_utils.c \
     23                          util/xc_stack.c \
    1524                          xcache.c \
    16                           mmap.c \
    17                           mem.c \
    18                           xc_shm.c \
    19                           const_string.c \
    20                           opcode_spec.c \
    21                           stack.c \
    22                           utils.c \
    23                           lock.c \
    2425                          ";
    2526    // {{{ add sources on enabled
     
    4142        var withval = eval("PHP_XCACHE_" + uname);
    4243        if (withval != "no") {
    43             xcache_sources += " " + name + ".c";
     44            xcache_sources += " submodules/xc_" + name + ".c";
    4445            XCACHE_MODULES += " " + name;
    4546            STDOUT.WriteLine("Enabling XCache Module: " + name);
     
    7677    if (PHP_XCACHE_TEST != "no") {
    7778        ADD_FLAG("XCACHE_ENABLE_TEST", "-DXCACHE_ENABLE_TEST");
    78         xcache_sources += " xc_malloc.c";
     79        xcache_sources += " main/xc_malloc.c";
    7980        AC_DEFINE("HAVE_XCACHE_TEST", 1, "Define to enable XCache self test");
    8081    }
     
    130131    XCACHE_PROC_SOURCES=glob(srcdir + "\\processor\\*.m4").join(' ');
    131132    ADD_FLAG("XCACHE_PROC_SOURCES", XCACHE_PROC_SOURCES);
    132     // {{{ check for opcode_spec_def.h
    133     STDOUT.Write("Checking if you have opcode_spec_def.h for XCache ... ");
    134     var file = srcdir + "\\opcode_spec_def.h";
    135     if (FSO.FileExists(file)) {
    136         STDOUT.WriteLine("yes");
    137         AC_DEFINE("HAVE_XCACHE_OPCODE_SPEC_DEF", 1, "Define if you have opcode_spec_def.h for XCache");
    138     }
    139     else {
    140         STDOUT.WriteLine("no");
    141 
    142         // check for features depend on opcode_spec_def.h
    143         var xcache_require_opcode_spec_def = function(withval, name) {
    144             if (withval != "no") {
    145                 ERROR(file + " is required to enable XCache " + name);
    146             }
    147         }
    148         xcache_require_opcode_spec_def(PHP_XCACHE_DISASSEMBLER, "disassembler");
    149     }
    150     // }}}
    151133}
  • trunk/devel/prepare.devel

    r976 r982  
    1313
    1414make_all() {
    15     make_opcode_spec_def.h
    16     make_const_string
     15    make_xc_opcode_spec_def.h
     16    make_xc_const_string
    1717    test -e tags && echo tags exists, skipping. use \""$0" tags\" to rebuild || make_tags
    1818}
    1919
    2020make_clean() {
    21     make_clean_const_string
    22     echo "*" rm -f tags opcode_spec_def.h
    23     rm -f tags opcode_spec_def.h
     21    make_clean_xc_const_string
     22    echo "*" rm -f tags xc_opcode_spec_def.h
     23    rm -f tags xc_opcode_spec_def.h
    2424}
    2525
    26 make_const_string() {
    27     make_const_string_opcodes_php4.x.h
    28     make_const_string_opcodes_php5.0.h
    29     make_const_string_opcodes_php5.1.h
    30     make_const_string_opcodes_php5.4.h
    31     make_const_string_opcodes_php6.x.h
     26make_xc_const_string() {
     27    make_xc_const_string_opcodes_php4.x.h
     28    make_xc_const_string_opcodes_php5.0.h
     29    make_xc_const_string_opcodes_php5.1.h
     30    make_xc_const_string_opcodes_php5.4.h
     31    make_xc_const_string_opcodes_php6.x.h
    3232}
    3333
    34 make_clean_const_string() {
    35     echo "*" rm -f const_string_opcodes_php*.h{,.tmp}
    36     rm -f const_string_opcodes_php*.h
     34make_clean_xc_const_string() {
     35    echo "*" rm -f main/xc_const_string_opcodes_php*.h{,.tmp}
     36    rm -f main/xc_const_string_opcodes_php*.h
    3737}
    3838
    39 make_const_string_opcodes_php4.x.h() {
    40     precheck const_string_opcodes_php4.x.h "${PHP4_x_DIR}/Zend/zend_compile.h" && "$AWK" -f ./mkopcode.awk < "$I" > "$O.tmp" && mv "$O.tmp" "$O"
     39make_xc_const_string_opcodes_php4.x.h() {
     40    precheck main/xc_const_string_opcodes_php4.x.h "${PHP4_x_DIR}/Zend/zend_compile.h" && "$AWK" -f ./devel/gen_const_string_opcodes.awk < "$I" > "$O.tmp" && mv "$O.tmp" "$O"
    4141}
    4242
    43 make_const_string_opcodes_php5.0.h() {
    44     precheck const_string_opcodes_php5.0.h "${PHP5_0_DIR}/Zend/zend_compile.h" && "$AWK" -f ./mkopcode.awk < "$I" > "$O.tmp" && mv "$O.tmp" "$O"
     43make_xc_const_string_opcodes_php5.0.h() {
     44    precheck main/xc_const_string_opcodes_php5.0.h "${PHP5_0_DIR}/Zend/zend_compile.h" && "$AWK" -f ./devel/gen_const_string_opcodes.awk < "$I" > "$O.tmp" && mv "$O.tmp" "$O"
    4545}
    4646
    47 make_const_string_opcodes_php5.1.h() {
    48     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"
     47make_xc_const_string_opcodes_php5.1.h() {
     48    precheck main/xc_const_string_opcodes_php5.1.h "${PHP5_1_DIR}/Zend/zend_vm_def.h"  && "$AWK" -f ./devel/gen_const_string_opcodes.awk < "$I" > "$O.tmp" && mv "$O.tmp" "$O"
    4949}
    5050
    51 make_const_string_opcodes_php5.4.h() {
    52     precheck const_string_opcodes_php5.4.h "${PHP5_4_DIR}/Zend/zend_vm_def.h"  && "$AWK" -f ./mkopcode.awk < "$I" > "$O.tmp" && mv "$O.tmp" "$O"
     51make_xc_const_string_opcodes_php5.4.h() {
     52    precheck main/xc_const_string_opcodes_php5.4.h "${PHP5_4_DIR}/Zend/zend_vm_def.h"  && "$AWK" -f ./devel/gen_const_string_opcodes.awk < "$I" > "$O.tmp" && mv "$O.tmp" "$O"
    5353}
    5454
    55 make_const_string_opcodes_php6.x.h() {
    56     precheck const_string_opcodes_php6.x.h "${PHP6_x_DIR}/Zend/zend_vm_def.h"  && "$AWK" -f ./mkopcode.awk < "$I" > "$O.tmp" && mv "$O.tmp" "$O"
     55make_xc_const_string_opcodes_php6.x.h() {
     56    precheck main/xc_const_string_opcodes_php6.x.h "${PHP6_x_DIR}/Zend/zend_vm_def.h"  && "$AWK" -f ./devel/gen_const_string_opcodes.awk < "$I" > "$O.tmp" && mv "$O.tmp" "$O"
    5757}
    5858
    59 make_opcode_spec_def.h() {
    60     precheck "opcode_spec_def.h" "${EA_DIR}/opcodes.c" && "$AWK" -f ./mkopcode_spec.awk < "$I" > "$O"
     59make_xc_opcode_spec_def.h() {
     60    precheck main/xc_opcode_spec_def.h "${EA_DIR}/opcodes.c" && "$AWK" -f ./devel/gen_xc_opcode_spec.awk < "$I" > "$O"
    6161}
    6262
  • trunk/devel/prepare.devel.inc.example

    r976 r982  
    1 # copy this file as devel.prepare.inc before modifying
     1# copy this file as ../devel.prepare.inc before modifying
    22PHP4_x_DIR=
    33PHP5_0_DIR=
  • trunk/devel/run

    r980 r982  
    77if echo $basename | grep -- - >/dev/null; then :; else
    88    dirs=${dirs:-php5-debug}
     9
    910    for dir in $dirs; do
    1011        cd ../${basename}-${dir} || exit
     12
     13        rm -f php-src
     14        find -L . -type l | xargs rm -f
     15        lndir ../$basename >/dev/null
     16        find . -iname .\*.swp | xargs rm -f
     17        ln -sf ~/src/php/$dir php-src
     18        for i in ~/src/php/$dir/sapi/cgi/php{,-cgi}; do
     19            [[ -r $i ]] && ln -sf "$i" php-cgi
     20        done
     21        ln -sf ~/src/php/$dir/sapi/cli/php php-cli
     22
    1123        pwd
    1224        $0 "$@"
     
    1426    exit
    1527fi
     28phpbasename=${basename#*-}
     29xcachebasename=${basename%%-*}
    1630
    1731if [[ ! -z $1 ]]; then
     
    2640fi
    2741
    28 if [[ $type = make ]]; then
     42case $type in
     43prepare)
     44    exec ./devel/prepare.devel
     45    ;;
     46tags)
     47    exec ./devel/prepare.devel tags
     48    ;;
     49rebuild)
     50    PHPDIRS=${PHPDIRS:-$HOME/test}
     51    if [[ ! -x $PHPDIRS/$phpbasename/bin/phpize ]]; then
     52        echo $PHPDIRS/$phpbasename/bin/phpize not found
     53        exit
     54    fi
     55    export PATH=$PHPDIRS/$phpbasename/bin:$PATH
     56    phpize --clean \
     57    && phpize \
     58    && CFLAGS="-Wall -Wno-unused -W -Wshadow -std=gnu99" ./configure --enable-xcache-disassembler --enable-xcache-test --enable-xcache-constant \
     59    && make
     60    exit
     61    ;;
     62make)
    2963    MAKEARGS=("$@")
    30 fi
     64    ;;
     65esac
    3166
    32 LANG=C /usr/bin/make $MAKEOPTS "${MAKEARGS[@]}" 2>&1 | hi error warn FAIL
     67LANG=C /usr/bin/make $MAKEOPTS "${MAKEARGS[@]}" 2>&1 | hi error implicit warn FAIL
    3368ret=${PIPESTATUS[0]}
    3469if [[ $ret -ne 0 || $type = make ]]; then
     
    75110    ;;
    76111dc)
    77     exec ./php-cli -c php.ini ./phpdc.phpr "${args[@]}" | tee decompiled.php
     112    exec ./php-cli -c php.ini ./bin/phpdc.phpr "${args[@]}" | tee decompiled.php
    78113    ;;
    79114dop)
    80     exec ./php-cgi -q -c php.ini ./phpdop.phpr "${args[@]}"
     115    exec ./php-cli -c php.ini ./bin/phpdop.phpr "${args[@]}"
    81116    ;;
    82117retest)
  • trunk/main/xc_const_string.c

    r976 r982  
    11#include "xcache.h"
    2 #include "const_string.h"
     2#include "xc_const_string.h"
    33
    44/* {{{ xc_get_op_type */
     
    6363/* {{{ xc_get_opcode */
    6464#if PHP_MAJOR_VERSION >= 6
    65 #   include "const_string_opcodes_php6.x.h"
     65#   include "xc_const_string_opcodes_php6.x.h"
    6666#elif defined(ZEND_ENGINE_2_4)
    67 #   include "const_string_opcodes_php5.4.h"
     67#   include "xc_const_string_opcodes_php5.4.h"
    6868#elif defined(ZEND_ENGINE_2_1)
    69 #   include "const_string_opcodes_php5.1.h"
     69#   include "xc_const_string_opcodes_php5.1.h"
    7070#elif defined(ZEND_ENGINE_2)
    71 #   include "const_string_opcodes_php5.0.h"
     71#   include "xc_const_string_opcodes_php5.0.h"
    7272#else
    73 #   include "const_string_opcodes_php4.x.h"
     73#   include "xc_const_string_opcodes_php4.x.h"
    7474#endif
    7575
  • trunk/main/xc_lock.c

    r976 r982  
    1919        NULL)
    2020#endif
    21 #include "lock.h"
     21#include "xc_lock.h"
    2222
    2323struct _xc_lock_t {
  • trunk/main/xc_malloc.c

    r976 r982  
    1010#include "xc_shm.h"
    1111#include "php.h"
    12 #include "align.h"
    13 #include "utils.h"
     12#include "xc_utils.h"
     13#include "util/xc_align.h"
    1414
    1515struct _xc_malloc_mem_t {
  • trunk/main/xc_mem.c

    r976 r982  
    1818#define XC_MEM_IMPL _xc_mem_mem_t
    1919#include "xc_shm.h"
    20 #include "align.h"
    21 #include "utils.h"
     20#include "xc_utils.h"
     21#include "util/xc_align.h"
     22#include "util/xc_trace.h"
    2223
    2324#if 0
  • trunk/main/xc_opcode_spec.c

    r976 r982  
    11#include "xcache.h"
    2 #include "opcode_spec.h"
    3 #include "const_string.h"
     2#include "xc_opcode_spec.h"
     3#include "xc_const_string.h"
    44
    5 #ifdef HAVE_XCACHE_OPCODE_SPEC_DEF
    65/* {{{ opcode_spec */
    76#define OPSPEC(ext, op1, op2, res) { OPSPEC_##ext, OPSPEC_##op1, OPSPEC_##op2, OPSPEC_##res },
     
    1110#   define OPSPEC_VAR_2 OPSPEC_VAR
    1211#endif
    13 #include "opcode_spec_def.h"
     12#include "xc_opcode_spec_def.h"
    1413
    1514zend_uchar xc_get_opcode_spec_count()
     
    3029}
    3130/* }}} */
    32 #endif
    3331/* {{{ op_spec */
    3432
  • trunk/main/xc_processor.c

    r976 r982  
    1 #include "processor_real.c"
     1#include "xc_processor_real.c"
  • trunk/main/xc_shm.h

    r979 r982  
    1414typedef size_t xc_shmsize_t;
    1515
    16 #include "mem.h"
     16#include "xc_mem.h"
    1717
    1818/* shm */
  • trunk/main/xc_shm_mmap.c

    r979 r982  
    3232#define XC_SHM_IMPL _xc_mmap_shm_t
    3333#include "xc_shm.h"
    34 #include "utils.h"
     34#include "xc_utils.h"
    3535
    3636#ifndef max
  • trunk/main/xc_utils.c

    r976 r982  
    11
    22#include "xcache.h"
    3 #include "stack.h"
    43#include "xcache_globals.h"
    5 #include "utils.h"
     4#include "xc_utils.h"
    65#ifdef ZEND_ENGINE_2_1
    76#include "zend_vm.h"
    87#endif
    9 #include "opcode_spec.h"
     8#include "xc_opcode_spec.h"
    109#undef NDEBUG
    1110#include "assert.h"
     
    283282/* }}} */
    284283
    285 #ifdef HAVE_XCACHE_OPCODE_SPEC_DEF
    286284static void xc_fix_opcode_ex_znode(int tofix, xc_op_spec_t spec, Z_OP_TYPEOF_TYPE *op_type, znode_op *op, int type TSRMLS_DC) /* {{{ */
    287285{
     
    348346}
    349347/* }}} */
    350 #endif
    351348
    352349int xc_foreach_early_binding_class(zend_op_array *op_array, void (*callback)(zend_op *opline, int oplineno, void *data TSRMLS_DC), void *data TSRMLS_DC) /* {{{ */
  • trunk/main/xc_utils.h

    r976 r982  
    11#include "php.h"
    22#include "xcache.h"
    3 
    4 #ifdef XCACHE_DEBUG
    5 #   define IFDEBUG(x) (x)
    6 int xc_vtrace(const char *fmt, va_list args);
    7 int xc_trace(const char *fmt, ...) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 1, 2);
    8 
    9 #   ifdef ZEND_WIN32
    10 static inline int TRACE(const char *fmt, ...)
    11 {
    12     va_list args;
    13     int ret;
    14 
    15     va_start(args, fmt);
    16     ret = xc_vtrace(fmt, args);
    17     va_end(args);
    18     return ret;
    19 }
    20 #   else
    21 #       define TRACE(fmt, ...) \
    22         xc_trace("%s:%d: " fmt "\r\n", __FILE__, __LINE__, __VA_ARGS__)
    23 #   endif /* ZEND_WIN32 */
    24 #   undef NDEBUG
    25 #   undef inline
    26 #   define inline
    27 #else /* XCACHE_DEBUG */
    28 
    29 #   ifdef ZEND_WIN32
    30 static inline int TRACE_DUMMY(const char *fmt, ...)
    31 {
    32     return 0;
    33 }
    34 #       define TRACE 1 ? 0 : TRACE_DUMMY
    35 #   else
    36 #       define TRACE(fmt, ...) do { } while (0)
    37 #   endif /* ZEND_WIN32 */
    38 
    39 #   define IFDEBUG(x) do { } while (0)
    40 #endif /* XCACHE_DEBUG */
    41 #include <assert.h>
    423
    434int xc_util_init(int module_number TSRMLS_DC);
     
    10869#define zend_atol xc_atol
    10970#endif
    110 
    111 typedef struct {
    112     zend_uint size;
    113     zend_uint cnt;
    114     void *data;
    115 } xc_vector_t;
    116 
    117 #define xc_vector_init(type, vector) do { \
    118     (vector)->cnt = 0;     \
    119     (vector)->size = 0;    \
    120     (vector)->data = NULL; \
    121 } while (0)
    122 
    123 #define xc_vector_add(type, vector, value) do { \
    124     if ((vector)->cnt == (vector)->size) { \
    125         if ((vector)->size) { \
    126             (vector)->size <<= 1; \
    127             (vector)->data = erealloc((vector)->data, sizeof(type) * (vector)->size); \
    128         } \
    129         else { \
    130             (vector)->size = 8; \
    131             (vector)->data = emalloc(sizeof(type) * (vector)->size); \
    132         } \
    133     } \
    134     ((type *) (vector)->data)[(vector)->cnt++] = value; \
    135 } while (0)
    136 
    137 static inline void *xc_vector_detach_impl(xc_vector_t *vector)
    138 {
    139     void *data = vector->data;
    140     vector->data = NULL;
    141     vector->size = 0;
    142     vector->cnt = 0;
    143     return data;
    144 }
    145 
    146 #define xc_vector_detach(type, vector) ((type *) xc_vector_detach_impl(vector))
    147 
    148 static inline void xc_vector_free_impl(xc_vector_t *vector TSRMLS_DC)
    149 {
    150     if (vector->data) {
    151         efree(vector->data);
    152     }
    153     vector->size = 0;
    154     vector->cnt = 0;
    155 }
    156 
    157 #define xc_vector_free(type, vector) xc_vector_free_impl(vector TSRMLS_CC)
    158 
  • trunk/processor/head.m4

    r930 r982  
    1111
    1212#include "xcache.h"
    13 #include "align.h"
    14 #include "const_string.h"
    15 #include "processor.h"
    16 #include "stack.h"
     13#include "util/xc_align.h"
     14#include "xc_const_string.h"
     15#include "xc_processor.h"
    1716#include "xcache_globals.h"
    1817
  • trunk/submodules/xc_disassembler.c

    r976 r982  
    1 #include "disassembler.h"
     1#include "xc_disassembler.h"
    22#include "xcache.h"
    3 #include "utils.h"
    4 #include "processor.h"
     3#include "xc_utils.h"
     4#include "xc_processor.h"
    55
    6 #ifndef HAVE_XCACHE_OPCODE_SPEC_DEF
    7 #error disassembler cannot be built without xcache/opcode_spec_def.h
    8 #endif
    96static void xc_dasm(zval *output, zend_op_array *op_array TSRMLS_DC) /* {{{ */
    107{
  • trunk/util/xc_stack.c

    r976 r982  
    11#include <stdlib.h>
    22#include <assert.h>
    3 #include "stack.h"
     3#include "xc_stack.h"
    44typedef xc_stack_t* S;
    55
  • trunk/util/xc_stack.h

    r976 r982  
     1#ifndef __XC_UTIL_STACK
     2#define __XC_UTIL_STACK
    13
    24typedef struct {
     
    1719void xc_stack_reverse(S stack);
    1820#undef S
     21
     22#endif /* __XC_UTIL_STACK */
  • trunk/xcache.c

    r979 r982  
    2727#include "ext/date/php_date.h"
    2828#endif
    29 #include "optimizer.h"
    30 #include "coverager.h"
    31 #include "disassembler.h"
    32 #include "align.h"
    33 #include "stack.h"
     29#include "submodules/xc_optimizer.h"
     30#include "submodules/xc_coverager.h"
     31#include "submodules/xc_disassembler.h"
    3432#include "xcache_globals.h"
    35 #include "processor.h"
    36 #include "const_string.h"
    37 #include "opcode_spec.h"
    38 #include "utils.h"
     33#include "xc_processor.h"
     34#include "xc_const_string.h"
     35#include "xc_opcode_spec.h"
     36#include "xc_utils.h"
     37#include "util/xc_align.h"
     38#include "util/xc_stack.h"
     39#include "util/xc_vector.h"
     40#include "util/xc_trace.h"
    3941
    4042#define VAR_ENTRY_EXPIRED(pentry) ((pentry)->ttl && XG(request_time) > (pentry)->ctime + (time_t) (pentry)->ttl)
     
    7274static zend_bool xc_disable_on_crash = 0;
    7375
    74 static xc_hash_t xc_php_hcache = { 0 };
    75 static xc_hash_t xc_php_hentry = { 0 };
    76 static xc_hash_t xc_var_hcache = { 0 };
    77 static xc_hash_t xc_var_hentry = { 0 };
     76static xc_hash_t xc_php_hcache = { 0, 0, 0 };
     77static xc_hash_t xc_php_hentry = { 0, 0, 0 };
     78static xc_hash_t xc_var_hcache = { 0, 0, 0 };
     79static xc_hash_t xc_var_hentry = { 0, 0, 0 };
    7880
    7981static zend_ulong xc_php_ttl    = 0;
     
    114116#endif
    115117ZEND_DLEXPORT zend_extension zend_extension_entry;
    116 ZEND_DECLARE_MODULE_GLOBALS(xcache);
     118ZEND_DECLARE_MODULE_GLOBALS(xcache)
    117119
    118120typedef enum { XC_TYPE_PHP, XC_TYPE_VAR } xc_entry_type_t;
     
    32713273}
    32723274/* }}} */
    3273 #ifdef HAVE_XCACHE_OPCODE_SPEC_DEF
    32743275/* {{{ proto string xcache_get_opcode_spec(int opcode) */
    32753276PHP_FUNCTION(xcache_get_opcode_spec)
     
    32953296}
    32963297/* }}} */
    3297 #endif
    32983298/* {{{ proto mixed xcache_get_special_value(zval value)
    32993299   XCache internal use only: For decompiler to get static value with type fixed */
     
    33983398    PHP_FE(xcache_get_data_type,     NULL)
    33993399    PHP_FE(xcache_get_opcode,        NULL)
    3400 #ifdef HAVE_XCACHE_OPCODE_SPEC_DEF
    34013400    PHP_FE(xcache_get_opcode_spec,   NULL)
    3402 #endif
    34033401    PHP_FE(xcache_is_autoglobal,     NULL)
    34043402    PHP_FE(xcache_inc,               NULL)
     
    35203518typedef void (*xc_sighandler_t)(int);
    35213519#define FOREACH_SIG(sig) static xc_sighandler_t old_##sig##_handler = NULL
    3522 #include "foreachcoresig.h"
     3520#include "util/xc_foreachcoresig.h"
    35233521#undef FOREACH_SIG
    35243522/* }}} */
     
    35343532    } \
    35353533} while (0)
    3536 #include "foreachcoresig.h"
     3534#include "util/xc_foreachcoresig.h"
    35373535#undef FOREACH_SIG
    35383536}
     
    35423540#define FOREACH_SIG(sig) \
    35433541    old_##sig##_handler = signal(sig, xcache_signal_handler)
    3544 #include "foreachcoresig.h"
     3542#include "util/xc_foreachcoresig.h"
    35453543#undef FOREACH_SIG
    35463544}
  • trunk/xcache.h

    r967 r982  
    2121#endif
    2222#include "xc_shm.h"
    23 #include "lock.h"
     23#include "xc_lock.h"
    2424
    2525#if !defined(ZEND_ENGINE_2_4) && (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 4 || PHP_MAJOR_VERSION > 5)
  • trunk/xcache_globals.h

    r894 r982  
     1#include "util/xc_stack.h"
    12
    23ZEND_BEGIN_MODULE_GLOBALS(xcache)
Note: See TracChangeset for help on using the changeset viewer.