summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2019-04-12 01:01:47 +0300
committerDmitry Stogov <dmitry@zend.com>2019-04-12 01:01:47 +0300
commit39505764adbf1b46656ea2a5c8337e667356ae4b (patch)
tree2d68b6f70611ee94e13d0f3e0d8f8edc38104cbe /ext
parent7604f295cae6c092fc55d17f7acdd108b8d532d1 (diff)
parent88a2268d6b9ff152399a8761dc826ce414c0b985 (diff)
downloadphp-git-39505764adbf1b46656ea2a5c8337e667356ae4b.tar.gz
Merge branch 'PHP-7.4'
* PHP-7.4: Replace "ZEND_CALL_CTOR" hack by additional live-range
Diffstat (limited to 'ext')
-rw-r--r--ext/opcache/Optimizer/zend_dump.c6
-rw-r--r--ext/opcache/jit/zend_jit_vm_helpers.c7
-rw-r--r--ext/opcache/jit/zend_jit_x86.dasc29
-rw-r--r--ext/opcache/tests/opt/dce_006.phpt2
4 files changed, 9 insertions, 35 deletions
diff --git a/ext/opcache/Optimizer/zend_dump.c b/ext/opcache/Optimizer/zend_dump.c
index ce002c644f..63591090b4 100644
--- a/ext/opcache/Optimizer/zend_dump.c
+++ b/ext/opcache/Optimizer/zend_dump.c
@@ -1027,6 +1027,9 @@ void zend_dump_op_array(const zend_op_array *op_array, uint32_t dump_flags, cons
case ZEND_LIVE_ROPE:
fprintf(stderr, "(rope)\n");
break;
+ case ZEND_LIVE_NEW:
+ fprintf(stderr, "(new)\n");
+ break;
}
}
}
@@ -1083,6 +1086,9 @@ void zend_dump_op_array(const zend_op_array *op_array, uint32_t dump_flags, cons
case ZEND_LIVE_ROPE:
fprintf(stderr, "(rope)\n");
break;
+ case ZEND_LIVE_NEW:
+ fprintf(stderr, "(new)\n");
+ break;
}
}
}
diff --git a/ext/opcache/jit/zend_jit_vm_helpers.c b/ext/opcache/jit/zend_jit_vm_helpers.c
index 9cff64df46..0ddab1d84e 100644
--- a/ext/opcache/jit/zend_jit_vm_helpers.c
+++ b/ext/opcache/jit/zend_jit_vm_helpers.c
@@ -50,12 +50,7 @@ ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_jit_leave_nested_func_helper(uint32_t
}
EG(current_execute_data) = EX(prev_execute_data);
if (UNEXPECTED(call_info & ZEND_CALL_RELEASE_THIS)) {
- zend_object *object = Z_OBJ(execute_data->This);
- if (UNEXPECTED(EG(exception) != NULL) && (call_info & ZEND_CALL_CTOR)) {
- GC_DELREF(object);
- zend_object_store_ctor_failed(object);
- }
- OBJ_RELEASE(object);
+ OBJ_RELEASE(Z_OBJ(execute_data->This));
} else if (UNEXPECTED(call_info & ZEND_CALL_CLOSURE)) {
OBJ_RELEASE(ZEND_CLOSURE_OBJECT(EX(func)));
}
diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc
index 7af3235373..f14053a41e 100644
--- a/ext/opcache/jit/zend_jit_x86.dasc
+++ b/ext/opcache/jit/zend_jit_x86.dasc
@@ -7731,17 +7731,6 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, zend_op_ar
|.cold_code
|1:
| GET_Z_PTR r0, RX + offsetof(zend_execute_data, This)
- if (opline->op1.num & ZEND_CALL_CTOR) {
- | // if (UNEXPECTED(EG(exception)
- | MEM_OP2_1_ZTS cmp, aword, executor_globals, exception, 0, r1
- | je >1
- | // GC_DELREF(object);
- | GC_DELREF r0
- | // zend_object_store_ctor_failed(object);
- | // GC_FLAGS(obj) |= IS_OBJ_DESTRUCTOR_CALLED;
- | or byte [r0 + offsetof(zend_object, gc.u.type_info)], IS_OBJ_DESTRUCTOR_CALLED
- |1:
- }
| // OBJ_RELEASE(object);
| OBJ_RELEASE r0, ecx, >2
| jmp >2
@@ -8612,24 +8601,6 @@ static int zend_jit_leave_func(dasm_State **Dst, const zend_op *opline, zend_op_
| je >4
| // zend_object *object = Z_OBJ(execute_data->This);
| mov r0, EX->This.value.obj
- if (op_array->scope->constructor == (zend_function*)op_array) {
- | // if (UNEXPECTED(EG(exception) != NULL)
- | MEM_OP2_1_ZTS cmp, aword, executor_globals, exception, 0, r1
- | jne >6
- |.cold_code
- |6:
- | // if (call_info & ZEND_CALL_CTOR)
- | test FCARG1d, ZEND_CALL_CTOR
- | jz >5
- | // GC_DELREF(object);
- | GC_DELREF r0
- | // zend_object_store_ctor_failed(object);
- | // GC_FLAGS(obj) |= IS_OBJ_DESTRUCTOR_CALLED;
- | or byte [r0 + offsetof(zend_object, gc.u.type_info)], IS_OBJ_DESTRUCTOR_CALLED
- | jmp >5
- |.code
- |5:
- }
| // OBJ_RELEASE(object);
| OBJ_RELEASE r0, ecx, >4
}
diff --git a/ext/opcache/tests/opt/dce_006.phpt b/ext/opcache/tests/opt/dce_006.phpt
index b53a73e990..c84805247a 100644
--- a/ext/opcache/tests/opt/dce_006.phpt
+++ b/ext/opcache/tests/opt/dce_006.phpt
@@ -33,6 +33,8 @@ L3 (6): CV1($a) = QM_ASSIGN V2
L4 (7): ASSIGN_OBJ CV1($a) string("foo")
L5 (7): OP_DATA CV0($x)
L6 (8): RETURN null
+LIVE RANGES:
+ 2: L2 - L3 (new)
A::__destruct: ; (lines=1, args=0, vars=0, tmps=0)
; (after optimizer)