Lines Matching refs:opline
79 zend_op *opline = op_array->opcodes; in zend_optimizer_lookup_cv() local
80 zend_op *end = opline + op_array->last; in zend_optimizer_lookup_cv()
81 while (opline < end) { in zend_optimizer_lookup_cv()
82 if (opline->op1_type & (IS_TMP_VAR|IS_VAR)) { in zend_optimizer_lookup_cv()
83 opline->op1.var += sizeof(zval); in zend_optimizer_lookup_cv()
85 if (opline->op2_type & (IS_TMP_VAR|IS_VAR)) { in zend_optimizer_lookup_cv()
86 opline->op2.var += sizeof(zval); in zend_optimizer_lookup_cv()
88 if (opline->result_type & (IS_TMP_VAR|IS_VAR)) { in zend_optimizer_lookup_cv()
89 opline->result.var += sizeof(zval); in zend_optimizer_lookup_cv()
91 if (opline->opcode == ZEND_DECLARE_INHERITED_CLASS || in zend_optimizer_lookup_cv()
92 opline->opcode == ZEND_DECLARE_ANON_INHERITED_CLASS || in zend_optimizer_lookup_cv()
93 opline->opcode == ZEND_DECLARE_INHERITED_CLASS_DELAYED) { in zend_optimizer_lookup_cv()
94 opline->extended_value += sizeof(zval); in zend_optimizer_lookup_cv()
96 opline++; in zend_optimizer_lookup_cv()
135 static inline void alloc_cache_slots_op1(zend_op_array *op_array, zend_op *opline, uint32_t num) { in alloc_cache_slots_op1() argument
136 Z_CACHE_SLOT(op_array->literals[opline->op1.constant]) = op_array->cache_size; in alloc_cache_slots_op1()
139 static inline void alloc_cache_slots_op2(zend_op_array *op_array, zend_op *opline, uint32_t num) { in alloc_cache_slots_op2() argument
140 Z_CACHE_SLOT(op_array->literals[opline->op2.constant]) = op_array->cache_size; in alloc_cache_slots_op2()
160 zend_op *opline, in zend_optimizer_update_op1_const() argument
163 switch (opline->opcode) { in zend_optimizer_update_op1_const()
165 MAKE_NOP(opline); in zend_optimizer_update_op1_const()
175 opline->op1.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op1_const()
176 alloc_cache_slots_op1(op_array, opline, 1); in zend_optimizer_update_op1_const()
186 opline->op1.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op1_const()
187 if (opline->extended_value == ZEND_FETCH_STATIC_MEMBER) { in zend_optimizer_update_op1_const()
188 alloc_cache_slots_op1(op_array, opline, 2); in zend_optimizer_update_op1_const()
196 opline->op1.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op1_const()
200 ZEND_OP1_TYPE(opline) = IS_CONST; in zend_optimizer_update_op1_const()
201 if (Z_TYPE(ZEND_OP1_LITERAL(opline)) == IS_STRING) { in zend_optimizer_update_op1_const()
202 zend_string_hash_val(Z_STR(ZEND_OP1_LITERAL(opline))); in zend_optimizer_update_op1_const()
208 zend_op *opline, in zend_optimizer_update_op2_const() argument
211 switch (opline->opcode) { in zend_optimizer_update_op2_const()
231 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
233 alloc_cache_slots_op2(op_array, opline, 1); in zend_optimizer_update_op2_const()
238 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
239 alloc_cache_slots_op2(op_array, opline, 1); in zend_optimizer_update_op2_const()
248 opline->opcode = ZEND_INIT_FCALL_BY_NAME; in zend_optimizer_update_op2_const()
250 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
252 alloc_cache_slots_op2(op_array, opline, 1); in zend_optimizer_update_op2_const()
254 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
260 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
262 alloc_cache_slots_op2(op_array, opline, 2); in zend_optimizer_update_op2_const()
279 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
280 alloc_cache_slots_op2(op_array, opline, 2); in zend_optimizer_update_op2_const()
294 if (opline->extended_value == ZEND_ASSIGN_OBJ) { in zend_optimizer_update_op2_const()
296 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
297 alloc_cache_slots_op2(op_array, opline, 2); in zend_optimizer_update_op2_const()
299 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
303 if ((opline-1)->opcode != ZEND_ASSIGN_DIM && in zend_optimizer_update_op2_const()
304 ((opline-1)->extended_value != ZEND_ASSIGN_DIM || in zend_optimizer_update_op2_const()
305 ((opline-1)->opcode != ZEND_ASSIGN_ADD && in zend_optimizer_update_op2_const()
306 (opline-1)->opcode != ZEND_ASSIGN_SUB && in zend_optimizer_update_op2_const()
307 (opline-1)->opcode != ZEND_ASSIGN_MUL && in zend_optimizer_update_op2_const()
308 (opline-1)->opcode != ZEND_ASSIGN_DIV && in zend_optimizer_update_op2_const()
309 (opline-1)->opcode != ZEND_ASSIGN_POW && in zend_optimizer_update_op2_const()
310 (opline-1)->opcode != ZEND_ASSIGN_MOD && in zend_optimizer_update_op2_const()
311 (opline-1)->opcode != ZEND_ASSIGN_SL && in zend_optimizer_update_op2_const()
312 (opline-1)->opcode != ZEND_ASSIGN_SR && in zend_optimizer_update_op2_const()
313 (opline-1)->opcode != ZEND_ASSIGN_CONCAT && in zend_optimizer_update_op2_const()
314 (opline-1)->opcode != ZEND_ASSIGN_BW_OR && in zend_optimizer_update_op2_const()
315 (opline-1)->opcode != ZEND_ASSIGN_BW_AND && in zend_optimizer_update_op2_const()
316 (opline-1)->opcode != ZEND_ASSIGN_BW_XOR)) in zend_optimizer_update_op2_const()
318 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
341 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
351 opline->op2.constant = zend_optimizer_add_literal(op_array, val); in zend_optimizer_update_op2_const()
355 ZEND_OP2_TYPE(opline) = IS_CONST; in zend_optimizer_update_op2_const()
356 if (Z_TYPE(ZEND_OP2_LITERAL(opline)) == IS_STRING) { in zend_optimizer_update_op2_const()
357 zend_string_hash_val(Z_STR(ZEND_OP2_LITERAL(opline))); in zend_optimizer_update_op2_const()
363 zend_op *opline, in zend_optimizer_replace_by_const() argument
370 while (opline < end) { in zend_optimizer_replace_by_const()
371 if (ZEND_OP1_TYPE(opline) == type && in zend_optimizer_replace_by_const()
372 ZEND_OP1(opline).var == var) { in zend_optimizer_replace_by_const()
373 switch (opline->opcode) { in zend_optimizer_replace_by_const()
384 opline->extended_value = 0; in zend_optimizer_replace_by_const()
385 opline->opcode = ZEND_SEND_VAL; in zend_optimizer_replace_by_const()
388 opline->extended_value = 0; in zend_optimizer_replace_by_const()
389 opline->opcode = ZEND_SEND_VAL_EX; in zend_optimizer_replace_by_const()
392 if (opline->extended_value & ZEND_ARG_COMPILE_TIME_BOUND) { in zend_optimizer_replace_by_const()
393 if (opline->extended_value & ZEND_ARG_SEND_BY_REF) { in zend_optimizer_replace_by_const()
397 opline->extended_value = 0; in zend_optimizer_replace_by_const()
398 opline->opcode = ZEND_SEND_VAL_EX; in zend_optimizer_replace_by_const()
400 opline->extended_value = 0; in zend_optimizer_replace_by_const()
401 opline->opcode = ZEND_SEND_VAL; in zend_optimizer_replace_by_const()
405 opline->opcode = ZEND_SEND_VAL_EX; in zend_optimizer_replace_by_const()
414 zend_op *m = opline; in zend_optimizer_replace_by_const()
433 if (op_array->brk_cont_array[brk].start <= (opline - op_array->opcodes) && in zend_optimizer_replace_by_const()
434 op_array->brk_cont_array[brk].brk > (opline - op_array->opcodes)) { in zend_optimizer_replace_by_const()
441 ZEND_ASSERT(opline->opcode == ZEND_FREE); in zend_optimizer_replace_by_const()
442 MAKE_NOP(opline); in zend_optimizer_replace_by_const()
447 m = opline; in zend_optimizer_replace_by_const()
471 ZEND_ASSERT((opline + 1)->opcode == ZEND_RETURN || (opline + 1)->opcode == ZEND_RETURN_BY_REF); in zend_optimizer_replace_by_const()
479 MAKE_NOP(opline); in zend_optimizer_replace_by_const()
480 zend_optimizer_update_op1_const(op_array, opline + 1, val); in zend_optimizer_replace_by_const()
486 return zend_optimizer_update_op1_const(op_array, opline, val); in zend_optimizer_replace_by_const()
489 if (ZEND_OP2_TYPE(opline) == type && in zend_optimizer_replace_by_const()
490 ZEND_OP2(opline).var == var) { in zend_optimizer_replace_by_const()
491 return zend_optimizer_update_op2_const(op_array, opline, val); in zend_optimizer_replace_by_const()
493 opline++; in zend_optimizer_replace_by_const()
574 zend_op *opline, *end; in zend_accel_optimize() local
577 opline = op_array->opcodes; in zend_accel_optimize()
578 end = opline + op_array->last; in zend_accel_optimize()
579 while (opline < end) { in zend_accel_optimize()
580 if (opline->op1_type == IS_CONST) { in zend_accel_optimize()
581 ZEND_PASS_TWO_UNDO_CONSTANT(op_array, opline->op1); in zend_accel_optimize()
583 if (opline->op2_type == IS_CONST) { in zend_accel_optimize()
584 ZEND_PASS_TWO_UNDO_CONSTANT(op_array, opline->op2); in zend_accel_optimize()
586 switch (opline->opcode) { in zend_accel_optimize()
591 ZEND_PASS_TWO_UNDO_JMP_TARGET(op_array, opline, ZEND_OP1(opline)); in zend_accel_optimize()
595 opline->extended_value = ZEND_OFFSET_TO_OPLINE_NUM(op_array, opline, opline->extended_value); in zend_accel_optimize()
607 ZEND_PASS_TWO_UNDO_JMP_TARGET(op_array, opline, ZEND_OP2(opline)); in zend_accel_optimize()
611 opline->extended_value = ZEND_OFFSET_TO_OPLINE_NUM(op_array, opline, opline->extended_value); in zend_accel_optimize()
614 opline++; in zend_accel_optimize()
621 opline = op_array->opcodes; in zend_accel_optimize()
622 end = opline + op_array->last; in zend_accel_optimize()
623 while (opline < end) { in zend_accel_optimize()
624 if (opline->op1_type == IS_CONST) { in zend_accel_optimize()
625 ZEND_PASS_TWO_UPDATE_CONSTANT(op_array, opline->op1); in zend_accel_optimize()
627 if (opline->op2_type == IS_CONST) { in zend_accel_optimize()
628 ZEND_PASS_TWO_UPDATE_CONSTANT(op_array, opline->op2); in zend_accel_optimize()
630 switch (opline->opcode) { in zend_accel_optimize()
635 ZEND_PASS_TWO_UPDATE_JMP_TARGET(op_array, opline, ZEND_OP1(opline)); in zend_accel_optimize()
639 opline->extended_value = ZEND_OPLINE_NUM_TO_OFFSET(op_array, opline, opline->extended_value); in zend_accel_optimize()
651 ZEND_PASS_TWO_UPDATE_JMP_TARGET(op_array, opline, ZEND_OP2(opline)); in zend_accel_optimize()
655 opline->extended_value = ZEND_OPLINE_NUM_TO_OFFSET(op_array, opline, opline->extended_value); in zend_accel_optimize()
658 ZEND_VM_SET_OPCODE_HANDLER(opline); in zend_accel_optimize()
659 opline++; in zend_accel_optimize()
666 zend_op *opline, *end; in zend_accel_adjust_fcall_stack_size() local
668 opline = op_array->opcodes; in zend_accel_adjust_fcall_stack_size()
669 end = opline + op_array->last; in zend_accel_adjust_fcall_stack_size()
670 while (opline < end) { in zend_accel_adjust_fcall_stack_size()
671 if (opline->opcode == ZEND_INIT_FCALL) { in zend_accel_adjust_fcall_stack_size()
674 Z_STR_P(RT_CONSTANT(op_array, opline->op2))); in zend_accel_adjust_fcall_stack_size()
676 opline->op1.num = zend_vm_calc_used_stack(opline->extended_value, func); in zend_accel_adjust_fcall_stack_size()
679 opline++; in zend_accel_adjust_fcall_stack_size()