Changeset 148
- Timestamp:
- 02/06/06 17:39:11 (2 years ago)
- Files:
-
- eaccelerator/branches/PHP_5_1/ChangeLog (modified) (1 diff)
- eaccelerator/branches/PHP_5_1/debug.c (modified) (1 diff)
- eaccelerator/branches/PHP_5_1/debug.h (modified) (1 diff)
- eaccelerator/branches/PHP_5_1/ea_restore.c (modified) (19 diffs)
- eaccelerator/branches/PHP_5_1/ea_store.c (modified) (14 diffs)
- eaccelerator/branches/PHP_5_1/eaccelerator.c (modified) (2 diffs)
- eaccelerator/branches/PHP_5_1/opcodes.c (modified) (1 diff)
- eaccelerator/branches/PHP_5_1/optimize.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
eaccelerator/branches/PHP_5_1/ChangeLog
r147 r148 1 2006-02-06 Hans Rakers <hans at parse dot nl> 2 3 * PHP_5_1: Quite some major changes, including but probably not limited to: 4 -Fixed numerous memory leaks 5 -Fixed the handling of empty string variables (as in ""), causing "String is not zero-terminated" warnings when PHP is compiled with --enable-debug 6 -More fixes to the handling of static properties (access checking/inheritance) 7 -Inheritance on restore is now handled by zend_do_inheritance 8 -Fixed handling of ZEND_OP_DATA and ZEND_INIT_METHOD_CALL by the optimizer 9 -Cosmetic fixes (spelling etc.) 10 1 11 2006-01-16 Hans Rakers <hans at parse dot nl> 2 12 eaccelerator/branches/PHP_5_1/debug.c
r142 r148 247 247 } 248 248 249 /* 250 * This dumps a HashTable to debug output. Taken from zend_hash.c and slightly adapted. 251 */ 252 void ea_debug_hash_display(HashTable * ht) 253 { 254 Bucket *p; 255 uint i; 256 257 fprintf(F_fp, "ht->nTableSize: %d\n", ht->nTableSize); 258 fprintf(F_fp, "ht->nNumOfElements: %d\n", ht->nNumOfElements); 259 260 for (i = 0; i < ht->nTableSize; i++) { 261 p = ht->arBuckets[i]; 262 while (p != NULL) { 263 fprintf(F_fp, "%s <==> 0x%lX\n", p->arKey, p->h); 264 p = p->pNext; 265 } 266 } 267 268 p = ht->pListTail; 269 while (p != NULL) { 270 fprintf(F_fp, "%s <==> 0x%lX\n", p->arKey, p->h); 271 p = p->pListLast; 272 } 273 fflush(F_fp); 274 } 275 249 276 #endif /* #ifdef HAVE_EACCELERATOR */ eaccelerator/branches/PHP_5_1/debug.h
r122 r148 72 72 long ea_debug_elapsed_time (struct timeval *tvstart); 73 73 74 void ea_debug_hash_display(HashTable * ht); 75 74 76 #endif /* INCLUDED_DEBUG_H */ eaccelerator/branches/PHP_5_1/ea_restore.c
r147 r148 276 276 fixup_hash(&from->properties_info, 277 277 (fixup_bucket_t) fixup_property_info TSRMLS_CC); 278 # ifdef ZEND_ENGINE_2_1 279 fixup_zval_hash(&from->default_static_members); 280 if (from->static_members != NULL) { 281 FIXUP(from->static_members); 282 if (from->static_members != &from->default_static_members) { 283 fixup_zval_hash(from->static_members); 284 } 285 } 286 # else 278 287 if (from->static_members != NULL) { 279 288 FIXUP(from->static_members); 280 289 fixup_zval_hash(from->static_members); 281 290 } 282 # ifdef ZEND_ENGINE_2_1283 fixup_zval_hash(&from->default_static_members);284 291 # endif 285 292 #else … … 305 312 memcpy(p, from, sizeof(zval)); 306 313 restore_zval(p TSRMLS_CC); 314 /* hrak: reset refcount to make sure there is one reference to this val, and prevent memleaks */ 315 p->refcount = 1; 307 316 return p; 308 317 } … … 379 388 case IS_STRING: 380 389 if (zv->value.str.val == NULL || 381 zv->value.str.val == empty_string|| zv->value.str.len == 0) {390 zv->value.str.val == "" || zv->value.str.len == 0) { 382 391 zv->value.str.val = empty_string; 383 392 return; … … 526 535 */ 527 536 if (from->scope_name != NULL) { 528 char *from_scope_lc = zend_str_tolower_dup(from->scope_name, from->scope_name_len); 529 if (zend_hash_find (CG(class_table), (void *) from_scope_lc, 530 from->scope_name_len + 1, (void **) &to->scope) != SUCCESS) { 537 zend_class_entry** scope_ptr = NULL; 538 if (zend_lookup_class(from->scope_name, from->scope_name_len, &scope_ptr TSRMLS_CC) != SUCCESS) { 531 539 ea_debug_pad(EA_DEBUG TSRMLS_CC); 532 ea_debug_printf(EA_DEBUG, "[%d] can't find '%s' in hash. use EAG(class_entry).\n", getpid(), from_scope_lc);540 ea_debug_printf(EA_DEBUG, "[%d] can't find '%s' in class_table. use EAG(class_entry).\n", getpid(), from->scope_name); 533 541 to->scope = EAG(class_entry); 534 542 } else { 535 543 ea_debug_pad(EA_DEBUG TSRMLS_CC); 536 ea_debug_printf(EA_DEBUG, "[%d] found '%s' in hash\n", getpid(), from_scope_lc); 537 to->scope = *(zend_class_entry **) to->scope; 538 } 539 efree(from_scope_lc); 544 ea_debug_printf(EA_DEBUG, "[%d] found '%s' in hash\n", getpid(), from->scope_name); 545 to->scope = *scope_ptr; 546 } 540 547 } else { // zoeloelip: is this needed? scope is always stored 541 548 ea_debug_pad(EA_DEBUG TSRMLS_CC); … … 590 597 ea_debug_pad(EA_DEBUG TSRMLS_CC); 591 598 ea_debug_printf(EA_DEBUG, "[%d] can't find\n", getpid()); 592 } 599 } 593 600 return to; 594 601 } 602 #ifdef ZEND_ENGINE_2 603 /* hrak: slight memleak here. dont forget to free the lowercase function name! */ 604 if (fname_lc != NULL) { 605 efree(fname_lc); 606 } 607 #endif 595 608 to->opcodes = from->opcodes; 596 609 to->last = to->size = from->last; … … 607 620 to->done_pass_two = 1; 608 621 to->filename = from->filename; 622 /* if (from->filename != NULL) { 623 size_t len = strlen(from->filename) + 1; 624 to->filename = emalloc(len); 625 memcpy(to->filename, from->filename, len); 626 }*/ 627 609 628 #ifdef ZEND_ENGINE_2 610 629 /* HOESH: try & catch support */ … … 644 663 to->last_var = from->last_var; 645 664 to->size_var = 0; 646 if (to->vars) { 665 /* if (from->vars) { 647 666 zend_uint i; 648 667 to->vars = (zend_compiled_variable*)emalloc(from->last_var*sizeof(zend_compiled_variable)); … … 651 670 to->vars[i].name = estrndup(from->vars[i].name, from->vars[i].name_len); 652 671 } 653 } 672 }*/ 654 673 #endif 655 674 … … 689 708 zend_class_entry * to TSRMLS_DC) 690 709 { 691 #ifdef ZEND_ENGINE_2 692 char *name_lc = zend_str_tolower_dup(parent, len); 693 if (zend_hash_find(CG(class_table), (void *) name_lc, len + 1, (void **) &to->parent) != SUCCESS) 710 ea_debug_printf(EA_DEBUG, "restore_class_parent: restoring parent class %s of class %s\n", (char *) parent, to->name); 711 #ifdef ZEND_ENGINE_2 712 /* char *name_lc = zend_str_tolower_dup(parent, len); 713 if (zend_hash_find(CG(class_table), (void *) name_lc, len + 1, (void **) &to->parent) != SUCCESS)*/ 714 zend_class_entry** parent_ptr = NULL; 715 if (zend_lookup_class(parent, len, &parent_ptr TSRMLS_CC) != SUCCESS) 694 716 #else 695 717 if (zend_hash_find(CG(class_table), (void *) parent, len + 1, (void **) &to->parent) != SUCCESS) … … 702 724 #ifdef ZEND_ENGINE_2 703 725 /* inherit parent methods */ 704 to->parent = *(zend_class_entry **) to->parent; 705 to->constructor = to->parent->constructor; 726 to->parent = *parent_ptr; 727 ea_debug_printf(EA_DEBUG, "restore_class_parent: found parent %s..\n", to->parent->name); 728 ea_debug_printf(EA_DEBUG, "restore_class_parent: parent type=%d child type=%d waa=%x\n", to->parent->type, to->type, CE_STATIC_MEMBERS(*parent_ptr)); 729 zend_do_inheritance(to, to->parent TSRMLS_CC); 730 to->parent->refcount++; 731 /* to->constructor = to->parent->constructor; 706 732 to->destructor = to->parent->destructor; 707 733 to->clone = to->parent->clone; … … 719 745 to->handle_property_get = to->parent->handle_property_get; 720 746 to->handle_property_set = to->parent->handle_property_set; 721 to->handle_function_call = to->parent->handle_function_call; 722 #endif 723 } 724 #ifdef ZEND_ENGINE_2 725 efree(name_lc);747 to->handle_function_call = to->parent->handle_function_call;*/ 748 #endif 749 } 750 #ifdef ZEND_ENGINE_2 751 /*efree(name_lc);*/ 726 752 #endif 727 753 } … … 742 768 fname_len = strlen(f->common.function_name); 743 769 fname_lc = zend_str_tolower_dup(f->common.function_name, fname_len); 770 ea_debug_printf(EA_DEBUG, "restore_class_methods: restoring function:%s scope:%s parent=%x scope=%x\n", fname_lc, ZEND_FN_SCOPE_NAME(f), to->parent, f->common.scope); 744 771 745 772 if (fname_len == cname_len && !memcmp(fname_lc, cname_lc, fname_len) && … … 786 813 zend_class_entry *old; 787 814 zend_function *f = NULL; 788 int fname_len = 0; 789 char *fname_lc = NULL; 790 #ifdef ZEND_ENGINE_2 791 int cname_len; 792 char *cname_lc; 815 /* int fname_len = 0; hrak: seems rather unused 816 char *fname_lc = NULL; */ 817 #ifdef ZEND_ENGINE_2 818 /* int cname_len; hrak: same here 819 char *cname_lc; */ 793 820 Bucket *p; 794 821 union _zend_function *old_ctor; … … 815 842 to->num_interfaces = from->num_interfaces; 816 843 if (to->num_interfaces > 0) { 844 /* hrak: Allocate the slots which will later be populated by ZEND_ADD_INTERFACE */ 817 845 to->interfaces = (zend_class_entry **) emalloc(sizeof(zend_class_entry *) * to->num_interfaces); 818 // should find out class entry. what the hell !!!819 846 memset(to->interfaces, 0, sizeof(zend_class_entry *) * to->num_interfaces); 820 847 } else { … … 834 861 } 835 862 836 if (from->parent != NULL) {863 /* if (from->parent != NULL) { 837 864 restore_class_parent(from->parent, strlen(from->parent), to TSRMLS_CC); 838 865 } else { … … 840 867 ea_debug_printf(EA_DEBUG, "[%d] parent = NULL\n", getpid()); 841 868 to->parent = NULL; 842 } 869 }*/ 843 870 844 871 old = EAG(class_entry); … … 850 877 to->line_start = from->line_start; 851 878 to->line_end = from->line_end; 879 ea_debug_printf(EA_DEBUG, "restore_class_entry: line_start=%d, line_end=%d", to->line_start, to->line_end); 852 880 to->doc_comment_len = from->doc_comment_len; 853 if (from->filename != NULL) {881 /* if (from->filename != NULL) { 854 882 size_t len = strlen(from->filename) + 1; 855 883 to->filename = emalloc(len); 856 884 memcpy(to->filename, from->filename, len); 857 } 885 }*/ 886 to->filename = from->filename; 858 887 if (from->doc_comment != NULL) { 859 888 to->doc_comment = emalloc(from->doc_comment_len + 1); … … 877 906 to->default_static_members.pDestructor = ZVAL_PTR_DTOR; 878 907 879 to->static_members = (from->type == ZEND_INTERNAL_CLASS) ? NULL : &to->default_static_members; 908 ea_debug_printf(EA_DEBUG, "restore_class_entry: static_members=%x, default_static_members=%x", from->static_members, &from->default_static_members); 909 if (from->static_members != &(from->default_static_members)) { 910 ALLOC_HASHTABLE(to->static_members); 911 restore_zval_hash(to->static_members, from->static_members); 912 to->static_members->pDestructor = ZVAL_PTR_DTOR; 913 } else { 914 to->static_members = &(to->default_static_members); 915 } 916 ea_debug_printf(EA_DEBUG, "restore_class_entry: to->static_members=%x, to->default_static_members=%x", to->static_members, &to->default_static_members); 880 917 # else 881 918 if (from->static_members != NULL) { … … 904 941 to->function_table.pDestructor = ZEND_FUNCTION_DTOR; 905 942 943 if (from->parent != NULL) { 944 restore_class_parent(from->parent, strlen(from->parent), to TSRMLS_CC); 945 } else { 946 ea_debug_pad(EA_DEBUG TSRMLS_CC); 947 ea_debug_printf(EA_DEBUG, "[%d] parent = NULL\n", getpid()); 948 to->parent = NULL; 949 } 950 906 951 #ifdef ZEND_ENGINE_2 907 952 restore_class_methods(to TSRMLS_CC); eaccelerator/branches/PHP_5_1/ea_store.c
r147 r148 123 123 case IS_CONSTANT: 124 124 case IS_STRING: 125 if (zv->value.str.val == NULL || zv->value.str.val == empty_string|| zv->value.str.len == 0) {126 } else { 125 /* if (zv->value.str.val == NULL || zv->value.str.len == 0) { 126 } else {*/ 127 127 calc_string(zv->value.str.val, zv->value.str.len + 1 TSRMLS_CC); 128 } 128 /* }*/ 129 129 break; 130 130 case IS_ARRAY: … … 285 285 calc_string(from->parent->name, from->parent->name_length + 1 TSRMLS_CC); 286 286 #ifdef ZEND_ENGINE_2 287 #if 0288 // what's problem. why from->interfaces[i] == 0x5a5a5a5a ?289 for (i = 0; i < from->num_interfaces; i++) {290 if (from->interfaces[i]) {291 calc_string(from->interfaces[i]->name,292 from->interfaces[i]->name_length);293 }294 }295 #endif296 287 if (from->filename != NULL) 297 288 calc_string(from->filename, strlen(from->filename) + 1 TSRMLS_CC); … … 302 293 calc_zval_hash(&from->default_properties); 303 294 304 #ifdef ZEND_ENGINE_2_1 295 calc_hash(&from->properties_info, (calc_bucket_t) calc_property_info); 296 297 # ifdef ZEND_ENGINE_2_1 305 298 calc_zval_hash(&from->default_static_members); 306 #endif 307 308 calc_hash(&from->properties_info, (calc_bucket_t) calc_property_info); 299 if ((from->static_members != NULL) && (from->static_members != &from->default_static_members)) { 300 # else 309 301 if (from->static_members != NULL) { 302 # endif 310 303 EACCELERATOR_ALIGN(EAG(mem)); 311 304 EAG(mem) += sizeof(HashTable); … … 388 381 389 382 typedef void *(*store_bucket_t) (void *TSRMLS_DC); 390 391 #define store_hash_ex(to, from, start, store_bucket) \ 392 store_hash_int(to, from, start, store_bucket TSRMLS_CC) 393 394 #define store_hash(to, from, store_bucket) \ 395 store_hash_ex(to, from, (from)->pListHead, store_bucket) 383 typedef void *(*check_bucket_t) (Bucket*, va_list); 384 385 #define store_hash_ex(to, from, start, store_bucket, check_bucket, ...) \ 386 store_hash_int(to, from, start, store_bucket, check_bucket, __VA_ARGS__) 387 388 #define store_hash(to, from, store_bucket, check_bucket, ...) \ 389 store_hash_ex(to, from, (from)->pListHead, store_bucket, check_bucket, __VA_ARGS__) 396 390 397 391 #define store_zval_hash(to, from) \ 398 store_hash(to, from, (store_bucket_t)store_zval_ptr )392 store_hash(to, from, (store_bucket_t)store_zval_ptr, NULL, NULL) 399 393 400 394 #define store_zval_hash_ex(to, from, start) \ 401 store_hash_ex(to, from, start, (store_bucket_t)store_zval_ptr )395 store_hash_ex(to, from, start, (store_bucket_t)store_zval_ptr, NULL) 402 396 403 397 static zval *store_zval_ptr(zval * from TSRMLS_DC) … … 413 407 414 408 static void store_hash_int(HashTable * target, HashTable * source, 415 Bucket * start, store_bucket_t copy_bucket TSRMLS_DC) 409 Bucket * start, store_bucket_t copy_bucket, 410 check_bucket_t check_bucket, ...) 416 411 { 417 412 Bucket *p, *np, *prev_p; … … 436 431 np = NULL; 437 432 while (p) { 433 /* If a check function has been defined, run it */ 434 if (check_bucket) { 435 va_list args; 436 va_start(args, check_bucket); 437 438 /* If the check function returns ZEND_HASH_APPLY_REMOVE, don't store this record, skip over it */ 439 if(check_bucket(p, args)) { 440 p = p->pListNext; 441 target->nNumOfElements--; 442 /* skip to next itteration */ 443 continue; 444 } 445 va_end(args); 446 } 447 438 448 EACCELERATOR_ALIGN(EAG(mem)); 439 449 np = (Bucket *) EAG(mem); … … 486 496 case IS_CONSTANT: 487 497 case IS_STRING: 488 if (zv->value.str.val == NULL || 489 zv->value.str.val == empty_string || zv->value.str.len == 0) { 490 zv->value.str.val = empty_string; 491 zv->value.str.len = 0; 492 } else { 493 zv->value.str.val = store_string(zv->value.str.val, zv->value.str.len + 1 TSRMLS_CC); 494 } 498 zv->value.str.val = store_string(zv->value.str.val, zv->value.str.len + 1 TSRMLS_CC); 495 499 break; 496 500 case IS_ARRAY: … … 631 635 #endif 632 636 to->static_variables = from->static_variables; 633 #ifdef ZEND_ENGINE_2_1634 to->vars = from->vars;635 to->last_var = from->last_var;636 #endif637 637 to->return_reference = from->return_reference; 638 638 to->filename = from->filename; … … 742 742 return to; 743 743 } 744 745 /* 746 * The following two functions handle access checking of properties (public/private/protected) 747 * and control proper inheritance during copying of the properties_info and (default_)static_members hashes 748 * 749 * Both functions return ZEND_HASH_APPLY_REMOVE if the property to be copied needs to be skipped, or 750 * ZEND_HASH_APPLY_KEEP if the property needs to be copied over into the cache. 751 * 752 * If the property is skipped due to access restrictions, or it needs inheritance of its value from the 753 * parent, the restore phase will take care of that. 754 * 755 * Most of the logic behind all this can be found in zend_compile.c, functions zend_do_inheritance and 756 * zend_do_inherit_property_access_check 757 */ 758 static int store_property_access_check(Bucket * p, va_list args) 759 { 760 zend_class_entry *from = va_arg(args, zend_class_entry*); 761 zend_class_entry *parent = from->parent; 762 763 ea_debug_printf(EA_DEBUG, "[%d] store_property_access_check enter. from=%x parent=%x arKey=%s\n", getpid(), from, parent, p->arKey); 764 765 if (parent) { 766 // hra: TODO - do some usefull stuff :) 767 // check for ACC_PRIVATE etc. 768 // for now, just return keep 769 } 770 ea_debug_printf(EA_DEBUG, "[%d] store_property_access_check result: keep\n", getpid()); 771 return ZEND_HASH_APPLY_KEEP; 772 } 773 774 static int store_static_member_access_check(Bucket * p, va_list args) 775 { 776 zend_class_entry *from = va_arg(args, zend_class_entry*); 777 zend_class_entry *parent = from->parent; 778 zend_property_info *pinfo, *cinfo = NULL; 779 zval **pprop = NULL; 780 zval **cprop = p->pData; 781 char *mname, *cname = NULL; 782 783 /* Check if this is a parent class. If so, copy unconditionally */ 784 if (parent) { 785 /* unpack the \0classname\0membername\0 style property name to seperate vars */ 786 zend_unmangle_property_name(p->arKey, &cname, &mname); 787 ea_debug_printf(EA_DEBUG, "[%d] store_static_member_access_check: cname=%s, mname=%s\n", getpid(), cname, mname); 788 789 /* lookup the member's info in parent and child */ 790 if((zend_hash_find(&parent->properties_info, mname, strlen(mname)+1, (void**)&pinfo) == SUCCESS) && 791 (zend_hash_find(&from->properties_info, mname, strlen(mname)+1, (void**)&cinfo) == SUCCESS)) { 792 /* don't copy this static property if protected in parent and static public in child. 793 inheritance will handle this properly on restore */ 794 if(cinfo->flags & ZEND_ACC_STATIC && (pinfo->flags & ZEND_ACC_PROTECTED && cinfo->flags & ZEND_ACC_PUBLIC)) { 795 ea_debug_printf(EA_DEBUG, "[%d] store_static_member_access_check: child static public, parent protected, result: skip\n", getpid()); 796 return ZEND_HASH_APPLY_REMOVE; 797 } 798 /* If the static member points to the same value in parent and child, remove for proper inheritance during restore */ 799 if(zend_hash_quick_find(&parent->default_static_members, p->arKey, p->nKeyLength, p->h, (void**)&pprop) == SUCCESS) { 800 ea_debug_printf(EA_DEBUG, "[%d] store_static_member_access_check: SUCCESS looking up arKey\n",getpid()); 801 ea_debug_printf(EA_DEBUG, "[%d] store_static_member_access_check: pprop=%x cprop=%x\n",getpid(), *pprop, *cprop); 802 if(*pprop == *cprop) { 803 ea_debug_printf(EA_DEBUG, "[%d] store_static_member_access_check: pprop == cprop, result: skip\n",getpid()); 804 return ZEND_HASH_APPLY_REMOVE; 805 } 806 } 807 } 808 } 809 ea_debug_printf(EA_DEBUG, "[%d] store_static_member_access_check: result: keep\n",getpid()); 810 return ZEND_HASH_APPLY_KEEP; 811 } 812 744 813 #endif 745 814 … … 751 820 EAG(mem) += sizeof(eaccelerator_class_entry); 752 821 to->type = from->type; 822 ea_debug_printf(EA_DEBUG, "[%d] store_class_entry: class type=%d\n", getpid(), from->type); 753 823 to->name = NULL; 754 824 to->name_length = from->name_length; … … 758 828 to->static_members = NULL; 759 829 to->num_interfaces = from->num_interfaces; 760 761 #if 0 762 // i need to check more. why this field is null. 763 // 764 for (i = 0; i < from->num_interfaces; i++) { 765 if (from->interfaces[i]) { 766 to->interfaces[i] = 767 store_string(from->interfaces[i]->name, 768 from->interfaces[i]->name_length); 769 } 770 } 771 #endif 772 830 /* hrak: no need to really store the interfaces since these get populated 831 * at/after restore by zend_do_inheritance and ZEND_ADD_INTERFACE */ 832 to->interfaces = NULL; 773 833 #endif 774 834 … … 786 846 to->parent = store_string(from->parent->name, from->parent->name_length + 1 TSRMLS_CC); 787 847 788 /*789 if (!from->constants_updated) {790 zend_hash_apply_with_argument(&from->default_properties, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC);791 to->constants_updated = 1;792 }793 */794 848 #ifdef ZEND_ENGINE_2 795 849 to->line_start = from->line_start; … … 808 862 store_zval_hash(&to->constants_table, &from->constants_table); 809 863 store_zval_hash(&to->default_properties, &from->default_properties); 810 store_hash(&to->properties_info, &from->properties_info, (store_bucket_t) store_property_info); 864 //store_hash(&to->properties_info, &from->properties_info, (store_bucket_t) store_property_info, NULL, NULL); 865 store_hash(&to->properties_info, &from->properties_info, (store_bucket_t) store_property_info, (check_bucket_t) store_property_access_check, from); 866 # ifdef ZEND_ENGINE_2_1 867 if((from->static_members != NULL) && (from->static_members != &from->default_static_members)) { 868 store_zval_hash(&to->default_static_members, &from->default_static_members); 869 EACCELERATOR_ALIGN(EAG(mem)); 870 to->static_members = (HashTable *) EAG(mem); 871 EAG(mem) += sizeof(HashTable); 872 store_hash(to->static_members, from->static_members, (store_bucket_t) store_zval_ptr, (check_bucket_t) store_static_member_access_check, from); 873 } else { 874 /*EACCELERATOR_ALIGN(EAG(mem)); 875 to->static_members = (HashTable *) EAG(mem); 876 EAG(mem) += sizeof(HashTable);*/ 877 store_hash(&to->default_static_members, &from->default_static_members, (store_bucket_t) store_zval_ptr, (check_bucket_t) store_static_member_access_check, from); 878 to->static_members = &to->default_static_members; 879 } 880 ea_debug_printf(EA_DEBUG, "[%d] store_class_entry: to->static_members(%x), to->default_static_members(%x)\n", getpid(), to->static_members, &to->default_static_members); 881 # else 811 882 if (from->static_members != NULL) { 812 883 EACCELERATOR_ALIGN(EAG(mem)); … … 815 886 store_zval_hash(to->static_members, from->static_members); 816 887 } 888 # endif 817 889 #else 818 890 store_zval_hash(&to->default_properties, &from->default_properties); 819 891 #endif 820 821 #ifdef ZEND_ENGINE_2_1 822 store_zval_hash(&to->default_static_members, &from->default_static_members); 823 #endif 824 store_hash(&to->function_table, &from->function_table, (store_bucket_t) store_op_array); 892 store_hash(&to->function_table, &from->function_table, (store_bucket_t) store_op_array, NULL, NULL); 825 893 826 894 #ifdef DEBUG eaccelerator/branches/PHP_5_1/eaccelerator.c
r146 r148 884 884 return 0; 885 885 } 886 ea_debug_printf (EA_DEBUG, "[%d] eaccelerator_store: calc_size returned %d, mm=%x", getpid(), size, eaccelerator_mm_instance->mm); 886 887 EACCELERATOR_UNPROTECT(); 887 888 EAG(mem) = eaccelerator_malloc(size); … … 1474 1475 (nreloads == 1) ? "cached" : "re-cached", file_handle->opened_path); 1475 1476 } else { 1476 ea_debug_log("[%d] EACCELERATOR can n't cache: \"%s\"\n", getpid(), file_handle->opened_path);1477 ea_debug_log("[%d] EACCELERATOR can't cache: \"%s\"\n", getpid(), file_handle->opened_path); 1477 1478 } 1478 1479 } else { eaccelerator/branches/PHP_5_1/opcodes.c
r146 r148 210 210 OPDEF("CLONE", EXT_UNUSED | OP1_STD | OP2_UNUSED | RES_VAR), /* 110 */ 211 211 OPDEF("INIT_CTOR_CALL", EXT_UNUSED | OP1_STD | OP2_UNUSED | RES_UNUSED), /* 111 */ 212 OPDEF("INIT_METHOD_CALL", EXT_UNUSED | OP1_STD | OP2_STD | RES_ UNUSED), /* 112 */212 OPDEF("INIT_METHOD_CALL", EXT_UNUSED | OP1_STD | OP2_STD | RES_VAR), /* 112 */ 213 213 OPDEF("INIT_STATIC_METHOD_CALL", EXT_UNUSED | OP1_UCLASS | OP2_STD | RES_UNUSED), /* 113 */ 214 214 OPDEF("ISSET_ISEMPTY_VAR", EXT_ISSET | OP1_STD | OP2_FETCH | RES_TMP), /* 114 */ eaccelerator/branches/PHP_5_1/optimize.c
r146 r148 311 311 case ZEND_FE_FETCH: 312 312 #ifdef ZEND_ENGINE_2 313 case ZEND_INIT_METHOD_CALL: 314 case ZEND_INIT_STATIC_METHOD_CALL: 313 315 case ZEND_ASSIGN_DIM: 314 316 case ZEND_DECLARE_CLASS: