Changeset 309
- Timestamp:
- 05/10/07 23:30:16 (3 years ago)
- Location:
- eaccelerator/trunk
- Files:
-
- 2 edited
-
eaccelerator.c (modified) (2 diffs)
-
optimize.c (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
eaccelerator/trunk/eaccelerator.c
r308 r309 1749 1749 ret = 1; 1750 1750 } else { 1751 zend_error(E_CORE_WARNING,"[%s] This build of \"%s\" was compiled for PHP version %s. Rebuild it for your PHP version (%s) or download precompiled binaries.\n", EACCELERATOR_EXTENSION_NAME,EACCELERATOR_EXTENSION_NAME,PHP_VERSION,Z_STRVAL(v)); 1751 ea_debug_error("[%s] This build of \"%s\" was compiled for PHP version %s. Rebuild it for your PHP version (%s) or download precompiled binaries.\n", 1752 EACCELERATOR_EXTENSION_NAME, EACCELERATOR_EXTENSION_NAME,PHP_VERSION,Z_STRVAL(v)); 1752 1753 } 1753 1754 zval_dtor(&v); 1754 1755 } else { 1755 zend_error(E_CORE_WARNING,"[%s] This build of \"%s\" was compiled for PHP version %s. Rebuild it for your PHP version.\n", EACCELERATOR_EXTENSION_NAME,EACCELERATOR_EXTENSION_NAME,PHP_VERSION); 1756 ea_debug_error("[%s] This build of \"%s\" was compiled for PHP version %s. Rebuild it for your PHP version.\n", 1757 EACCELERATOR_EXTENSION_NAME, EACCELERATOR_EXTENSION_NAME, PHP_VERSION); 1756 1758 } 1757 1759 return ret; … … 1792 1794 } 1793 1795 if (!eaccelerator_check_php_version(TSRMLS_C)) { 1794 return FAILURE; 1796 /* 1797 * do not return FAILURE, because it causes PHP to completely fail. 1798 * Just disable eAccelerator instead of making eA fail starting php 1799 */ 1800 return SUCCESS; 1795 1801 } 1796 1802 ZEND_INIT_MODULE_GLOBALS(eaccelerator, eaccelerator_init_globals, NULL); -
eaccelerator/trunk/optimize.c
r286 r309 28 28 #include "eaccelerator.h" 29 29 30 #ifdef HAVE_EACCELERATOR31 #ifdef WITH_EACCELERATOR_OPTIMIZER30 //#ifdef HAVE_EACCELERATOR 31 //#ifdef WITH_EACCELERATOR_OPTIMIZER 32 32 33 33 #include "zend.h" … … 46 46 /* 47 47 * HOESH: To protect merging. Primary 48 * it a bblies to try & catch blocks.48 * it applies to try & catch blocks. 49 49 * ZEND_ENGINE_2 specific, but can take place 50 50 */ … … 63 63 } BBlink; 64 64 65 #if 066 65 static void dump_bb(BB* bb, zend_op_array *op_array) { 67 66 BB* p = bb; … … 69 68 zend_printf("<pre>%s:%s\n", op_array->filename, op_array->function_name); 70 69 while (p != NULL) { 71 zend_printf(" bb%u start=%u len=%d used=%d\n",70 zend_printf(" <strong>bb%u</strong> start=%u len=%d used=%d protected=%d\n", 72 71 (unsigned int)(p-bb), 73 72 (unsigned int)(p->start-op_array->opcodes), 74 73 p->len, 75 p->used); 74 p->used, 75 p->protect_merge); 76 76 if (p->jmp_1) { 77 77 zend_printf(" jmp_1 bb%u start=%u len=%d used=%d\n", … … 168 168 zend_printf("<br>\n"); 169 169 } 170 #endif171 170 172 171 #define SET_TO_NOP(op) \ … … 249 248 #ifdef ZEND_ENGINE_2 250 249 (end->opcode == ZEND_RECV || end->opcode == ZEND_RECV_INIT || 251 (end->result.u.EA.type & EXT_TYPE_UNUSED) == 0)) ||250 (end->result.u.EA.type & EXT_TYPE_UNUSED) == 0)) || 252 251 #else 253 252 (end->result.u.EA.type & EXT_TYPE_UNUSED) == 0) || 254 253 #endif 255 254 (end->result.op_type == IS_TMP_VAR)) && 256 !global[VAR_NUM(end->result.u.var)] && !used[VAR_NUM(end->result.u.var)]) {255 !global[VAR_NUM(end->result.u.var)] && !used[VAR_NUM(end->result.u.var)]) { 257 256 switch(end->opcode) { 258 257 case ZEND_JMPZ_EX: … … 549 548 p = bb; 550 549 while (p->next != NULL) { 551 if (p->next->used && p->next->pred) {550 if (p->next->used && (p->next->pred || p->protect_merge)) { 552 551 p = p->next; 553 552 } else { … … 581 580 p = bb; 582 581 while (p != NULL) { 583 while (p->next != NULL && (!p->next->used || p->next->pred == NULL) ) {582 while (p->next != NULL && (!p->next->used || p->next->pred == NULL) && !p->protect_merge) { 584 583 del_bb(p->next); 585 584 p->next = p->next->next; … … 2715 2714 bb[tc_element->catch_op].start = &op_array->opcodes[tc_element->catch_op]; 2716 2715 bb[tc_element->catch_op].protect_merge = 1; 2716 bb[tc_element->catch_op].used = 1; 2717 2717 } 2718 2718 } 2719 2720 dump_bb(bb, op_array); 2721 2719 2722 #endif 2720 2723 /* Find Starts of Basic Blocks */ … … 3175 3178 #define FREE_REG(R) reg_pool[(R)] = 0; 3176 3179 3177 3178 void reassign_registers(zend_op_array *op_array, BB* p, char *global) { 3180 static void reassign_registers(zend_op_array *op_array, BB* p, char *global) { 3179 3181 zend_uint i; 3180 3182 zend_uint n = 0; … … 3298 3300 } 3299 3301 3300 void restore_operand_types(zend_op_array *op_array) {3302 static void restore_operand_types(zend_op_array *op_array) { 3301 3303 zend_op* op = op_array->opcodes; 3302 3304 int len = op_array->last; … … 3322 3324 3323 3325 TSRMLS_FETCH(); 3324 /*??? 3325 #ifdef ZEND_ENGINE_2 3326 return; 3327 #endif 3328 */ 3326 3329 3327 if (!EAG(compiler) || op_array->type != ZEND_USER_FUNCTION) { 3330 3328 return; … … 3337 3335 /* Find All Basic Blocks and build CFG */ 3338 3336 if (build_cfg(op_array, bb)) { 3337 dump_bb(bb, op_array); 3339 3338 char *global = do_alloca(op_array->T * sizeof(char)); 3340 3339 if (global == NULL) return; … … 3343 3342 /* Determine Used Blocks and its Predcessors */ 3344 3343 mark_used_bb(bb); 3344 dump_bb(bb, op_array); 3345 3345 3346 3346 /* JMP Optimization */ … … 3355 3355 } 3356 3356 3357 /* Mark All Basi kBlocks as Unused. Free Predcessors Links. */3357 /* Mark All Basic Blocks as Unused. Free Predcessors Links. */ 3358 3358 p = bb; 3359 3359 while (p != NULL) { … … 3368 3368 p = bb; 3369 3369 while (p->next != NULL) { 3370 if (p->next->used ) {3370 if (p->next->used || p->protect_merge) { 3371 3371 p = p->next; 3372 3372 } else { … … 3398 3398 free_alloca(bb); 3399 3399 } 3400 #endif3401 #endif /* #ifdef HAVE_EACCELERATOR */3400 //#endif 3401 //#endif /* #ifdef HAVE_EACCELERATOR */
Note: See TracChangeset
for help on using the changeset viewer.