dmitry                                   Tue, 18 Aug 2009 10:12:32 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=287443

Log:
Fixed ability to call user functions from user opcodes without recursion

Changed paths:
    U   php/php-src/branches/PHP_5_3/Zend/zend_execute.h
    U   php/php-src/branches/PHP_5_3/Zend/zend_vm_def.h
    U   php/php-src/branches/PHP_5_3/Zend/zend_vm_execute.h
    U   php/php-src/trunk/Zend/zend_execute.h
    U   php/php-src/trunk/Zend/zend_vm_def.h
    U   php/php-src/trunk/Zend/zend_vm_execute.h

Modified: php/php-src/branches/PHP_5_3/Zend/zend_execute.h
===================================================================
--- php/php-src/branches/PHP_5_3/Zend/zend_execute.h    2009-08-18 09:45:17 UTC 
(rev 287442)
+++ php/php-src/branches/PHP_5_3/Zend/zend_execute.h    2009-08-18 10:12:32 UTC 
(rev 287443)
@@ -351,6 +351,8 @@
 #define ZEND_USER_OPCODE_CONTINUE   0 /* execute next opcode */
 #define ZEND_USER_OPCODE_RETURN     1 /* exit from executor (return from 
function) */
 #define ZEND_USER_OPCODE_DISPATCH   2 /* call original opcode handler */
+#define ZEND_USER_OPCODE_ENTER      3 /* enter into new op_array without 
recursion */
+#define ZEND_USER_OPCODE_LEAVE      4 /* return to calling op_array within the 
same executor */

 #define ZEND_USER_OPCODE_DISPATCH_TO 0x100 /* call original handler of 
returned opcode */


Modified: php/php-src/branches/PHP_5_3/Zend/zend_vm_def.h
===================================================================
--- php/php-src/branches/PHP_5_3/Zend/zend_vm_def.h     2009-08-18 09:45:17 UTC 
(rev 287442)
+++ php/php-src/branches/PHP_5_3/Zend/zend_vm_def.h     2009-08-18 10:12:32 UTC 
(rev 287443)
@@ -2328,16 +2328,12 @@
                        EX_T(opline->result.u.var).var.fcall_returned_reference 
= EX(function_state).function->common.return_reference;
                }

-#ifndef ZEND_VM_EXPORT
                if (zend_execute == execute && !EG(exception)) {
                        EX(call_opline) = opline;
                        ZEND_VM_ENTER();
                } else {
                        zend_execute(EG(active_op_array) TSRMLS_CC);
                }
-#else
-               zend_execute(EG(active_op_array) TSRMLS_CC);
-#endif

                EG(opline_ptr) = &EX(opline);
                EG(active_op_array) = EX(op_array);
@@ -4358,6 +4354,10 @@
                        ZEND_VM_CONTINUE();
                case ZEND_USER_OPCODE_RETURN:
                        ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper);
+               case ZEND_USER_OPCODE_ENTER:
+                       ZEND_VM_ENTER();
+               case ZEND_USER_OPCODE_LEAVE:
+                       ZEND_VM_LEAVE();
                case ZEND_USER_OPCODE_DISPATCH:
                        ZEND_VM_DISPATCH(EX(opline)->opcode, EX(opline));
                default:

Modified: php/php-src/branches/PHP_5_3/Zend/zend_vm_execute.h
===================================================================
--- php/php-src/branches/PHP_5_3/Zend/zend_vm_execute.h 2009-08-18 09:45:17 UTC 
(rev 287442)
+++ php/php-src/branches/PHP_5_3/Zend/zend_vm_execute.h 2009-08-18 10:12:32 UTC 
(rev 287443)
@@ -330,16 +330,12 @@
                        EX_T(opline->result.u.var).var.fcall_returned_reference 
= EX(function_state).function->common.return_reference;
                }

-#if 1
                if (zend_execute == execute && !EG(exception)) {
                        EX(call_opline) = opline;
                        ZEND_VM_ENTER();
                } else {
                        zend_execute(EG(active_op_array) TSRMLS_CC);
                }
-#else
-               zend_execute(EG(active_op_array) TSRMLS_CC);
-#endif

                EG(opline_ptr) = &EX(opline);
                EG(active_op_array) = EX(op_array);
@@ -699,6 +695,10 @@
                        ZEND_VM_CONTINUE();
                case ZEND_USER_OPCODE_RETURN:
                        return 
zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+               case ZEND_USER_OPCODE_ENTER:
+                       ZEND_VM_ENTER();
+               case ZEND_USER_OPCODE_LEAVE:
+                       ZEND_VM_LEAVE();
                case ZEND_USER_OPCODE_DISPATCH:
                        ZEND_VM_DISPATCH(EX(opline)->opcode, EX(opline));
                default:

Modified: php/php-src/trunk/Zend/zend_execute.h
===================================================================
--- php/php-src/trunk/Zend/zend_execute.h       2009-08-18 09:45:17 UTC (rev 
287442)
+++ php/php-src/trunk/Zend/zend_execute.h       2009-08-18 10:12:32 UTC (rev 
287443)
@@ -372,6 +372,8 @@
 #define ZEND_USER_OPCODE_CONTINUE   0 /* execute next opcode */
 #define ZEND_USER_OPCODE_RETURN     1 /* exit from executor (return from 
function) */
 #define ZEND_USER_OPCODE_DISPATCH   2 /* call original opcode handler */
+#define ZEND_USER_OPCODE_ENTER      3 /* enter into new op_array without 
recursion */
+#define ZEND_USER_OPCODE_LEAVE      4 /* return to calling op_array within the 
same executor */

 #define ZEND_USER_OPCODE_DISPATCH_TO 0x100 /* call original handler of 
returned opcode */


Modified: php/php-src/trunk/Zend/zend_vm_def.h
===================================================================
--- php/php-src/trunk/Zend/zend_vm_def.h        2009-08-18 09:45:17 UTC (rev 
287442)
+++ php/php-src/trunk/Zend/zend_vm_def.h        2009-08-18 10:12:32 UTC (rev 
287443)
@@ -2405,16 +2405,12 @@
                        EX_T(opline->result.u.var).var.fcall_returned_reference 
= EX(function_state).function->common.return_reference;
                }

-#ifndef ZEND_VM_EXPORT
                if (zend_execute == execute && !EG(exception)) {
                        EX(call_opline) = opline;
                        ZEND_VM_ENTER();
                } else {
                        zend_execute(EG(active_op_array) TSRMLS_CC);
                }
-#else
-               zend_execute(EG(active_op_array) TSRMLS_CC);
-#endif

                EG(opline_ptr) = &EX(opline);
                EG(active_op_array) = EX(op_array);
@@ -4566,6 +4562,10 @@
                        ZEND_VM_CONTINUE();
                case ZEND_USER_OPCODE_RETURN:
                        ZEND_VM_DISPATCH_TO_HELPER(zend_leave_helper);
+               case ZEND_USER_OPCODE_ENTER:
+                       ZEND_VM_ENTER();
+               case ZEND_USER_OPCODE_LEAVE:
+                       ZEND_VM_LEAVE();
                case ZEND_USER_OPCODE_DISPATCH:
                        ZEND_VM_DISPATCH(EX(opline)->opcode, EX(opline));
                default:

Modified: php/php-src/trunk/Zend/zend_vm_execute.h
===================================================================
--- php/php-src/trunk/Zend/zend_vm_execute.h    2009-08-18 09:45:17 UTC (rev 
287442)
+++ php/php-src/trunk/Zend/zend_vm_execute.h    2009-08-18 10:12:32 UTC (rev 
287443)
@@ -338,16 +338,12 @@
                        EX_T(opline->result.u.var).var.fcall_returned_reference 
= EX(function_state).function->common.return_reference;
                }

-#if 1
                if (zend_execute == execute && !EG(exception)) {
                        EX(call_opline) = opline;
                        ZEND_VM_ENTER();
                } else {
                        zend_execute(EG(active_op_array) TSRMLS_CC);
                }
-#else
-               zend_execute(EG(active_op_array) TSRMLS_CC);
-#endif

                EG(opline_ptr) = &EX(opline);
                EG(active_op_array) = EX(op_array);
@@ -707,6 +703,10 @@
                        ZEND_VM_CONTINUE();
                case ZEND_USER_OPCODE_RETURN:
                        return 
zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
+               case ZEND_USER_OPCODE_ENTER:
+                       ZEND_VM_ENTER();
+               case ZEND_USER_OPCODE_LEAVE:
+                       ZEND_VM_LEAVE();
                case ZEND_USER_OPCODE_DISPATCH:
                        ZEND_VM_DISPATCH(EX(opline)->opcode, EX(opline));
                default:

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to