} else {
zend_op *opline;
- ZEND_ASSERT(loop_var->var_type == IS_VAR || loop_var->var_type == IS_TMP_VAR);
+ ZEND_ASSERT(loop_var->var_type & (IS_VAR|IS_TMP_VAR));
opline = get_next_op(CG(active_op_array));
opline->opcode = loop_var->opcode;
opline->op1_type = loop_var->var_type;
zend_end_loop(get_next_op_number(CG(active_op_array)), &expr_node);
- if (expr_node.op_type == IS_VAR || expr_node.op_type == IS_TMP_VAR) {
+ if (expr_node.op_type & (IS_VAR|IS_TMP_VAR)) {
/* don't use emit_op() to prevent automatic live-range construction */
opline = get_next_op(CG(active_op_array));
opline->opcode = ZEND_FREE;
}
/* get variable source */
- if (opline->result_type == IS_VAR || opline->result_type == IS_TMP_VAR) {
+ if (opline->result_type & (IS_VAR|IS_TMP_VAR)) {
SET_VAR_SOURCE(opline);
}
opline++;
}
while (opline<end) {
- if (opline->op1_type == IS_VAR || opline->op1_type == IS_TMP_VAR) {
+ if (opline->op1_type & (IS_VAR|IS_TMP_VAR)) {
var_num = VAR_NUM(opline->op1.var);
if (!zend_bitset_in(defined_here, var_num)) {
zend_bitset_incl(used_ext, var_num);
zend_bitset_incl(usage, VAR_NUM(opline->op2.var));
}
- if (opline->op1_type == IS_VAR || opline->op1_type == IS_TMP_VAR) {
+ if (opline->op1_type & (IS_VAR|IS_TMP_VAR)) {
zend_bitset_incl(usage, VAR_NUM(opline->op1.var));
}
DFG_SET(use, set_size, j, EX_VAR_TO_NUM(opline->op1.var));
}
}
- } else if (opline->op1_type == IS_VAR ||
- opline->op1_type == IS_TMP_VAR) {
+ } else if (opline->op1_type & (IS_VAR|IS_TMP_VAR)) {
if (!DFG_ISSET(def, set_size, j, EX_VAR_TO_NUM(opline->op1.var))) {
DFG_SET(use, set_size, j, EX_VAR_TO_NUM(opline->op1.var));
}
}
break;
}
- } else if (opline->op2_type == IS_VAR ||
- opline->op2_type == IS_TMP_VAR) {
+ } else if (opline->op2_type & (IS_VAR|IS_TMP_VAR)) {
if (opline->opcode == ZEND_FE_FETCH_R || opline->opcode == ZEND_FE_FETCH_RW) {
if (!DFG_ISSET(use, set_size, j, EX_VAR_TO_NUM(opline->op2.var))) {
DFG_SET(def, set_size, j, EX_VAR_TO_NUM(opline->op2.var));
DFG_SET(def, set_size, j, EX_VAR_TO_NUM(opline->result.var));
}
DFG_SET(gen, set_size, j, EX_VAR_TO_NUM(opline->result.var));
- } else if (opline->result_type == IS_VAR ||
- opline->result_type == IS_TMP_VAR) {
+ } else if (opline->result_type & (IS_VAR|IS_TMP_VAR)) {
if (!DFG_ISSET(use, set_size, j, EX_VAR_TO_NUM(opline->result.var))) {
DFG_SET(def, set_size, j, EX_VAR_TO_NUM(opline->result.var));
}
fprintf(stderr, "%*c", 8-len, ' ');
if (!ssa || !ssa->ops || ssa->ops[opline - op_array->opcodes].result_use < 0) {
- if (opline->result_type == IS_CV ||
- opline->result_type == IS_VAR ||
- opline->result_type == IS_TMP_VAR) {
+ if (opline->result_type & (IS_CV|IS_VAR|IS_TMP_VAR)) {
if (ssa && ssa->ops) {
int ssa_var_num = ssa->ops[opline - op_array->opcodes].result_def;
ZEND_ASSERT(ssa_var_num >= 0);
if (opline->op1_type == IS_CONST) {
zend_dump_const(CRT_CONSTANT_EX(op_array, opline->op1, (dump_flags & ZEND_DUMP_RT_CONSTANTS)));
- } else if (opline->op1_type == IS_CV ||
- opline->op1_type == IS_VAR ||
- opline->op1_type == IS_TMP_VAR) {
+ } else if (opline->op1_type & (IS_CV|IS_VAR|IS_TMP_VAR)) {
if (ssa && ssa->ops) {
int ssa_var_num = ssa->ops[opline - op_array->opcodes].op1_use;
if (ssa_var_num >= 0) {
if (opline->op2_type == IS_CONST) {
zend_dump_const(CRT_CONSTANT_EX(op_array, opline->op2, (dump_flags & ZEND_DUMP_RT_CONSTANTS)));
- } else if (opline->op2_type == IS_CV ||
- opline->op2_type == IS_VAR ||
- opline->op2_type == IS_TMP_VAR) {
+ } else if (opline->op2_type & (IS_CV|IS_VAR|IS_TMP_VAR)) {
if (ssa && ssa->ops) {
int ssa_var_num = ssa->ops[opline - op_array->opcodes].op2_use;
if (ssa_var_num >= 0) {
if (opline->result_type == IS_CONST) {
zend_dump_const(CRT_CONSTANT_EX(op_array, opline->result, (dump_flags & ZEND_DUMP_RT_CONSTANTS)));
} else if (ssa && ssa->ops && ssa->ops[opline - op_array->opcodes].result_use >= 0) {
- if (opline->result_type == IS_CV ||
- opline->result_type == IS_VAR ||
- opline->result_type == IS_TMP_VAR) {
+ if (opline->result_type & (IS_CV|IS_VAR|IS_TMP_VAR)) {
if (ssa && ssa->ops) {
int ssa_var_num = ssa->ops[opline - op_array->opcodes].result_use;
if (ssa_var_num >= 0) {
if (next->op1_type == IS_CV) {
ssa_ops[k + 1].op1_use = var[EX_VAR_TO_NUM(next->op1.var)];
//USE_SSA_VAR(next->op1.var);
- } else if (next->op1_type == IS_VAR ||
- next->op1_type == IS_TMP_VAR) {
+ } else if (next->op1_type & (IS_VAR|IS_TMP_VAR)) {
ssa_ops[k + 1].op1_use = var[EX_VAR_TO_NUM(next->op1.var)];
//USE_SSA_VAR(op_array->last_var + next->op1.var);
}
if (next->op2_type == IS_CV) {
ssa_ops[k + 1].op2_use = var[EX_VAR_TO_NUM(next->op2.var)];
//USE_SSA_VAR(next->op2.var);
- } else if (next->op2_type == IS_VAR ||
- next->op2_type == IS_TMP_VAR) {
+ } else if (next->op2_type & (IS_VAR|IS_TMP_VAR)) {
ssa_ops[k + 1].op2_use = var[EX_VAR_TO_NUM(next->op2.var)];
//USE_SSA_VAR(op_array->last_var + next->op2.var);
}
var[EX_VAR_TO_NUM(opline->result.var)] = ssa_vars_count;
ssa_vars_count++;
//NEW_SSA_VAR(opline->result.var)
- } else if (opline->result_type == IS_VAR ||
- opline->result_type == IS_TMP_VAR) {
+ } else if (opline->result_type & (IS_VAR|IS_TMP_VAR)) {
ssa_ops[k].result_def = ssa_vars_count;
var[EX_VAR_TO_NUM(opline->result.var)] = ssa_vars_count;
ssa_vars_count++;