Index: /trunk/devel/prepare.mak
===================================================================
--- /trunk/devel/prepare.mak	(revision 1197)
+++ /trunk/devel/prepare.mak	(revision 1213)
@@ -21,6 +21,8 @@
 	xcache/xc_const_string_opcodes_php5.0.h \
 	xcache/xc_const_string_opcodes_php5.1.h \
+	xcache/xc_const_string_opcodes_php5.2.h \
 	xcache/xc_const_string_opcodes_php5.3.h \
 	xcache/xc_const_string_opcodes_php5.4.h \
+	xcache/xc_const_string_opcodes_php5.5.h \
 	xcache/xc_const_string_opcodes_php6.x.h
 
@@ -61,4 +63,13 @@
 endif
 
+ifeq (${PHP5_2_DIR},)
+xcache/xc_const_string_opcodes_php5.2.h: dummy
+	@echo "Skipped $@: PHP_5_2_DIR not set"
+else
+xcache/xc_const_string_opcodes_php5.2.h: ${PHP5_2_DIR}/Zend/zend_vm_def.h
+	$(AWK) -f ./devel/gen_const_string_opcodes.awk < "$<" > "$@.tmp"
+	mv "$@.tmp" "$@"
+endif
+
 ifeq (${PHP5_3_DIR},)
 xcache/xc_const_string_opcodes_php5.3.h: dummy
@@ -75,4 +86,13 @@
 else
 xcache/xc_const_string_opcodes_php5.4.h: ${PHP5_4_DIR}/Zend/zend_vm_def.h
+	$(AWK) -f ./devel/gen_const_string_opcodes.awk < "$<" > "$@.tmp"
+	mv "$@.tmp" "$@"
+endif
+
+ifeq (${PHP5_5_DIR},)
+xcache/xc_const_string_opcodes_php5.5.h: dummy
+	@echo "Skipped $@: PHP_5_5_DIR not set"
+else
+xcache/xc_const_string_opcodes_php5.5.h: ${PHP5_5_DIR}/Zend/zend_vm_def.h
 	$(AWK) -f ./devel/gen_const_string_opcodes.awk < "$<" > "$@.tmp"
 	mv "$@.tmp" "$@"
Index: /trunk/mod_optimizer/xc_optimizer.c
===================================================================
--- /trunk/mod_optimizer/xc_optimizer.c	(revision 1208)
+++ /trunk/mod_optimizer/xc_optimizer.c	(revision 1213)
@@ -165,8 +165,20 @@
 #endif
 	case ZEND_RETURN:
+#ifdef ZEND_FAST_RET
+	case ZEND_FAST_RET:
+#endif
+#ifdef ZEND_GENERATOR_RETURN
+	case ZEND_GENERATOR_RETURN:
+#endif
 	case ZEND_EXIT:
 		return SUCCESS; /* no fall */
 
+#ifdef ZEND_GOTO
+	case ZEND_GOTO:
+#endif
 	case ZEND_JMP:
+#ifdef ZEND_FAST_CALL
+	case ZEND_FAST_CALL:
+#endif
 		fi->jmpout_op1 = Z_OP(opline->op1).opline_num;
 		return SUCCESS; /* no fall */
Index: /trunk/ChangeLog
===================================================================
--- /trunk/ChangeLog	(revision 1208)
+++ /trunk/ChangeLog	(revision 1213)
@@ -1,2 +1,7 @@
+3.1.0 2012-??-??
+ChangeLog
+========
+ * adds support for PHP_5_5
+
 3.0.1 2012-??-??
 ChangeLog
Index: /trunk/xcache/xc_opcode_spec_def.h
===================================================================
--- /trunk/xcache/xc_opcode_spec_def.h	(revision 982)
+++ /trunk/xcache/xc_opcode_spec_def.h	(revision 1213)
@@ -238,5 +238,6 @@
 	OPSPEC(    UNUSED,        STD,    JMPADDR,        TMP) /* 152 JMP_SET                        */
 	OPSPEC(    UNUSED,        STD,        STD,        TMP) /* 153 DECLARE_LAMBDA_FUNCTION        */
-#  ifdef ZEND_ENGINE_2_4
+# endif
+# ifdef ZEND_ENGINE_2_4
 	OPSPEC(    UNUSED,     UNUSED,     UNUSED,     UNUSED) /* 154 ADD_TRAIT                      */
 	OPSPEC(    UNUSED,     UNUSED,     UNUSED,     UNUSED) /* 155 BIND_TRAITS                    */
@@ -244,9 +245,11 @@
 	OPSPEC(    UNUSED,     UNUSED,     UNUSED,     UNUSED) /* 157 QM_ASSIGN_VAR                  */
 	OPSPEC(    UNUSED,     UNUSED,     UNUSED,     UNUSED) /* 158 JMP_SET_VAR                    */
-#  endif
-# else
-	OPSPEC(    UNUSED,     UNUSED,     UNUSED,     UNUSED) /* 151 UNDEF                          */
-	OPSPEC(    UNUSED,     UNUSED,     UNUSED,     UNUSED) /* 152 UNDEF                          */
-	OPSPEC(    UNUSED,     UNUSED,     UNUSED,     UNUSED) /* 153 UNDEF                          */
+# endif
+# ifdef ZEND_ENGINE_2_5
+	OPSPEC(    UNUSED,     UNUSED,     UNUSED,     UNUSED) /* 159 DISCARD_EXCEPTION              */
+	OPSPEC(    UNUSED,        STD,        STD,     UNUSED) /* 160 YIELD                          */
+	OPSPEC(    UNUSED,        STD,     UNUSED,     UNUSED) /* 161 GENERATOR_RETURN               */
+	OPSPEC(    UNUSED,    JMPADDR,     UNUSED,     UNUSED) /* 162 FAST_CALL                      */
+	OPSPEC(    UNUSED,     UNUSED,     UNUSED,     UNUSED) /* 163 FAST_RET                       */
 # endif
 #else
Index: /trunk/xcache/xc_compatibility.h
===================================================================
--- /trunk/xcache/xc_compatibility.h	(revision 1151)
+++ /trunk/xcache/xc_compatibility.h	(revision 1213)
@@ -11,5 +11,8 @@
  */
 
-#if !defined(ZEND_ENGINE_2_4) && (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 4 || PHP_MAJOR_VERSION > 5)
+#if !defined(ZEND_ENGINE_2_5) && (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 5 || PHP_MAJOR_VERSION > 6)
+#	define ZEND_ENGINE_2_5
+#endif
+#if !defined(ZEND_ENGINE_2_4) && (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION == 4 || defined(ZEND_ENGINE_2_5))
 #	define ZEND_ENGINE_2_4
 #endif
Index: /trunk/xcache/xc_const_string_opcodes_php5.5.h
===================================================================
--- /trunk/xcache/xc_const_string_opcodes_php5.5.h	(revision 1213)
+++ /trunk/xcache/xc_const_string_opcodes_php5.5.h	(revision 1213)
@@ -0,0 +1,167 @@
+/* size = 164 */
+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 */	"GOTO",
+/* 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 */	"RETURN_BY_REF",
+/* 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 */	"DECLARE_INHERITED_CLASS_DELAYED",
+/* 146 */	"VERIFY_ABSTRACT_CLASS",
+/* 147 */	"ASSIGN_DIM",
+/* 148 */	"ISSET_ISEMPTY_PROP_OBJ",
+/* 149 */	"HANDLE_EXCEPTION",
+/* 150 */	"USER_OPCODE",
+/* 151 */	"UNDEF",
+/* 152 */	"JMP_SET",
+/* 153 */	"DECLARE_LAMBDA_FUNCTION",
+/* 154 */	"ADD_TRAIT",
+/* 155 */	"BIND_TRAITS",
+/* 156 */	"SEPARATE",
+/* 157 */	"QM_ASSIGN_VAR",
+/* 158 */	"JMP_SET_VAR",
+/* 159 */	"DISCARD_EXCEPTION",
+/* 160 */	"YIELD",
+/* 161 */	"GENERATOR_RETURN",
+/* 162 */	"FAST_CALL",
+/* 163 */	"FAST_RET"
+};
Index: /trunk/xcache/xc_utils.c
===================================================================
--- /trunk/xcache/xc_utils.c	(revision 1208)
+++ /trunk/xcache/xc_utils.c	(revision 1213)
@@ -152,4 +152,7 @@
 #endif
 			case ZEND_JMP:
+#ifdef ZEND_FAST_CALL
+			case ZEND_FAST_CALL:
+#endif
 				assert(Z_OP(opline->op1).jmp_addr >= op_array->opcodes && (zend_uint) (Z_OP(opline->op1).jmp_addr - op_array->opcodes) < op_array->last);
 				Z_OP(opline->op1).opline_num = Z_OP(opline->op1).jmp_addr - op_array->opcodes;
@@ -239,4 +242,7 @@
 #endif
 			case ZEND_JMP:
+#ifdef ZEND_FAST_CALL
+			case ZEND_FAST_CALL:
+#endif
 				assert(Z_OP(opline->op1).opline_num < op_array->last);
 				Z_OP(opline->op1).jmp_addr = op_array->opcodes + Z_OP(opline->op1).opline_num;
@@ -347,4 +353,7 @@
 #endif
 			case ZEND_JMP:
+#ifdef ZEND_FAST_CALL
+			case ZEND_FAST_CALL:
+#endif
 				next = begin + Z_OP(opline->op1).opline_num;
 				break;
Index: /trunk/xcache/xc_const_string.c
===================================================================
--- /trunk/xcache/xc_const_string.c	(revision 1095)
+++ /trunk/xcache/xc_const_string.c	(revision 1213)
@@ -64,4 +64,6 @@
 #if PHP_MAJOR_VERSION >= 6
 #	include "xc_const_string_opcodes_php6.x.h"
+#elif defined(ZEND_ENGINE_2_5)
+#	include "xc_const_string_opcodes_php5.5.h"
 #elif defined(ZEND_ENGINE_2_4)
 #	include "xc_const_string_opcodes_php5.4.h"
Index: /trunk/NEWS
===================================================================
--- /trunk/NEWS	(revision 1208)
+++ /trunk/NEWS	(revision 1213)
@@ -1,4 +1,7 @@
+3.1.1 2012-??-??
+========
+ * adds support for PHP_5_5
+
 3.0.1 2012-??-??
-ChangeLog
 ========
  * bug fixes
Index: /trunk/processor/processor.m4
===================================================================
--- /trunk/processor/processor.m4	(revision 1201)
+++ /trunk/processor/processor.m4	(revision 1213)
@@ -49,4 +49,8 @@
 	PROCESS(zend_uint, try_op)
 	PROCESS(zend_uint, catch_op)
+#ifdef ZEND_ENGINE_2_5
+	PROCESS(zend_uint, finally_op)
+	PROCESS(zend_uint, finally_end)
+#endif
 ')
 dnl }}}
@@ -654,4 +658,7 @@
 #endif
 			case ZEND_JMP:
+#ifdef ZEND_FAST_CALL
+			case ZEND_FAST_CALL:
+#endif
 #ifdef ZEND_ENGINE_2
 				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);
@@ -762,4 +769,7 @@
 #endif
 					case ZEND_JMP:
+#ifdef ZEND_FAST_CALL
+					case ZEND_FAST_CALL:
+#endif
 #ifdef ZEND_ENGINE_2
 						Z_OP(opline->op1).jmp_addr = &dst->opcodes[Z_OP(opline->op1).jmp_addr - src->opcodes];
@@ -874,4 +884,9 @@
 	PROCESS(zend_uint, T)
 
+#ifdef ZEND_ENGINE_2_4
+	PROCESS(zend_uint, nested_calls)
+	PROCESS(zend_uint, used_stack)
+#endif
+
 	STRUCT_ARRAY(last_brk_cont_t, last_brk_cont, zend_brk_cont_element, brk_cont_array)
 	PROCESS(last_brk_cont_t, last_brk_cont)
@@ -886,4 +901,7 @@
 	STRUCT_ARRAY(int, last_try_catch, zend_try_catch_element, try_catch_array)
 	PROCESS(int, last_try_catch)
+#endif
+#ifdef ZEND_ENGINE_2_5
+	PROCESS(zend_bool, has_finally_block)
 #endif
 
