summaryrefslogtreecommitdiff
path: root/Zend/zend_opcode.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2014-07-18 15:48:56 +0800
committerXinchen Hui <laruence@php.net>2014-07-18 15:48:56 +0800
commit550b3e4306124fbf65602c7e3a99653427ed8c8d (patch)
tree02bece5c0452896af68466d508b49cc2d4214820 /Zend/zend_opcode.c
parent84673485f5b3134e357f6ec90bbaab9ffec11a68 (diff)
parentba1cf321f301410cc5b3da61e106040187f1787b (diff)
downloadphp-git-550b3e4306124fbf65602c7e3a99653427ed8c8d.tar.gz
Merge branch 'PHP-5.5' into PHP-5.6
Conflicts: Zend/zend_vm_def.h Zend/zend_vm_execute.h
Diffstat (limited to 'Zend/zend_opcode.c')
-rw-r--r--Zend/zend_opcode.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/Zend/zend_opcode.c b/Zend/zend_opcode.c
index 457f08f313..0201d4165f 100644
--- a/Zend/zend_opcode.c
+++ b/Zend/zend_opcode.c
@@ -538,7 +538,7 @@ static void zend_resolve_finally_call(zend_op_array *op_array, zend_uint op_num,
SET_UNUSED(opline->op2);
opline->op1.opline_num = op_array->try_catch_array[i].finally_op;
if (op_array->try_catch_array[i].catch_op) {
- opline->extended_value = 1;
+ opline->extended_value = ZEND_FAST_CALL_FOR_CATCH;
opline->op2.opline_num = op_array->try_catch_array[i].catch_op;
}
@@ -603,6 +603,26 @@ static void zend_resolve_finally_ret(zend_op_array *op_array, zend_uint op_num T
}
}
+static void zend_resolve_fast_call(zend_op_array *op_array, zend_uint op_num TSRMLS_DC)
+{
+ int i;
+ zend_uint finally_op_num = 0;
+
+ for (i = 0; i < op_array->last_try_catch; i++) {
+ if (op_array->try_catch_array[i].finally_op > op_num) {
+ break;
+ }
+ if (op_num < op_array->try_catch_array[i].finally_end) {
+ finally_op_num = op_array->try_catch_array[i].finally_op;
+ }
+ }
+
+ if (finally_op_num) {
+ op_array->opcodes[op_num].extended_value = ZEND_FAST_CALL_FOR_FINALLY;
+ op_array->opcodes[op_num].op2.opline_num = finally_op_num - 2; /* it must be ZEND_FAST_CALL */
+ }
+}
+
static void zend_resolve_finally_calls(zend_op_array *op_array TSRMLS_DC)
{
zend_uint i;
@@ -644,6 +664,9 @@ static void zend_resolve_finally_calls(zend_op_array *op_array TSRMLS_DC)
case ZEND_JMP:
zend_resolve_finally_call(op_array, i, opline->op1.opline_num TSRMLS_CC);
break;
+ case ZEND_FAST_CALL:
+ zend_resolve_fast_call(op_array, i TSRMLS_CC);
+ break;
case ZEND_FAST_RET:
zend_resolve_finally_ret(op_array, i TSRMLS_CC);
break;