cvs: ZendEngine2 / zend_compile.c zend_hash.c zend_hash.h
[email protected] ("David Soria Parra") Wed, 27 May 2009 11:58:44 -0000
| Newsgroups | php.zend-engine.cvs |
|---|---|
| Message-ID | <cvsdsp1243425524@cvsserver> |
dsp Wed May 27 11:58:44 2009 UTC
Modified files:
/ZendEngine2 zend_compile.c zend_hash.c zend_hash.h
Log:
Remove duplicated code of zend_hash_func and alias it to zend_get_hash_value
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_compile.c?r1=1.858&r2=1.859&diff_format=u
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.858 ZendEngine2/zend_compile.c:1.859
--- ZendEngine2/zend_compile.c:1.858 Mon May 25 14:32:13 2009
+++ ZendEngine2/zend_compile.c Wed May 27 11:58:44 2009
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_compile.c,v 1.858 2009/05/25 14:32:13 felipe Exp $ */
+/* $Id: zend_compile.c,v 1.859 2009/05/27 11:58:44 dsp Exp $ */
#include <zend_language_parser.h>
#include "zend.h"
@@ -1459,7 +1459,7 @@
current_op = ¤t_op_array->opcodes[current_op_number];
current_op->opcode = ZEND_DECLARE_LAMBDA_FUNCTION;
zval_dtor(¤t_op->op2.u.constant);
- ZVAL_LONG(¤t_op->op2.u.constant, zend_u_hash_func(Z_TYPE(current_op->op1.u.constant), Z_UNIVAL(current_op->op1.u.constant), Z_UNILEN(current_op->op1.u.constant)));
+ ZVAL_LONG(¤t_op->op2.u.constant, zend_u_get_hash_value(Z_TYPE(current_op->op1.u.constant), Z_UNIVAL(current_op->op1.u.constant), Z_UNILEN(current_op->op1.u.constant)));
current_op->result = *result;
if (is_static) {
CG(active_op_array)->fn_flags |= ZEND_ACC_STATIC;
@@ -1695,7 +1695,7 @@
Z_TYPE(opline->op1.u.constant) = Z_TYPE(opline->op2.u.constant);
Z_UNIVAL(opline->op1.u.constant) = zend_u_str_case_fold(Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant), Z_UNILEN(opline->op2.u.constant), 0, &len);
Z_UNILEN(opline->op1.u.constant) = len;
- opline->extended_value = zend_u_hash_func(Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant), Z_UNILEN(opline->op1.u.constant) + 1);
+ opline->extended_value = zend_u_get_hash_value(Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant), Z_UNILEN(opline->op1.u.constant) + 1);
} else {
opline->extended_value = 0;
SET_UNUSED(opline->op1);
@@ -1741,7 +1741,7 @@
type = Z_TYPE(opline->op1.u.constant) = Z_TYPE(opline->op2.u.constant);
Z_UNIVAL(opline->op1.u.constant) = zend_u_str_case_fold(Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant), Z_UNILEN(opline->op2.u.constant), 0, &len);
Z_UNILEN(opline->op1.u.constant) = len;
- opline->extended_value = zend_u_hash_func(Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant), Z_UNILEN(opline->op1.u.constant) + 1);
+ opline->extended_value = zend_u_get_hash_value(Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant), Z_UNILEN(opline->op1.u.constant) + 1);
if(Z_TYPE(opline->op1.u.constant) == IS_UNICODE) {
slash.u = u_memrchr(Z_USTRVAL(opline->op1.u.constant), '\\', Z_USTRLEN(opline->op1.u.constant));
if(!slash.u) {
@@ -1765,7 +1765,7 @@
/* this is the length of namespace prefix */
Z_LVAL(opline2->op1.u.constant) = prefix_len;
/* this is the hash of the non-prefixed part, lowercased */
- opline2->extended_value = zend_u_hash_func(type, slash, name_len+1);
+ opline2->extended_value = zend_u_get_hash_value(type, slash, name_len+1);
SET_UNUSED(opline2->op2);
} else {
opline->opcode = ZEND_INIT_FCALL_BY_NAME;
@@ -1775,7 +1775,7 @@
Z_TYPE(opline->op1.u.constant) = Z_TYPE(opline->op2.u.constant);
Z_UNIVAL(opline->op1.u.constant) = zend_u_str_case_fold(Z_TYPE(opline->op2.u.constant), Z_UNIVAL(opline->op2.u.constant), Z_UNILEN(opline->op2.u.constant), 0, &len);
Z_UNILEN(opline->op1.u.constant) = len;
- opline->extended_value = zend_u_hash_func(Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant), Z_UNILEN(opline->op1.u.constant) + 1);
+ opline->extended_value = zend_u_get_hash_value(Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant), Z_UNILEN(opline->op1.u.constant) + 1);
} else {
opline->extended_value = 0;
SET_UNUSED(opline->op1);
@@ -2100,7 +2100,7 @@
if (!is_method && !is_dynamic_fcall && function_name->op_type==IS_CONST) {
opline->opcode = ZEND_DO_FCALL;
opline->op1 = *function_name;
- ZVAL_LONG(&opline->op2.u.constant, zend_u_hash_func(Z_TYPE(function_name->u.constant), Z_UNIVAL(function_name->u.constant), Z_UNILEN(function_name->u.constant) + 1));
+ ZVAL_LONG(&opline->op2.u.constant, zend_u_get_hash_value(Z_TYPE(function_name->u.constant), Z_UNIVAL(function_name->u.constant), Z_UNILEN(function_name->u.constant) + 1));
} else {
opline->opcode = ZEND_DO_FCALL_BY_NAME;
SET_UNUSED(opline->op1);
@@ -4158,7 +4158,7 @@
opline->op1.op_type = IS_CONST;
opline->extended_value = 1;
SET_UNUSED(opline->op2);
- ZVAL_LONG(&opline->op2.u.constant, zend_u_hash_func(Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant), Z_UNILEN(opline->op1.u.constant)+1));
+ ZVAL_LONG(&opline->op2.u.constant, zend_u_get_hash_value(Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant), Z_UNILEN(opline->op1.u.constant)+1));
*result = opline->result;
}
/* }}} */
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_hash.c?r1=1.165&r2=1.166&diff_format=u
Index: ZendEngine2/zend_hash.c
diff -u ZendEngine2/zend_hash.c:1.165 ZendEngine2/zend_hash.c:1.166
--- ZendEngine2/zend_hash.c:1.165 Mon May 25 01:16:19 2009
+++ ZendEngine2/zend_hash.c Wed May 27 11:58:44 2009
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_hash.c,v 1.165 2009/05/25 01:16:19 pollita Exp $ */
+/* $Id: zend_hash.c,v 1.166 2009/05/27 11:58:44 dsp Exp $ */
#include "zend.h"
#include "zend_operators.h"
@@ -120,18 +120,6 @@
static int zend_hash_do_resize(HashTable *ht);
-ZEND_API ulong zend_u_hash_func(zend_uchar type, zstr arKey, uint nKeyLength) /* {{{ */
-{
- return zend_u_inline_hash_func(type, arKey, nKeyLength);
-}
-/* }}} */
-
-ZEND_API ulong zend_hash_func(const char *arKey, uint nKeyLength) /* {{{ */
-{
- return zend_u_hash_func(IS_STRING, ZSTR(arKey), nKeyLength);
-}
-/* }}} */
-
#define UPDATE_DATA(ht, p, pData, nDataSize) \
if (nDataSize == sizeof(void*)) { \
if ((p)->pData != &(p)->pDataPtr) { \
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_hash.h?r1=1.103&r2=1.104&diff_format=u
Index: ZendEngine2/zend_hash.h
diff -u ZendEngine2/zend_hash.h:1.103 ZendEngine2/zend_hash.h:1.104
--- ZendEngine2/zend_hash.h:1.103 Mon May 25 01:16:19 2009
+++ ZendEngine2/zend_hash.h Wed May 27 11:58:44 2009
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_hash.h,v 1.103 2009/05/25 01:16:19 pollita Exp $ */
+/* $Id: zend_hash.h,v 1.104 2009/05/27 11:58:44 dsp Exp $ */
#ifndef ZEND_HASH_H
#define ZEND_HASH_H
@@ -352,8 +352,8 @@
#define zend_u_inline_hash_func(type, arKey, nKeyLength) \
zend_inline_hash_func(arKey.s, USTR_BYTES(type, nKeyLength))
-ZEND_API ulong zend_hash_func(const char *arKey, uint nKeyLength);
-ZEND_API ulong zend_u_hash_func(zend_uchar type, zstr arKey, uint nKeyLength);
+#define zend_hash_func(arKey, nKeyLength) zend_get_hash_value(arKey, nKeyLength)
+#define zend_u_hash_func(type, arKey, nKeyLength) zend_u_get_hash_value(type, arKey, nKeyLength)
#if ZEND_DEBUG
/* debug */