Changeset 170
- Timestamp:
- 02/21/06 17:45:43 (3 years ago)
- Files:
-
- eaccelerator/trunk/ChangeLog (modified) (1 diff)
- eaccelerator/trunk/ea_restore.c (modified) (4 diffs)
- eaccelerator/trunk/ea_store.c (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
eaccelerator/trunk/ChangeLog
r169 r170 1 2006-02-21 Hans Rakers <hans at parse dot nl> 2 3 * Ditched the variadic macros. They were kinda useless now anyway since 4 they were only passing one arg. This should make the Win32 folks happy 5 since VC6 doesn't seem to support variadic macros (its a C99 thing) 6 * Removed some excessive debug output. 7 1 8 2006-02-20 Bart Vanbrabant <bart.vanbrabant at zoeloelip.be> 2 9 eaccelerator/trunk/ea_restore.c
r167 r170 719 719 zend_class_entry * to TSRMLS_DC) 720 720 { 721 ea_debug_printf(EA_DEBUG, "restore_class_parent: restoring parent class %s of class %s\n", (char *) parent, to->name);722 721 #ifdef ZEND_ENGINE_2 723 722 zend_class_entry** parent_ptr = NULL; 724 723 if (zend_lookup_class(parent, len, &parent_ptr TSRMLS_CC) != SUCCESS) 725 724 #else 726 ea_debug_hash_display(CG(class_table));727 725 char *name_lc = estrndup(parent, len); 728 726 zend_str_tolower(name_lc, len); … … 765 763 fname_len = strlen(f->common.function_name); 766 764 fname_lc = zend_str_tolower_dup(f->common.function_name, fname_len); 767 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);768 765 769 766 if (fname_len == cname_len && !memcmp(fname_lc, cname_lc, fname_len) && … … 900 897 to->default_static_members.pDestructor = ZVAL_PTR_DTOR; 901 898 902 ea_debug_printf(EA_DEBUG, "restore_class_entry: static_members=%x, default_static_members=%x\n", from->static_members, &from->default_static_members);903 899 if (from->static_members != &(from->default_static_members)) { 904 900 ALLOC_HASHTABLE(to->static_members); … … 908 904 to->static_members = &(to->default_static_members); 909 905 } 910 ea_debug_printf(EA_DEBUG, "restore_class_entry: to->static_members=%x, to->default_static_members=%x\n", to->static_members, &to->default_static_members);911 906 # else 912 907 if (from->static_members != NULL) { eaccelerator/trunk/ea_store.c
r166 r170 381 381 382 382 typedef void *(*store_bucket_t) (void *TSRMLS_DC); 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__)383 typedef void *(*check_bucket_t) (Bucket*, zend_class_entry*); 384 385 #define store_hash_ex(to, from, start, store_bucket, check_bucket, from_ce) \ 386 store_hash_int(to, from, start, store_bucket, check_bucket, from_ce) 387 388 #define store_hash(to, from, store_bucket, check_bucket, from_ce) \ 389 store_hash_ex(to, from, (from)->pListHead, store_bucket, check_bucket, from_ce) 390 390 391 391 #define store_zval_hash(to, from) \ … … 408 408 static void store_hash_int(HashTable * target, HashTable * source, 409 409 Bucket * start, store_bucket_t copy_bucket, 410 check_bucket_t check_bucket, ...) 410 check_bucket_t check_bucket, 411 zend_class_entry * from_ce) 411 412 { 412 413 Bucket *p, *np, *prev_p; … … 434 435 /* If a check function has been defined, run it */ 435 436 if (check_bucket) { 436 va_list args;437 va_start(args, check_bucket);438 439 437 /* If the check function returns ZEND_HASH_APPLY_REMOVE, don't store this record, skip over it */ 440 if(check_bucket(p, args)) {438 if(check_bucket(p, from_ce)) { 441 439 p = p->pListNext; 442 440 target->nNumOfElements--; … … 444 442 continue; 445 443 } 446 va_end(args);447 444 } 448 445 … … 767 764 * zend_do_inherit_property_access_check 768 765 */ 769 static int store_property_access_check(Bucket * p, va_list args)770 { 771 zend_class_entry *from = va_arg(args, zend_class_entry*);766 static int store_property_access_check(Bucket * p, zend_class_entry * from_ce) 767 { 768 zend_class_entry *from = from_ce; 772 769 zend_class_entry *parent = from->parent; 773 774 ea_debug_printf(EA_DEBUG, "[%d] store_property_access_check enter. from=%x parent=%x arKey=%s\n", getpid(), from, parent, p->arKey);775 770 776 771 if (parent) { … … 779 774 // for now, just return keep 780 775 } 781 ea_debug_printf(EA_DEBUG, "[%d] store_property_access_check result: keep\n", getpid());782 776 return ZEND_HASH_APPLY_KEEP; 783 777 } 784 778 785 static int store_static_member_access_check(Bucket * p, va_list args)786 { 787 zend_class_entry *from = va_arg(args, zend_class_entry*);779 static int store_static_member_access_check(Bucket * p, zend_class_entry * from_ce) 780 { 781 zend_class_entry *from = from_ce; 788 782 zend_class_entry *parent = from->parent; 789 783 zend_property_info *pinfo, *cinfo = NULL; … … 796 790 /* unpack the \0classname\0membername\0 style property name to seperate vars */ 797 791 zend_unmangle_property_name(p->arKey, &cname, &mname); 798 ea_debug_printf(EA_DEBUG, "[%d] store_static_member_access_check: cname=%s, mname=%s\n", getpid(), cname, mname);799 792 800 793 /* lookup the member's info in parent and child */ … … 804 797 inheritance will handle this properly on restore */ 805 798 if(cinfo->flags & ZEND_ACC_STATIC && (pinfo->flags & ZEND_ACC_PROTECTED && cinfo->flags & ZEND_ACC_PUBLIC)) { 806 ea_debug_printf(EA_DEBUG, "[%d] store_static_member_access_check: child static public, parent protected, result: skip\n", getpid());807 799 return ZEND_HASH_APPLY_REMOVE; 808 800 } … … 813 805 if(zend_hash_quick_find(parent->static_members, p->arKey, p->nKeyLength, p->h, (void**)&pprop) == SUCCESS) { 814 806 # endif 815 ea_debug_printf(EA_DEBUG, "[%d] store_static_member_access_check: SUCCESS looking up arKey\n",getpid());816 ea_debug_printf(EA_DEBUG, "[%d] store_static_member_access_check: pprop=%x cprop=%x\n",getpid(), *pprop, *cprop);817 807 if(*pprop == *cprop) { 818 ea_debug_printf(EA_DEBUG, "[%d] store_static_member_access_check: pprop == cprop, result: skip\n",getpid());819 808 return ZEND_HASH_APPLY_REMOVE; 820 809 } … … 822 811 } 823 812 } 824 ea_debug_printf(EA_DEBUG, "[%d] store_static_member_access_check: result: keep\n",getpid());825 813 return ZEND_HASH_APPLY_KEEP; 826 814 } … … 834 822 * (e.g. "Cannot override final method") and the like. 835 823 */ 836 static int store_function_inheritance_check(Bucket * p, va_list args)837 { 838 zend_class_entry *from = va_arg(args, zend_class_entry*);824 static int store_function_inheritance_check(Bucket * p, zend_class_entry * from_ce) 825 { 826 zend_class_entry *from = from_ce; 839 827 zend_function *zf = p->pData; 840 828 … … 853 841 EAG(mem) += sizeof(eaccelerator_class_entry); 854 842 to->type = from->type; 855 ea_debug_printf(EA_DEBUG, "[%d] store_class_entry: class type=%d\n", getpid(), from->type);856 843 to->name = NULL; 857 844 to->name_length = from->name_length; … … 898 885 store_hash(&to->properties_info, &from->properties_info, (store_bucket_t) store_property_info, (check_bucket_t) store_property_access_check, from); 899 886 # ifdef ZEND_ENGINE_2_1 900 ea_debug_printf(EA_DEBUG, "[%d] store_class_entry: from->static_members(%x), from->default_static_members(%x)\n", getpid(), from->static_members, &from->default_static_members);901 887 if((from->static_members != NULL) && (from->static_members != &from->default_static_members)) { 902 888 store_zval_hash(&to->default_static_members, &from->default_static_members); … … 912 898 to->static_members = &to->default_static_members; 913 899 } 914 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);915 900 # elif defined(ZEND_ENGINE_2) && !defined(ZEND_ENGINE_2_1) 916 901 /* for php-5.0 */