com php-src: Drop dead zend_optimizer_lookup_cv() f unction: ext/opcache/Optimizer/zend_optimizer.c ext/o pcache/Optimizer/zend_optimizer_internal.h

[email protected] (Nikita Popov)
Newsgroups php.cvs
Message-ID <[email protected]>
Commit:    4cd5e6816bd2827cb3e319ab949afbdcebdfc469
Author:    Nikita Popov <[email protected]>         Mon, 17 Apr 2017 12:20:25 +0200
Parents:   88c85cbd5cb4b83529a1adc9e6aa8cff1b2d2322
Branches:  master

Link:       http://git.php.net/?p=php-src.git;a=commitdiff;h=4cd5e6816bd2827cb3e319ab949afbdcebdfc469

Log:
Drop dead zend_optimizer_lookup_cv() function

Changed paths:
  M  ext/opcache/Optimizer/zend_optimizer.c
  M  ext/opcache/Optimizer/zend_optimizer_internal.h


Diff:
diff --git a/ext/opcache/Optimizer/zend_optimizer.c b/ext/opcache/Optimizer/zend_optimizer.c
index 5fd6484..241f594 100644
--- a/ext/opcache/Optimizer/zend_optimizer.c
+++ b/ext/opcache/Optimizer/zend_optimizer.c
@@ -64,46 +64,6 @@ int zend_optimizer_get_collected_constant(HashTable *constants, zval *name, zval
 	return 0;
 }
 
-int zend_optimizer_lookup_cv(zend_op_array *op_array, zend_string* name)
-{
-	int i = 0;
-	zend_ulong hash_value = zend_string_hash_val(name);
-
-	while (i < op_array->last_var) {
-		if (op_array->vars[i] == name ||
-		    (ZSTR_H(op_array->vars[i]) == hash_value &&
-		     ZSTR_LEN(op_array->vars[i]) == ZSTR_LEN(name) &&
-		     memcmp(ZSTR_VAL(op_array->vars[i]), ZSTR_VAL(name), ZSTR_LEN(name)) == 0)) {
-			return (int)(zend_intptr_t)ZEND_CALL_VAR_NUM(NULL, i);
-		}
-		i++;
-	}
-	i = op_array->last_var;
-	op_array->last_var++;
-	op_array->vars = erealloc(op_array->vars, op_array->last_var * sizeof(zend_string*));
-	op_array->vars[i] = zend_string_dup(name, 0);
-
-	/* all IS_TMP_VAR and IS_VAR variable numbers have to be adjusted */
-	{
-		zend_op *opline = op_array->opcodes;
-		zend_op *end = opline + op_array->last;
-		while (opline < end) {
-			if (opline->op1_type & (IS_TMP_VAR|IS_VAR)) {
-				opline->op1.var += sizeof(zval);
-			}
-			if (opline->op2_type & (IS_TMP_VAR|IS_VAR)) {
-				opline->op2.var += sizeof(zval);
-			}
-			if (opline->result_type & (IS_TMP_VAR|IS_VAR)) {
-				opline->result.var += sizeof(zval);
-			}
-			opline++;
-		}
-	}
-
-	return (int)(zend_intptr_t)ZEND_CALL_VAR_NUM(NULL, i);
-}
-
 int zend_optimizer_add_literal(zend_op_array *op_array, zval *zv)
 {
 	int i = op_array->last_literal;
diff --git a/ext/opcache/Optimizer/zend_optimizer_internal.h b/ext/opcache/Optimizer/zend_optimizer_internal.h
index 7101813..71a9020 100644
--- a/ext/opcache/Optimizer/zend_optimizer_internal.h
+++ b/ext/opcache/Optimizer/zend_optimizer_internal.h
@@ -80,7 +80,6 @@ int  zend_optimizer_add_literal(zend_op_array *op_array, zval *zv);
 int  zend_optimizer_get_persistent_constant(zend_string *name, zval *result, int copy);
 void zend_optimizer_collect_constant(zend_optimizer_ctx *ctx, zval *name, zval* value);
 int  zend_optimizer_get_collected_constant(HashTable *constants, zval *name, zval* value);
-int  zend_optimizer_lookup_cv(zend_op_array *op_array, zend_string* name);
 int zend_optimizer_update_op1_const(zend_op_array *op_array,
                                     zend_op       *opline,
                                     zval          *val);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.