Index: /branches/1.3/const_string.c
===================================================================
--- /branches/1.3/const_string.c	(revision 616)
+++ /branches/1.3/const_string.c	(revision 617)
@@ -89,15 +89,11 @@
 /* {{{ xc_get_opcode */
 #if PHP_MAJOR_VERSION >= 6
-#	include     "const_string_opcodes_php6.x.h"
-#else
-#	ifdef ZEND_ENGINE_2_1
-#		include     "const_string_opcodes_php5.1.h"
-#	else
-#		ifdef ZEND_ENGINE_2
-#			include "const_string_opcodes_php5.0.h"
-#		else
-#			include "const_string_opcodes_php4.x.h"
-#		endif
-#	endif
+#	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)
+#	include "const_string_opcodes_php5.0.h"
 #endif
 
Index: /branches/1.3/const_string_opcodes_php5.3.h
===================================================================
--- /branches/1.3/const_string_opcodes_php5.3.h	(revision 617)
+++ /branches/1.3/const_string_opcodes_php5.3.h	(revision 617)
@@ -0,0 +1,156 @@
+/* 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"
+};
Index: /branches/1.3/coverager.c
===================================================================
--- /branches/1.3/coverager.c	(revision 616)
+++ /branches/1.3/coverager.c	(revision 617)
@@ -36,7 +36,8 @@
 	char *fullpath;
 	struct stat st;
+	ALLOCA_FLAG(use_heap)
 
 	TRACE("mkdirs %s %d %s %d", root, rootlen, path, pathlen);
-	fullpath = do_alloca(rootlen + pathlen + 1);
+	fullpath = my_do_alloca(rootlen + pathlen + 1, use_heap);
 	memcpy(fullpath, root, rootlen);
 	memcpy(fullpath + rootlen, path, pathlen);
@@ -59,5 +60,5 @@
 #endif
 	}
-	free_alloca(fullpath);
+	my_free_alloca(fullpath, use_heap);
 }
 /* }}} */
Index: /branches/1.3/prepare.devel
===================================================================
--- /branches/1.3/prepare.devel	(revision 616)
+++ /branches/1.3/prepare.devel	(revision 617)
@@ -28,4 +28,5 @@
 	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
 }
@@ -46,4 +47,8 @@
 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"
 }
 
Index: /branches/1.3/prepare.devel.inc.example
===================================================================
--- /branches/1.3/prepare.devel.inc.example	(revision 616)
+++ /branches/1.3/prepare.devel.inc.example	(revision 617)
@@ -3,4 +3,5 @@
 PHP5_0_DIR=
 PHP5_1_DIR=
+PHP5_3_DIR=
 PHP6_x_DIR=
 
Index: /branches/1.3/processor/processor.m4
===================================================================
--- /branches/1.3/processor/processor.m4	(revision 616)
+++ /branches/1.3/processor/processor.m4	(revision 617)
@@ -81,9 +81,11 @@
 		ZVAL_REFCOUNT(dst) = 1;
 		DONE(value)
+		DONE(type)
+#ifdef ZEND_ENGINE_2_3
+		DONE(is_ref__gc)
+		DONE(refcount__gc)
+#else
+		DONE(is_ref)
 		DONE(refcount)
-		DONE(type)
-		DONE(is_ref)
-#ifdef ZEND_ENGINE_2_3
-		COPY(idx_type)
 #endif
 	} while(0);
@@ -149,12 +151,16 @@
 		DONE(value)
 		DISPATCH(zval_data_type, type)
+#ifdef ZEND_ENGINE_2_3
+		DISPATCH(zend_uchar, is_ref__gc)
+#else
 		DISPATCH(zend_uchar, is_ref)
-#ifdef ZEND_ENGINE_2
+#endif
+
+#ifdef ZEND_ENGINE_2_3
+		DISPATCH(zend_uint, refcount__gc)
+#elif defined(ZEND_ENGINE_2)
 		DISPATCH(zend_uint, refcount)
 #else
 		DISPATCH(zend_ushort, refcount)
-#endif
-#ifdef ZEND_ENGINE_2_3
-		DISPATCH(zend_uchar, idx_type)
 #endif
 	')dnl IFDASM
@@ -479,4 +485,7 @@
 			case ZEND_JMPZ_EX:
 			case ZEND_JMPNZ_EX:
+#ifdef ZEND_JMP_SET
+			case ZEND_JMP_SET:
+#endif
 				dst->op2.u.jmp_addr = processor->active_opcodes_dst + (src->op2.u.jmp_addr - processor->active_opcodes_src);
 				break;
Index: /branches/1.3/utils.c
===================================================================
--- /branches/1.3/utils.c	(revision 616)
+++ /branches/1.3/utils.c	(revision 617)
@@ -20,5 +20,5 @@
 
 #define OP_ZVAL_DTOR(op) do { \
-	(op).u.constant.is_ref = 0; \
+	Z_UNSET_ISREF((op).u.constant); \
 	zval_dtor(&(op).u.constant); \
 } while(0)
@@ -152,4 +152,7 @@
 			case ZEND_JMPZ_EX:
 			case ZEND_JMPNZ_EX:
+#ifdef ZEND_JMP_SET
+			case ZEND_JMP_SET:
+#endif
 				opline->op2.u.opline_num = opline->op2.u.jmp_addr - op_array->opcodes;
 				assert(opline->op2.u.opline_num < op_array->last);
@@ -181,10 +184,11 @@
 	while (opline < end) {
 		if (opline->op1.op_type == IS_CONST) {
-			opline->op1.u.constant.is_ref = 1;
-			opline->op1.u.constant.refcount = 2; /* Make sure is_ref won't be reset */
+			Z_SET_ISREF(opline->op1.u.constant);
+			Z_SET_REFCOUNT(opline->op1.u.constant, 2); /* Make sure is_ref won't be reset */
+
 		}
 		if (opline->op2.op_type == IS_CONST) {
-			opline->op2.u.constant.is_ref = 1;
-			opline->op2.u.constant.refcount = 2;
+			Z_SET_ISREF(opline->op2.u.constant);
+			Z_SET_REFCOUNT(opline->op2.u.constant, 2);
 		}
 #ifdef ZEND_ENGINE_2_1
@@ -198,4 +202,7 @@
 			case ZEND_JMPZ_EX:
 			case ZEND_JMPNZ_EX:
+#ifdef ZEND_JMP_SET
+			case ZEND_JMP_SET:
+#endif
 				assert(opline->op2.u.opline_num < op_array->last);
 				opline->op2.u.jmp_addr = op_array->opcodes + opline->op2.u.opline_num;
@@ -299,4 +306,7 @@
 			case ZEND_JMPZ_EX:
 			case ZEND_JMPNZ_EX:
+#ifdef ZEND_JMP_SET
+			case ZEND_JMP_SET:
+#endif
 				next = begin + opline->op2.u.opline_num;
 				break;
Index: /branches/1.3/xcache.c
===================================================================
--- /branches/1.3/xcache.c	(revision 616)
+++ /branches/1.3/xcache.c	(revision 617)
@@ -542,7 +542,9 @@
 	xc_entry_data_php_t *p = xce->data.php;
 	zend_op_array *old_active_op_array = CG(active_op_array);
+	ALLOCA_FLAG(use_heap)
+
 #ifndef ZEND_ENGINE_2
 	/* new ptr which is stored inside CG(class_table) */
-	xc_cest_t **new_cest_ptrs = (xc_cest_t **)do_alloca(sizeof(xc_cest_t*) * p->classinfo_cnt);
+	xc_cest_t **new_cest_ptrs = (xc_cest_t **)my_do_alloca(sizeof(xc_cest_t*) * p->classinfo_cnt, use_heap);
 #endif
 
@@ -605,5 +607,5 @@
 
 #ifndef ZEND_ENGINE_2
-	free_alloca(new_cest_ptrs);
+	my_free_alloca(new_cest_ptrs, use_heap);
 #endif
 	CG(active_op_array) = old_active_op_array;
@@ -649,6 +651,7 @@
 	int size = strlen(include_path) + 1;
 	char tokens[] = { DEFAULT_DIR_SEPARATOR, '\0' };
-
-	paths = (char *)do_alloca(size);
+	ALLOCA_FLAG(use_heap)
+
+	paths = (char *)my_do_alloca(size, use_heap);
 	memcpy(paths, include_path, size);
 
@@ -658,10 +661,10 @@
 		}
 		if (VCWD_STAT(filepath, pbuf) == 0) {
-			free_alloca(paths);
+			my_free_alloca(paths, use_heap);
 			return SUCCESS;
 		}
 	}
 
-	free_alloca(paths);
+	my_free_alloca(paths, use_heap);
 
 	return FAILURE;
Index: /branches/1.3/xcache.h
===================================================================
--- /branches/1.3/xcache.h	(revision 616)
+++ /branches/1.3/xcache.h	(revision 617)
@@ -10,4 +10,5 @@
 #include <zend_compile.h>
 #include <zend_API.h>
+#include <zend.h>
 #include "php_ini.h"
 #include "zend_hash.h"
@@ -36,4 +37,22 @@
 #else
 #	define ZESW(v1, v2) v2
+#endif
+
+#ifdef ALLOCA_FLAG
+#	define my_do_alloca(size, use_heap) do_alloca(size, use_heap)
+#	define my_free_alloca(size, use_heap) free_alloca(size, use_heap)
+#else
+#	define my_do_alloca(size, use_heap) do_alloca(size)
+#	define my_free_alloca(size, use_heap) free_alloca(size)
+#	define ALLOCA_FLAG(x)
+#endif
+#ifndef Z_SET_ISREF
+#	define Z_SET_ISREF(z) (z).is_ref = 1;
+#endif
+#ifndef Z_UNSET_ISREF
+#	define Z_UNSET_ISREF(z) (z).is_ref = 0;
+#endif
+#ifndef Z_SET_REFCOUNT
+#	define Z_SET_REFCOUNT(z, rc) (z).refcount = rc;
 #endif
 
