dmitry                                   Fri, 23 Apr 2010 08:56:03 +0000

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

Log:
Use fast class fetch function

Changed paths:
    U   php/php-src/trunk/Zend/zend_compile.c
    U   php/php-src/trunk/Zend/zend_execute_API.c
    U   php/php-src/trunk/Zend/zend_vm_def.h
    U   php/php-src/trunk/Zend/zend_vm_execute.h

Modified: php/php-src/trunk/Zend/zend_compile.c
===================================================================
--- php/php-src/trunk/Zend/zend_compile.c       2010-04-23 08:06:49 UTC (rev 
298368)
+++ php/php-src/trunk/Zend/zend_compile.c       2010-04-23 08:56:03 UTC (rev 
298369)
@@ -4506,10 +4506,11 @@

        opline = get_next_op(CG(active_op_array) TSRMLS_CC);
        opline->opcode = ZEND_ADD_TRAIT;
-  SET_NODE(opline->op1, &CG(implementing_class));
+       SET_NODE(opline->op1, &CG(implementing_class));
        zend_resolve_class_name(trait_name, &opline->extended_value, 0 
TSRMLS_CC);
        opline->extended_value = (opline->extended_value & 
~ZEND_FETCH_CLASS_MASK) | ZEND_FETCH_CLASS_TRAIT;
-       SET_NODE(opline->op2, trait_name);
+       opline->op2_type = IS_CONST;
+       opline->op2.constant = zend_add_class_name_literal(CG(active_op_array), 
&trait_name->u.constant TSRMLS_CC);
        CG(active_class_entry)->num_traits++;
 }
 /* }}} */

Modified: php/php-src/trunk/Zend/zend_execute_API.c
===================================================================
--- php/php-src/trunk/Zend/zend_execute_API.c   2010-04-23 08:06:49 UTC (rev 
298368)
+++ php/php-src/trunk/Zend/zend_execute_API.c   2010-04-23 08:56:03 UTC (rev 
298369)
@@ -1584,6 +1584,8 @@
                        if ((fetch_type & ZEND_FETCH_CLASS_SILENT) == 0 && 
!EG(exception)) {
                                if ((fetch_type & ZEND_FETCH_CLASS_MASK) == 
ZEND_FETCH_CLASS_INTERFACE) {
                                        zend_error(E_ERROR, "Interface '%s' not 
found", class_name);
+                               } else if ((fetch_type & ZEND_FETCH_CLASS_MASK) 
== ZEND_FETCH_CLASS_TRAIT) {
+                       zend_error(E_ERROR, "Trait '%s' not found", class_name);
                                } else {
                                        zend_error(E_ERROR, "Class '%s' not 
found", class_name);
                                }

Modified: php/php-src/trunk/Zend/zend_vm_def.h
===================================================================
--- php/php-src/trunk/Zend/zend_vm_def.h        2010-04-23 08:06:49 UTC (rev 
298368)
+++ php/php-src/trunk/Zend/zend_vm_def.h        2010-04-23 08:56:03 UTC (rev 
298369)
@@ -4642,8 +4642,9 @@
 {
        zend_op *opline = EX(opline);
        zend_class_entry *ce = EX_T(opline->op1.var).class_entry;
-       zend_class_entry *trait = zend_fetch_class(Z_STRVAL_P(opline->op2.zv),
+       zend_class_entry *trait = 
zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv),
                                              Z_STRLEN_P(opline->op2.zv),
+                                             opline->op2.literal + 1,
                                              opline->extended_value TSRMLS_CC);

        if (trait) {

Modified: php/php-src/trunk/Zend/zend_vm_execute.h
===================================================================
--- php/php-src/trunk/Zend/zend_vm_execute.h    2010-04-23 08:06:49 UTC (rev 
298368)
+++ php/php-src/trunk/Zend/zend_vm_execute.h    2010-04-23 08:56:03 UTC (rev 
298369)
@@ -685,8 +685,9 @@
 {
        zend_op *opline = EX(opline);
        zend_class_entry *ce = EX_T(opline->op1.var).class_entry;
-       zend_class_entry *trait = zend_fetch_class(Z_STRVAL_P(opline->op2.zv),
+       zend_class_entry *trait = 
zend_fetch_class_by_name(Z_STRVAL_P(opline->op2.zv),
                                              Z_STRLEN_P(opline->op2.zv),
+                                             opline->op2.literal + 1,
                                              opline->extended_value TSRMLS_CC);

        if (trait) {

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

Reply via email to