Changeset 485 in svn
- Timestamp:
- 2007-12-28T10:16:12Z (11 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/const_string.c
r393 r485 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 -
trunk/coverager.c
r462 r485 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 /* }}} */ -
trunk/optimizer.c
r477 r485 151 151 case ZEND_JMPZ_EX: 152 152 case ZEND_JMPNZ_EX: 153 #ifdef ZEND_JMP_SET 154 case ZEND_JMP_SET: 155 #endif 153 156 #ifdef ZEND_JMP_NO_CTOR 154 157 case ZEND_JMP_NO_CTOR: … … 347 350 op_flowinfo_t fi; 348 351 zend_op *opline; 349 bbid_t *bbids = do_alloca(count * sizeof(bbid_t)); 350 bbid_t *catchbbids = do_alloca(count * sizeof(bbid_t)); 351 zend_bool *markbbhead = do_alloca(count * sizeof(zend_bool)); 352 ALLOCA_FLAG(use_heap_bbids) 353 ALLOCA_FLAG(use_heap_catchbbids) 354 ALLOCA_FLAG(use_heap_markbbhead) 355 bbid_t *bbids = my_do_alloca(count * sizeof(bbid_t), use_heap_bbids); 356 bbid_t *catchbbids = my_do_alloca(count * sizeof(bbid_t), use_heap_catchbbids); 357 zend_bool *markbbhead = my_do_alloca(count * sizeof(zend_bool), use_heap_markbbhead); 352 358 353 359 /* {{{ mark jmpin/jumpout */ … … 450 456 /* }}} */ 451 457 452 free_alloca(catchbbids);453 free_alloca(bbids);454 free_alloca(markbbhead);458 my_free_alloca(markbbhead, use_heap_markbbhead); 459 my_free_alloca(catchbbids, use_heap_catchbbids); 460 my_free_alloca(bbids, use_heap_bbids); 455 461 return SUCCESS; 456 462 } -
trunk/prepare.devel
r52 r485 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 -
trunk/prepare.devel.inc.example
r327 r485 3 3 PHP5_0_DIR= 4 4 PHP5_1_DIR= 5 PHP5_3_DIR= 5 6 PHP6_x_DIR= 6 7 -
trunk/processor/processor.m4
r484 r485 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; -
trunk/utils.c
r434 r485 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; -
trunk/xcache.c
r477 r485 609 609 xc_entry_data_php_t *p = xce->data.php; 610 610 zend_op_array *old_active_op_array = CG(active_op_array); 611 ALLOCA_FLAG(use_heap) 612 611 613 #ifndef ZEND_ENGINE_2 612 614 /* new ptr which is stored inside CG(class_table) */ 613 xc_cest_t **new_cest_ptrs = (xc_cest_t **) do_alloca(sizeof(xc_cest_t*) * p->classinfo_cnt);615 xc_cest_t **new_cest_ptrs = (xc_cest_t **)my_do_alloca(sizeof(xc_cest_t*) * p->classinfo_cnt, use_heap); 614 616 #endif 615 617 … … 672 674 673 675 #ifndef ZEND_ENGINE_2 674 free_alloca(new_cest_ptrs);676 my_free_alloca(new_cest_ptrs, use_heap); 675 677 #endif 676 678 CG(active_op_array) = old_active_op_array; … … 716 718 int size = strlen(include_path) + 1; 717 719 char tokens[] = { DEFAULT_DIR_SEPARATOR, '\0' }; 718 719 paths = (char *)do_alloca(size); 720 ALLOCA_FLAG(use_heap) 721 722 paths = (char *)my_do_alloca(size, use_heap); 720 723 memcpy(paths, include_path, size); 721 724 … … 725 728 } 726 729 if (VCWD_STAT(filepath, pbuf) == 0) { 727 free_alloca(paths);730 my_free_alloca(paths, use_heap); 728 731 return SUCCESS; 729 732 } 730 733 } 731 734 732 free_alloca(paths);735 my_free_alloca(paths, use_heap); 733 736 734 737 return FAILURE; … … 888 891 php_stream *stream; 889 892 xc_hash_value_t hv; 893 ulong old_rsid = EG(regular_list).nNextFreeElement; 890 894 891 895 stream = php_stream_open_wrapper(xce->name.str.val, "rb", USE_PATH | REPORT_ERRORS | ENFORCE_SAFE_MODE | STREAM_DISABLE_OPEN_BASEDIR, NULL); … … 901 905 902 906 php_stream_close(stream); 907 if (EG(regular_list).nNextFreeElement = old_rsid + 1) { 908 EG(regular_list).nNextFreeElement = old_rsid; 909 } 903 910 904 911 if (n < 0) { -
trunk/xcache.h
r480 r485 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.