From 7a96fdff4cf67b1b211fa4219c161af0b9f28ff4 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 7 Dec 2009 08:14:48 +0000 Subject: [PATCH] Fixed bug #50351 (performance regression handling objects, ten times slower in 5.3 than in 5.2. foreach statement should not initiate GC) --- NEWS | 2 ++ Zend/zend_vm_def.h | 4 +--- Zend/zend_vm_execute.h | 6 ++---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/NEWS b/NEWS index 89a0479ac0..bb22014ba0 100644 --- a/NEWS +++ b/NEWS @@ -30,6 +30,8 @@ PHP NEWS - Fixed memory leak in extension loading when an error occurs on Windows. (Pierre) +- Fixed bug #50351 (performance regression handling objects, ten times slower + in 5.3 than in 5.2). (Dmitry) - Fixed bug #50345 (nanosleep not detected properly on some solaris versions). (Jani) - Fixed bug #50340 (php.ini parser does not allow spaces in ini keys). (Jani) diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 52f200e35d..8b574cb46b 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -3691,7 +3691,7 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY) { zend_op *opline = EX(opline); zend_free_op free_op1; - zval *array = GET_OP1_ZVAL_PTR(BP_VAR_R); + zval *array = EX_T(opline->op1.u.var).var.ptr; zval **value; char *str_key; uint str_key_len; @@ -3701,8 +3701,6 @@ ZEND_VM_HANDLER(78, ZEND_FE_FETCH, VAR, ANY) int key_type = 0; zend_bool use_key = (zend_bool)(opline->extended_value & ZEND_FE_FETCH_WITH_KEY); - PZVAL_LOCK(array); - switch (zend_iterator_unwrap(array, &iter TSRMLS_CC)) { default: case ZEND_ITER_INVALID: diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 38bd50be16..74f144a4bb 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -8851,8 +8851,8 @@ static int ZEND_FASTCALL ZEND_FE_RESET_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS) { zend_op *opline = EX(opline); - zend_free_op free_op1; - zval *array = _get_zval_ptr_var(&opline->op1, EX(Ts), &free_op1 TSRMLS_CC); + + zval *array = EX_T(opline->op1.u.var).var.ptr; zval **value; char *str_key; uint str_key_len; @@ -8862,8 +8862,6 @@ static int ZEND_FASTCALL ZEND_FE_FETCH_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG int key_type = 0; zend_bool use_key = (zend_bool)(opline->extended_value & ZEND_FE_FETCH_WITH_KEY); - PZVAL_LOCK(array); - switch (zend_iterator_unwrap(array, &iter TSRMLS_CC)) { default: case ZEND_ITER_INVALID: -- 2.40.0