Changeset 662 for trunk/processor/processor.m4
- Timestamp:
- 2009-08-03T10:15:53+02:00 (4 years ago)
- File:
-
- 1 edited
-
trunk/processor/processor.m4 (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/processor/processor.m4
r648 r662 339 339 if (src->num_interfaces) { 340 340 /* 341 int i; 341 342 zval *arr; 342 343 ALLOC_INIT_ZVAL(arr); … … 499 500 DEF_STRUCT_P_FUNC(`zend_op_array', , `dnl {{{ 500 501 IFRESTORE(` 502 const xc_op_array_info_t *op_array_info = &processor->active_op_array_infos_src[processor->active_op_array_index]; 501 503 dnl shadow copy must NOT meet: 502 504 dnl readonly_protection=on 503 505 dnl main op_array && have early binding 504 zend_uint ii;505 506 #ifdef ZEND_COMPILE_DELAYED_BINDING 506 507 zend_bool need_early_binding = 0; … … 508 509 zend_bool need_early_binding = processor->php_src->have_early_binding; 509 510 #endif 510 if (!processor->readonly_protection && !(src == processor->php_src->op_array && need_early_binding)) { 511 zend_bool shallow_copy = !processor->readonly_protection && !(src == processor->php_src->op_array && need_early_binding); 512 if (shallow_copy) { 513 zend_bool gc_arg_info = 0; 514 int gc_opcodes = 0; 511 515 /* really fast shallow copy */ 512 516 memcpy(dst, src, sizeof(src[0])); … … 515 519 STRUCT_P(HashTable, static_variables, HashTable_zval_ptr) 516 520 #ifdef ZEND_ENGINE_2 517 STRUCT_ARRAY_I(num_args, zend_arg_info, arg_info) 518 xc_gc_add_op_array(dst TSRMLS_CC); 519 #endif 521 STRUCT_ARRAY(num_args, zend_arg_info, arg_info) 522 gc_arg_info = 1; 523 #endif 524 if (op_array_info->oplineinfo_cnt) { 525 gc_opcodes = 1; 526 COPY_N_EX(last, zend_op, opcodes) 527 } 528 if (gc_arg_info || gc_opcodes) { 529 xc_gc_op_array_t gc_op_array; 530 #ifdef ZEND_ENGINE_2 531 gc_op_array.num_args = gc_arg_info ? dst->num_args : 0; 532 gc_op_array.arg_info = gc_arg_info ? dst->arg_info : NULL; 533 #endif 534 gc_op_array.last = gc_opcodes > 1 ? dst->last : 0; 535 gc_op_array.opcodes = gc_opcodes ? dst->opcodes : NULL; 536 xc_gc_add_op_array(&gc_op_array TSRMLS_CC); 537 } 520 538 define(`SKIPASSERT_ONCE') 521 539 } … … 524 542 do { 525 543 dnl RESTORE is done above! 526 zend_uint ii;527 int i;528 544 529 545 /* Common elements */ … … 532 548 #ifdef ZEND_ENGINE_2 533 549 DISPATCH(zend_uint, fn_flags) 534 STRUCT_ARRAY _I(num_args, zend_arg_info, arg_info)550 STRUCT_ARRAY(num_args, zend_arg_info, arg_info) 535 551 DISPATCH(zend_uint, num_args) 536 552 DISPATCH(zend_uint, required_num_args) … … 541 557 IFCOPY(`memcpy(dst->arg_types, src->arg_types, sizeof(src->arg_types[0]) * (src->arg_types[0]+1));') 542 558 IFDASM(`do { 543 zend_uint ii;544 559 int i; 545 560 zval *zv; … … 581 596 processor->active_opcodes_src = src->opcodes; 582 597 ')') 583 STRUCT_ARRAY _I(last, zend_op, opcodes)598 STRUCT_ARRAY(last, zend_op, opcodes) 584 599 popdef(`AFTER_ALLOC') 585 600 DISPATCH(zend_uint, last) … … 599 614 DISPATCH(zend_uint, T) 600 615 601 STRUCT_ARRAY _I(last_brk_cont, zend_brk_cont_element, brk_cont_array)616 STRUCT_ARRAY(last_brk_cont, zend_brk_cont_element, brk_cont_array) 602 617 DISPATCH(zend_uint, last_brk_cont) 603 618 DISPATCH(zend_uint, current_brk_cont) … … 649 664 #endif 650 665 } while (0); 666 IFRESTORE(`xc_fix_op_array_info(processor->php_src, dst, !shallow_copy, op_array_info TSRMLS_CC);') 651 667 652 668 #ifdef ZEND_ENGINE_2 … … 713 729 dnl }}} 714 730 #endif 731 DEF_STRUCT_P_FUNC(`xc_op_array_info_t', , `dnl {{{ 732 DISPATCH(zend_uint, oplineinfo_cnt) 733 DISPATCH_ARRAY(oplineinfo_cnt, int, oplineinfos) 734 ') 735 dnl }}} 715 736 DEF_STRUCT_P_FUNC(`xc_funcinfo_t', , `dnl {{{ 716 737 DISPATCH(zend_uint, key_size) … … 722 743 ') 723 744 DISPATCH(ulong, h) 745 IFRESTORE(`COPY(op_array_info)', ` 746 STRUCT(xc_op_array_info_t, op_array_info) 747 ') 748 IFRESTORE(` 749 processor->active_op_array_infos_src = &dst->op_array_info; 750 processor->active_op_array_index = 0; 751 ') 724 752 STRUCT(zend_function, func) 725 753 ') … … 734 762 ') 735 763 DISPATCH(ulong, h) 764 DISPATCH(zend_uint, methodinfo_cnt) 765 IFRESTORE(`COPY(methodinfos)', ` 766 STRUCT_ARRAY(methodinfo_cnt, xc_op_array_info_t, methodinfos) 767 ') 768 IFRESTORE(` 769 processor->active_op_array_infos_src = dst->methodinfos; 770 processor->active_op_array_index = 0; 771 ') 736 772 #ifdef ZEND_ENGINE_2 737 773 STRUCT_P(zend_class_entry, cest) … … 767 803 #endif 768 804 DEF_STRUCT_P_FUNC(`xc_entry_data_php_t', , `dnl {{{ 769 zend_uint i;770 771 805 IFCOPY(` 772 806 processor->php_dst = dst; … … 785 819 DISPATCH(size_t, size) 786 820 821 DISPATCH(int, filepath_len) 822 IFRESTORE(`COPY(filepath)', `PROC_STRING_L(filepath, filepath_len)') 823 DISPATCH(int, dirpath_len) 824 IFRESTORE(`COPY(dirpath)', `PROC_STRING_L(dirpath, dirpath_len)') 825 #ifdef IS_UNICODE 826 DISPATCH(int, ufilepath_len) 827 IFRESTORE(`COPY(ufilepath)', `PROC_USTRING_L(ufilepath, ufilepath_len)') 828 DISPATCH(int, udirpath_len) 829 IFRESTORE(`COPY(udirpath)', `PROC_USTRING_L(udirpath, udirpath_len)') 830 #endif 831 832 IFRESTORE(`COPY(op_array_info)', ` 833 STRUCT(xc_op_array_info_t, op_array_info) 834 ') 835 IFRESTORE(` 836 processor->active_op_array_infos_src = &dst->op_array_info; 837 processor->active_op_array_index = 0; 838 ') 787 839 STRUCT_P(zend_op_array, op_array) 788 840 … … 796 848 797 849 DISPATCH(zend_uint, classinfo_cnt) 798 pushdef(`BEFORE_LOOP', ` 799 IFCOPY(` 800 processor->active_class_num = i + 1; 801 ') 802 ') 803 STRUCT_ARRAY(classinfo_cnt, xc_classinfo_t, classinfos) 804 popdef(`BEFORE_LOOP') 850 STRUCT_ARRAY(classinfo_cnt, xc_classinfo_t, classinfos, , IFRESTORE(`processor->active_class_index')) 805 851 #ifdef ZEND_ENGINE_2_1 806 852 DISPATCH(zend_uint, autoglobal_cnt) … … 879 925 switch (src->type) { 880 926 case XC_TYPE_PHP: 881 IFCALCCOPY(` DONE(data.php)', `STRUCT_P(xc_entry_data_php_t, data.php)')927 IFCALCCOPY(`COPY(data.php)', `STRUCT_P(xc_entry_data_php_t, data.php)') 882 928 break; 883 929
Note: See TracChangeset
for help on using the changeset viewer.

