Skip to content

sync master #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 91 commits into from
Sep 20, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
3b2410e
Fix test
mbeccati Sep 16, 2020
392f0ab
Avoid ubsan warning due to memcpy null
nikic Sep 16, 2020
f896b98
Exclude trait methods from call-graph
dstogov Sep 16, 2020
f08e666
Remove unused GMP_ABS() macro
nikic Sep 16, 2020
0d99a56
Changed the wording of the error message
kamil-tekiela Sep 15, 2020
f786c0e
Optimize code for FETCH_THIS + INIT_METHOD_CALL/ASSIGN_OBJ_OP/etc
dstogov Sep 16, 2020
7a48381
XMLReader::getAttributeNs() can no longer return false
kocsismate Sep 16, 2020
81d6cee
Update php_xmlreader.stub.php
kocsismate Sep 16, 2020
e7e3099
Update xmlreader arginfo hash
kocsismate Sep 16, 2020
0286dec
Accept GMP|string|int union in GMP functions
nikic Sep 16, 2020
c76910c
Display types in stubs more uniformly
kocsismate Sep 16, 2020
de91282
Display string default values in stubs more uniformly
kocsismate Sep 16, 2020
36fd95b
Generate arginfos
kocsismate Sep 16, 2020
46d22e4
Change int parameter types to bool when the parameter behaves as bool
kocsismate Sep 16, 2020
8f56b7a
mysqli: Promote warning in field_seek
kamil-tekiela Sep 16, 2020
e3d0bc0
Fixed bug #80109
nikic Sep 17, 2020
a4f806a
Fixed bug #80083
nikic Sep 17, 2020
9c136f1
Merge branch 'PHP-7.3' into PHP-7.4
nikic Sep 17, 2020
801cf66
Merge branch 'PHP-7.4'
nikic Sep 17, 2020
efc52f1
ext/soap: Compare Set-Cookie header case-insensitively
Sep 16, 2020
f0d2efb
Merge branch 'PHP-7.3' into PHP-7.4
nikic Sep 17, 2020
e55a658
Merge branch 'PHP-7.4'
nikic Sep 17, 2020
e9820bf
Fixed memory leak in ext/spl/tests/bug77263.phpt
dstogov Sep 17, 2020
8d37c37
Fix a few UNKNOWN default values in ext/pgsql
kocsismate Sep 16, 2020
202a069
mysqli: use native api
grooverdan Aug 29, 2020
c9abb0c
mysql: native mysql-8.0 uses _Bool
grooverdan Sep 12, 2020
1aab7db
pdo_mysql/mysqli (native) libmysqlclient_r no-longer used
grooverdan Sep 13, 2020
d591e1c
Merge branch 'PHP-7.3' into PHP-7.4
nikic Sep 17, 2020
3ad57f9
Merge branch 'PHP-7.4'
nikic Sep 17, 2020
e7f98f8
Add missing mysqlnd checks to stubs
nikic Sep 17, 2020
5cb8b04
Drop support for libmysqlclient < 5.5
nikic Sep 17, 2020
efdbc36
Fix #80115: mysqlnd.debug doesn't recognize absolute paths with slashes
cmb69 Sep 17, 2020
c3c76db
Merge branch 'PHP-7.3' into PHP-7.4
cmb69 Sep 17, 2020
f601d7c
Merge branch 'PHP-7.4' into master
cmb69 Sep 17, 2020
d4e5b5b
Fix compilation warnings in odbc
nikic Sep 17, 2020
ec08180
Enable unixODBC in azure
nikic Sep 17, 2020
9f2d039
Update to PCRE2 10.35
cmb69 Sep 17, 2020
c584e84
Merge branch 'PHP-7.4' into master
cmb69 Sep 17, 2020
b0661a9
Fix warnings when building against libmysqlclient
nikic Sep 17, 2020
e2b3c0e
Remove checks for old libmysqlclient versions in tests
nikic Sep 17, 2020
86e0027
Fix some tests for libmysql
nikic Sep 17, 2020
c3944c4
Fix mysqli_release_savepoint() on mysqlnd
nikic Sep 17, 2020
3306957
Merge branch 'PHP-7.3' into PHP-7.4
nikic Sep 17, 2020
e9ac7d2
Merge branch 'PHP-7.4'
nikic Sep 17, 2020
f3ea88b
Fix bundled libpcre2 build regarding the `-fcf-protection` gcc flag
cmb69 Sep 17, 2020
cafeec3
Merge branch 'PHP-7.4' into master
cmb69 Sep 17, 2020
95f2583
Allow http tests to run in parallel by using ephemeral ports
sgolemon Sep 15, 2020
a61a9fe
Support ephemeral ports in debug server
sgolemon Sep 14, 2020
bfa8e42
Use ephemeral ports during curl tests with dev server
sgolemon Sep 14, 2020
23429b5
Fixed incorrect register allocation
dstogov Sep 17, 2020
0f9aefa
Fixed incorrect live-range construction
dstogov Sep 17, 2020
a03c1ed
Remove vestiges of embedded mysql from tests
nikic Sep 17, 2020
a9cbdaf
Support for ZEND_COMPILE_EXTENDED_STMT
dstogov Sep 17, 2020
9e94bcf
Remove specialization of SPEC(OBSERVER) handlers
SammyK Sep 17, 2020
34bb5ba
Remove support for EXT_NOP
nikic Sep 18, 2020
d9628b9
Update the default values of xmlwriter_write_dtd_entity()
kocsismate Sep 18, 2020
b4c2670
Fix UNKNOWN default values in ext/pdo_pgsql
kocsismate Sep 18, 2020
d5d31ea
Cleanup observer API and add JIT support
dstogov Sep 18, 2020
c7ceebc
Bug #80107 Add test for mysqli_query() fails for ~16 MB long query wh…
kocsismate Sep 15, 2020
ecd9c42
Fix bug #80107: Handling of large compressed packets
nikic Sep 16, 2020
5e7c5a8
Merge branch 'PHP-7.3' into PHP-7.4
nikic Sep 18, 2020
0582c40
Merge branch 'PHP-7.4'
nikic Sep 18, 2020
bfceb71
Apply tidy to SKIPIF and CLEAN section as well
nikic Sep 18, 2020
c540185
Run tidy
nikic Sep 18, 2020
77f43e4
Use MyISAM engine for new test
nikic Sep 18, 2020
d87c393
Merge branch 'PHP-7.3' into PHP-7.4
nikic Sep 18, 2020
2abea9c
Merge branch 'PHP-7.4'
nikic Sep 18, 2020
6454766
Assert that all switch cases are covered
nikic Sep 18, 2020
74d1699
mysqli_set_charset now throws an mysqli_sql_exception when incorrect …
kamil-tekiela Sep 16, 2020
70cba36
Support NO_BACKSLASH_ESCAPES with newer libmysqlclient
nikic Sep 18, 2020
e6dc9ab
Merge branch 'PHP-7.3' into PHP-7.4
nikic Sep 18, 2020
9962ad6
Merge branch 'PHP-7.4'
nikic Sep 18, 2020
740f0f6
Fix #78179: mysqli/mysqlnd transaction extensions
grooverdan Jul 21, 2020
f231645
Merge branch 'PHP-7.3' into PHP-7.4
nikic Sep 18, 2020
b40ffa9
Merge branch 'PHP-7.4'
nikic Sep 18, 2020
2d00225
Drop skipifemb.inc
nikic Sep 18, 2020
19314ff
Fix some tests for libmysql
nikic Sep 17, 2020
ef9359d
Set-up IMAP in Azure
Girgias Sep 17, 2020
30bb15b
Fix IMAP tests
Girgias Sep 18, 2020
1230672
Add system ID entropy API
SammyK Jul 16, 2020
40e8c7c
Adjust the order of method modifiers in stub
kocsismate Sep 19, 2020
f088aec
Fix UNKNOWN default value of apache_note()
kocsismate Sep 19, 2020
b15885b
Separate Closure::bind() implementations
kocsismate Sep 19, 2020
0741858
Fix mysqli build with mysqlnd and without PDO
bwoebi Sep 20, 2020
a754441
Fix mysqli build with mysqlnd and without PDO
bwoebi Sep 20, 2020
9d1c7f8
Merge branch 'PHP-7.3' into PHP-7.4
nikic Sep 20, 2020
e5082af
Merge branch 'PHP-7.4'
nikic Sep 20, 2020
93745a2
Only check linking in PHP_TEST_BUILD
nikic Sep 20, 2020
81b2f3e
Fix #80114: parse_url does not accept URLs with port 0
cmb69 Sep 20, 2020
105132b
Merge branch 'PHP-7.3' into PHP-7.4
cmb69 Sep 20, 2020
c0f8cc1
Merge branch 'PHP-7.4' into master
cmb69 Sep 20, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Optimize code for FETCH_THIS + INIT_METHOD_CALL/ASSIGN_OBJ_OP/etc
  • Loading branch information
dstogov committed Sep 16, 2020
commit f786c0e097f748b32a3aefb116c7d9dcc5bd3ee9
2 changes: 2 additions & 0 deletions ext/opcache/jit/zend_jit_disasm_x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,11 @@ static int zend_jit_disasm_init(void)
REGISTER_HELPER(zend_jit_find_func_helper);
REGISTER_HELPER(zend_jit_find_ns_func_helper);
REGISTER_HELPER(zend_jit_find_method_helper);
REGISTER_HELPER(zend_jit_find_method_tmp_helper);
REGISTER_HELPER(zend_jit_push_static_metod_call_frame);
REGISTER_HELPER(zend_jit_push_static_metod_call_frame_tmp);
REGISTER_HELPER(zend_jit_invalid_method_call);
REGISTER_HELPER(zend_jit_invalid_method_call_tmp);
REGISTER_HELPER(zend_jit_unref_helper);
REGISTER_HELPER(zend_jit_extend_stack_helper);
REGISTER_HELPER(zend_jit_int_extend_stack_helper);
Expand Down
45 changes: 29 additions & 16 deletions ext/opcache/jit/zend_jit_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,15 @@ static ZEND_COLD void ZEND_FASTCALL zend_jit_invalid_method_call(zval *object)
}
zend_throw_error(NULL, "Call to a member function %s() on %s",
Z_STRVAL_P(function_name), zend_zval_type_name(object));
if (opline->op1_type & (IS_VAR|IS_TMP_VAR)) {
zval_ptr_dtor_nogc(EX_VAR(opline->op1.var));
}
}

static ZEND_COLD void ZEND_FASTCALL zend_jit_invalid_method_call_tmp(zval *object)
{
zend_execute_data *execute_data = EG(current_execute_data);
const zend_op *opline = EX(opline);

zend_jit_invalid_method_call(object);
zval_ptr_dtor_nogc(EX_VAR(opline->op1.var));
}

static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_undefined_method(const zend_class_entry *ce, const zend_string *method)
Expand All @@ -136,32 +142,21 @@ static zend_function* ZEND_FASTCALL zend_jit_find_method_helper(zend_object *obj
zend_execute_data *execute_data = EG(current_execute_data);
const zend_op *opline = EX(opline);
zend_class_entry *called_scope = obj->ce;
zend_object *orig_obj = obj;
zend_function *fbc;

fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), function_name + 1);
fbc = obj->handlers->get_method(obj_ptr, Z_STR_P(function_name), function_name + 1);
if (UNEXPECTED(fbc == NULL)) {
if (EXPECTED(!EG(exception))) {
zend_undefined_method(called_scope, Z_STR_P(function_name));
}
if ((opline->op1_type & (IS_VAR|IS_TMP_VAR)) && GC_DELREF(orig_obj) == 0) {
zend_objects_store_del(orig_obj);
}
return NULL;
}

if (EXPECTED(fbc->type == ZEND_USER_FUNCTION) && UNEXPECTED(!RUN_TIME_CACHE(&fbc->op_array))) {
zend_init_func_run_time_cache(&fbc->op_array);
}

if (UNEXPECTED(obj != orig_obj)) {
if (opline->op1_type & (IS_VAR|IS_TMP_VAR)) {
GC_ADDREF(obj);
if (GC_DELREF(orig_obj) == 0) {
zend_objects_store_del(orig_obj);
}
}
*obj_ptr = obj;
if (UNEXPECTED(obj != *obj_ptr)) {
return fbc;
}

Expand All @@ -172,6 +167,24 @@ static zend_function* ZEND_FASTCALL zend_jit_find_method_helper(zend_object *obj
return fbc;
}

static zend_function* ZEND_FASTCALL zend_jit_find_method_tmp_helper(zend_object *obj, zval *function_name, zend_object **obj_ptr)
{
zend_function *fbc;

fbc = zend_jit_find_method_helper(obj, function_name, obj_ptr);
if (!fbc) {
if (GC_DELREF(obj) == 0) {
zend_objects_store_del(obj);
}
} else if (obj != *obj_ptr) {
GC_ADDREF(obj);
if (GC_DELREF(obj) == 0) {
zend_objects_store_del(obj);
}
}
return fbc;
}

static zend_execute_data* ZEND_FASTCALL zend_jit_push_static_metod_call_frame(zend_object *obj, zend_function *fbc, uint32_t num_args)
{
zend_class_entry *scope = obj->ce;
Expand Down
15 changes: 10 additions & 5 deletions ext/opcache/jit/zend_jit_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -2827,7 +2827,10 @@ static zend_bool zend_jit_may_delay_fetch_this(zend_ssa *ssa, const zend_op **ss
}

opline = ssa_opcodes[use];
if (opline->opcode == ZEND_FETCH_OBJ_FUNC_ARG) {
if (opline->opcode == ZEND_INIT_METHOD_CALL) {
return (opline->op2_type == IS_CONST &&
Z_TYPE_P(RT_CONSTANT(opline, opline->op2)) == IS_STRING);
} else if (opline->opcode == ZEND_FETCH_OBJ_FUNC_ARG) {
if (!JIT_G(current_frame)
|| !JIT_G(current_frame)->call
|| !JIT_G(current_frame)->call->func
Expand All @@ -2837,7 +2840,12 @@ static zend_bool zend_jit_may_delay_fetch_this(zend_ssa *ssa, const zend_op **ss
} else if (opline->opcode != ZEND_FETCH_OBJ_R
&& opline->opcode != ZEND_FETCH_OBJ_IS
&& opline->opcode != ZEND_FETCH_OBJ_W
&& opline->opcode != ZEND_ASSIGN_OBJ) {
&& opline->opcode != ZEND_ASSIGN_OBJ
&& opline->opcode != ZEND_ASSIGN_OBJ_OP
&& opline->opcode != ZEND_PRE_INC_OBJ
&& opline->opcode != ZEND_PRE_DEC_OBJ
&& opline->opcode != ZEND_POST_INC_OBJ
&& opline->opcode != ZEND_POST_DEC_OBJ) {
return 0;
}

Expand Down Expand Up @@ -5001,9 +5009,6 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
op1_addr = 0;
} else {
op1_info = OP1_INFO();
if (!(op1_info & MAY_BE_OBJECT)) {
goto generic_dynamic_call;
}
op1_addr = OP1_REG_ADDR();
if (orig_op1_type != IS_UNKNOWN
&& (orig_op1_type & IS_TRACE_REFERENCE)) {
Expand Down
26 changes: 17 additions & 9 deletions ext/opcache/jit/zend_jit_x86.dasc
Original file line number Diff line number Diff line change
Expand Up @@ -8477,7 +8477,7 @@ typedef struct _zend_closure {
zif_handler orig_internal_handler;
} zend_closure;

static int zend_jit_push_call_frame(dasm_State **Dst, const zend_op *opline, zend_function *func, zend_bool is_closure)
static int zend_jit_push_call_frame(dasm_State **Dst, const zend_op *opline, zend_function *func, zend_bool is_closure, zend_bool use_this)
{
uint32_t used_stack;

Expand Down Expand Up @@ -8599,7 +8599,7 @@ static int zend_jit_push_call_frame(dasm_State **Dst, const zend_op *opline, zen
| // Z_PTR(call->This) = obj;
| mov r1, aword T1
| mov aword EX:RX->This.value.ptr, r1
if (opline->op1_type == IS_UNUSED) {
if (opline->op1_type == IS_UNUSED || use_this) {
| // call->call_info |= ZEND_CALL_HAS_THIS;
if (JIT_G(trigger) == ZEND_JIT_ON_HOT_TRACE) {
| mov dword EX:RX->This.u1.type_info, ZEND_CALL_HAS_THIS
Expand Down Expand Up @@ -9038,7 +9038,7 @@ static int zend_jit_init_fcall(dasm_State **Dst, const zend_op *opline, uint32_t
|3:
}

if (!zend_jit_push_call_frame(Dst, opline, func, 0)) {
if (!zend_jit_push_call_frame(Dst, opline, func, 0, 0)) {
return 0;
}

Expand Down Expand Up @@ -9116,7 +9116,11 @@ static int zend_jit_init_method_call(dasm_State **Dst,
| LOAD_ZVAL_ADDR FCARG1a, op1_addr
}
| SET_EX_OPLINE opline, r0
| EXT_CALL zend_jit_invalid_method_call, r0
if ((opline->op1_type & (IS_VAR|IS_TMP_VAR)) && !use_this) {
| EXT_CALL zend_jit_invalid_method_call_tmp, r0
} else {
| EXT_CALL zend_jit_invalid_method_call, r0
}
| jmp ->exception_handler
|.code
}
Expand Down Expand Up @@ -9169,7 +9173,11 @@ static int zend_jit_init_method_call(dasm_State **Dst,
| push r0
|.endif
| SET_EX_OPLINE opline, r0
| EXT_CALL zend_jit_find_method_helper, r0
if ((opline->op1_type & (IS_VAR|IS_TMP_VAR)) && !use_this) {
| EXT_CALL zend_jit_find_method_tmp_helper, r0
} else {
| EXT_CALL zend_jit_find_method_helper, r0
}
| test r0, r0
| jz ->exception_handler
|.if not(X64)
Expand Down Expand Up @@ -9247,15 +9255,15 @@ static int zend_jit_init_method_call(dasm_State **Dst,
| sub r4, 12
| push opline->extended_value
|.endif
if (opline->op1_type & (IS_VAR|IS_TMP_VAR)) {
if ((opline->op1_type & (IS_VAR|IS_TMP_VAR)) && !use_this) {
| EXT_CALL zend_jit_push_static_metod_call_frame_tmp, r0
} else {
| EXT_CALL zend_jit_push_static_metod_call_frame, r0
}
|.if not(X64)
| add r4, 12
|.endif
if (opline->op1_type & (IS_VAR|IS_TMP_VAR)) {
if ((opline->op1_type & (IS_VAR|IS_TMP_VAR) && !use_this)) {
| test r0, r0
| jz ->exception_handler
}
Expand All @@ -9268,7 +9276,7 @@ static int zend_jit_init_method_call(dasm_State **Dst,
}

if (!func || (func->common.fn_flags & ZEND_ACC_STATIC) == 0) {
if (!zend_jit_push_call_frame(Dst, opline, func, 0)) {
if (!zend_jit_push_call_frame(Dst, opline, func, 0, use_this)) {
return 0;
}
}
Expand Down Expand Up @@ -9366,7 +9374,7 @@ static int zend_jit_init_closure_call(dasm_State **Dst,
}
}

if (!zend_jit_push_call_frame(Dst, opline, func, 1)) {
if (!zend_jit_push_call_frame(Dst, opline, func, 1, 0)) {
return 0;
}

Expand Down