&& !(op_array->fn_flags & ZEND_ACC_GENERATOR)
&& !(ssa->cfg.flags & ZEND_FUNC_INDIRECT_VAR_ACCESS)) {
- /* TODO: passing -1 as optimization_level may break overloaded operators ??? */
- if (zend_ssa_inference(&CG(arena), op_array, script, ssa, -1) != SUCCESS) {
+ /* TODO: passing ZEND_OPTIMIZER_ALL_PASSES as optimization_level
+ * may break overloaded operators (see ext/gmp/tests/overloading.phpt)
+ */
+ if (zend_ssa_inference(&CG(arena), op_array, script, ssa, ZEND_OPTIMIZER_ALL_PASSES /*- ZEND_OPTIMIZER_IGNORE_OVERLOADING*/) != SUCCESS) {
return FAILURE;
}
}
static int zend_jit_negative_shift_stub(dasm_State **Dst)
{
|->negative_shift:
- | SAVE_OPLINE
|.if X64
|.if WIN
| LOAD_ADDR CARG1, &zend_ce_arithmetic_error
static int zend_jit_mod_by_zero_stub(dasm_State **Dst)
{
|->mod_by_zero:
- | SAVE_OPLINE
|.if X64
|.if WIN
| LOAD_ADDR CARG1, &zend_ce_division_by_zero_error
if (EXPECTED(op2_lval > 0)) {
| xor Ra(result_reg), Ra(result_reg)
} else {
- if (!zend_jit_set_ip(Dst, opline)) {
- return 0;
- }
+ | SAVE_VALID_OPLINE opline
| jmp ->negative_shift
}
} else {
| cmp r1, 0
| mov Ra(result_reg), 0
| jg >1
- if (!zend_jit_set_ip(Dst, opline)) {
- return 0;
- }
+ | SAVE_VALID_OPLINE opline
| jmp ->negative_shift
|.code
}
if (EXPECTED(op2_lval > 0)) {
| sar Ra(result_reg), (SIZEOF_ZEND_LONG * 8) - 1
} else {
- if (!zend_jit_set_ip(Dst, opline)) {
- return 0;
- }
+ | SAVE_VALID_OPLINE opline
| jmp ->negative_shift
}
} else {
| cmp r1, 0
| mov r1, (SIZEOF_ZEND_LONG * 8) - 1
| jg >1
- if (!zend_jit_set_ip(Dst, opline)) {
- return 0;
- }
+ | SAVE_VALID_OPLINE opline
| jmp ->negative_shift
|.code
}
zend_long op2_lval = Z_LVAL_P(Z_ZV(op2_addr));
if (op2_lval == 0) {
- if (!zend_jit_set_ip(Dst, opline)) {
- return 0;
- }
+ | SAVE_VALID_OPLINE opline
| jmp ->mod_by_zero
} else if (op2_lval == -1) {
| xor Ra(result_reg), Ra(result_reg)
!ssa->var_info[op2_ssa_var].has_range ||
(ssa->var_info[op2_ssa_var].range.min <= 0 &&
ssa->var_info[op2_ssa_var].range.max >= 0)) {
- if (!zend_jit_set_valid_ip(Dst, opline)) {
- return 0;
- }
if (Z_MODE(op2_addr) == IS_MEM_ZVAL) {
| cmp aword [Ra(Z_REG(op2_addr))+Z_OFFSET(op2_addr)], 0
} else if (Z_MODE(op2_addr) == IS_REG) {
| jz >1
|.cold_code
|1:
- if (!zend_jit_set_ip(Dst, opline)) {
- return 0;
- }
+ | SAVE_VALID_OPLINE opline
| jmp ->mod_by_zero
|.code
}
if (len > 0) {
const char *str = Z_STRVAL_P(zv);
- if (!zend_jit_set_valid_ip(Dst, opline)) {
- return 0;
- }
- | SAVE_OPLINE
+ | SAVE_VALID_OPLINE opline
|.if X64
| LOAD_ADDR CARG1, str
| LOAD_ADDR CARG2, len