164 int l_empty_arr = -1;
167 void *checkpoint = zend_arena_checkpoint(ctx->
arena);
168 int *const_slot, *class_slot, *func_slot, *bind_var_slot, *property_slot, *method_slot;
176 while (opline <
end) {
296#if DEBUG_COMPACT_LITERALS
305 zend_string_release(str);
317 if (!info[i].num_related) {
319 zval_ptr_dtor_nogc(&op_array->
literals[i]);
360 if (info[i].num_related == 1) {
376 bias_key(
key, 100 + info[i].num_related - 1);
380 zval_ptr_dtor_nogc(&op_array->
literals[i+1]);
389 info[
j+1] = info[i+1];
399 key = zend_string_init((
char*)&
Z_DVAL(op_array->
literals[i]),
sizeof(
double), 0);
419 info[i].num_related == info[
Z_LVAL_P(
pos)].num_related);
422 zval_ptr_dtor_nogc(&op_array->
literals[i]);
426 zval_ptr_dtor_nogc(&op_array->
literals[i]);
452 if (l_empty_arr < 0) {
460 zval_ptr_dtor_nogc(&op_array->
literals[i]);
462 map[i] = l_empty_arr;
483 const_slot = zend_arena_alloc(&ctx->
arena,
j * 6 *
sizeof(
int));
484 memset(const_slot, -1,
j * 6 *
sizeof(
int));
485 class_slot = const_slot +
j;
486 func_slot = class_slot +
j;
487 bind_var_slot = func_slot +
j;
488 property_slot = bind_var_slot +
j;
489 method_slot = property_slot +
j;
495 while (opline <
end) {
497 opline->op1.constant = map[opline->op1.constant];
500 opline->op2.constant = map[opline->op2.constant];
502 switch (opline->opcode) {
507 size_t num_classes = type_num_classes(op_array, opline->op1.num);
509 opline->extended_value = cache_size;
510 cache_size += num_classes *
sizeof(
void *);
516 size_t num_classes = type_num_classes(op_array, 0);
518 opline->op2.num = cache_size;
519 cache_size += num_classes *
sizeof(
void *);
527 (opline+1)->extended_value = add_static_slot(&
hash, op_array,
528 opline->op2.constant,
529 opline->op1.constant,
533 (opline+1)->extended_value = cache_size;
534 cache_size += 3 *
sizeof(
void *);
536 }
else if (opline->op2_type ==
IS_CONST) {
538 if (class_slot[opline->op2.constant] >= 0) {
539 (opline+1)->extended_value = class_slot[opline->op2.constant];
541 (opline+1)->extended_value = cache_size;
542 class_slot[opline->op2.constant] = cache_size;
543 cache_size +=
sizeof(
void *);
551 property_slot[opline->op2.constant] >= 0) {
552 (opline+1)->extended_value = property_slot[opline->op2.constant];
554 (opline+1)->extended_value = cache_size;
555 cache_size += 3 *
sizeof(
void *);
557 property_slot[opline->op2.constant] = (opline+1)->extended_value;
578 property_slot[opline->op2.constant] >= 0) {
579 opline->extended_value = property_slot[opline->op2.constant] | (opline->extended_value &
ZEND_FETCH_OBJ_FLAGS);
582 cache_size += 3 *
sizeof(
void *);
593 property_slot[opline->op2.constant] >= 0) {
594 opline->extended_value = property_slot[opline->op2.constant] | (opline->extended_value &
ZEND_ISEMPTY);
596 opline->extended_value = cache_size | (opline->extended_value &
ZEND_ISEMPTY);
597 cache_size += 3 *
sizeof(
void *);
599 property_slot[opline->op2.constant] = opline->extended_value &
~ZEND_ISEMPTY;
608 if (func_slot[opline->op2.constant] >= 0) {
609 opline->result.num = func_slot[opline->op2.constant];
611 opline->result.num = cache_size;
612 cache_size +=
sizeof(
void *);
613 func_slot[opline->op2.constant] = opline->result.num;
620 method_slot[opline->op2.constant] >= 0) {
621 opline->result.num = method_slot[opline->op2.constant];
623 opline->result.num = cache_size;
624 cache_size += 2 *
sizeof(
void *);
626 method_slot[opline->op2.constant] = opline->result.num;
635 opline->result.num = add_static_slot(&
hash, op_array,
636 opline->op1.constant,
637 opline->op2.constant,
641 opline->result.num = cache_size;
642 cache_size += 2 *
sizeof(
void *);
644 }
else if (opline->op1_type ==
IS_CONST) {
646 if (class_slot[opline->op1.constant] >= 0) {
647 opline->result.num = class_slot[opline->op1.constant];
649 opline->result.num = cache_size;
650 cache_size +=
sizeof(
void *);
651 class_slot[opline->op1.constant] = opline->result.num;
657 if (const_slot[opline->op1.constant] >= 0) {
658 opline->extended_value = const_slot[opline->op1.constant];
660 opline->extended_value = cache_size;
661 cache_size +=
sizeof(
void *);
662 const_slot[opline->op1.constant] = opline->extended_value;
667 if (const_slot[opline->op2.constant] >= 0) {
668 opline->extended_value = const_slot[opline->op2.constant];
670 opline->extended_value = cache_size;
671 cache_size +=
sizeof(
void *);
672 const_slot[opline->op2.constant] = opline->extended_value;
680 opline->extended_value = add_static_slot(&
hash, op_array,
681 opline->op1.constant,
682 opline->op2.constant,
686 opline->extended_value = cache_size;
687 cache_size += 2 *
sizeof(
void *);
707 opline->extended_value = add_static_slot(&
hash, op_array,
708 opline->op2.constant,
709 opline->op1.constant,
714 cache_size += 3 *
sizeof(
void *);
716 }
else if (opline->op2_type ==
IS_CONST) {
718 if (class_slot[opline->op2.constant] >= 0) {
719 opline->extended_value = class_slot[opline->op2.constant] | (opline->extended_value &
ZEND_FETCH_OBJ_FLAGS);
722 class_slot[opline->op2.constant] = cache_size;
723 cache_size +=
sizeof(
void *);
731 if (class_slot[opline->op2.constant] >= 0) {
732 opline->extended_value = class_slot[opline->op2.constant];
734 opline->extended_value = cache_size;
735 cache_size +=
sizeof(
void *);
736 class_slot[opline->op2.constant] = opline->extended_value;
743 if (class_slot[opline->op1.constant] >= 0) {
744 opline->op2.num = class_slot[opline->op1.constant];
746 opline->op2.num = cache_size;
747 cache_size +=
sizeof(
void *);
748 class_slot[opline->op1.constant] = opline->op2.num;
755 if (class_slot[opline->op1.constant] >= 0) {
756 opline->extended_value = class_slot[opline->op1.constant] | (opline->extended_value &
ZEND_LAST_CATCH);
758 opline->extended_value = cache_size | (opline->extended_value &
ZEND_LAST_CATCH);
759 cache_size +=
sizeof(
void *);
760 class_slot[opline->op1.constant] = opline->extended_value &
~ZEND_LAST_CATCH;
766 if (bind_var_slot[opline->op2.constant] >= 0) {
767 opline->extended_value = bind_var_slot[opline->op2.constant];
769 opline->extended_value = cache_size;
770 cache_size +=
sizeof(
void *);
771 bind_var_slot[opline->op2.constant] = opline->extended_value;
777 opline->extended_value = cache_size;
778 cache_size +=
sizeof(
void *);
790 opline->result.num = cache_size;
791 cache_size += 2 *
sizeof(
void *);
799 zend_arena_release(&ctx->
arena, checkpoint);
813 }
else if (opline->opcode !=
ZEND_RECV) {
820#if DEBUG_COMPACT_LITERALS
827 zend_string_release(str);