cvs: ZendEngine2 / zend_compile.c zend_vm_def.h zend_vm_execute.h
[email protected] ("Dmitry Stogov") Tue, 10 Mar 2009 10:01:28 -0000
| Newsgroups | php.zend-engine.cvs |
|---|---|
| Message-ID | <cvsdmitry1236679288@cvsserver> |
dmitry Tue Mar 10 10:01:28 2009 UTC
Modified files:
/ZendEngine2 zend_compile.c zend_vm_def.h zend_vm_execute.h
Log:
Clenaup deprecated namespace code
dmitry-20090310100128.txt
(text/plain, 12.3 KB)
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_compile.c?r1=1.850&r2=1.851&diff_format=u
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.850 ZendEngine2/zend_compile.c:1.851
--- ZendEngine2/zend_compile.c:1.850 Tue Jan 20 13:22:25 2009
+++ ZendEngine2/zend_compile.c Tue Mar 10 10:01:28 2009
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_compile.c,v 1.850 2009/01/20 13:22:25 dmitry Exp $ */
+/* $Id: zend_compile.c,v 1.851 2009/03/10 10:01:28 dmitry Exp $ */
#include <zend_language_parser.h>
#include "zend.h"
@@ -2095,7 +2095,6 @@
}
if (class_name->op_type == IS_CONST &&
- method_name->op_type == IS_CONST &&
ZEND_FETCH_CLASS_DEFAULT == zend_get_class_fetch_type(Z_TYPE(class_name->u.constant), Z_UNIVAL(class_name->u.constant), Z_UNILEN(class_name->u.constant))) {
fetch_type = ZEND_FETCH_CLASS_GLOBAL;
zend_resolve_class_name(class_name, &fetch_type, 1 TSRMLS_CC);
@@ -2108,45 +2107,6 @@
opline->op1 = class_node;
opline->op2 = *method_name;
- if (class_node.op_type == IS_CONST &&
- method_name->op_type == IS_CONST) {
- /* Prebuild ns\func name to speedup run-time check.
- The additional names are stored in additional OP_DATA opcode. */
- zstr nsname, fname, lcname;
- unsigned int nsname_len, len, lcname_len;
-
- opline = get_next_op(CG(active_op_array) TSRMLS_CC);
- opline->opcode = ZEND_OP_DATA;
- opline->op1.op_type = IS_CONST;
- SET_UNUSED(opline->op2);
-
- nsname = Z_UNIVAL(class_node.u.constant);
- nsname_len = Z_UNILEN(class_node.u.constant);
- len = nsname_len + 1 + Z_UNILEN(method_name->u.constant);
- if (UG(unicode)) {
- fname.u = eumalloc(len + 1);
- memcpy(fname.u, nsname.u, UBYTES(nsname_len));
- fname.u[nsname_len] = '\\';
- memcpy(fname.u + nsname_len + 1,
- Z_USTRVAL(method_name->u.constant),
- UBYTES(Z_USTRLEN(method_name->u.constant)+1));
- lcname = zend_u_str_case_fold(IS_UNICODE, fname, len, 1, &lcname_len);
- opline->extended_value = zend_u_hash_func(IS_UNICODE, lcname, lcname_len + 1);
- ZVAL_UNICODEL(&opline->op1.u.constant, lcname.u, lcname_len, 0);
- } else {
- fname.s = emalloc(len + 1);
- memcpy(fname.s, nsname.s, nsname_len);
- fname.s[nsname_len] = '\\';
- memcpy(fname.s + nsname_len + 1,
- Z_STRVAL(method_name->u.constant),
- Z_STRLEN(method_name->u.constant)+1);
- lcname = zend_u_str_case_fold(IS_STRING, fname, len, 1, &lcname_len);
- opline->extended_value = zend_u_hash_func(IS_STRING, lcname, lcname_len + 1);
- ZVAL_STRINGL(&opline->op1.u.constant, lcname.s, lcname_len, 0);
- }
- efree(fname.v);
- }
-
zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *));
zend_do_extended_fcall_begin(TSRMLS_C);
return 1; /* Dynamic */
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_vm_def.h?r1=1.256&r2=1.257&diff_format=u
Index: ZendEngine2/zend_vm_def.h
diff -u ZendEngine2/zend_vm_def.h:1.256 ZendEngine2/zend_vm_def.h:1.257
--- ZendEngine2/zend_vm_def.h:1.256 Tue Jan 20 13:22:26 2009
+++ ZendEngine2/zend_vm_def.h Tue Mar 10 10:01:28 2009
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_vm_def.h,v 1.256 2009/01/20 13:22:26 dmitry Exp $ */
+/* $Id: zend_vm_def.h,v 1.257 2009/03/10 10:01:28 dmitry Exp $ */
/* If you change this file, please regenerate the zend_vm_execute.h and
* zend_vm_opcodes.h files by running:
@@ -2016,17 +2016,7 @@
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
- if (OP1_TYPE == IS_CONST && OP2_TYPE == IS_CONST) {
- /* try a function in namespace */
- zend_op *op_data = opline+1;
-
- ZEND_VM_INC_OPCODE();
-
- if (zend_u_hash_quick_find(EG(function_table), Z_TYPE(op_data->op1.u.constant), Z_UNIVAL(op_data->op1.u.constant), Z_UNILEN(op_data->op1.u.constant)+1, op_data->extended_value, (void **) &EX(fbc))==SUCCESS) {
- EX(object) = NULL;
- ZEND_VM_NEXT_OPCODE();
- }
-
+ if (OP1_TYPE == IS_CONST) {
/* no function found. try a static method in class */
ce = zend_u_fetch_class(Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant), Z_UNILEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
if (!ce) {
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_vm_execute.h?r1=1.260&r2=1.261&diff_format=u
Index: ZendEngine2/zend_vm_execute.h
diff -u ZendEngine2/zend_vm_execute.h:1.260 ZendEngine2/zend_vm_execute.h:1.261
--- ZendEngine2/zend_vm_execute.h:1.260 Tue Jan 20 13:22:26 2009
+++ ZendEngine2/zend_vm_execute.h Tue Mar 10 10:01:28 2009
@@ -2671,17 +2671,7 @@
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
- if (IS_CONST == IS_CONST && IS_CONST == IS_CONST) {
- /* try a function in namespace */
- zend_op *op_data = opline+1;
-
- ZEND_VM_INC_OPCODE();
-
- if (zend_u_hash_quick_find(EG(function_table), Z_TYPE(op_data->op1.u.constant), Z_UNIVAL(op_data->op1.u.constant), Z_UNILEN(op_data->op1.u.constant)+1, op_data->extended_value, (void **) &EX(fbc))==SUCCESS) {
- EX(object) = NULL;
- ZEND_VM_NEXT_OPCODE();
- }
-
+ if (IS_CONST == IS_CONST) {
/* no function found. try a static method in class */
ce = zend_u_fetch_class(Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant), Z_UNILEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
if (!ce) {
@@ -3274,17 +3264,7 @@
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
- if (IS_CONST == IS_CONST && IS_TMP_VAR == IS_CONST) {
- /* try a function in namespace */
- zend_op *op_data = opline+1;
-
- ZEND_VM_INC_OPCODE();
-
- if (zend_u_hash_quick_find(EG(function_table), Z_TYPE(op_data->op1.u.constant), Z_UNIVAL(op_data->op1.u.constant), Z_UNILEN(op_data->op1.u.constant)+1, op_data->extended_value, (void **) &EX(fbc))==SUCCESS) {
- EX(object) = NULL;
- ZEND_VM_NEXT_OPCODE();
- }
-
+ if (IS_CONST == IS_CONST) {
/* no function found. try a static method in class */
ce = zend_u_fetch_class(Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant), Z_UNILEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
if (!ce) {
@@ -3756,17 +3736,7 @@
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
- if (IS_CONST == IS_CONST && IS_VAR == IS_CONST) {
- /* try a function in namespace */
- zend_op *op_data = opline+1;
-
- ZEND_VM_INC_OPCODE();
-
- if (zend_u_hash_quick_find(EG(function_table), Z_TYPE(op_data->op1.u.constant), Z_UNIVAL(op_data->op1.u.constant), Z_UNILEN(op_data->op1.u.constant)+1, op_data->extended_value, (void **) &EX(fbc))==SUCCESS) {
- EX(object) = NULL;
- ZEND_VM_NEXT_OPCODE();
- }
-
+ if (IS_CONST == IS_CONST) {
/* no function found. try a static method in class */
ce = zend_u_fetch_class(Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant), Z_UNILEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
if (!ce) {
@@ -3994,17 +3964,7 @@
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
- if (IS_CONST == IS_CONST && IS_UNUSED == IS_CONST) {
- /* try a function in namespace */
- zend_op *op_data = opline+1;
-
- ZEND_VM_INC_OPCODE();
-
- if (zend_u_hash_quick_find(EG(function_table), Z_TYPE(op_data->op1.u.constant), Z_UNIVAL(op_data->op1.u.constant), Z_UNILEN(op_data->op1.u.constant)+1, op_data->extended_value, (void **) &EX(fbc))==SUCCESS) {
- EX(object) = NULL;
- ZEND_VM_NEXT_OPCODE();
- }
-
+ if (IS_CONST == IS_CONST) {
/* no function found. try a static method in class */
ce = zend_u_fetch_class(Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant), Z_UNILEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
if (!ce) {
@@ -4444,17 +4404,7 @@
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
- if (IS_CONST == IS_CONST && IS_CV == IS_CONST) {
- /* try a function in namespace */
- zend_op *op_data = opline+1;
-
- ZEND_VM_INC_OPCODE();
-
- if (zend_u_hash_quick_find(EG(function_table), Z_TYPE(op_data->op1.u.constant), Z_UNIVAL(op_data->op1.u.constant), Z_UNILEN(op_data->op1.u.constant)+1, op_data->extended_value, (void **) &EX(fbc))==SUCCESS) {
- EX(object) = NULL;
- ZEND_VM_NEXT_OPCODE();
- }
-
+ if (IS_CONST == IS_CONST) {
/* no function found. try a static method in class */
ce = zend_u_fetch_class(Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant), Z_UNILEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
if (!ce) {
@@ -10771,17 +10721,7 @@
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
- if (IS_VAR == IS_CONST && IS_CONST == IS_CONST) {
- /* try a function in namespace */
- zend_op *op_data = opline+1;
-
- ZEND_VM_INC_OPCODE();
-
- if (zend_u_hash_quick_find(EG(function_table), Z_TYPE(op_data->op1.u.constant), Z_UNIVAL(op_data->op1.u.constant), Z_UNILEN(op_data->op1.u.constant)+1, op_data->extended_value, (void **) &EX(fbc))==SUCCESS) {
- EX(object) = NULL;
- ZEND_VM_NEXT_OPCODE();
- }
-
+ if (IS_VAR == IS_CONST) {
/* no function found. try a static method in class */
ce = zend_u_fetch_class(Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant), Z_UNILEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
if (!ce) {
@@ -12690,17 +12630,7 @@
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
- if (IS_VAR == IS_CONST && IS_TMP_VAR == IS_CONST) {
- /* try a function in namespace */
- zend_op *op_data = opline+1;
-
- ZEND_VM_INC_OPCODE();
-
- if (zend_u_hash_quick_find(EG(function_table), Z_TYPE(op_data->op1.u.constant), Z_UNIVAL(op_data->op1.u.constant), Z_UNILEN(op_data->op1.u.constant)+1, op_data->extended_value, (void **) &EX(fbc))==SUCCESS) {
- EX(object) = NULL;
- ZEND_VM_NEXT_OPCODE();
- }
-
+ if (IS_VAR == IS_CONST) {
/* no function found. try a static method in class */
ce = zend_u_fetch_class(Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant), Z_UNILEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
if (!ce) {
@@ -14592,17 +14522,7 @@
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
- if (IS_VAR == IS_CONST && IS_VAR == IS_CONST) {
- /* try a function in namespace */
- zend_op *op_data = opline+1;
-
- ZEND_VM_INC_OPCODE();
-
- if (zend_u_hash_quick_find(EG(function_table), Z_TYPE(op_data->op1.u.constant), Z_UNIVAL(op_data->op1.u.constant), Z_UNILEN(op_data->op1.u.constant)+1, op_data->extended_value, (void **) &EX(fbc))==SUCCESS) {
- EX(object) = NULL;
- ZEND_VM_NEXT_OPCODE();
- }
-
+ if (IS_VAR == IS_CONST) {
/* no function found. try a static method in class */
ce = zend_u_fetch_class(Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant), Z_UNILEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
if (!ce) {
@@ -15577,17 +15497,7 @@
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
- if (IS_VAR == IS_CONST && IS_UNUSED == IS_CONST) {
- /* try a function in namespace */
- zend_op *op_data = opline+1;
-
- ZEND_VM_INC_OPCODE();
-
- if (zend_u_hash_quick_find(EG(function_table), Z_TYPE(op_data->op1.u.constant), Z_UNIVAL(op_data->op1.u.constant), Z_UNILEN(op_data->op1.u.constant)+1, op_data->extended_value, (void **) &EX(fbc))==SUCCESS) {
- EX(object) = NULL;
- ZEND_VM_NEXT_OPCODE();
- }
-
+ if (IS_VAR == IS_CONST) {
/* no function found. try a static method in class */
ce = zend_u_fetch_class(Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant), Z_UNILEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
if (!ce) {
@@ -17113,17 +17023,7 @@
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), EX(called_scope));
- if (IS_VAR == IS_CONST && IS_CV == IS_CONST) {
- /* try a function in namespace */
- zend_op *op_data = opline+1;
-
- ZEND_VM_INC_OPCODE();
-
- if (zend_u_hash_quick_find(EG(function_table), Z_TYPE(op_data->op1.u.constant), Z_UNIVAL(op_data->op1.u.constant), Z_UNILEN(op_data->op1.u.constant)+1, op_data->extended_value, (void **) &EX(fbc))==SUCCESS) {
- EX(object) = NULL;
- ZEND_VM_NEXT_OPCODE();
- }
-
+ if (IS_VAR == IS_CONST) {
/* no function found. try a static method in class */
ce = zend_u_fetch_class(Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant), Z_UNILEN(opline->op1.u.constant), opline->extended_value TSRMLS_CC);
if (!ce) {