Changeset 617
- Timestamp:
- 2009-07-05T08:30:54+02:00 (4 years ago)
- Location:
- branches/1.3
- Files:
-
- 9 edited
- 1 copied
-
. (modified) (1 prop)
-
const_string.c (modified) (1 diff)
-
const_string_opcodes_php5.3.h (copied) (copied from trunk/const_string_opcodes_php5.3.h)
-
coverager.c (modified) (2 diffs)
-
prepare.devel (modified) (2 diffs)
-
prepare.devel.inc.example (modified) (1 diff)
-
processor/processor.m4 (modified) (3 diffs)
-
utils.c (modified) (5 diffs)
-
xcache.c (modified) (4 diffs)
-
xcache.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.3
-
branches/1.3/const_string.c
r394 r617 89 89 /* {{{ xc_get_opcode */ 90 90 #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" 102 98 #endif 103 99 -
branches/1.3/coverager.c
r615 r617 36 36 char *fullpath; 37 37 struct stat st; 38 ALLOCA_FLAG(use_heap) 38 39 39 40 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); 41 42 memcpy(fullpath, root, rootlen); 42 43 memcpy(fullpath + rootlen, path, pathlen); … … 59 60 #endif 60 61 } 61 free_alloca(fullpath);62 my_free_alloca(fullpath, use_heap); 62 63 } 63 64 /* }}} */ -
branches/1.3/prepare.devel
r604 r617 28 28 make_const_string_opcodes_php5.0.h 29 29 make_const_string_opcodes_php5.1.h 30 make_const_string_opcodes_php5.3.h 30 31 make_const_string_opcodes_php6.x.h 31 32 } … … 46 47 make_const_string_opcodes_php5.1.h() { 47 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" 49 } 50 51 make_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" 48 53 } 49 54 -
branches/1.3/prepare.devel.inc.example
r604 r617 3 3 PHP5_0_DIR= 4 4 PHP5_1_DIR= 5 PHP5_3_DIR= 5 6 PHP6_x_DIR= 6 7 -
branches/1.3/processor/processor.m4
r616 r617 81 81 ZVAL_REFCOUNT(dst) = 1; 82 82 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) 83 89 DONE(refcount) 84 DONE(type)85 DONE(is_ref)86 #ifdef ZEND_ENGINE_2_387 COPY(idx_type)88 90 #endif 89 91 } while(0); … … 149 151 DONE(value) 150 152 DISPATCH(zval_data_type, type) 153 #ifdef ZEND_ENGINE_2_3 154 DISPATCH(zend_uchar, is_ref__gc) 155 #else 151 156 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) 153 162 DISPATCH(zend_uint, refcount) 154 163 #else 155 164 DISPATCH(zend_ushort, refcount) 156 #endif157 #ifdef ZEND_ENGINE_2_3158 DISPATCH(zend_uchar, idx_type)159 165 #endif 160 166 ')dnl IFDASM … … 479 485 case ZEND_JMPZ_EX: 480 486 case ZEND_JMPNZ_EX: 487 #ifdef ZEND_JMP_SET 488 case ZEND_JMP_SET: 489 #endif 481 490 dst->op2.u.jmp_addr = processor->active_opcodes_dst + (src->op2.u.jmp_addr - processor->active_opcodes_src); 482 491 break; -
branches/1.3/utils.c
r600 r617 20 20 21 21 #define OP_ZVAL_DTOR(op) do { \ 22 (op).u.constant.is_ref = 0; \22 Z_UNSET_ISREF((op).u.constant); \ 23 23 zval_dtor(&(op).u.constant); \ 24 24 } while(0) … … 152 152 case ZEND_JMPZ_EX: 153 153 case ZEND_JMPNZ_EX: 154 #ifdef ZEND_JMP_SET 155 case ZEND_JMP_SET: 156 #endif 154 157 opline->op2.u.opline_num = opline->op2.u.jmp_addr - op_array->opcodes; 155 158 assert(opline->op2.u.opline_num < op_array->last); … … 181 184 while (opline < end) { 182 185 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 185 189 } 186 190 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); 189 193 } 190 194 #ifdef ZEND_ENGINE_2_1 … … 198 202 case ZEND_JMPZ_EX: 199 203 case ZEND_JMPNZ_EX: 204 #ifdef ZEND_JMP_SET 205 case ZEND_JMP_SET: 206 #endif 200 207 assert(opline->op2.u.opline_num < op_array->last); 201 208 opline->op2.u.jmp_addr = op_array->opcodes + opline->op2.u.opline_num; … … 299 306 case ZEND_JMPZ_EX: 300 307 case ZEND_JMPNZ_EX: 308 #ifdef ZEND_JMP_SET 309 case ZEND_JMP_SET: 310 #endif 301 311 next = begin + opline->op2.u.opline_num; 302 312 break; -
branches/1.3/xcache.c
r602 r617 542 542 xc_entry_data_php_t *p = xce->data.php; 543 543 zend_op_array *old_active_op_array = CG(active_op_array); 544 ALLOCA_FLAG(use_heap) 545 544 546 #ifndef ZEND_ENGINE_2 545 547 /* 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); 547 549 #endif 548 550 … … 605 607 606 608 #ifndef ZEND_ENGINE_2 607 free_alloca(new_cest_ptrs);609 my_free_alloca(new_cest_ptrs, use_heap); 608 610 #endif 609 611 CG(active_op_array) = old_active_op_array; … … 649 651 int size = strlen(include_path) + 1; 650 652 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); 653 656 memcpy(paths, include_path, size); 654 657 … … 658 661 } 659 662 if (VCWD_STAT(filepath, pbuf) == 0) { 660 free_alloca(paths);663 my_free_alloca(paths, use_heap); 661 664 return SUCCESS; 662 665 } 663 666 } 664 667 665 free_alloca(paths);668 my_free_alloca(paths, use_heap); 666 669 667 670 return FAILURE; -
branches/1.3/xcache.h
r610 r617 10 10 #include <zend_compile.h> 11 11 #include <zend_API.h> 12 #include <zend.h> 12 13 #include "php_ini.h" 13 14 #include "zend_hash.h" … … 36 37 #else 37 38 # 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; 38 57 #endif 39 58
Note: See TracChangeset
for help on using the changeset viewer.

