cvs: ZendEngine2 / zend_execute_API.c
| From: | Sterling Hughes | Date: | Wed, 02 Jul 2003 14:44:41 +0000 |
| Subject: | cvs: ZendEngine2 / zend_execute_API.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-1431@lists.php.net to get a copy of this message | ||
sterling Wed Jul 2 10:44:41 2003 EDT
Modified files:
/ZendEngine2 zend_execute_API.c
Log:
optimize the case where the object is really a class name, as we don't need
to set EX(object) here.
Index: ZendEngine2/zend_execute_API.c
diff -u ZendEngine2/zend_execute_API.c:1.215 ZendEngine2/zend_execute_API.c:1.216
--- ZendEngine2/zend_execute_API.c:1.215 Wed Jul 2 10:33:41 2003
+++ ZendEngine2/zend_execute_API.c Wed Jul 2 10:44:41 2003
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_execute_API.c,v 1.215 2003/07/02 14:33:41 sterling Exp $ */
+/* $Id: zend_execute_API.c,v 1.216 2003/07/02 14:44:41 sterling Exp $ */
#include <stdio.h>
#include <signal.h>
@@ -531,33 +531,40 @@
calling_scope = Z_OBJCE_PP(object_pp);
function_table = &calling_scope->function_table;
EX(object) = *object_pp;
- } else if (Z_TYPE_PP(object_pp) == IS_STRING) {
- zend_class_entry **ce;
- char *lc_class;
- int found = FAILURE;
-
- lc_class = zend_str_tolower_dup(Z_STRVAL_PP(object_pp), Z_STRLEN_PP(object_pp));
- if (EG(active_op_array) && strcmp(lc_class, "self") == 0) {
- ce = &(EG(active_op_array)->scope);
- found = (*ce != NULL?SUCCESS:FAILURE);
- } else if (strcmp(lc_class, "parent") == 0 && EG(active_op_array) &&
EG(active_op_array)->scope) {
- ce = &(EG(active_op_array)->scope->parent);
- found = (*ce != NULL?SUCCESS:FAILURE);
- } else {
- found = zend_lookup_class(lc_class, Z_STRLEN_PP(object_pp), &ce TSRMLS_CC);
- }
- efree(lc_class);
- if (found == FAILURE)
- return FAILURE;
-
- function_table = &(*ce)->function_table;
- calling_scope = *ce;
- object_pp = NULL;
- } else
- return FAILURE;
+ }
}
if (*function_pointer == NULL) {
+ if (object_pp) {
+ if (Z_TYPE_PP(object_pp) == IS_STRING) {
+ zend_class_entry **ce;
+ char *lc_class;
+ int found = FAILURE;
+
+ lc_class = zend_str_tolower_dup(Z_STRVAL_PP(object_pp), Z_STRLEN_PP(object_pp));
+ if (EG(active_op_array) && strcmp(lc_class, "self") == 0) {
+ ce = &(EG(active_op_array)->scope);
+ found = (*ce != NULL?SUCCESS:FAILURE);
+ } else if (strcmp(lc_class, "parent") == 0 && EG(active_op_array) &&
EG(active_op_array)->scope) {
+ ce = &(EG(active_op_array)->scope->parent);
+ found = (*ce != NULL?SUCCESS:FAILURE);
+ } else {
+ found = zend_lookup_class(lc_class, Z_STRLEN_PP(object_pp), &ce TSRMLS_CC);
+ }
+ efree(lc_class);
+ if (found == FAILURE)
+ return FAILURE;
+
+ function_table = &(*ce)->function_table;
+ calling_scope = *ce;
+ object_pp = NULL;
+ }
+
+ if (function_table == NULL) {
+ return FAILURE;
+ }
+ }
+
if (function_name->type!=IS_STRING) {
return FAILURE;
}