Avoid extra specialization for cold opcodes

This commit is contained in:
Dmitry Stogov 2019-07-17 14:03:48 +03:00
parent c2c5c9a973
commit b30e4a5aa6
3 changed files with 56 additions and 508 deletions

View File

@ -4911,138 +4911,12 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CON
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
if (EXPECTED(Z_LVAL_P(op1) == Z_LVAL_P(op2))) {
is_equal_true:
ZEND_VM_SMART_BRANCH_TRUE();
ZVAL_TRUE(EX_VAR(opline->result.var));
ZEND_VM_NEXT_OPCODE();
} else {
is_equal_false:
ZVAL_FALSE(EX_VAR(opline->result.var));
ZEND_VM_NEXT_OPCODE();
}
} else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
d1 = (double)Z_LVAL_P(op1);
d2 = Z_DVAL_P(op2);
goto is_equal_double;
}
} else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
d1 = Z_DVAL_P(op1);
d2 = Z_DVAL_P(op2);
is_equal_double:
if (d1 == d2) {
goto is_equal_true;
} else {
goto is_equal_false;
}
} else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
d1 = Z_DVAL_P(op1);
d2 = (double)Z_LVAL_P(op2);
goto is_equal_double;
}
} else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) {
int result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2));
if (IS_CONST & (IS_TMP_VAR|IS_VAR)) {
zval_ptr_dtor_str(op1);
}
if (IS_CONST & (IS_TMP_VAR|IS_VAR)) {
zval_ptr_dtor_str(op2);
}
if (result) {
goto is_equal_true;
} else {
goto is_equal_false;
}
}
}
ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
}
static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zval *op1, *op2;
double d1, d2;
op1 = RT_CONSTANT(opline, opline->op1);
op2 = RT_CONSTANT(opline, opline->op2);
if (ZEND_VM_SPEC && IS_CONST == IS_CONST && IS_CONST == IS_CONST) {
/* pass */
} else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
if (EXPECTED(Z_LVAL_P(op1) == Z_LVAL_P(op2))) {
is_equal_true:
ZEND_VM_SMART_BRANCH_TRUE_JMPZ();
ZVAL_TRUE(EX_VAR(opline->result.var));
ZEND_VM_NEXT_OPCODE();
} else {
is_equal_false:
ZEND_VM_SMART_BRANCH_FALSE_JMPZ();
ZVAL_FALSE(EX_VAR(opline->result.var));
ZEND_VM_NEXT_OPCODE();
}
} else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
d1 = (double)Z_LVAL_P(op1);
d2 = Z_DVAL_P(op2);
goto is_equal_double;
}
} else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
d1 = Z_DVAL_P(op1);
d2 = Z_DVAL_P(op2);
is_equal_double:
if (d1 == d2) {
goto is_equal_true;
} else {
goto is_equal_false;
}
} else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
d1 = Z_DVAL_P(op1);
d2 = (double)Z_LVAL_P(op2);
goto is_equal_double;
}
} else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) {
int result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2));
if (IS_CONST & (IS_TMP_VAR|IS_VAR)) {
zval_ptr_dtor_str(op1);
}
if (IS_CONST & (IS_TMP_VAR|IS_VAR)) {
zval_ptr_dtor_str(op2);
}
if (result) {
goto is_equal_true;
} else {
goto is_equal_false;
}
}
}
ZEND_VM_TAIL_CALL(zend_is_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
}
static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_EQUAL_SPEC_CONST_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zval *op1, *op2;
double d1, d2;
op1 = RT_CONSTANT(opline, opline->op1);
op2 = RT_CONSTANT(opline, opline->op2);
if (ZEND_VM_SPEC && IS_CONST == IS_CONST && IS_CONST == IS_CONST) {
/* pass */
} else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
if (EXPECTED(Z_LVAL_P(op1) == Z_LVAL_P(op2))) {
is_equal_true:
ZEND_VM_SMART_BRANCH_TRUE_JMPNZ();
ZVAL_TRUE(EX_VAR(opline->result.var));
ZEND_VM_NEXT_OPCODE();
} else {
is_equal_false:
ZEND_VM_SMART_BRANCH_FALSE_JMPNZ();
ZEND_VM_SMART_BRANCH_FALSE();
ZVAL_FALSE(EX_VAR(opline->result.var));
ZEND_VM_NEXT_OPCODE();
}
@ -5100,138 +4974,12 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
if (EXPECTED(Z_LVAL_P(op1) != Z_LVAL_P(op2))) {
is_not_equal_true:
ZEND_VM_SMART_BRANCH_TRUE();
ZVAL_TRUE(EX_VAR(opline->result.var));
ZEND_VM_NEXT_OPCODE();
} else {
is_not_equal_false:
ZVAL_FALSE(EX_VAR(opline->result.var));
ZEND_VM_NEXT_OPCODE();
}
} else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
d1 = (double)Z_LVAL_P(op1);
d2 = Z_DVAL_P(op2);
goto is_not_equal_double;
}
} else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
d1 = Z_DVAL_P(op1);
d2 = Z_DVAL_P(op2);
is_not_equal_double:
if (d1 != d2) {
goto is_not_equal_true;
} else {
goto is_not_equal_false;
}
} else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
d1 = Z_DVAL_P(op1);
d2 = (double)Z_LVAL_P(op2);
goto is_not_equal_double;
}
} else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) {
int result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2));
if (IS_CONST & (IS_TMP_VAR|IS_VAR)) {
zval_ptr_dtor_str(op1);
}
if (IS_CONST & (IS_TMP_VAR|IS_VAR)) {
zval_ptr_dtor_str(op2);
}
if (!result) {
goto is_not_equal_true;
} else {
goto is_not_equal_false;
}
}
}
ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
}
static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zval *op1, *op2;
double d1, d2;
op1 = RT_CONSTANT(opline, opline->op1);
op2 = RT_CONSTANT(opline, opline->op2);
if (ZEND_VM_SPEC && IS_CONST == IS_CONST && IS_CONST == IS_CONST) {
/* pass */
} else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
if (EXPECTED(Z_LVAL_P(op1) != Z_LVAL_P(op2))) {
is_not_equal_true:
ZEND_VM_SMART_BRANCH_TRUE_JMPZ();
ZVAL_TRUE(EX_VAR(opline->result.var));
ZEND_VM_NEXT_OPCODE();
} else {
is_not_equal_false:
ZEND_VM_SMART_BRANCH_FALSE_JMPZ();
ZVAL_FALSE(EX_VAR(opline->result.var));
ZEND_VM_NEXT_OPCODE();
}
} else if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
d1 = (double)Z_LVAL_P(op1);
d2 = Z_DVAL_P(op2);
goto is_not_equal_double;
}
} else if (EXPECTED(Z_TYPE_P(op1) == IS_DOUBLE)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_DOUBLE)) {
d1 = Z_DVAL_P(op1);
d2 = Z_DVAL_P(op2);
is_not_equal_double:
if (d1 != d2) {
goto is_not_equal_true;
} else {
goto is_not_equal_false;
}
} else if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
d1 = Z_DVAL_P(op1);
d2 = (double)Z_LVAL_P(op2);
goto is_not_equal_double;
}
} else if (EXPECTED(Z_TYPE_P(op1) == IS_STRING)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_STRING)) {
int result = zend_fast_equal_strings(Z_STR_P(op1), Z_STR_P(op2));
if (IS_CONST & (IS_TMP_VAR|IS_VAR)) {
zval_ptr_dtor_str(op1);
}
if (IS_CONST & (IS_TMP_VAR|IS_VAR)) {
zval_ptr_dtor_str(op2);
}
if (!result) {
goto is_not_equal_true;
} else {
goto is_not_equal_false;
}
}
}
ZEND_VM_TAIL_CALL(zend_is_not_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
}
static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zval *op1, *op2;
double d1, d2;
op1 = RT_CONSTANT(opline, opline->op1);
op2 = RT_CONSTANT(opline, opline->op2);
if (ZEND_VM_SPEC && IS_CONST == IS_CONST && IS_CONST == IS_CONST) {
/* pass */
} else if (EXPECTED(Z_TYPE_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
if (EXPECTED(Z_LVAL_P(op1) != Z_LVAL_P(op2))) {
is_not_equal_true:
ZEND_VM_SMART_BRANCH_TRUE_JMPNZ();
ZVAL_TRUE(EX_VAR(opline->result.var));
ZEND_VM_NEXT_OPCODE();
} else {
is_not_equal_false:
ZEND_VM_SMART_BRANCH_FALSE_JMPNZ();
ZEND_VM_SMART_BRANCH_FALSE();
ZVAL_FALSE(EX_VAR(opline->result.var));
ZEND_VM_NEXT_OPCODE();
}
@ -5289,108 +5037,12 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_C
if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
if (EXPECTED(Z_LVAL_P(op1) < Z_LVAL_P(op2))) {
is_smaller_true:
ZEND_VM_SMART_BRANCH_TRUE();
ZVAL_TRUE(EX_VAR(opline->result.var));
ZEND_VM_NEXT_OPCODE();
} else {
is_smaller_false:
ZVAL_FALSE(EX_VAR(opline->result.var));
ZEND_VM_NEXT_OPCODE();
}
} else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) {
d1 = (double)Z_LVAL_P(op1);
d2 = Z_DVAL_P(op2);
goto is_smaller_double;
}
} else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) {
if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) {
d1 = Z_DVAL_P(op1);
d2 = Z_DVAL_P(op2);
is_smaller_double:
if (d1 < d2) {
goto is_smaller_true;
} else {
goto is_smaller_false;
}
} else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
d1 = Z_DVAL_P(op1);
d2 = (double)Z_LVAL_P(op2);
goto is_smaller_double;
}
}
ZEND_VM_TAIL_CALL(zend_is_smaller_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
}
static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zval *op1, *op2;
double d1, d2;
op1 = RT_CONSTANT(opline, opline->op1);
op2 = RT_CONSTANT(opline, opline->op2);
if (ZEND_VM_SPEC && IS_CONST == IS_CONST && IS_CONST == IS_CONST) {
/* pass */
} else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
if (EXPECTED(Z_LVAL_P(op1) < Z_LVAL_P(op2))) {
is_smaller_true:
ZEND_VM_SMART_BRANCH_TRUE_JMPZ();
ZVAL_TRUE(EX_VAR(opline->result.var));
ZEND_VM_NEXT_OPCODE();
} else {
is_smaller_false:
ZEND_VM_SMART_BRANCH_FALSE_JMPZ();
ZVAL_FALSE(EX_VAR(opline->result.var));
ZEND_VM_NEXT_OPCODE();
}
} else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) {
d1 = (double)Z_LVAL_P(op1);
d2 = Z_DVAL_P(op2);
goto is_smaller_double;
}
} else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) {
if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) {
d1 = Z_DVAL_P(op1);
d2 = Z_DVAL_P(op2);
is_smaller_double:
if (d1 < d2) {
goto is_smaller_true;
} else {
goto is_smaller_false;
}
} else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
d1 = Z_DVAL_P(op1);
d2 = (double)Z_LVAL_P(op2);
goto is_smaller_double;
}
}
ZEND_VM_TAIL_CALL(zend_is_smaller_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
}
static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_SPEC_CONST_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zval *op1, *op2;
double d1, d2;
op1 = RT_CONSTANT(opline, opline->op1);
op2 = RT_CONSTANT(opline, opline->op2);
if (ZEND_VM_SPEC && IS_CONST == IS_CONST && IS_CONST == IS_CONST) {
/* pass */
} else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
if (EXPECTED(Z_LVAL_P(op1) < Z_LVAL_P(op2))) {
is_smaller_true:
ZEND_VM_SMART_BRANCH_TRUE_JMPNZ();
ZVAL_TRUE(EX_VAR(opline->result.var));
ZEND_VM_NEXT_OPCODE();
} else {
is_smaller_false:
ZEND_VM_SMART_BRANCH_FALSE_JMPNZ();
ZEND_VM_SMART_BRANCH_FALSE();
ZVAL_FALSE(EX_VAR(opline->result.var));
ZEND_VM_NEXT_OPCODE();
}
@ -5433,108 +5085,12 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQU
if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
if (EXPECTED(Z_LVAL_P(op1) <= Z_LVAL_P(op2))) {
is_smaller_or_equal_true:
ZEND_VM_SMART_BRANCH_TRUE();
ZVAL_TRUE(EX_VAR(opline->result.var));
ZEND_VM_NEXT_OPCODE();
} else {
is_smaller_or_equal_false:
ZVAL_FALSE(EX_VAR(opline->result.var));
ZEND_VM_NEXT_OPCODE();
}
} else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) {
d1 = (double)Z_LVAL_P(op1);
d2 = Z_DVAL_P(op2);
goto is_smaller_or_equal_double;
}
} else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) {
if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) {
d1 = Z_DVAL_P(op1);
d2 = Z_DVAL_P(op2);
is_smaller_or_equal_double:
if (d1 <= d2) {
goto is_smaller_or_equal_true;
} else {
goto is_smaller_or_equal_false;
}
} else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
d1 = Z_DVAL_P(op1);
d2 = (double)Z_LVAL_P(op2);
goto is_smaller_or_equal_double;
}
}
ZEND_VM_TAIL_CALL(zend_is_smaller_or_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
}
static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zval *op1, *op2;
double d1, d2;
op1 = RT_CONSTANT(opline, opline->op1);
op2 = RT_CONSTANT(opline, opline->op2);
if (ZEND_VM_SPEC && IS_CONST == IS_CONST && IS_CONST == IS_CONST) {
/* pass */
} else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
if (EXPECTED(Z_LVAL_P(op1) <= Z_LVAL_P(op2))) {
is_smaller_or_equal_true:
ZEND_VM_SMART_BRANCH_TRUE_JMPZ();
ZVAL_TRUE(EX_VAR(opline->result.var));
ZEND_VM_NEXT_OPCODE();
} else {
is_smaller_or_equal_false:
ZEND_VM_SMART_BRANCH_FALSE_JMPZ();
ZVAL_FALSE(EX_VAR(opline->result.var));
ZEND_VM_NEXT_OPCODE();
}
} else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) {
d1 = (double)Z_LVAL_P(op1);
d2 = Z_DVAL_P(op2);
goto is_smaller_or_equal_double;
}
} else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_DOUBLE)) {
if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_DOUBLE)) {
d1 = Z_DVAL_P(op1);
d2 = Z_DVAL_P(op2);
is_smaller_or_equal_double:
if (d1 <= d2) {
goto is_smaller_or_equal_true;
} else {
goto is_smaller_or_equal_false;
}
} else if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
d1 = Z_DVAL_P(op1);
d2 = (double)Z_LVAL_P(op2);
goto is_smaller_or_equal_double;
}
}
ZEND_VM_TAIL_CALL(zend_is_smaller_or_equal_helper_SPEC(op1, op2 ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_CC));
}
static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
USE_OPLINE
zval *op1, *op2;
double d1, d2;
op1 = RT_CONSTANT(opline, opline->op1);
op2 = RT_CONSTANT(opline, opline->op2);
if (ZEND_VM_SPEC && IS_CONST == IS_CONST && IS_CONST == IS_CONST) {
/* pass */
} else if (EXPECTED(Z_TYPE_INFO_P(op1) == IS_LONG)) {
if (EXPECTED(Z_TYPE_INFO_P(op2) == IS_LONG)) {
if (EXPECTED(Z_LVAL_P(op1) <= Z_LVAL_P(op2))) {
is_smaller_or_equal_true:
ZEND_VM_SMART_BRANCH_TRUE_JMPNZ();
ZVAL_TRUE(EX_VAR(opline->result.var));
ZEND_VM_NEXT_OPCODE();
} else {
is_smaller_or_equal_false:
ZEND_VM_SMART_BRANCH_FALSE_JMPNZ();
ZEND_VM_SMART_BRANCH_FALSE();
ZVAL_FALSE(EX_VAR(opline->result.var));
ZEND_VM_NEXT_OPCODE();
}
@ -50866,8 +50422,8 @@ ZEND_API void execute_ex(zend_execute_data *ex)
(void*)&&ZEND_NULL_LABEL,
(void*)&&ZEND_IS_NOT_IDENTICAL_SPEC_CV_CV_LABEL,
(void*)&&ZEND_IS_EQUAL_SPEC_CONST_CONST_LABEL,
(void*)&&ZEND_IS_EQUAL_SPEC_CONST_CONST_JMPZ_LABEL,
(void*)&&ZEND_IS_EQUAL_SPEC_CONST_CONST_JMPNZ_LABEL,
(void*)&&ZEND_IS_EQUAL_SPEC_CONST_CONST_LABEL,
(void*)&&ZEND_IS_EQUAL_SPEC_CONST_CONST_LABEL,
(void*)&&ZEND_NULL_LABEL,
(void*)&&ZEND_NULL_LABEL,
(void*)&&ZEND_NULL_LABEL,
@ -50941,8 +50497,8 @@ ZEND_API void execute_ex(zend_execute_data *ex)
(void*)&&ZEND_IS_EQUAL_SPEC_CV_CV_JMPZ_LABEL,
(void*)&&ZEND_IS_EQUAL_SPEC_CV_CV_JMPNZ_LABEL,
(void*)&&ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_LABEL,
(void*)&&ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_JMPZ_LABEL,
(void*)&&ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_JMPNZ_LABEL,
(void*)&&ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_LABEL,
(void*)&&ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_LABEL,
(void*)&&ZEND_NULL_LABEL,
(void*)&&ZEND_NULL_LABEL,
(void*)&&ZEND_NULL_LABEL,
@ -51016,8 +50572,8 @@ ZEND_API void execute_ex(zend_execute_data *ex)
(void*)&&ZEND_IS_NOT_EQUAL_SPEC_CV_CV_JMPZ_LABEL,
(void*)&&ZEND_IS_NOT_EQUAL_SPEC_CV_CV_JMPNZ_LABEL,
(void*)&&ZEND_IS_SMALLER_SPEC_CONST_CONST_LABEL,
(void*)&&ZEND_IS_SMALLER_SPEC_CONST_CONST_JMPZ_LABEL,
(void*)&&ZEND_IS_SMALLER_SPEC_CONST_CONST_JMPNZ_LABEL,
(void*)&&ZEND_IS_SMALLER_SPEC_CONST_CONST_LABEL,
(void*)&&ZEND_IS_SMALLER_SPEC_CONST_CONST_LABEL,
(void*)&&ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_LABEL,
(void*)&&ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_JMPZ_LABEL,
(void*)&&ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_JMPNZ_LABEL,
@ -51091,8 +50647,8 @@ ZEND_API void execute_ex(zend_execute_data *ex)
(void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ_LABEL,
(void*)&&ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ_LABEL,
(void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_LABEL,
(void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_JMPZ_LABEL,
(void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_JMPNZ_LABEL,
(void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_LABEL,
(void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_LABEL,
(void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_LABEL,
(void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_JMPZ_LABEL,
(void*)&&ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_JMPNZ_LABEL,
@ -54299,50 +53855,18 @@ zend_leave_helper_SPEC_LABEL:
VM_TRACE(ZEND_IS_EQUAL_SPEC_CONST_CONST)
ZEND_IS_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
HYBRID_BREAK();
HYBRID_CASE(ZEND_IS_EQUAL_SPEC_CONST_CONST_JMPZ):
VM_TRACE(ZEND_IS_EQUAL_SPEC_CONST_CONST_JMPZ)
ZEND_IS_EQUAL_SPEC_CONST_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
HYBRID_BREAK();
HYBRID_CASE(ZEND_IS_EQUAL_SPEC_CONST_CONST_JMPNZ):
VM_TRACE(ZEND_IS_EQUAL_SPEC_CONST_CONST_JMPNZ)
ZEND_IS_EQUAL_SPEC_CONST_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
HYBRID_BREAK();
HYBRID_CASE(ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST):
VM_TRACE(ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST)
ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
HYBRID_BREAK();
HYBRID_CASE(ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_JMPZ):
VM_TRACE(ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_JMPZ)
ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
HYBRID_BREAK();
HYBRID_CASE(ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_JMPNZ):
VM_TRACE(ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_JMPNZ)
ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
HYBRID_BREAK();
HYBRID_CASE(ZEND_IS_SMALLER_SPEC_CONST_CONST):
VM_TRACE(ZEND_IS_SMALLER_SPEC_CONST_CONST)
ZEND_IS_SMALLER_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
HYBRID_BREAK();
HYBRID_CASE(ZEND_IS_SMALLER_SPEC_CONST_CONST_JMPZ):
VM_TRACE(ZEND_IS_SMALLER_SPEC_CONST_CONST_JMPZ)
ZEND_IS_SMALLER_SPEC_CONST_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
HYBRID_BREAK();
HYBRID_CASE(ZEND_IS_SMALLER_SPEC_CONST_CONST_JMPNZ):
VM_TRACE(ZEND_IS_SMALLER_SPEC_CONST_CONST_JMPNZ)
ZEND_IS_SMALLER_SPEC_CONST_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
HYBRID_BREAK();
HYBRID_CASE(ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST):
VM_TRACE(ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST)
ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
HYBRID_BREAK();
HYBRID_CASE(ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_JMPZ):
VM_TRACE(ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_JMPZ)
ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_JMPZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
HYBRID_BREAK();
HYBRID_CASE(ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_JMPNZ):
VM_TRACE(ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_JMPNZ)
ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_JMPNZ_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
HYBRID_BREAK();
HYBRID_CASE(ZEND_SPACESHIP_SPEC_CONST_CONST):
VM_TRACE(ZEND_SPACESHIP_SPEC_CONST_CONST)
ZEND_SPACESHIP_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
@ -58418,8 +57942,8 @@ void zend_vm_init(void)
ZEND_NULL_HANDLER,
ZEND_IS_NOT_IDENTICAL_SPEC_CV_CV_HANDLER,
ZEND_IS_EQUAL_SPEC_CONST_CONST_HANDLER,
ZEND_IS_EQUAL_SPEC_CONST_CONST_JMPZ_HANDLER,
ZEND_IS_EQUAL_SPEC_CONST_CONST_JMPNZ_HANDLER,
ZEND_IS_EQUAL_SPEC_CONST_CONST_HANDLER,
ZEND_IS_EQUAL_SPEC_CONST_CONST_HANDLER,
ZEND_NULL_HANDLER,
ZEND_NULL_HANDLER,
ZEND_NULL_HANDLER,
@ -58493,8 +58017,8 @@ void zend_vm_init(void)
ZEND_IS_EQUAL_SPEC_CV_CV_JMPZ_HANDLER,
ZEND_IS_EQUAL_SPEC_CV_CV_JMPNZ_HANDLER,
ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_HANDLER,
ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_JMPZ_HANDLER,
ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_JMPNZ_HANDLER,
ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_HANDLER,
ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_HANDLER,
ZEND_NULL_HANDLER,
ZEND_NULL_HANDLER,
ZEND_NULL_HANDLER,
@ -58568,8 +58092,8 @@ void zend_vm_init(void)
ZEND_IS_NOT_EQUAL_SPEC_CV_CV_JMPZ_HANDLER,
ZEND_IS_NOT_EQUAL_SPEC_CV_CV_JMPNZ_HANDLER,
ZEND_IS_SMALLER_SPEC_CONST_CONST_HANDLER,
ZEND_IS_SMALLER_SPEC_CONST_CONST_JMPZ_HANDLER,
ZEND_IS_SMALLER_SPEC_CONST_CONST_JMPNZ_HANDLER,
ZEND_IS_SMALLER_SPEC_CONST_CONST_HANDLER,
ZEND_IS_SMALLER_SPEC_CONST_CONST_HANDLER,
ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_HANDLER,
ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_JMPZ_HANDLER,
ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_JMPNZ_HANDLER,
@ -58643,8 +58167,8 @@ void zend_vm_init(void)
ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ_HANDLER,
ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ_HANDLER,
ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_HANDLER,
ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_JMPZ_HANDLER,
ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_JMPNZ_HANDLER,
ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_HANDLER,
ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_HANDLER,
ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_HANDLER,
ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_JMPZ_HANDLER,
ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_JMPNZ_HANDLER,

View File

@ -1100,6 +1100,20 @@ function gen_handler($f, $spec, $kind, $name, $op1, $op2, $use, $code, $lineno,
return;
}
/* Skip SMART_BRANCH specialization for "cold" CONST_CONST instructions */
if (isset($extra_spec["SMART_BRANCH"])) {
if ($opcode["hot"] === 'HOT_NOCONSTCONST_'
|| $opcode["hot"] === 'COLD_CONSTCONST_') {
if (($op1 === 'CONST') && ($op2 === 'CONST')) {
if ($extra_spec["SMART_BRANCH"] == 0) {
unset($extra_spec["SMART_BRANCH"]);
} else {
return;
}
}
}
}
if (ZEND_VM_LINES) {
out($f, "#line $lineno \"$definition_file\"\n");
}
@ -1410,6 +1424,16 @@ function gen_labels($f, $spec, $kind, $prolog, &$specs, $switch_labels = array()
return;
}
/* Skip SMART_BRANCH specialization for "cold" CONST_CONST instructions */
if (isset($extra_spec["SMART_BRANCH"])) {
if ($dsc["hot"] === 'HOT_NOCONSTCONST_'
|| $dsc["hot"] === 'COLD_CONSTCONST_') {
if (($op1 === 'CONST') && ($op2 === 'CONST')) {
unset($extra_spec["SMART_BRANCH"]);
}
}
}
// Emit pointer to specialized handler
$spec_name = $dsc["op"]."_SPEC".$prefix[$op1].$prefix[$op2].extra_spec_name($extra_spec);
switch ($kind) {

View File

@ -219,8 +219,8 @@
_(383, ZEND_IS_NOT_IDENTICAL_SPEC_CV_VAR) \
_(385, ZEND_IS_NOT_IDENTICAL_SPEC_CV_CV) \
_(386, ZEND_IS_EQUAL_SPEC_CONST_CONST) \
_(387, ZEND_IS_EQUAL_SPEC_CONST_CONST_JMPZ) \
_(388, ZEND_IS_EQUAL_SPEC_CONST_CONST_JMPNZ) \
_(387, ZEND_IS_EQUAL_SPEC_CONST_CONST) \
_(388, ZEND_IS_EQUAL_SPEC_CONST_CONST) \
_(401, ZEND_IS_EQUAL_SPEC_TMPVAR_CONST) \
_(402, ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_JMPZ) \
_(403, ZEND_IS_EQUAL_SPEC_TMPVAR_CONST_JMPNZ) \
@ -252,8 +252,8 @@
_(459, ZEND_IS_EQUAL_SPEC_CV_CV_JMPZ) \
_(460, ZEND_IS_EQUAL_SPEC_CV_CV_JMPNZ) \
_(461, ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST) \
_(462, ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_JMPZ) \
_(463, ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST_JMPNZ) \
_(462, ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST) \
_(463, ZEND_IS_NOT_EQUAL_SPEC_CONST_CONST) \
_(476, ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST) \
_(477, ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST_JMPZ) \
_(478, ZEND_IS_NOT_EQUAL_SPEC_TMPVAR_CONST_JMPNZ) \
@ -285,8 +285,8 @@
_(534, ZEND_IS_NOT_EQUAL_SPEC_CV_CV_JMPZ) \
_(535, ZEND_IS_NOT_EQUAL_SPEC_CV_CV_JMPNZ) \
_(536, ZEND_IS_SMALLER_SPEC_CONST_CONST) \
_(537, ZEND_IS_SMALLER_SPEC_CONST_CONST_JMPZ) \
_(538, ZEND_IS_SMALLER_SPEC_CONST_CONST_JMPNZ) \
_(537, ZEND_IS_SMALLER_SPEC_CONST_CONST) \
_(538, ZEND_IS_SMALLER_SPEC_CONST_CONST) \
_(539, ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV) \
_(540, ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_JMPZ) \
_(541, ZEND_IS_SMALLER_SPEC_CONST_TMPVARCV_JMPNZ) \
@ -333,8 +333,8 @@
_(609, ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPZ) \
_(610, ZEND_IS_SMALLER_SPEC_TMPVARCV_TMPVARCV_JMPNZ) \
_(611, ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST) \
_(612, ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_JMPZ) \
_(613, ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST_JMPNZ) \
_(612, ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST) \
_(613, ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_CONST) \
_(614, ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV) \
_(615, ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_JMPZ) \
_(616, ZEND_IS_SMALLER_OR_EQUAL_SPEC_CONST_TMPVARCV_JMPNZ) \