com php-src: Remove useless parts of EX(old_error_reporti ng): Zend/zend_compile.h Zend/zend_execute.c Zend/zend_types.h Zend/zend_vm_def.h
Zend/zend_ vm_execute.h
| From: | Dmitry Stogov | Date: | Tue, 07 Oct 2014 13:54:24 +0000 |
| Subject: | com php-src: Remove useless parts of EX(old_error_reporti ng): Zend/zend_compile.h Zend/zend_execute.c Zend/zend_types.h Zend/zend_vm_def.h Zend/zend_ vm_execute.h |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-82173@lists.php.net to get a copy of this message | ||
Commit: 67be34ec95d48d7b5ce85200f96ce05e8d409f99
Author: Dmitry Stogov <dmitry@zend.com> Tue, 7 Oct 2014 17:54:24 +0400
Parents: 33e137d409f552f35bf73ccb76c37b1ee0d65e2f
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=67be34ec95d48d7b5ce85200f96ce05e8d409f99
Log:
Remove useless parts of EX(old_error_reporting)
Changed paths:
M Zend/zend_compile.h
M Zend/zend_execute.c
M Zend/zend_types.h
M Zend/zend_vm_def.h
M Zend/zend_vm_execute.h
Diff:
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index 5490263..55100ac 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -370,7 +370,8 @@ struct _zend_execute_data {
zend_array *symbol_table;
const zend_op *fast_ret; /* used by FAST_CALL/FAST_RET (finally keyword) */
zend_object *delayed_exception;
- zval old_error_reporting;
+ uint32_t silence_op_num;
+ uint32_t old_error_reporting;
};
#define VM_FRAME_KIND_MASK 0x000000ff
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c
index 2cf1548..0c455b8 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -1433,7 +1433,7 @@ static zend_always_inline void i_init_func_execute_data(zend_execute_data
*execu
EX(return_value) = return_value;
EX(scope) = EG(scope);
EX(delayed_exception) = NULL;
- ZVAL_UNDEF(&EX(old_error_reporting));
+ EX(silence_op_num) = -1;
/* Handle arguments */
first_extra_arg = op_array->num_args;
@@ -1500,7 +1500,7 @@ static zend_always_inline void i_init_code_execute_data(zend_execute_data
*execu
EX(return_value) = return_value;
EX(scope) = EG(scope);
EX(delayed_exception) = NULL;
- ZVAL_UNDEF(&EX(old_error_reporting));
+ EX(silence_op_num) = -1;
zend_attach_symbol_table(execute_data);
@@ -1527,7 +1527,7 @@ static zend_always_inline void i_init_execute_data(zend_execute_data
*execute_da
EX(return_value) = return_value;
EX(scope) = EG(scope);
EX(delayed_exception) = NULL;
- ZVAL_UNDEF(&EX(old_error_reporting));
+ EX(silence_op_num) = -1;
if (UNEXPECTED(EX(symbol_table) != NULL)) {
zend_attach_symbol_table(execute_data);
diff --git a/Zend/zend_types.h b/Zend/zend_types.h
index 1ac7b29..b7e8068 100644
--- a/Zend/zend_types.h
+++ b/Zend/zend_types.h
@@ -141,7 +141,6 @@ struct _zval_struct {
uint32_t next; /* hash collision chain */
uint32_t cache_slot; /* literal cache slot */
uint32_t lineno; /* line number (for ast nodes) */
- uint32_t silence_num; /* BEGIN_SILENCE op number */
} u2;
};
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index d641442..fd4311c 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -5097,9 +5097,9 @@ ZEND_VM_HANDLER(57, ZEND_BEGIN_SILENCE, ANY, ANY)
SAVE_OPLINE();
ZVAL_LONG(EX_VAR(opline->result.var), EG(error_reporting));
- if (Z_TYPE(EX(old_error_reporting)) == IS_UNDEF) {
- ZVAL_LONG(&EX(old_error_reporting), EG(error_reporting));
- EX(old_error_reporting).u2.silence_num = opline->op2.num;
+ if (EX(silence_op_num) == -1) {
+ EX(silence_op_num) = opline->op2.num;
+ EX(old_error_reporting) = EG(error_reporting);
}
if (EG(error_reporting)) {
@@ -5138,9 +5138,8 @@ ZEND_VM_HANDLER(58, ZEND_END_SILENCE, TMP, ANY)
if (!EG(error_reporting) && Z_LVAL_P(EX_VAR(opline->op1.var)) != 0) {
EG(error_reporting) = Z_LVAL_P(EX_VAR(opline->op1.var));
}
- if (Z_TYPE(EX(old_error_reporting)) != IS_UNDEF &&
- EX(old_error_reporting).u2.silence_num == opline->op2.num) {
- ZVAL_UNDEF(&EX(old_error_reporting));
+ if (EX(silence_op_num) == opline->op2.num) {
+ EX(silence_op_num) = -1;
}
ZEND_VM_NEXT_OPCODE();
}
@@ -5495,10 +5494,10 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
}
/* restore previous error_reporting value */
- if (!EG(error_reporting) && Z_TYPE(EX(old_error_reporting)) != IS_UNDEF &&
Z_LVAL(EX(old_error_reporting)) != 0) {
- EG(error_reporting) = Z_LVAL(EX(old_error_reporting));
+ if (!EG(error_reporting) && EX(silence_op_num) != -1 && EX(old_error_reporting) !=
0) {
+ EG(error_reporting) = EX(old_error_reporting);
}
- ZVAL_UNDEF(&EX(old_error_reporting));
+ EX(silence_op_num) = -1;
if (finally_op_num && (!catch_op_num || catch_op_num >= finally_op_num)) {
if (EX(delayed_exception)) {
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 81f75a7..4937bce 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -1080,9 +1080,9 @@ static int ZEND_FASTCALL
ZEND_BEGIN_SILENCE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
ZVAL_LONG(EX_VAR(opline->result.var), EG(error_reporting));
- if (Z_TYPE(EX(old_error_reporting)) == IS_UNDEF) {
- ZVAL_LONG(&EX(old_error_reporting), EG(error_reporting));
- EX(old_error_reporting).u2.silence_num = opline->op2.num;
+ if (EX(silence_op_num) == -1) {
+ EX(silence_op_num) = opline->op2.num;
+ EX(old_error_reporting) = EG(error_reporting);
}
if (EG(error_reporting)) {
@@ -1321,10 +1321,10 @@ static int ZEND_FASTCALL
ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER
}
/* restore previous error_reporting value */
- if (!EG(error_reporting) && Z_TYPE(EX(old_error_reporting)) != IS_UNDEF &&
Z_LVAL(EX(old_error_reporting)) != 0) {
- EG(error_reporting) = Z_LVAL(EX(old_error_reporting));
+ if (!EG(error_reporting) && EX(silence_op_num) != -1 && EX(old_error_reporting) !=
0) {
+ EG(error_reporting) = EX(old_error_reporting);
}
- ZVAL_UNDEF(&EX(old_error_reporting));
+ EX(silence_op_num) = -1;
if (finally_op_num && (!catch_op_num || catch_op_num >= finally_op_num)) {
if (EX(delayed_exception)) {
@@ -10106,9 +10106,8 @@ static int ZEND_FASTCALL
ZEND_END_SILENCE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_
if (!EG(error_reporting) && Z_LVAL_P(EX_VAR(opline->op1.var)) != 0) {
EG(error_reporting) = Z_LVAL_P(EX_VAR(opline->op1.var));
}
- if (Z_TYPE(EX(old_error_reporting)) != IS_UNDEF &&
- EX(old_error_reporting).u2.silence_num == opline->op2.num) {
- ZVAL_UNDEF(&EX(old_error_reporting));
+ if (EX(silence_op_num) == opline->op2.num) {
+ EX(silence_op_num) = -1;
}
ZEND_VM_NEXT_OPCODE();
}