Browse Source

merged r562-572 from trunk

git-svn-id: svn://svn.lighttpd.net/xcache/branches/1.3@626 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
1.3
Xuefer 12 years ago
parent
commit
225afd2c89
  1. 3
      ChangeLog
  2. 4
      NEWS
  3. 2
      const_string.c
  4. 2
      const_string_opcodes_php4.x.h
  5. 15
      const_string_opcodes_php5.1.h
  6. 156
      const_string_opcodes_php5.3.h
  7. 2
      const_string_opcodes_php6.x.h
  8. 2
      mkopcode.awk
  9. 14
      mkopcode_spec.awk
  10. 319
      opcode_spec_def.h
  11. 5
      prepare.devel
  12. 4
      processor/main.m4
  13. 6
      processor/processor.m4
  14. 20
      xcache.c
  15. 6
      xcache.h

3
ChangeLog

@ -1,6 +1,6 @@
1.3.0 2009-??-??
== ChangeLog ==
* PHP 5.3 Supported
* PHP 5.3 support
* fixed #138: no segv if cache is not initialized correctly
* default to 64M for xcache.size in xcache.ini
* could not show module info in admin page when XCache is the last module
@ -10,7 +10,6 @@
1.2.2 2007-12-29
== ChangeLog ==
* added module dependency
* added module dependency
* live with wrong system time: allow caching files with mtime in further
* bug fix for compatibility with Zend Optimizer and other non-cachable

4
NEWS

@ -1,10 +1,10 @@
1.3.0 2009-??-??
========
* PHP 5.3 Supported
* PHP 5.3 support
* many cacher/coverager bug fixes
* improved admin pages
* admin page is now magic quote gpc aware
1.2.2 2007-12-29
========
* live with wrong system time: allow caching files with mtime in further

2
const_string.c

@ -63,8 +63,6 @@ const char *xc_get_data_type(zend_uchar data_type)
/* {{{ xc_get_opcode */
#if PHP_MAJOR_VERSION >= 6
# include "const_string_opcodes_php6.x.h"
#elif defined(ZEND_ENGINE_2_3)
# include "const_string_opcodes_php5.3.h"
#elif defined(ZEND_ENGINE_2_1)
# include "const_string_opcodes_php5.1.h"
#elif defined(ZEND_ENGINE_2)

2
const_string_opcodes_php4.x.h

@ -1,4 +1,4 @@
/* size = 112 */
/* size = 113 */
static const char *const xc_opcode_names[] = {
/* 0 */ "NOP",
/* 1 */ "ADD",

15
const_string_opcodes_php5.1.h

@ -1,4 +1,4 @@
/* size = 150 */
/* size = 154 */
static const char *const xc_opcode_names[] = {
/* 0 */ "NOP",
/* 1 */ "ADD",
@ -69,7 +69,7 @@ static const char *const xc_opcode_names[] = {
/* 66 */ "SEND_VAR",
/* 67 */ "SEND_REF",
/* 68 */ "NEW",
/* 69 */ "UNDEF",
/* 69 */ "INIT_NS_FCALL_BY_NAME",
/* 70 */ "FREE",
/* 71 */ "INIT_ARRAY",
/* 72 */ "ADD_ARRAY_ELEMENT",
@ -100,7 +100,7 @@ static const char *const xc_opcode_names[] = {
/* 97 */ "FETCH_OBJ_UNSET",
/* 98 */ "FETCH_DIM_TMP_VAR",
/* 99 */ "FETCH_CONSTANT",
/* 100 */ "UNDEF",
/* 100 */ "GOTO",
/* 101 */ "EXT_STMT",
/* 102 */ "EXT_FCALL_BEGIN",
/* 103 */ "EXT_FCALL_END",
@ -143,12 +143,15 @@ static const char *const xc_opcode_names[] = {
/* 140 */ "DECLARE_INHERITED_CLASS",
/* 141 */ "DECLARE_FUNCTION",
/* 142 */ "RAISE_ABSTRACT_ERROR",
/* 143 */ "UNDEF",
/* 143 */ "DECLARE_CONST",
/* 144 */ "ADD_INTERFACE",
/* 145 */ "UNDEF",
/* 145 */ "DECLARE_INHERITED_CLASS_DELAYED",
/* 146 */ "VERIFY_ABSTRACT_CLASS",
/* 147 */ "ASSIGN_DIM",
/* 148 */ "ISSET_ISEMPTY_PROP_OBJ",
/* 149 */ "HANDLE_EXCEPTION",
/* 150 */ "USER_OPCODE"
/* 150 */ "USER_OPCODE",
/* 151 */ "UNDEF",
/* 152 */ "JMP_SET",
/* 153 */ "DECLARE_LAMBDA_FUNCTION"
};

156
const_string_opcodes_php5.3.h

@ -1,156 +0,0 @@
/* size = 152 */
static const char *const xc_opcode_names[] = {
/* 0 */ "NOP",
/* 1 */ "ADD",
/* 2 */ "SUB",
/* 3 */ "MUL",
/* 4 */ "DIV",
/* 5 */ "MOD",
/* 6 */ "SL",
/* 7 */ "SR",
/* 8 */ "CONCAT",
/* 9 */ "BW_OR",
/* 10 */ "BW_AND",
/* 11 */ "BW_XOR",
/* 12 */ "BW_NOT",
/* 13 */ "BOOL_NOT",
/* 14 */ "BOOL_XOR",
/* 15 */ "IS_IDENTICAL",
/* 16 */ "IS_NOT_IDENTICAL",
/* 17 */ "IS_EQUAL",
/* 18 */ "IS_NOT_EQUAL",
/* 19 */ "IS_SMALLER",
/* 20 */ "IS_SMALLER_OR_EQUAL",
/* 21 */ "CAST",
/* 22 */ "QM_ASSIGN",
/* 23 */ "ASSIGN_ADD",
/* 24 */ "ASSIGN_SUB",
/* 25 */ "ASSIGN_MUL",
/* 26 */ "ASSIGN_DIV",
/* 27 */ "ASSIGN_MOD",
/* 28 */ "ASSIGN_SL",
/* 29 */ "ASSIGN_SR",
/* 30 */ "ASSIGN_CONCAT",
/* 31 */ "ASSIGN_BW_OR",
/* 32 */ "ASSIGN_BW_AND",
/* 33 */ "ASSIGN_BW_XOR",
/* 34 */ "PRE_INC",
/* 35 */ "PRE_DEC",
/* 36 */ "POST_INC",
/* 37 */ "POST_DEC",
/* 38 */ "ASSIGN",
/* 39 */ "ASSIGN_REF",
/* 40 */ "ECHO",
/* 41 */ "PRINT",
/* 42 */ "JMP",
/* 43 */ "JMPZ",
/* 44 */ "JMPNZ",
/* 45 */ "JMPZNZ",
/* 46 */ "JMPZ_EX",
/* 47 */ "JMPNZ_EX",
/* 48 */ "CASE",
/* 49 */ "SWITCH_FREE",
/* 50 */ "BRK",
/* 51 */ "CONT",
/* 52 */ "BOOL",
/* 53 */ "INIT_STRING",
/* 54 */ "ADD_CHAR",
/* 55 */ "ADD_STRING",
/* 56 */ "ADD_VAR",
/* 57 */ "BEGIN_SILENCE",
/* 58 */ "END_SILENCE",
/* 59 */ "INIT_FCALL_BY_NAME",
/* 60 */ "DO_FCALL",
/* 61 */ "DO_FCALL_BY_NAME",
/* 62 */ "RETURN",
/* 63 */ "RECV",
/* 64 */ "RECV_INIT",
/* 65 */ "SEND_VAL",
/* 66 */ "SEND_VAR",
/* 67 */ "SEND_REF",
/* 68 */ "NEW",
/* 69 */ "INIT_NS_FCALL_BY_NAME",
/* 70 */ "FREE",
/* 71 */ "INIT_ARRAY",
/* 72 */ "ADD_ARRAY_ELEMENT",
/* 73 */ "INCLUDE_OR_EVAL",
/* 74 */ "UNSET_VAR",
/* 75 */ "UNSET_DIM",
/* 76 */ "UNSET_OBJ",
/* 77 */ "FE_RESET",
/* 78 */ "FE_FETCH",
/* 79 */ "EXIT",
/* 80 */ "FETCH_R",
/* 81 */ "FETCH_DIM_R",
/* 82 */ "FETCH_OBJ_R",
/* 83 */ "FETCH_W",
/* 84 */ "FETCH_DIM_W",
/* 85 */ "FETCH_OBJ_W",
/* 86 */ "FETCH_RW",
/* 87 */ "FETCH_DIM_RW",
/* 88 */ "FETCH_OBJ_RW",
/* 89 */ "FETCH_IS",
/* 90 */ "FETCH_DIM_IS",
/* 91 */ "FETCH_OBJ_IS",
/* 92 */ "FETCH_FUNC_ARG",
/* 93 */ "FETCH_DIM_FUNC_ARG",
/* 94 */ "FETCH_OBJ_FUNC_ARG",
/* 95 */ "FETCH_UNSET",
/* 96 */ "FETCH_DIM_UNSET",
/* 97 */ "FETCH_OBJ_UNSET",
/* 98 */ "FETCH_DIM_TMP_VAR",
/* 99 */ "FETCH_CONSTANT",
/* 100 */ "UNDEF",
/* 101 */ "EXT_STMT",
/* 102 */ "EXT_FCALL_BEGIN",
/* 103 */ "EXT_FCALL_END",
/* 104 */ "EXT_NOP",
/* 105 */ "TICKS",
/* 106 */ "SEND_VAR_NO_REF",
/* 107 */ "CATCH",
/* 108 */ "THROW",
/* 109 */ "FETCH_CLASS",
/* 110 */ "CLONE",
/* 111 */ "UNDEF",
/* 112 */ "INIT_METHOD_CALL",
/* 113 */ "INIT_STATIC_METHOD_CALL",
/* 114 */ "ISSET_ISEMPTY_VAR",
/* 115 */ "ISSET_ISEMPTY_DIM_OBJ",
/* 116 */ "UNDEF",
/* 117 */ "UNDEF",
/* 118 */ "UNDEF",
/* 119 */ "UNDEF",
/* 120 */ "UNDEF",
/* 121 */ "UNDEF",
/* 122 */ "UNDEF",
/* 123 */ "UNDEF",
/* 124 */ "UNDEF",
/* 125 */ "UNDEF",
/* 126 */ "UNDEF",
/* 127 */ "UNDEF",
/* 128 */ "UNDEF",
/* 129 */ "UNDEF",
/* 130 */ "UNDEF",
/* 131 */ "UNDEF",
/* 132 */ "PRE_INC_OBJ",
/* 133 */ "PRE_DEC_OBJ",
/* 134 */ "POST_INC_OBJ",
/* 135 */ "POST_DEC_OBJ",
/* 136 */ "ASSIGN_OBJ",
/* 137 */ "OP_DATA",
/* 138 */ "INSTANCEOF",
/* 139 */ "DECLARE_CLASS",
/* 140 */ "DECLARE_INHERITED_CLASS",
/* 141 */ "DECLARE_FUNCTION",
/* 142 */ "RAISE_ABSTRACT_ERROR",
/* 143 */ "DECLARE_CONST",
/* 144 */ "ADD_INTERFACE",
/* 145 */ "UNDEF",
/* 146 */ "VERIFY_ABSTRACT_CLASS",
/* 147 */ "ASSIGN_DIM",
/* 148 */ "ISSET_ISEMPTY_PROP_OBJ",
/* 149 */ "HANDLE_EXCEPTION",
/* 150 */ "USER_OPCODE",
/* 151 */ "UNDEF",
/* 152 */ "JMP_SET"
};

2
const_string_opcodes_php6.x.h

@ -1,4 +1,4 @@
/* size = 153 */
/* size = 154 */
static const char *const xc_opcode_names[] = {
/* 0 */ "NOP",
/* 1 */ "ADD",

2
mkopcode.awk

@ -53,7 +53,7 @@ END {
opcodes[111] = "ZEND_INIT_FCALL_BY_FUNC";
opcodes[112] = "UNDEF";
}
printf "/* size = %d */\n", max;
printf "/* size = %d */\n", max + 1;
print "static const char *const xc_opcode_names[] = {";
for (i = 0; i <= max; i ++) {
if (i != 0) {

14
mkopcode_spec.awk

@ -9,16 +9,20 @@ BEGIN {
/OPDEF/ {
if (started) {
sub(/".*"/, "")
name = "";
if (match($0, /"([^"]+)"/, m)) {
name = m[1];
}
sub(/"[^"]*"/, "");
if (!match($0, /EXT_([^ |]+).*OP[1S]_([^ |]+).*OP2_([^ |]+).*RES_([^ |)]+).*/, array)) {
print "error" $0
exit
}
comment = "";
if (match($0, /\/\* (\d+) \*\//, comments)) {
comment = comments[1];
id = "";
if (match($0, /\/\* *([0-9]+) *\*\//, comments)) {
id = comments[1];
}
printf "\tOPSPEC(%10s, %10s, %10s, %10s)%s\n", array[1], array[2], array[3], array[4], comment;
printf "\tOPSPEC(%10s, %10s, %10s, %10s) /* %s %-30s */\n", array[1], array[2], array[3], array[4], id, name;
next
}
}

319
opcode_spec_def.h

@ -1,39 +1,39 @@
static const xc_opcode_spec_t xc_opcode_spec[] = {
OPSPEC( UNUSED, UNUSED, UNUSED, UNUSED)
OPSPEC( UNUSED, STD, STD, TMP)
OPSPEC( UNUSED, STD, STD, TMP)
OPSPEC( UNUSED, STD, STD, TMP)
OPSPEC( UNUSED, STD, STD, TMP)
OPSPEC( UNUSED, STD, STD, TMP)
OPSPEC( UNUSED, STD, STD, TMP)
OPSPEC( UNUSED, STD, STD, TMP)
OPSPEC( UNUSED, STD, STD, TMP)
OPSPEC( UNUSED, STD, STD, TMP)
OPSPEC( UNUSED, STD, STD, TMP)
OPSPEC( UNUSED, STD, STD, TMP)
OPSPEC( UNUSED, STD, UNUSED, TMP)
OPSPEC( UNUSED, STD, STD, TMP)
OPSPEC( UNUSED, STD, STD, TMP)
OPSPEC( UNUSED, STD, STD, TMP)
OPSPEC( UNUSED, STD, STD, TMP)
OPSPEC( UNUSED, STD, STD, TMP)
OPSPEC( UNUSED, STD, STD, TMP)
OPSPEC( UNUSED, STD, STD, TMP)
OPSPEC( UNUSED, STD, STD, TMP)
OPSPEC( CAST, STD, UNUSED, TMP)
OPSPEC( UNUSED, STD, UNUSED, TMP)
OPSPEC( UNUSED, UNUSED, UNUSED, UNUSED) /* 0 NOP */
OPSPEC( UNUSED, STD, STD, TMP) /* 1 ADD */
OPSPEC( UNUSED, STD, STD, TMP) /* 2 SUB */
OPSPEC( UNUSED, STD, STD, TMP) /* 3 MUL */
OPSPEC( UNUSED, STD, STD, TMP) /* 4 DIV */
OPSPEC( UNUSED, STD, STD, TMP) /* 5 MOD */
OPSPEC( UNUSED, STD, STD, TMP) /* 6 SL */
OPSPEC( UNUSED, STD, STD, TMP) /* 7 SR */
OPSPEC( UNUSED, STD, STD, TMP) /* 8 CONCAT */
OPSPEC( UNUSED, STD, STD, TMP) /* 9 BW_OR */
OPSPEC( UNUSED, STD, STD, TMP) /* 10 BW_AND */
OPSPEC( UNUSED, STD, STD, TMP) /* 11 BW_XOR */
OPSPEC( UNUSED, STD, UNUSED, TMP) /* 12 BW_NOT */
OPSPEC( UNUSED, STD, STD, TMP) /* 13 BOOL_NOT */
OPSPEC( UNUSED, STD, STD, TMP) /* 14 BOOL_XOR */
OPSPEC( UNUSED, STD, STD, TMP) /* 15 IS_IDENTICAL */
OPSPEC( UNUSED, STD, STD, TMP) /* 16 IS_NOT_IDENTICAL */
OPSPEC( UNUSED, STD, STD, TMP) /* 17 IS_EQUAL */
OPSPEC( UNUSED, STD, STD, TMP) /* 18 IS_NOT_EQUAL */
OPSPEC( UNUSED, STD, STD, TMP) /* 19 IS_SMALLER */
OPSPEC( UNUSED, STD, STD, TMP) /* 20 IS_SMALLER_OR_EQUAL */
OPSPEC( CAST, STD, UNUSED, TMP) /* 21 CAST */
OPSPEC( UNUSED, STD, UNUSED, TMP) /* 22 QM_ASSIGN */
#ifdef ZEND_ENGINE_2
OPSPEC( ASSIGN, STD, STD, VAR)
OPSPEC( ASSIGN, STD, STD, VAR)
OPSPEC( ASSIGN, STD, STD, VAR)
OPSPEC( ASSIGN, STD, STD, VAR)
OPSPEC( ASSIGN, STD, STD, VAR)
OPSPEC( ASSIGN, STD, STD, VAR)
OPSPEC( ASSIGN, STD, STD, VAR)
OPSPEC( ASSIGN, STD, STD, VAR)
OPSPEC( ASSIGN, STD, STD, VAR)
OPSPEC( ASSIGN, STD, STD, VAR)
OPSPEC( ASSIGN, STD, STD, VAR)
OPSPEC( ASSIGN, STD, STD, VAR) /* 23 ASSIGN_ADD */
OPSPEC( ASSIGN, STD, STD, VAR) /* 24 ASSIGN_SUB */
OPSPEC( ASSIGN, STD, STD, VAR) /* 25 ASSIGN_MUL */
OPSPEC( ASSIGN, STD, STD, VAR) /* 26 ASSIGN_DIV */
OPSPEC( ASSIGN, STD, STD, VAR) /* 27 ASSIGN_MOD */
OPSPEC( ASSIGN, STD, STD, VAR) /* 28 ASSIGN_SL */
OPSPEC( ASSIGN, STD, STD, VAR) /* 29 ASSIGN_SR */
OPSPEC( ASSIGN, STD, STD, VAR) /* 30 ASSIGN_CONCAT */
OPSPEC( ASSIGN, STD, STD, VAR) /* 31 ASSIGN_BW_OR */
OPSPEC( ASSIGN, STD, STD, VAR) /* 32 ASSIGN_BW_AND */
OPSPEC( ASSIGN, STD, STD, VAR) /* 33 ASSIGN_BW_XOR */
#else
OPSPEC( UNUSED, VAR, STD, VAR)
OPSPEC( UNUSED, VAR, STD, VAR)
@ -47,72 +47,76 @@ static const xc_opcode_spec_t xc_opcode_spec[] = {
OPSPEC( UNUSED, VAR, STD, VAR)
OPSPEC( UNUSED, VAR, STD, VAR)
#endif
OPSPEC( UNUSED, VAR, UNUSED, VAR)
OPSPEC( UNUSED, VAR, UNUSED, VAR)
OPSPEC( UNUSED, VAR, UNUSED, TMP)
OPSPEC( UNUSED, VAR, UNUSED, TMP)
OPSPEC( UNUSED, VAR, STD, VAR)
OPSPEC( UNUSED, VAR, VAR, VAR)
OPSPEC( UNUSED, STD, UNUSED, UNUSED)
OPSPEC( UNUSED, STD, UNUSED, TMP)
OPSPEC( UNUSED, VAR, UNUSED, VAR) /* 34 PRE_INC */
OPSPEC( UNUSED, VAR, UNUSED, VAR) /* 35 PRE_DEC */
OPSPEC( UNUSED, VAR, UNUSED, TMP) /* 36 POST_INC */
OPSPEC( UNUSED, VAR, UNUSED, TMP) /* 37 POST_DEC */
OPSPEC( UNUSED, VAR, STD, VAR) /* 38 ASSIGN */
OPSPEC( UNUSED, VAR, VAR, VAR) /* 39 ASSIGN_REF */
OPSPEC( UNUSED, STD, UNUSED, UNUSED) /* 40 ECHO */
OPSPEC( UNUSED, STD, UNUSED, TMP) /* 41 PRINT */
#ifdef ZEND_ENGINE_2
OPSPEC( UNUSED, JMPADDR, UNUSED, UNUSED)
OPSPEC( UNUSED, STD, JMPADDR, UNUSED)
OPSPEC( UNUSED, STD, JMPADDR, UNUSED)
OPSPEC( UNUSED, JMPADDR, UNUSED, UNUSED) /* 42 JMP */
OPSPEC( UNUSED, STD, JMPADDR, UNUSED) /* 43 JMPZ */
OPSPEC( UNUSED, STD, JMPADDR, UNUSED) /* 44 JMPNZ */
#else
OPSPEC( UNUSED, OPLINE, UNUSED, UNUSED)
OPSPEC( UNUSED, STD, OPLINE, UNUSED)
OPSPEC( UNUSED, STD, OPLINE, UNUSED)
#endif
OPSPEC( OPLINE, STD, OPLINE, UNUSED)
OPSPEC( OPLINE, STD, OPLINE, UNUSED) /* 45 JMPZNZ */
#ifdef ZEND_ENGINE_2
OPSPEC( UNUSED, STD, JMPADDR, TMP)
OPSPEC( UNUSED, STD, JMPADDR, TMP)
OPSPEC( UNUSED, STD, JMPADDR, TMP) /* 46 JMPZ_EX */
OPSPEC( UNUSED, STD, JMPADDR, TMP) /* 47 JMPNZ_EX */
#else
OPSPEC( UNUSED, STD, OPLINE, TMP)
OPSPEC( UNUSED, STD, OPLINE, TMP)
#endif
OPSPEC( UNUSED, STD, STD, TMP)
OPSPEC( BIT, STD, UNUSED, UNUSED)
OPSPEC( UNUSED, BRK, STD, UNUSED)
OPSPEC( UNUSED, CONT, STD, UNUSED)
OPSPEC( UNUSED, STD, UNUSED, TMP)
OPSPEC( UNUSED, UNUSED, UNUSED, TMP)
OPSPEC( UNUSED, STD, STD, TMP)
OPSPEC( UNUSED, STD, STD, TMP)
OPSPEC( UNUSED, STD, STD, TMP)
OPSPEC( UNUSED, UNUSED, UNUSED, TMP)
OPSPEC( UNUSED, TMP, UNUSED, UNUSED)
OPSPEC(INIT_FCALL, STD, STD, UNUSED)
OPSPEC( UNUSED, STD, STD, TMP) /* 48 CASE */
OPSPEC( BIT, STD, UNUSED, UNUSED) /* 49 SWITCH_FREE */
OPSPEC( UNUSED, BRK, STD, UNUSED) /* 50 BRK */
OPSPEC( UNUSED, CONT, STD, UNUSED) /* 51 CONT */
OPSPEC( UNUSED, STD, UNUSED, TMP) /* 52 BOOL */
OPSPEC( UNUSED, UNUSED, UNUSED, TMP) /* 53 INIT_STRING */
OPSPEC( UNUSED, STD, STD, TMP) /* 54 ADD_CHAR */
OPSPEC( UNUSED, STD, STD, TMP) /* 55 ADD_STRING */
OPSPEC( UNUSED, STD, STD, TMP) /* 56 ADD_VAR */
OPSPEC( UNUSED, UNUSED, UNUSED, TMP) /* 57 BEGIN_SILENCE */
OPSPEC( UNUSED, TMP, UNUSED, UNUSED) /* 58 END_SILENCE */
OPSPEC(INIT_FCALL, STD, STD, UNUSED) /* 59 INIT_FCALL_BY_NAME */
#ifdef ZEND_ENGINE_2
OPSPEC( FCALL, STD, OPLINE, VAR)
OPSPEC( FCALL, STD, OPLINE, VAR)
OPSPEC( FCALL, STD, OPLINE, VAR) /* 60 DO_FCALL */
OPSPEC( FCALL, STD, OPLINE, VAR) /* 61 DO_FCALL_BY_NAME */
#else
OPSPEC( FCALL, STD, UNUSED, VAR)
OPSPEC( FCALL, STD, UNUSED, VAR)
#endif
OPSPEC( UNUSED, STD, UNUSED, UNUSED)
OPSPEC( UNUSED, ARG, UNUSED, VAR)
OPSPEC( UNUSED, ARG, STD, VAR)
OPSPEC( SEND, STD, ARG, UNUSED)
OPSPEC( SEND, VAR, ARG, UNUSED)
OPSPEC( SEND, VAR, ARG, UNUSED)
OPSPEC( UNUSED, STD, UNUSED, UNUSED) /* 62 RETURN */
OPSPEC( UNUSED, ARG, UNUSED, VAR) /* 63 RECV */
OPSPEC( UNUSED, ARG, STD, VAR) /* 64 RECV_INIT */
OPSPEC( SEND, STD, ARG, UNUSED) /* 65 SEND_VAL */
OPSPEC( SEND, VAR, ARG, UNUSED) /* 66 SEND_VAR */
OPSPEC( SEND, VAR, ARG, UNUSED) /* 67 SEND_REF */
#ifdef ZEND_ENGINE_2
OPSPEC( UNUSED, CLASS, UNUSED, VAR)
OPSPEC( UNUSED, CLASS, UNUSED, VAR) /* 68 NEW */
#else
OPSPEC( UNUSED, STD, UNUSED, VAR)
#endif
OPSPEC( UNUSED, STD, OPLINE, UNUSED)
OPSPEC( UNUSED, TMP, UNUSED, UNUSED)
OPSPEC( BIT, STD, STD, TMP)
OPSPEC( BIT, STD, STD, TMP)
OPSPEC( UNUSED, STD, INCLUDE, VAR)
#ifdef ZEND_ENGINE_2_3
OPSPEC( STD, STD, STD, STD) /* 69 INIT_NS_FCALL_BY_NAME */
#else
OPSPEC( UNUSED, STD, OPLINE, UNUSED) /* 69 JMP_NO_CTOR */
#endif
OPSPEC( UNUSED, TMP, UNUSED, UNUSED) /* 70 FREE */
OPSPEC( BIT, STD, STD, TMP) /* 71 INIT_ARRAY */
OPSPEC( BIT, STD, STD, TMP) /* 72 ADD_ARRAY_ELEMENT */
OPSPEC( UNUSED, STD, INCLUDE, VAR) /* 73 INCLUDE_OR_EVAL */
#ifdef ZEND_ENGINE_2_1
/* php 5.1 and up */
OPSPEC( UNUSED, STD, FETCH, UNUSED)
OPSPEC( STD, STD, STD, UNUSED)
OPSPEC( STD, STD, STD, UNUSED)
OPSPEC( BIT, STD, OPLINE, VAR)
OPSPEC( UNUSED, STD, FETCH, UNUSED) /* 74 UNSET_VAR */
OPSPEC( STD, STD, STD, UNUSED) /* 75 UNSET_DIM */
OPSPEC( STD, STD, STD, UNUSED) /* 76 UNSET_OBJ */
OPSPEC( BIT, STD, OPLINE, VAR) /* 77 FE_RESET */
#else
/* <= php 5.0 */
/* though there is no ISSET_ISEMPTY in php 5.0 it's better to leave it here i guess */
@ -121,86 +125,93 @@ static const xc_opcode_spec_t xc_opcode_spec[] = {
OPSPEC( UNUSED, VAR, ISSET, TMP)
OPSPEC( BIT, STD, UNUSED, VAR)
#endif
OPSPEC( FE, STD, OPLINE, TMP)
OPSPEC( UNUSED, STD, UNUSED, UNUSED)
OPSPEC( UNUSED, STD, FETCH, VAR)
OPSPEC( FETCH, VAR, STD, VAR)
OPSPEC( UNUSED, VAR_2, STD, VAR)
OPSPEC( UNUSED, STD, FETCH, VAR)
OPSPEC( UNUSED, VAR, STD, VAR)
OPSPEC( UNUSED, VAR_2, STD, VAR)
OPSPEC( UNUSED, STD, FETCH, VAR)
OPSPEC( UNUSED, VAR, STD, VAR)
OPSPEC( UNUSED, VAR_2, STD, VAR)
OPSPEC( UNUSED, STD, FETCH, VAR)
OPSPEC( UNUSED, VAR, STD, VAR)
OPSPEC( UNUSED, VAR_2, STD, VAR)
OPSPEC( ARG, STD, FETCH, VAR)
OPSPEC( ARG, VAR, STD, VAR)
OPSPEC( ARG, VAR_2, STD, VAR)
OPSPEC( UNUSED, STD, FETCH, VAR)
OPSPEC( UNUSED, VAR, STD, VAR)
OPSPEC( UNUSED, VAR_2, STD, VAR)
OPSPEC( UNUSED, STD, STD, VAR)
OPSPEC( FE, STD, OPLINE, TMP) /* 78 FE_FETCH */
OPSPEC( UNUSED, STD, UNUSED, UNUSED) /* 79 EXIT */
OPSPEC( UNUSED, STD, FETCH, VAR) /* 80 FETCH_R */
OPSPEC( FETCH, VAR, STD, VAR) /* 81 FETCH_DIM_R */
OPSPEC( UNUSED, VAR_2, STD, VAR) /* 82 FETCH_OBJ_R */
OPSPEC( UNUSED, STD, FETCH, VAR) /* 83 FETCH_W */
OPSPEC( UNUSED, VAR, STD, VAR) /* 84 FETCH_DIM_W */
OPSPEC( UNUSED, VAR_2, STD, VAR) /* 85 FETCH_OBJ_W */
OPSPEC( UNUSED, STD, FETCH, VAR) /* 86 FETCH_RW */
OPSPEC( UNUSED, VAR, STD, VAR) /* 87 FETCH_DIM_RW */
OPSPEC( UNUSED, VAR_2, STD, VAR) /* 88 FETCH_OBJ_RW */
OPSPEC( UNUSED, STD, FETCH, VAR) /* 89 FETCH_IS */
OPSPEC( UNUSED, VAR, STD, VAR) /* 90 FETCH_DIM_IS */
OPSPEC( UNUSED, VAR_2, STD, VAR) /* 91 FETCH_OBJ_IS */
OPSPEC( ARG, STD, FETCH, VAR) /* 92 FETCH_FUNC_ARG */
OPSPEC( ARG, VAR, STD, VAR) /* 93 FETCH_DIM_FUNC_ARG */
OPSPEC( ARG, VAR_2, STD, VAR) /* 94 FETCH_OBJ_FUNC_ARG */
OPSPEC( UNUSED, STD, FETCH, VAR) /* 95 FETCH_UNSET */
OPSPEC( UNUSED, VAR, STD, VAR) /* 96 FETCH_DIM_UNSET */
OPSPEC( UNUSED, VAR_2, STD, VAR) /* 97 FETCH_OBJ_UNSET */
OPSPEC( UNUSED, STD, STD, VAR) /* 98 FETCH_DIM_TMP_VAR */
#ifdef ZEND_ENGINE_2
OPSPEC( UNUSED, UCLASS, STD, TMP)
OPSPEC( UNUSED, UCLASS, STD, TMP) /* 99 FETCH_CONSTANT */
#else
OPSPEC( UNUSED, STD, UNUSED, TMP)
OPSPEC( UNUSED, STD, UNUSED, TMP) /* 99 FETCH_CONSTANT */
#endif
OPSPEC( DECLARE, STD, STD, UNUSED)
OPSPEC( STD, STD, STD, STD)
OPSPEC( STD, STD, STD, STD)
OPSPEC( STD, STD, STD, STD)
OPSPEC( UNUSED, UNUSED, UNUSED, UNUSED)
OPSPEC( UNUSED, STD, UNUSED, UNUSED)
OPSPEC(SEND_NOREF, VAR, ARG, UNUSED)
OPSPEC( DECLARE, STD, STD, UNUSED) /* 100 DECLARE_FUNCTION_OR_CLASS */
OPSPEC( STD, STD, STD, STD) /* 101 EXT_STMT */
OPSPEC( STD, STD, STD, STD) /* 102 EXT_FCALL_BEGIN */
OPSPEC( STD, STD, STD, STD) /* 103 EXT_FCALL_END */
OPSPEC( UNUSED, UNUSED, UNUSED, UNUSED) /* 104 EXT_NOP */
OPSPEC( UNUSED, STD, UNUSED, UNUSED) /* 105 TICKS */
OPSPEC(SEND_NOREF, VAR, ARG, UNUSED) /* 106 SEND_VAR_NO_REF */
#ifdef ZEND_ENGINE_2
OPSPEC( OPLINE, CLASS, STD, UNUSED)
OPSPEC( UNUSED, STD, OPLINE, UNUSED)
OPSPEC( FCLASS, STD, STD, CLASS)
OPSPEC( UNUSED, STD, UNUSED, VAR)
OPSPEC( UNUSED, STD, UNUSED, UNUSED)
OPSPEC( UNUSED, STD, STD, VAR)
OPSPEC( UNUSED, UCLASS, STD, UNUSED)
OPSPEC( ISSET, STD, FETCH, TMP)
OPSPEC( ISSET, STD, STD, TMP)
OPSPEC( UNUSED, CLASS, STD, UNUSED)
OPSPEC( UNUSED, CLASS, STD, UNUSED)
OPSPEC( UNUSED, CLASS, STD, UNUSED)
OPSPEC( STD, STD, STD, STD)
OPSPEC( STD, STD, STD, STD)
OPSPEC( UNUSED, STD, STD, VAR)
OPSPEC( UNUSED, STD, STD, VAR)
OPSPEC( UNUSED, STD, STD, VAR)
OPSPEC( UNUSED, STD, STD, VAR)
OPSPEC( UNUSED, STD, STD, VAR)
OPSPEC( UNUSED, STD, STD, VAR)
OPSPEC( UNUSED, STD, STD, VAR)
OPSPEC( UNUSED, STD, STD, VAR)
OPSPEC( UNUSED, STD, STD, VAR)
OPSPEC( UNUSED, STD, STD, VAR)
OPSPEC( UNUSED, STD, STD, VAR)
OPSPEC( UNUSED, STD, STD, VAR)
OPSPEC( UNUSED, STD, STD, VAR)
OPSPEC( UNUSED, STD, STD, TMP)
OPSPEC( UNUSED, STD, STD, TMP)
OPSPEC( UNUSED, STD, STD, VAR)
OPSPEC( UNUSED, STD, STD, STD)
OPSPEC( UNUSED, STD, CLASS, TMP)
OPSPEC( UNUSED, STD, STD, CLASS)
OPSPEC( CLASS, STD, STD, CLASS)
OPSPEC( UNUSED, STD, STD, UNUSED)
OPSPEC( UNUSED, UNUSED, UNUSED, UNUSED)
OPSPEC( UNUSED, STD, UNUSED, UNUSED)
OPSPEC( IFACE, CLASS, CLASS, UNUSED)
OPSPEC( UNUSED, CLASS, STD, UNUSED)
OPSPEC( UNUSED, CLASS, UNUSED, UNUSED)
OPSPEC( UNUSED, STD, STD, VAR)
OPSPEC( ISSET, STD, STD, TMP)
OPSPEC( STD, UNUSED, UNUSED, STD)
# ifdef ZEND_ENGINE_2_1
OPSPEC( STD, UNUSED, UNUSED, STD)
# endif
OPSPEC( OPLINE, CLASS, STD, UNUSED) /* 107 CATCH */
OPSPEC( UNUSED, STD, OPLINE, UNUSED) /* 108 THROW */
OPSPEC( FCLASS, STD, STD, CLASS) /* 109 FETCH_CLASS */
OPSPEC( UNUSED, STD, UNUSED, VAR) /* 110 CLONE */
OPSPEC( UNUSED, STD, UNUSED, UNUSED) /* 111 INIT_CTOR_CALL */
OPSPEC( UNUSED, STD, STD, VAR) /* 112 INIT_METHOD_CALL */
OPSPEC( UNUSED, UCLASS, STD, UNUSED) /* 113 INIT_STATIC_METHOD_CALL */
OPSPEC( ISSET, STD, FETCH, TMP) /* 114 ISSET_ISEMPTY_VAR */
OPSPEC( ISSET, STD, STD, TMP) /* 115 ISSET_ISEMPTY_DIM_OBJ */
OPSPEC( UNUSED, CLASS, STD, UNUSED) /* 116 IMPORT_FUNCTION */
OPSPEC( UNUSED, CLASS, STD, UNUSED) /* 117 IMPORT_CLASS */
OPSPEC( UNUSED, CLASS, STD, UNUSED) /* 118 IMPORT_CONST */
OPSPEC( STD, STD, STD, STD) /* 119 OP_119 */
OPSPEC( STD, STD, STD, STD) /* 120 OP_120 */
OPSPEC( UNUSED, STD, STD, VAR) /* 121 ASSIGN_ADD_OBJ */
OPSPEC( UNUSED, STD, STD, VAR) /* 122 ASSIGN_SUB_OBJ */
OPSPEC( UNUSED, STD, STD, VAR) /* 123 ASSIGN_MUL_OBJ */
OPSPEC( UNUSED, STD, STD, VAR) /* 124 ASSIGN_DIV_OBJ */
OPSPEC( UNUSED, STD, STD, VAR) /* 125 ASSIGN_MOD_OBJ */
OPSPEC( UNUSED, STD, STD, VAR) /* 126 ASSIGN_SL_OBJ */
OPSPEC( UNUSED, STD, STD, VAR) /* 127 ASSIGN_SR_OBJ */
OPSPEC( UNUSED, STD, STD, VAR) /* 128 ASSIGN_CONCAT_OBJ */
OPSPEC( UNUSED, STD, STD, VAR) /* 129 ASSIGN_BW_OR_OBJ */
OPSPEC( UNUSED, STD, STD, VAR) /* 130 ASSIGN_BW_AND_OBJ */
OPSPEC( UNUSED, STD, STD, VAR) /* 131 ASSIGN_BW_XOR_OBJ */
OPSPEC( UNUSED, STD, STD, VAR) /* 132 PRE_INC_OBJ */
OPSPEC( UNUSED, STD, STD, VAR) /* 133 PRE_DEC_OBJ */
OPSPEC( UNUSED, STD, STD, TMP) /* 134 POST_INC_OBJ */
OPSPEC( UNUSED, STD, STD, TMP) /* 135 POST_DEC_OBJ */
OPSPEC( UNUSED, STD, STD, VAR) /* 136 ASSIGN_OBJ */
OPSPEC( UNUSED, STD, STD, STD) /* 137 OP_DATA */
OPSPEC( UNUSED, STD, CLASS, TMP) /* 138 INSTANCEOF */
OPSPEC( UNUSED, STD, STD, CLASS) /* 139 DECLARE_CLASS */
OPSPEC( CLASS, STD, STD, CLASS) /* 140 DECLARE_INHERITED_CLASS */
OPSPEC( UNUSED, STD, STD, UNUSED) /* 141 DECLARE_FUNCTION */
OPSPEC( UNUSED, UNUSED, UNUSED, UNUSED) /* 142 RAISE_ABSTRACT_ERROR */
#ifdef ZEND_ENGINE_2_3
OPSPEC( DECLARE, STD, STD, UNUSED) /* 143 DECLARE_CONST */
#else
OPSPEC( UNUSED, STD, UNUSED, UNUSED) /* 143 START_NAMESPACE */
#endif
OPSPEC( IFACE, CLASS, CLASS, UNUSED) /* 144 ADD_INTERFACE */
OPSPEC( UNUSED, CLASS, STD, UNUSED) /* 145 VERIFY_INSTANCEOF */
OPSPEC( UNUSED, CLASS, UNUSED, UNUSED) /* 146 VERIFY_ABSTRACT_CLASS */
OPSPEC( UNUSED, STD, STD, VAR) /* 147 ASSIGN_DIM */
OPSPEC( ISSET, STD, STD, TMP) /* 148 ISSET_ISEMPTY_PROP_OBJ */
OPSPEC( STD, UNUSED, UNUSED, STD) /* 149 HANDLE_EXCEPTION */
# ifdef ZEND_ENGINE_2_3
OPSPEC( STD, UNUSED, UNUSED, STD) /* 150 ZEND_USER_OPCODE */
OPSPEC( UNUSED, UNUSED, UNUSED, UNUSED) /* 151 UNDEF */
OPSPEC( UNUSED, STD, JMPADDR, UNUSED) /* 152 JMP_SET */
OPSPEC( UNUSED, STD, STD, UNUSED) /* 153 DECLARE_LAMBDA_FUNCTION */
# endif
#endif
};

5
prepare.devel

@ -27,7 +27,6 @@ make_const_string() {
make_const_string_opcodes_php4.x.h
make_const_string_opcodes_php5.0.h
make_const_string_opcodes_php5.1.h
make_const_string_opcodes_php5.3.h
make_const_string_opcodes_php6.x.h
}
@ -48,10 +47,6 @@ make_const_string_opcodes_php5.1.h() {
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"
}
make_const_string_opcodes_php5.3.h() {
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"
}
make_const_string_opcodes_php6.x.h() {
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"
}

4
processor/main.m4

@ -110,7 +110,11 @@ define(`PROC_CLASS_ENTRY_P_EX', `
if ($2) {
IFSTORE(`$1 = (zend_class_entry *) xc_get_class_num(processor, $2);')
IFRESTORE(`$1 = xc_get_class(processor, (zend_ulong) $2);')
#ifdef IS_UNICODE
IFDASM(`add_assoc_unicodel_ex(dst, ZEND_STRS("$3"), ZSTR_U($2->name), $2->name_length, 1);')
#else
IFDASM(`add_assoc_stringl_ex(dst, ZEND_STRS("$3"), $2->name, $2->name_length, 1);')
#endif
}
else {
COPYNULL_EX(`$1', `$3')

6
processor/processor.m4

@ -617,9 +617,13 @@ DEF_STRUCT_P_FUNC(`zend_op_array', , `dnl {{{
COPY(start_op)
DISPATCH(int, backpatch_count)
#ifdef ZEND_ENGINE_2_3
DISPATCH(zend_uint, this_var)
#endif
DISPATCH(zend_bool, done_pass_two)
#ifdef ZEND_ENGINE_2
/* 5.0 <= ver < 5.3 */
#if defined(ZEND_ENGINE_2) && !defined(ZEND_ENGINE_2_3)
DISPATCH(zend_bool, uses_this)
#endif

20
xcache.c

@ -225,7 +225,7 @@ static xc_entry_t *xc_entry_find_dmz(xc_entry_t *xce TSRMLS_DC) /* {{{ */
xc_entry_t *p;
for (p = xce->cache->entries[xce->hvalue]; p; p = p->next) {
if (xc_entry_equal_dmz(xce, p)) {
if (p->type == XC_TYPE_VAR || /* PHP */ p->data.php->mtime == xce->data.php->mtime) {
if (p->type == XC_TYPE_VAR || /* PHP */ p->data.php->mtime == xce->data.php->mtime && p->data.php->sourcesize == xce->data.php->sourcesize) {
p->hits ++;
p->atime = XG(request_time);
return p;
@ -2802,24 +2802,24 @@ static PHP_MINIT_FUNCTION(xcache)
#endif
REGISTER_INI_ENTRIES();
xc_config_long(&xc_php_size, "xcache.size", "0");
xc_config_hash(&xc_php_hcache, "xcache.count", "1");
xc_config_hash(&xc_php_hentry, "xcache.slots", "8K");
xc_config_long(&xc_var_size, "xcache.var_size", "0");
xc_config_hash(&xc_var_hcache, "xcache.var_count", "1");
xc_config_hash(&xc_var_hentry, "xcache.var_slots", "8K");
if (strcmp(sapi_module.name, "cli") == 0) {
if ((env = getenv("XCACHE_TEST")) != NULL) {
zend_alter_ini_entry("xcache.test", sizeof("xcache.test"), env, strlen(env) + 1, PHP_INI_SYSTEM, PHP_INI_STAGE_STARTUP);
}
if (!xc_test) {
/* disable cache for cli except for test */
/* disable cache for cli except for testing */
xc_php_size = xc_var_size = 0;
}
}
xc_config_long(&xc_php_size, "xcache.size", "0");
xc_config_hash(&xc_php_hcache, "xcache.count", "1");
xc_config_hash(&xc_php_hentry, "xcache.slots", "8K");
xc_config_long(&xc_var_size, "xcache.var_size", "0");
xc_config_hash(&xc_var_hcache, "xcache.var_count", "1");
xc_config_hash(&xc_var_hentry, "xcache.var_slots", "8K");
if (xc_php_size <= 0) {
xc_php_size = xc_php_hcache.size = 0;
}

6
xcache.h

@ -51,13 +51,13 @@
# define ALLOCA_FLAG(x)
#endif
#ifndef Z_SET_ISREF
# define Z_SET_ISREF(z) (z).is_ref = 1;
# define Z_SET_ISREF(z) (z).is_ref = 1
#endif
#ifndef Z_UNSET_ISREF
# define Z_UNSET_ISREF(z) (z).is_ref = 0;
# define Z_UNSET_ISREF(z) (z).is_ref = 0
#endif
#ifndef Z_SET_REFCOUNT
# define Z_SET_REFCOUNT(z, rc) (z).refcount = rc;
# define Z_SET_REFCOUNT(z, rc) (z).refcount = rc
#endif
#ifndef IS_CONSTANT_TYPE_MASK
# define IS_CONSTANT_TYPE_MASK 0xf

Loading…
Cancel
Save