Lines Matching refs:common

249   backtrack_common common;  member
260 backtrack_common common; member
280 backtrack_common common; member
290 backtrack_common common; member
295 backtrack_common common; member
309 backtrack_common common; member
329 backtrack_common common; member
341 backtrack_common common; member
569 #define OVECTOR_START (common->ovector_start)
571 #define OVECTOR_PRIV(i) (common->cbra_ptr + (i) * (sljit_sw)sizeof(sljit_sw))
572 #define PRIVATE_DATA(cc) (common->private_data_ptrs[(cc) - common->start])
591 struct sljit_compiler *compiler = common->compiler
656 static PCRE2_SPTR next_opcode(compiler_common *common, PCRE2_SPTR cc) in next_opcode() argument
658 SLJIT_UNUSED_ARG(common); in next_opcode()
807 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in next_opcode()
829 if (common->utf) return NULL; in next_opcode()
855 static BOOL check_opcode_types(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend) in check_opcode_types() argument
867 common->has_set_som = TRUE; in check_opcode_types()
868 common->might_be_empty = TRUE; in check_opcode_types()
874 common->optimized_cbracket[GET2(cc, 1)] = 0; in check_opcode_types()
880 common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] = 0; in check_opcode_types()
894 common->optimized_cbracket[GET2(cc, 1)] = 0; in check_opcode_types()
902 slot = common->name_table + GET2(cc, 1) * common->name_entry_size; in check_opcode_types()
905 common->optimized_cbracket[GET2(slot, 0)] = 0; in check_opcode_types()
906 slot += common->name_entry_size; in check_opcode_types()
913 if (common->recursive_head_ptr == 0) in check_opcode_types()
915 common->recursive_head_ptr = common->ovector_start; in check_opcode_types()
916 common->ovector_start += sizeof(sljit_sw); in check_opcode_types()
923 if (common->capture_last_ptr == 0) in check_opcode_types()
925 common->capture_last_ptr = common->ovector_start; in check_opcode_types()
926 common->ovector_start += sizeof(sljit_sw); in check_opcode_types()
939 common->has_then = TRUE; in check_opcode_types()
940 common->control_head_ptr = 1; in check_opcode_types()
946 if (common->mark_ptr == 0) in check_opcode_types()
948 common->mark_ptr = common->ovector_start; in check_opcode_types()
949 common->ovector_start += sizeof(sljit_sw); in check_opcode_types()
955 common->has_then = TRUE; in check_opcode_types()
956 common->control_head_ptr = 1; in check_opcode_types()
962 common->has_skip_in_assert_back = TRUE; in check_opcode_types()
967 common->control_head_ptr = 1; in check_opcode_types()
968 common->has_skip_arg = TRUE; in check_opcode_types()
970 common->has_skip_in_assert_back = TRUE; in check_opcode_types()
975 cc = next_opcode(common, cc); in check_opcode_types()
1049 static SLJIT_INLINE BOOL detect_fast_forward_skip(compiler_common *common, int *private_data_start) in detect_fast_forward_skip() argument
1051 PCRE2_SPTR cc = common->start; in detect_fast_forward_skip()
1083 if (common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] == 0) in detect_fast_forward_skip()
1092 common->fast_forward_bc_ptr = cc; in detect_fast_forward_skip()
1093 common->private_data_ptrs[(cc + 1) - common->start] = *private_data_start; in detect_fast_forward_skip()
1100 static SLJIT_INLINE void detect_fast_fail(compiler_common *common, PCRE2_SPTR cc, int *private_data… in detect_fast_fail() argument
1106 if (*cc == OP_CBRA && common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] == 0) in detect_fast_fail()
1142 detect_fast_fail(common, cc, private_data_start, depth - 1); in detect_fast_fail()
1146 common->private_data_ptrs[(cc + 1) - common->start] = *private_data_start; in detect_fast_fail()
1148 if (common->fast_fail_start_ptr == 0) in detect_fast_fail()
1149 common->fast_fail_start_ptr = *private_data_start; in detect_fast_fail()
1152 common->fast_fail_end_ptr = *private_data_start; in detect_fast_fail()
1195 static BOOL detect_repeat(compiler_common *common, PCRE2_SPTR begin) in detect_repeat() argument
1210 if (common->private_data_ptrs[end - common->start - LINK_SIZE] != 0) in detect_repeat()
1256 common->private_data_ptrs[max_end - common->start - LINK_SIZE] = next_end - max_end; in detect_repeat()
1257common->private_data_ptrs[max_end - common->start - LINK_SIZE + 1] = (type == OP_BRAZERO) ? OP_UPT… in detect_repeat()
1259 common->private_data_ptrs[max_end - common->start - LINK_SIZE + 2] = max + 2; in detect_repeat()
1271 common->private_data_ptrs[end - common->start - LINK_SIZE] = max_end - end; in detect_repeat()
1272 common->private_data_ptrs[end - common->start - LINK_SIZE + 1] = OP_EXACT; in detect_repeat()
1273 common->private_data_ptrs[end - common->start - LINK_SIZE + 2] = min; in detect_repeat()
1332 static void set_private_data_ptrs(compiler_common *common, int *private_data_start, PCRE2_SPTR ccen… in set_private_data_ptrs() argument
1334 PCRE2_SPTR cc = common->start; in set_private_data_ptrs()
1351 if (detect_repeat(common, cc)) in set_private_data_ptrs()
1364 if (common->private_data_ptrs[cc + 1 - common->start] != 0) in set_private_data_ptrs()
1366 common->private_data_ptrs[cc - common->start] = private_data_ptr; in set_private_data_ptrs()
1368 cc += common->private_data_ptrs[cc + 1 - common->start]; in set_private_data_ptrs()
1382 common->private_data_ptrs[cc - common->start] = private_data_ptr; in set_private_data_ptrs()
1389 common->private_data_ptrs[cc - common->start] = private_data_ptr; in set_private_data_ptrs()
1399 common->private_data_ptrs[cc - common->start] = private_data_ptr; in set_private_data_ptrs()
1472 cc = next_opcode(common, cc); in set_private_data_ptrs()
1481 common->private_data_ptrs[cc - common->start] = private_data_ptr; in set_private_data_ptrs()
1491 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in set_private_data_ptrs()
1513 static int get_framesize(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend, BOOL recursive, … in get_framesize() argument
1524 SLJIT_ASSERT(common->control_head_ptr != 0); in get_framesize()
1535 possessive = length = (common->capture_last_ptr != 0) ? 5 : 3; in get_framesize()
1539 cc = next_opcode(common, cc); in get_framesize()
1547 SLJIT_ASSERT(common->has_set_som); in get_framesize()
1561 SLJIT_ASSERT(common->mark_ptr != 0); in get_framesize()
1568 if (common->control_head_ptr != 0) in get_framesize()
1575 if (common->has_set_som && !setsom_found) in get_framesize()
1580 if (common->mark_ptr != 0 && !setmark_found) in get_framesize()
1585 if (common->capture_last_ptr != 0 && !capture_last_found) in get_framesize()
1598 if (common->capture_last_ptr != 0 && !capture_last_found) in get_framesize()
1609 if (common->control_head_ptr != 0) in get_framesize()
1685 cc = next_opcode(common, cc); in get_framesize()
1699 static void init_frame(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend, int stackpos, int … in init_frame() argument
1717 cc = next_opcode(common, cc); in init_frame()
1725 SLJIT_ASSERT(common->has_set_som); in init_frame()
1742 SLJIT_ASSERT(common->mark_ptr != 0); in init_frame()
1745 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->mark_ptr); in init_frame()
1746 OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, SLJIT_IMM, -common->mark_ptr); in init_frame()
1756 if (common->has_set_som && !setsom_found) in init_frame()
1765 if (common->mark_ptr != 0 && !setmark_found) in init_frame()
1767 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->mark_ptr); in init_frame()
1768 OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, SLJIT_IMM, -common->mark_ptr); in init_frame()
1774 if (common->capture_last_ptr != 0 && !capture_last_found) in init_frame()
1776 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr); in init_frame()
1777 OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, SLJIT_IMM, -common->capture_last_ptr); in init_frame()
1790 if (common->capture_last_ptr != 0 && !capture_last_found) in init_frame()
1792 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr); in init_frame()
1793 OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, SLJIT_IMM, -common->capture_last_ptr); in init_frame()
1813 cc = next_opcode(common, cc); in init_frame()
1833 static void delayed_mem_copy_init(delayed_mem_copy_status *status, compiler_common *common) in delayed_mem_copy_init() argument
1845 status->compiler = common->compiler; in delayed_mem_copy_init()
1899 static int get_recurse_data_length(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend, in get_recurse_data_length() argument
1913 SLJIT_ASSERT(common->control_head_ptr != 0); in get_recurse_data_length()
1924 SLJIT_ASSERT(common->has_set_som); in get_recurse_data_length()
1930 if (common->has_set_som) in get_recurse_data_length()
1932 if (common->mark_ptr != 0) in get_recurse_data_length()
1934 if (common->capture_last_ptr != 0) in get_recurse_data_length()
1966 if (common->capture_last_ptr != 0) in get_recurse_data_length()
1968 if (common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] == 0) in get_recurse_data_length()
1976 if (common->capture_last_ptr != 0) in get_recurse_data_length()
1994 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in get_recurse_data_length()
2003 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in get_recurse_data_length()
2012 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in get_recurse_data_length()
2051 SLJIT_ASSERT(common->mark_ptr != 0); in get_recurse_data_length()
2054 if (common->control_head_ptr != 0) in get_recurse_data_length()
2075 SLJIT_ASSERT(common->control_head_ptr != 0); in get_recurse_data_length()
2089 cc = next_opcode(common, cc); in get_recurse_data_length()
2122 static void copy_recurse_data(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend, in copy_recurse_data() argument
2138 SLJIT_ASSERT(common->control_head_ptr != 0); in copy_recurse_data()
2189 delayed_mem_copy_init(&status, common); in copy_recurse_data()
2196 delayed_mem_copy_move(&status, base_reg, stackptr, SLJIT_SP, common->recursive_head_ptr); in copy_recurse_data()
2199 delayed_mem_copy_move(&status, SLJIT_SP, common->recursive_head_ptr, base_reg, stackptr); in copy_recurse_data()
2208 delayed_mem_copy_move(&status, base_reg, stackptr, SLJIT_SP, common->control_head_ptr); in copy_recurse_data()
2211 delayed_mem_copy_move(&status, SLJIT_SP, common->control_head_ptr, base_reg, stackptr); in copy_recurse_data()
2226 SLJIT_ASSERT(common->has_set_som); in copy_recurse_data()
2239 if (common->has_set_som && !setsom_found) in copy_recurse_data()
2245 if (common->mark_ptr != 0 && !setmark_found) in copy_recurse_data()
2247 kept_shared_srcw[kept_shared_count] = common->mark_ptr; in copy_recurse_data()
2252 if (common->capture_last_ptr != 0 && !capture_last_found) in copy_recurse_data()
2254 shared_srcw[0] = common->capture_last_ptr; in copy_recurse_data()
2293 if (common->capture_last_ptr != 0 && !capture_last_found) in copy_recurse_data()
2295 shared_srcw[2] = common->capture_last_ptr; in copy_recurse_data()
2300 if (common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] == 0) in copy_recurse_data()
2315 if (common->capture_last_ptr != 0 && !capture_last_found) in copy_recurse_data()
2317 shared_srcw[2] = common->capture_last_ptr; in copy_recurse_data()
2347 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in copy_recurse_data()
2360 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in copy_recurse_data()
2373 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in copy_recurse_data()
2439 SLJIT_ASSERT(common->mark_ptr != 0); in copy_recurse_data()
2442 kept_shared_srcw[0] = common->mark_ptr; in copy_recurse_data()
2446 if (common->control_head_ptr != 0 && !control_head_found) in copy_recurse_data()
2448 shared_srcw[0] = common->control_head_ptr; in copy_recurse_data()
2456 SLJIT_ASSERT(common->control_head_ptr != 0); in copy_recurse_data()
2459 shared_srcw[0] = common->control_head_ptr; in copy_recurse_data()
2467 cc = next_opcode(common, cc); in copy_recurse_data()
2538 static SLJIT_INLINE PCRE2_SPTR set_then_offsets(compiler_common *common, PCRE2_SPTR cc, sljit_u8 *c… in set_then_offsets() argument
2550 cc = next_opcode(common, cc); in set_then_offsets()
2552 current_offset = common->then_offsets + (cc - common->start); in set_then_offsets()
2557 cc = set_then_offsets(common, cc, current_offset); in set_then_offsets()
2561 current_offset = common->then_offsets + (cc + 1 + LINK_SIZE - common->start); in set_then_offsets()
2564 cc = next_opcode(common, cc); in set_then_offsets()
2605 static void add_stub(compiler_common *common, struct sljit_jump *start) in add_stub() argument
2614 list_item->next = common->stubs; in add_stub()
2615 common->stubs = list_item; in add_stub()
2619 static void flush_stubs(compiler_common *common) in flush_stubs() argument
2622 stub_list *list_item = common->stubs; in flush_stubs()
2627 add_jump(compiler, &common->stackalloc, JUMP(SLJIT_FAST_CALL)); in flush_stubs()
2631 common->stubs = NULL; in flush_stubs()
2634 static void add_label_addr(compiler_common *common, sljit_uw *update_addr) in add_label_addr() argument
2644 label_addr->next = common->label_addrs; in add_label_addr()
2645 common->label_addrs = label_addr; in add_label_addr()
2648 static SLJIT_INLINE void count_match(compiler_common *common) in count_match() argument
2653 add_jump(compiler, &common->calllimit, JUMP(SLJIT_ZERO)); in count_match()
2656 static SLJIT_INLINE void allocate_stack(compiler_common *common, int size) in allocate_stack() argument
2670 add_stub(common, CMP(SLJIT_LESS, STACK_TOP, 0, STACK_LIMIT, 0)); in allocate_stack()
2673 static SLJIT_INLINE void free_stack(compiler_common *common, int size) in free_stack() argument
2681 static sljit_uw * allocate_read_only_data(compiler_common *common, sljit_uw size) in allocate_read_only_data() argument
2696 *(void**)result = common->read_only_data_head; in allocate_read_only_data()
2697 common->read_only_data_head = (void *)result; in allocate_read_only_data()
2701 static SLJIT_INLINE void reset_ovector(compiler_common *common, int length) in reset_ovector() argument
2740 static SLJIT_INLINE void reset_fast_fail(compiler_common *common) in reset_fast_fail() argument
2745 SLJIT_ASSERT(common->fast_fail_start_ptr < common->fast_fail_end_ptr); in reset_fast_fail()
2748 for (i = common->fast_fail_start_ptr; i < common->fast_fail_end_ptr; i += sizeof(sljit_sw)) in reset_fast_fail()
2752 static SLJIT_INLINE void do_reset_match(compiler_common *common, int length) in do_reset_match() argument
2791 if (common->mark_ptr != 0) in do_reset_match()
2792 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->mark_ptr, SLJIT_IMM, 0); in do_reset_match()
2793 if (common->control_head_ptr != 0) in do_reset_match()
2794 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_IMM, 0); in do_reset_match()
2796 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->start_ptr); in do_reset_match()
2824 static SLJIT_INLINE void copy_ovector(compiler_common *common, int topbracket) in copy_ovector() argument
2835 OP1(SLJIT_MOV, SLJIT_S0, 0, SLJIT_MEM1(SLJIT_SP), common->start_ptr); in copy_ovector()
2836 if (common->mark_ptr != 0) in copy_ovector()
2837 OP1(SLJIT_MOV, SLJIT_R2, 0, SLJIT_MEM1(SLJIT_SP), common->mark_ptr); in copy_ovector()
2840 if (common->mark_ptr != 0) in copy_ovector()
2906 static SLJIT_INLINE void return_with_partial_match(compiler_common *common, struct sljit_label *qui… in return_with_partial_match() argument
2912 SLJIT_ASSERT(common->start_used_ptr != 0 && common->start_ptr != 0 in return_with_partial_match()
2913 && (common->mode == PCRE2_JIT_PARTIAL_SOFT ? common->hit_start != 0 : common->hit_start == 0)); in return_with_partial_match()
2917 common->mode == PCRE2_JIT_PARTIAL_SOFT ? common->hit_start : common->start_ptr); in return_with_partial_match()
2942 static SLJIT_INLINE void check_start_used_ptr(compiler_common *common) in check_start_used_ptr() argument
2948 if (common->mode == PCRE2_JIT_PARTIAL_SOFT) in check_start_used_ptr()
2951 OP2(SLJIT_ADD, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, SLJIT_IMM, 1); in check_start_used_ptr()
2955 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0); in check_start_used_ptr()
2958 else if (common->mode == PCRE2_JIT_PARTIAL_HARD) in check_start_used_ptr()
2960 jump = CMP(SLJIT_LESS_EQUAL, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0); in check_start_used_ptr()
2961 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0); in check_start_used_ptr()
2966 static SLJIT_INLINE BOOL char_has_othercase(compiler_common *common, PCRE2_SPTR cc) in char_has_othercase() argument
2972 if (common->utf) in char_has_othercase()
2980 return common->fcc[c] != c; in char_has_othercase()
2986 return MAX_255(c) ? common->fcc[c] != c : FALSE; in char_has_othercase()
2989 static SLJIT_INLINE unsigned int char_othercase(compiler_common *common, unsigned int c) in char_othercase() argument
2993 if (common->utf && c > 127) in char_othercase()
2998 return TABLE_GET(c, common->fcc, c); in char_othercase()
3001 static unsigned int char_get_othercase_bit(compiler_common *common, PCRE2_SPTR cc) in char_get_othercase_bit() argument
3010 if (common->utf) in char_get_othercase_bit()
3014 oc = common->fcc[c]; in char_get_othercase_bit()
3023 oc = TABLE_GET(c, common->fcc, c); in char_get_othercase_bit()
3027 oc = TABLE_GET(c, common->fcc, c); in char_get_othercase_bit()
3044 if (common->utf && c > 127) in char_get_othercase_bit()
3060 if (common->utf && c > 65535) in char_get_othercase_bit()
3073 static void check_partial(compiler_common *common, BOOL force) in check_partial() argument
3079 SLJIT_ASSERT(!force || common->mode != PCRE2_JIT_COMPLETE); in check_partial()
3081 if (common->mode == PCRE2_JIT_COMPLETE) in check_partial()
3085 jump = CMP(SLJIT_GREATER_EQUAL, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0); in check_partial()
3086 else if (common->mode == PCRE2_JIT_PARTIAL_SOFT) in check_partial()
3087 jump = CMP(SLJIT_EQUAL, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, SLJIT_IMM, -1); in check_partial()
3089 if (common->mode == PCRE2_JIT_PARTIAL_SOFT) in check_partial()
3090 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, 0); in check_partial()
3093 if (common->partialmatchlabel != NULL) in check_partial()
3094 JUMPTO(SLJIT_JUMP, common->partialmatchlabel); in check_partial()
3096 add_jump(compiler, &common->partialmatch, JUMP(SLJIT_JUMP)); in check_partial()
3103 static void check_str_end(compiler_common *common, jump_list **end_reached) in check_str_end() argument
3109 if (common->mode == PCRE2_JIT_COMPLETE) in check_str_end()
3116 if (common->mode == PCRE2_JIT_PARTIAL_SOFT) in check_str_end()
3118 …add_jump(compiler, end_reached, CMP(SLJIT_GREATER_EQUAL, SLJIT_MEM1(SLJIT_SP), common->start_used_… in check_str_end()
3119 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, 0); in check_str_end()
3124 …add_jump(compiler, end_reached, CMP(SLJIT_GREATER_EQUAL, SLJIT_MEM1(SLJIT_SP), common->start_used_… in check_str_end()
3125 if (common->partialmatchlabel != NULL) in check_str_end()
3126 JUMPTO(SLJIT_JUMP, common->partialmatchlabel); in check_str_end()
3128 add_jump(compiler, &common->partialmatch, JUMP(SLJIT_JUMP)); in check_str_end()
3133 static void detect_partial_match(compiler_common *common, jump_list **backtracks) in detect_partial_match() argument
3138 if (common->mode == PCRE2_JIT_COMPLETE) in detect_partial_match()
3146 add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, SLJIT_MEM1(SLJIT_SP), common->start_used_pt… in detect_partial_match()
3147 if (common->mode == PCRE2_JIT_PARTIAL_SOFT) in detect_partial_match()
3149 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, 0); in detect_partial_match()
3154 if (common->partialmatchlabel != NULL) in detect_partial_match()
3155 JUMPTO(SLJIT_JUMP, common->partialmatchlabel); in detect_partial_match()
3157 add_jump(compiler, &common->partialmatch, JUMP(SLJIT_JUMP)); in detect_partial_match()
3162 static void peek_char(compiler_common *common, sljit_u32 max) in peek_char() argument
3175 if (common->utf) in peek_char()
3181 add_jump(compiler, &common->utfreadchar, JUMP(SLJIT_FAST_CALL)); in peek_char()
3188 if (common->utf) in peek_char()
3224 static void read_char7_type(compiler_common *common, BOOL full_read) in read_char7_type() argument
3232 SLJIT_ASSERT(common->utf); in read_char7_type()
3237 OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); in read_char7_type()
3250 static void read_char_range(compiler_common *common, sljit_u32 min, sljit_u32 max, BOOL update_str_… in read_char_range() argument
3272 if (common->utf) in read_char_range()
3322 …add_jump(compiler, (max < 0x10000) ? &common->utfreadchar16 : &common->utfreadchar, JUMP(SLJIT_FAS… in read_char_range()
3347 if (common->utf) in read_char_range()
3378 static SLJIT_INLINE void read_char(compiler_common *common) in read_char() argument
3380 read_char_range(common, 0, READ_CHAR_MAX, TRUE); in read_char()
3383 static void read_char8_type(compiler_common *common, BOOL update_str_ptr) in read_char8_type() argument
3400 if (common->utf) in read_char8_type()
3404 OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); in read_char8_type()
3416 OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); in read_char8_type()
3420 add_jump(compiler, &common->utfreadtype8, JUMP(SLJIT_FAST_CALL)); in read_char8_type()
3431 OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); in read_char8_type()
3437 if (common->utf && update_str_ptr) in read_char8_type()
3448 static void skip_char_back(compiler_common *common) in skip_char_back() argument
3456 if (common->utf) in skip_char_back()
3466 if (common->utf) in skip_char_back()
3483 static void check_newlinechar(compiler_common *common, int nltype, jump_list **backtracks, BOOL jum… in check_newlinechar() argument
3491 add_jump(compiler, &common->anynewline, JUMP(SLJIT_FAST_CALL)); in check_newlinechar()
3511 SLJIT_ASSERT(nltype == NLTYPE_FIXED && common->newline < 256); in check_newlinechar()
3512 …backtracks, CMP(jumpifmatch ? SLJIT_EQUAL : SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, common->newline)); in check_newlinechar()
3519 static void do_utfreadchar(compiler_common *common) in do_utfreadchar() argument
3567 static void do_utfreadchar16(compiler_common *common) in do_utfreadchar16() argument
3603 static void do_utfreadtype8(compiler_common *common) in do_utfreadtype8() argument
3624 OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); in do_utfreadtype8()
3645 static void do_getucd(compiler_common *common) in do_getucd() argument
3666 if (!common->utf) in do_getucd()
3689 static SLJIT_INLINE struct sljit_label *mainloop_entry(compiler_common *common) in mainloop_entry() argument
3701 sljit_u32 overall_options = common->re->overall_options; in mainloop_entry()
3702 BOOL hascrorlf = (common->re->flags & PCRE2_HASCRORLF) != 0; in mainloop_entry()
3707 && (common->nltype == NLTYPE_ANY || common->nltype == NLTYPE_ANYCRLF || common->newline > 255)) in mainloop_entry()
3710 SLJIT_ASSERT(common->abort_label == NULL); in mainloop_entry()
3715 SLJIT_ASSERT(common->match_end_ptr != 0); in mainloop_entry()
3718 if (common->nltype == NLTYPE_FIXED && common->newline > 255) in mainloop_entry()
3725 CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff, mainloop); in mainloop_entry()
3726 CMPTO(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, common->newline & 0xff, mainloop); in mainloop_entry()
3728 … OP2(SLJIT_SUB, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); in mainloop_entry()
3735 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr, STR_PTR, 0); in mainloop_entry()
3736 read_char_range(common, common->nlmin, common->nlmax, TRUE); in mainloop_entry()
3737 check_newlinechar(common, common->nltype, &newline, TRUE); in mainloop_entry()
3740 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr, STR_PTR, 0); in mainloop_entry()
3749 SLJIT_ASSERT(common->match_end_ptr != 0); in mainloop_entry()
3767 add_jump(compiler, &common->abort, CMP(SLJIT_LESS, TMP2, 0, STR_PTR, 0)); in mainloop_entry()
3769 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr, TMP2, 0); in mainloop_entry()
3780 OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, common->newline & 0xff); in mainloop_entry()
3793 if (common->utf) readuchar = TRUE; in mainloop_entry()
3801 CMPTO(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff, newlinelabel); in mainloop_entry()
3806 if (common->utf) in mainloop_entry()
3814 if (common->utf) in mainloop_entry()
3872 static int scan_prefix(compiler_common *common, PCRE2_SPTR cc, fast_forward_char_data *chars, int m… in scan_prefix() argument
3963 if (common->utf && HAS_EXTRALEN(*cc)) len += GET_EXTRALEN(*cc); in scan_prefix()
3965 max_chars = scan_prefix(common, cc + len, chars, max_chars, rec_count); in scan_prefix()
3987 max_chars = scan_prefix(common, alternative + 1 + LINK_SIZE, chars, max_chars, rec_count); in scan_prefix()
4000 if (common->utf && !is_char7_bitset((const sljit_u8 *)(cc + 1), FALSE)) in scan_prefix()
4008 if (common->utf) return consumed; in scan_prefix()
4016 if (common->utf) return consumed; in scan_prefix()
4025 …if (common->utf && !is_char7_bitset((const sljit_u8 *)common->ctypes - cbit_length + cbit_digit, F… in scan_prefix()
4034 …if (common->utf && !is_char7_bitset((const sljit_u8 *)common->ctypes - cbit_length + cbit_space, F… in scan_prefix()
4043 …if (common->utf && !is_char7_bitset((const sljit_u8 *)common->ctypes - cbit_length + cbit_word, FA… in scan_prefix()
4060 if (common->utf) return consumed; in scan_prefix()
4070 if (common->utf) return consumed; in scan_prefix()
4085 if (common->utf) return consumed; in scan_prefix()
4126 max_chars = scan_prefix(common, cc + 1, chars, max_chars, rec_count); in scan_prefix()
4212 if (common->utf && HAS_EXTRALEN(*cc)) len += GET_EXTRALEN(*cc); in scan_prefix()
4215 if (caseless && char_has_othercase(common, cc)) in scan_prefix()
4218 if (common->utf) in scan_prefix()
4221 if ((int)PRIV(ord2utf)(char_othercase(common, chr), othercase) != len) in scan_prefix()
4228 othercase[0] = TABLE_GET(chr, common->fcc, chr); in scan_prefix()
4415 static void fast_forward_first_char2_sse2(compiler_common *common, PCRE2_UCHAR char1, PCRE2_UCHAR c… in fast_forward_first_char2_sse2() argument
4443 if (common->mode == PCRE2_JIT_COMPLETE) in fast_forward_first_char2_sse2()
4444 add_jump(compiler, &common->failed_match, partial_quit[0]); in fast_forward_first_char2_sse2()
4519 if (common->mode == PCRE2_JIT_COMPLETE) in fast_forward_first_char2_sse2()
4520 add_jump(compiler, &common->failed_match, partial_quit[1]); in fast_forward_first_char2_sse2()
4546 if (common->mode != PCRE2_JIT_COMPLETE) in fast_forward_first_char2_sse2()
4554 add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0)); in fast_forward_first_char2_sse2()
4557 if (common->utf && offset > 0) in fast_forward_first_char2_sse2()
4559 SLJIT_ASSERT(common->mode == PCRE2_JIT_COMPLETE); in fast_forward_first_char2_sse2()
4566 add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0)); in fast_forward_first_char2_sse2()
4590 static void fast_forward_char_pair_sse2(compiler_common *common, sljit_s32 offs1, in fast_forward_char_pair_sse2() argument
4615 SLJIT_ASSERT(common->mode == PCRE2_JIT_COMPLETE && offs1 > offs2); in fast_forward_char_pair_sse2()
4620 if (common->match_end_ptr != 0) in fast_forward_char_pair_sse2()
4622 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr); in fast_forward_char_pair_sse2()
4631 add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0)); in fast_forward_char_pair_sse2()
4825 add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0)); in fast_forward_char_pair_sse2()
4889 add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER_EQUAL, STR_PTR, 0, STR_END, 0)); in fast_forward_char_pair_sse2()
4891 if (common->match_end_ptr != 0) in fast_forward_char_pair_sse2()
4892 OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr); in fast_forward_char_pair_sse2()
4895 if (common->utf) in fast_forward_char_pair_sse2()
4904 add_jump(compiler, &common->failed_match, JUMP(SLJIT_JUMP)); in fast_forward_char_pair_sse2()
4912 if (common->match_end_ptr != 0) in fast_forward_char_pair_sse2()
4916 static BOOL check_fast_forward_char_pair_sse2(compiler_common *common, fast_forward_char_data *char… in check_fast_forward_char_pair_sse2() argument
4965 fast_forward_char_pair_sse2(common, i, a1, a2, j, b1, b2); in check_fast_forward_char_pair_sse2()
4983 static void fast_forward_first_char2(compiler_common *common, PCRE2_UCHAR char1, PCRE2_UCHAR char2,… in fast_forward_first_char2() argument
4990 BOOL has_match_end = (common->match_end_ptr != 0); in fast_forward_first_char2()
4992 SLJIT_ASSERT(common->mode == PCRE2_JIT_COMPLETE || offset == 0); in fast_forward_first_char2()
4995 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr); in fast_forward_first_char2()
5015 fast_forward_first_char2_sse2(common, char1, char2, offset); in fast_forward_first_char2()
5030 if (common->mode == PCRE2_JIT_COMPLETE) in fast_forward_first_char2()
5031 add_jump(compiler, &common->failed_match, partial_quit); in fast_forward_first_char2()
5055 if (common->utf && offset > 0) in fast_forward_first_char2()
5064 if (common->mode != PCRE2_JIT_COMPLETE) in fast_forward_first_char2()
5071 static SLJIT_INLINE BOOL fast_forward_first_n_chars(compiler_common *common) in fast_forward_first_n_chars() argument
5093 max = scan_prefix(common, common->start, chars, MAX_N_CHARS, &rec_count); in fast_forward_first_n_chars()
5123 if (check_fast_forward_char_pair_sse2(common, chars, max)) in fast_forward_first_n_chars()
5154 update_table = (sljit_u8 *)allocate_read_only_data(common, 256); in fast_forward_first_n_chars()
5198 fast_forward_first_char2(common, chars[offset].chars[0], chars[offset].chars[1], offset); in fast_forward_first_n_chars()
5204 if (common->match_end_ptr != 0) in fast_forward_first_n_chars()
5206 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr); in fast_forward_first_n_chars()
5222 add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER, STR_PTR, 0, STR_END, 0)); in fast_forward_first_n_chars()
5263 if (common->utf && offset != 0) in fast_forward_first_n_chars()
5283 if (common->match_end_ptr != 0) in fast_forward_first_n_chars()
5290 static SLJIT_INLINE void fast_forward_first_char(compiler_common *common) in fast_forward_first_char() argument
5292 PCRE2_UCHAR first_char = (PCRE2_UCHAR)(common->re->first_codeunit); in fast_forward_first_char()
5296 if ((common->re->flags & PCRE2_FIRSTCASELESS) != 0) in fast_forward_first_char()
5298 oc = TABLE_GET(first_char, common->fcc, first_char); in fast_forward_first_char()
5300 if (first_char > 127 && common->utf) in fast_forward_first_char()
5305 fast_forward_first_char2(common, first_char, oc, 0); in fast_forward_first_char()
5308 static SLJIT_INLINE void fast_forward_newline(compiler_common *common) in fast_forward_newline() argument
5319 if (common->match_end_ptr != 0) in fast_forward_newline()
5322 OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr); in fast_forward_newline()
5325 if (common->nltype == NLTYPE_FIXED && common->newline > 255) in fast_forward_newline()
5346 CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff, loop); in fast_forward_newline()
5347 CMPTO(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, common->newline & 0xff, loop); in fast_forward_newline()
5353 if (common->match_end_ptr != 0) in fast_forward_newline()
5361 skip_char_back(common); in fast_forward_newline()
5364 common->ff_newline_shortcut = loop; in fast_forward_newline()
5366 read_char_range(common, common->nlmin, common->nlmax, TRUE); in fast_forward_newline()
5368 if (common->nltype == NLTYPE_ANY || common->nltype == NLTYPE_ANYCRLF) in fast_forward_newline()
5370 check_newlinechar(common, common->nltype, &newline, FALSE); in fast_forward_newline()
5373 if (common->nltype == NLTYPE_ANY || common->nltype == NLTYPE_ANYCRLF) in fast_forward_newline()
5391 if (common->match_end_ptr != 0) in fast_forward_newline()
5395 static BOOL optimize_class(compiler_common *common, const sljit_u8 *bits, BOOL nclass, BOOL invert,…
5397 static SLJIT_INLINE void fast_forward_start_bits(compiler_common *common) in fast_forward_start_bits() argument
5400 const sljit_u8 *start_bits = common->re->start_bitmap; in fast_forward_start_bits()
5408 if (common->match_end_ptr != 0) in fast_forward_start_bits()
5410 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr); in fast_forward_start_bits()
5420 if (common->mode == PCRE2_JIT_COMPLETE) in fast_forward_start_bits()
5421 add_jump(compiler, &common->failed_match, partial_quit); in fast_forward_start_bits()
5426 if (!optimize_class(common, start_bits, (start_bits[31] & 0x80) != 0, FALSE, &matches)) in fast_forward_start_bits()
5434 if (common->utf && is_char7_bitset(start_bits, FALSE)) in fast_forward_start_bits()
5462 if (common->mode != PCRE2_JIT_COMPLETE) in fast_forward_start_bits()
5465 if (common->match_end_ptr != 0) in fast_forward_start_bits()
5469 static SLJIT_INLINE struct sljit_jump *search_requested_char(compiler_common *common, PCRE2_UCHAR r… in search_requested_char() argument
5480 SLJIT_ASSERT(common->req_char_ptr != 0); in search_requested_char()
5481 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->req_char_ptr); in search_requested_char()
5498 oc = TABLE_GET(req_char, common->fcc, req_char); in search_requested_char()
5500 if (req_char > 127 && common->utf) in search_requested_char()
5526 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->req_char_ptr, TMP1, 0); in search_requested_char()
5532 static void do_revertframes(compiler_common *common) in do_revertframes() argument
5586 static void check_wordboundary(compiler_common *common) in check_wordboundary() argument
5603 skip_char_back(common); in check_wordboundary()
5604 check_start_used_ptr(common); in check_wordboundary()
5605 read_char(common); in check_wordboundary()
5609 if (common->use_ucp) in check_wordboundary()
5613 add_jump(compiler, &common->getucd, JUMP(SLJIT_FAST_CALL)); in check_wordboundary()
5631 if (common->utf) in check_wordboundary()
5634 OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), common->ctypes); in check_wordboundary()
5648 check_str_end(common, &skipread_list); in check_wordboundary()
5649 peek_char(common, READ_CHAR_MAX); in check_wordboundary()
5653 if (common->use_ucp) in check_wordboundary()
5657 add_jump(compiler, &common->getucd, JUMP(SLJIT_FAST_CALL)); in check_wordboundary()
5676 if (common->utf) in check_wordboundary()
5679 OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP1), common->ctypes); in check_wordboundary()
5695 static BOOL optimize_class_ranges(compiler_common *common, const sljit_u8 *bits, BOOL nclass, BOOL … in optimize_class_ranges() argument
5847 static BOOL optimize_class_chars(compiler_common *common, const sljit_u8 *bits, BOOL nclass, BOOL i… in optimize_class_chars() argument
5948 static BOOL optimize_class(compiler_common *common, const sljit_u8 *bits, BOOL nclass, BOOL invert,… in optimize_class() argument
5951 if (optimize_class_ranges(common, bits, nclass, invert, backtracks)) in optimize_class()
5953 return optimize_class_chars(common, bits, nclass, invert, backtracks); in optimize_class()
5956 static void check_anynewline(compiler_common *common) in check_anynewline() argument
5969 if (common->utf) in check_anynewline()
5983 static void check_hspace(compiler_common *common) in check_hspace() argument
5997 if (common->utf) in check_hspace()
6022 static void check_vspace(compiler_common *common) in check_vspace() argument
6035 if (common->utf) in check_vspace()
6050 static void do_casefulcmp(compiler_common *common) in do_casefulcmp() argument
6130 static void do_caselesscmp(compiler_common *common) in do_caselesscmp() argument
6167 OP1(SLJIT_MOV, lcc_table, 0, SLJIT_IMM, common->lcc); in do_caselesscmp()
6259 static PCRE2_SPTR byte_sequence_compare(compiler_common *common, BOOL caseless, PCRE2_SPTR cc, in byte_sequence_compare() argument
6269 if (caseless && char_has_othercase(common, cc)) in byte_sequence_compare()
6271 othercasebit = char_get_othercase_bit(common, cc); in byte_sequence_compare()
6316 if (common->utf && HAS_EXTRALEN(*cc)) in byte_sequence_compare()
6434 static PCRE2_SPTR compile_char1_matchingpath(compiler_common *common, PCRE2_UCHAR type, PCRE2_SPTR …
6436 static void compile_xclass_matchingpath(compiler_common *common, PCRE2_SPTR cc, jump_list **backtra… in compile_xclass_matchingpath() argument
6446 BOOL utf = common->utf; in compile_xclass_matchingpath()
6519 compile_char1_matchingpath(common, OP_ALLANY, cc, backtracks, FALSE); in compile_xclass_matchingpath()
6564 read_char_range(common, min, max, (cc[-1] & XCL_NOT) != 0); in compile_xclass_matchingpath()
6571 …if (!optimize_class(common, (const sljit_u8 *)cc, (((const sljit_u8 *)cc)[31] & 0x80) != 0, TRUE, … in compile_xclass_matchingpath()
6598 if (!optimize_class(common, (const sljit_u8 *)cc, FALSE, TRUE, list)) in compile_xclass_matchingpath()
6602 if (common->utf) in compile_xclass_matchingpath()
6614 if (common->utf) in compile_xclass_matchingpath()
6630 if (!common->utf) in compile_xclass_matchingpath()
6997 static PCRE2_SPTR compile_simple_assertion_matchingpath(compiler_common *common, PCRE2_UCHAR type, … in compile_simple_assertion_matchingpath() argument
7022 add_jump(compiler, &common->wordboundary, JUMP(SLJIT_FAST_CALL)); in compile_simple_assertion_matchingpath()
7030 if (common->nltype == NLTYPE_FIXED && common->newline > 255) in compile_simple_assertion_matchingpath()
7034 if (common->mode == PCRE2_JIT_COMPLETE) in compile_simple_assertion_matchingpath()
7041 … OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff); in compile_simple_assertion_matchingpath()
7044 check_partial(common, TRUE); in compile_simple_assertion_matchingpath()
7049 …add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0… in compile_simple_assertion_matchingpath()
7050 … add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, common->newline & 0xff)); in compile_simple_assertion_matchingpath()
7052 else if (common->nltype == NLTYPE_FIXED) in compile_simple_assertion_matchingpath()
7057 add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, common->newline)); in compile_simple_assertion_matchingpath()
7073 if (common->nltype == NLTYPE_ANYCRLF) in compile_simple_assertion_matchingpath()
7082 read_char_range(common, common->nlmin, common->nlmax, TRUE); in compile_simple_assertion_matchingpath()
7084 add_jump(compiler, &common->anynewline, JUMP(SLJIT_FAST_CALL)); in compile_simple_assertion_matchingpath()
7093 check_partial(common, FALSE); in compile_simple_assertion_matchingpath()
7098 check_partial(common, FALSE); in compile_simple_assertion_matchingpath()
7106 if (!common->endonly) in compile_simple_assertion_matchingpath()
7107 compile_simple_assertion_matchingpath(common, OP_EODN, cc, backtracks); in compile_simple_assertion_matchingpath()
7111 check_partial(common, FALSE); in compile_simple_assertion_matchingpath()
7120 check_partial(common, FALSE); in compile_simple_assertion_matchingpath()
7124 if (common->nltype == NLTYPE_FIXED && common->newline > 255) in compile_simple_assertion_matchingpath()
7128 if (common->mode == PCRE2_JIT_COMPLETE) in compile_simple_assertion_matchingpath()
7134 …add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0… in compile_simple_assertion_matchingpath()
7135 check_partial(common, TRUE); in compile_simple_assertion_matchingpath()
7141 …add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0… in compile_simple_assertion_matchingpath()
7142 … add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, common->newline & 0xff)); in compile_simple_assertion_matchingpath()
7146 peek_char(common, common->nlmax); in compile_simple_assertion_matchingpath()
7147 check_newlinechar(common, common->nltype, backtracks, FALSE); in compile_simple_assertion_matchingpath()
7169 if (!common->alt_circumflex) in compile_simple_assertion_matchingpath()
7172 if (common->nltype == NLTYPE_FIXED && common->newline > 255) in compile_simple_assertion_matchingpath()
7178 …add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0… in compile_simple_assertion_matchingpath()
7179 … add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, common->newline & 0xff)); in compile_simple_assertion_matchingpath()
7183 skip_char_back(common); in compile_simple_assertion_matchingpath()
7184 read_char_range(common, common->nlmin, common->nlmax, TRUE); in compile_simple_assertion_matchingpath()
7185 check_newlinechar(common, common->nltype, backtracks, FALSE); in compile_simple_assertion_matchingpath()
7196 if (common->utf) in compile_simple_assertion_matchingpath()
7202 skip_char_back(common); in compile_simple_assertion_matchingpath()
7213 check_start_used_ptr(common); in compile_simple_assertion_matchingpath()
7338 static PCRE2_SPTR compile_char1_matchingpath(compiler_common *common, PCRE2_UCHAR type, PCRE2_SPTR … in compile_char1_matchingpath() argument
7356 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
7358 …if (common->utf && is_char7_bitset((const sljit_u8*)common->ctypes - cbit_length + cbit_digit, FAL… in compile_char1_matchingpath()
7359 read_char7_type(common, type == OP_NOT_DIGIT); in compile_char1_matchingpath()
7362 read_char8_type(common, type == OP_NOT_DIGIT); in compile_char1_matchingpath()
7371 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
7373 …if (common->utf && is_char7_bitset((const sljit_u8*)common->ctypes - cbit_length + cbit_space, FAL… in compile_char1_matchingpath()
7374 read_char7_type(common, type == OP_NOT_WHITESPACE); in compile_char1_matchingpath()
7377 read_char8_type(common, type == OP_NOT_WHITESPACE); in compile_char1_matchingpath()
7385 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
7387 …if (common->utf && is_char7_bitset((const sljit_u8*)common->ctypes - cbit_length + cbit_word, FALS… in compile_char1_matchingpath()
7388 read_char7_type(common, type == OP_NOT_WORDCHAR); in compile_char1_matchingpath()
7391 read_char8_type(common, type == OP_NOT_WORDCHAR); in compile_char1_matchingpath()
7398 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
7399 read_char_range(common, common->nlmin, common->nlmax, TRUE); in compile_char1_matchingpath()
7400 if (common->nltype == NLTYPE_FIXED && common->newline > 255) in compile_char1_matchingpath()
7402 jump[0] = CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff); in compile_char1_matchingpath()
7404 if (common->mode != PCRE2_JIT_PARTIAL_HARD) in compile_char1_matchingpath()
7407 check_str_end(common, &end_list); in compile_char1_matchingpath()
7410 add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, common->newline & 0xff)); in compile_char1_matchingpath()
7415 check_newlinechar(common, common->nltype, backtracks, TRUE); in compile_char1_matchingpath()
7420 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
7422 if (common->utf) in compile_char1_matchingpath()
7449 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
7462 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
7463 compile_xclass_matchingpath(common, propdata, backtracks); in compile_char1_matchingpath()
7469 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
7470 read_char_range(common, common->bsr_nlmin, common->bsr_nlmax, FALSE); in compile_char1_matchingpath()
7474 if (common->mode != PCRE2_JIT_PARTIAL_HARD) in compile_char1_matchingpath()
7477 check_str_end(common, &end_list); in compile_char1_matchingpath()
7483 check_newlinechar(common, common->bsr_nltype, backtracks, FALSE); in compile_char1_matchingpath()
7492 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
7493 read_char_range(common, 0x9, 0x3000, type == OP_NOT_HSPACE); in compile_char1_matchingpath()
7494 add_jump(compiler, &common->hspace, JUMP(SLJIT_FAST_CALL)); in compile_char1_matchingpath()
7502 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
7503 read_char_range(common, 0xa, 0x2029, type == OP_NOT_VSPACE); in compile_char1_matchingpath()
7504 add_jump(compiler, &common->vspace, JUMP(SLJIT_FAST_CALL)); in compile_char1_matchingpath()
7512 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
7519 common->utf ? SLJIT_FUNC_OFFSET(do_extuni_utf) : SLJIT_FUNC_OFFSET(do_extuni_no_utf)); in compile_char1_matchingpath()
7526 if (common->mode == PCRE2_JIT_PARTIAL_HARD) in compile_char1_matchingpath()
7530 check_partial(common, TRUE); in compile_char1_matchingpath()
7540 if (common->utf && HAS_EXTRALEN(*cc)) length += GET_EXTRALEN(*cc); in compile_char1_matchingpath()
7542 if (common->mode == PCRE2_JIT_COMPLETE && check_str_ptr in compile_char1_matchingpath()
7543 …&& (type == OP_CHAR || !char_has_othercase(common, cc) || char_get_othercase_bit(common, cc) != 0)) in compile_char1_matchingpath()
7553 return byte_sequence_compare(common, type == OP_CHARI, cc, &context, backtracks); in compile_char1_matchingpath()
7557 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
7559 if (common->utf) in compile_char1_matchingpath()
7567 if (type == OP_CHAR || !char_has_othercase(common, cc)) in compile_char1_matchingpath()
7569 read_char_range(common, c, c, FALSE); in compile_char1_matchingpath()
7573 oc = char_othercase(common, c); in compile_char1_matchingpath()
7574 read_char_range(common, c < oc ? c : oc, c > oc ? c : oc, FALSE); in compile_char1_matchingpath()
7590 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
7594 if (common->utf) in compile_char1_matchingpath()
7601 if (type == OP_NOT || !char_has_othercase(common, cc)) in compile_char1_matchingpath()
7627 if (type == OP_NOT || !char_has_othercase(common, cc)) in compile_char1_matchingpath()
7629 read_char_range(common, c, c, TRUE); in compile_char1_matchingpath()
7634 oc = char_othercase(common, c); in compile_char1_matchingpath()
7635 read_char_range(common, c < oc ? c : oc, c > oc ? c : oc, TRUE); in compile_char1_matchingpath()
7653 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
7656 bit = (common->utf && is_char7_bitset((const sljit_u8 *)cc, type == OP_NCLASS)) ? 127 : 255; in compile_char1_matchingpath()
7657 read_char_range(common, 0, bit, type == OP_NCLASS); in compile_char1_matchingpath()
7659 read_char_range(common, 0, 255, type == OP_NCLASS); in compile_char1_matchingpath()
7662 if (optimize_class(common, (const sljit_u8 *)cc, type == OP_NCLASS, FALSE, backtracks)) in compile_char1_matchingpath()
7667 if (common->utf) in compile_char1_matchingpath()
7701 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
7702 compile_xclass_matchingpath(common, cc + LINK_SIZE, backtracks); in compile_char1_matchingpath()
7710 static SLJIT_INLINE PCRE2_SPTR compile_charn_matchingpath(compiler_common *common, PCRE2_SPTR cc, P… in compile_charn_matchingpath() argument
7729 if (common->utf && HAS_EXTRALEN(cc[1])) in compile_charn_matchingpath()
7737 if (common->utf) in compile_charn_matchingpath()
7739 if (char_has_othercase(common, cc + 1) && char_get_othercase_bit(common, cc + 1) == 0) in compile_charn_matchingpath()
7746 if (char_has_othercase(common, cc + 1) && char_get_othercase_bit(common, cc + 1) == 0) in compile_charn_matchingpath()
7768 …do cc = byte_sequence_compare(common, *cc == OP_CHARI, cc + 1, &context, backtracks); while (conte… in compile_charn_matchingpath()
7773 return compile_char1_matchingpath(common, *cc, cc + 1, backtracks, TRUE); in compile_charn_matchingpath()
7808 static void compile_dnref_search(compiler_common *common, PCRE2_SPTR cc, jump_list **backtracks) in compile_dnref_search() argument
7813 PCRE2_SPTR slot = common->name_table + GET2(cc, 1) * common->name_entry_size; in compile_dnref_search()
7827 slot += common->name_entry_size; in compile_dnref_search()
7832 if (backtracks != NULL && !common->unset_backref) in compile_dnref_search()
7838 static void compile_ref_matchingpath(compiler_common *common, PCRE2_SPTR cc, jump_list **backtracks… in compile_ref_matchingpath() argument
7852 if (withchecks && !common->unset_backref) in compile_ref_matchingpath()
7859 if (common->utf && *cc == OP_REFI) in compile_ref_matchingpath()
7875 if (common->mode == PCRE2_JIT_COMPLETE) in compile_ref_matchingpath()
7885 check_partial(common, FALSE); in compile_ref_matchingpath()
7903 if (common->mode == PCRE2_JIT_COMPLETE) in compile_ref_matchingpath()
7906 …add_jump(compiler, *cc == OP_REF ? &common->casefulcmp : &common->caselesscmp, JUMP(SLJIT_FAST_CAL… in compile_ref_matchingpath()
7909 if (common->mode != PCRE2_JIT_COMPLETE) in compile_ref_matchingpath()
7918 …add_jump(compiler, *cc == OP_REF ? &common->casefulcmp : &common->caselesscmp, JUMP(SLJIT_FAST_CAL… in compile_ref_matchingpath()
7921 check_partial(common, FALSE); in compile_ref_matchingpath()
7936 static SLJIT_INLINE PCRE2_SPTR compile_ref_iterator_matchingpath(compiler_common *common, PCRE2_SPT… in compile_ref_iterator_matchingpath() argument
7995 allocate_stack(common, 2); in compile_ref_iterator_matchingpath()
8008 compile_dnref_search(common, ccbegin, NULL); in compile_ref_iterator_matchingpath()
8018 allocate_stack(common, 1); in compile_ref_iterator_matchingpath()
8029 compile_dnref_search(common, ccbegin, &backtrack->topbacktracks); in compile_ref_iterator_matchingpath()
8042 compile_ref_matchingpath(common, ccbegin, &backtrack->topbacktracks, FALSE, FALSE); in compile_ref_iterator_matchingpath()
8054 allocate_stack(common, 1); in compile_ref_iterator_matchingpath()
8064 allocate_stack(common, 1); in compile_ref_iterator_matchingpath()
8072 count_match(common); in compile_ref_iterator_matchingpath()
8076 allocate_stack(common, ref ? 2 : 3); in compile_ref_iterator_matchingpath()
8091 compile_dnref_search(common, ccbegin, NULL); in compile_ref_iterator_matchingpath()
8109 compile_dnref_search(common, ccbegin, &backtrack->topbacktracks); in compile_ref_iterator_matchingpath()
8122 compile_ref_matchingpath(common, ccbegin, &backtrack->topbacktracks, TRUE, TRUE); in compile_ref_iterator_matchingpath()
8139 count_match(common); in compile_ref_iterator_matchingpath()
8143 static SLJIT_INLINE PCRE2_SPTR compile_recurse_matchingpath(compiler_common *common, PCRE2_SPTR cc,… in compile_recurse_matchingpath() argument
8147 recurse_entry *entry = common->entries; in compile_recurse_matchingpath()
8156 if (get_framesize(common, common->start + start, NULL, TRUE, &needs_control_head) == no_stack) in compile_recurse_matchingpath()
8158 start_cc = common->start + start; in compile_recurse_matchingpath()
8159 …compile_matchingpath(common, next_opcode(common, start_cc), bracketend(start_cc) - (1 + LINK_SIZE)… in compile_recurse_matchingpath()
8187 common->entries = entry; in compile_recurse_matchingpath()
8259 static SLJIT_INLINE PCRE2_SPTR compile_callout_matchingpath(compiler_common *common, PCRE2_SPTR cc,… in compile_callout_matchingpath() argument
8269 sljit_uw callout_arg_size = (common->re->top_bracket + 1) * 2 * sizeof(sljit_sw); in compile_callout_matchingpath()
8275 allocate_stack(common, callout_arg_size); in compile_callout_matchingpath()
8277 SLJIT_ASSERT(common->capture_last_ptr != 0); in compile_callout_matchingpath()
8278 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr); in compile_callout_matchingpath()
8283 OP1(SLJIT_MOV_U32, SLJIT_MEM1(STACK_TOP), CALLOUT_ARG_OFFSET(capture_top), SLJIT_IMM, common->re->t… in compile_callout_matchingpath()
8288 if (common->mark_ptr != 0) in compile_callout_matchingpath()
8310 OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), CALLOUT_ARG_OFFSET(mark), (common->mark_ptr != 0) ? TMP2 : SL… in compile_callout_matchingpath()
8321 free_stack(common, callout_arg_size); in compile_callout_matchingpath()
8326 if (common->abort_label == NULL) in compile_callout_matchingpath()
8327 add_jump(compiler, &common->abort, JUMP(SLJIT_NOT_EQUAL32) /* SIG_LESS */); in compile_callout_matchingpath()
8329 JUMPTO(SLJIT_NOT_EQUAL32 /* SIG_LESS */, common->abort_label); in compile_callout_matchingpath()
8366 static PCRE2_SPTR compile_assert_matchingpath(compiler_common *common, PCRE2_SPTR cc, assert_backtr… in compile_assert_matchingpath() argument
8379 jump_list **target = (conditional) ? &backtrack->condfailed : &backtrack->common.topbacktracks; in compile_assert_matchingpath()
8382 BOOL save_local_quit_available = common->local_quit_available; in compile_assert_matchingpath()
8383 BOOL save_in_positive_assertion = common->in_positive_assertion; in compile_assert_matchingpath()
8384 then_trap_backtrack *save_then_trap = common->then_trap; in compile_assert_matchingpath()
8385 struct sljit_label *save_quit_label = common->quit_label; in compile_assert_matchingpath()
8386 struct sljit_label *save_accept_label = common->accept_label; in compile_assert_matchingpath()
8387 jump_list *save_quit = common->quit; in compile_assert_matchingpath()
8388 jump_list *save_positive_assertion_quit = common->positive_assertion_quit; in compile_assert_matchingpath()
8389 jump_list *save_accept = common->accept; in compile_assert_matchingpath()
8394 common->then_trap = NULL; in compile_assert_matchingpath()
8404 framesize = get_framesize(common, cc, NULL, FALSE, &needs_control_head); in compile_assert_matchingpath()
8417 free_stack(common, 1); in compile_assert_matchingpath()
8434 allocate_stack(common, extrasize); in compile_assert_matchingpath()
8437 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_assert_matchingpath()
8445 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_IMM, 0); in compile_assert_matchingpath()
8452 allocate_stack(common, framesize + extrasize); in compile_assert_matchingpath()
8458 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_assert_matchingpath()
8465 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_IMM, 0); in compile_assert_matchingpath()
8470 init_frame(common, ccbegin, NULL, framesize + extrasize - 1, extrasize); in compile_assert_matchingpath()
8478 common->local_quit_available = TRUE; in compile_assert_matchingpath()
8479 common->quit_label = NULL; in compile_assert_matchingpath()
8480 common->quit = NULL; in compile_assert_matchingpath()
8483 common->in_positive_assertion = (opcode == OP_ASSERT || opcode == OP_ASSERTBACK); in compile_assert_matchingpath()
8484 common->positive_assertion_quit = NULL; in compile_assert_matchingpath()
8488 common->accept_label = NULL; in compile_assert_matchingpath()
8489 common->accept = NULL; in compile_assert_matchingpath()
8497 compile_matchingpath(common, ccbegin + 1 + LINK_SIZE, cc, &altbacktrack); in compile_assert_matchingpath()
8502 common->local_quit_available = save_local_quit_available; in compile_assert_matchingpath()
8503 common->quit_label = save_quit_label; in compile_assert_matchingpath()
8504 common->quit = save_quit; in compile_assert_matchingpath()
8506 common->in_positive_assertion = save_in_positive_assertion; in compile_assert_matchingpath()
8507 common->then_trap = save_then_trap; in compile_assert_matchingpath()
8508 common->accept_label = save_accept_label; in compile_assert_matchingpath()
8509 common->positive_assertion_quit = save_positive_assertion_quit; in compile_assert_matchingpath()
8510 common->accept = save_accept; in compile_assert_matchingpath()
8513 common->accept_label = LABEL(); in compile_assert_matchingpath()
8514 if (common->accept != NULL) in compile_assert_matchingpath()
8515 set_jumps(common->accept, common->accept_label); in compile_assert_matchingpath()
8523 free_stack(common, extrasize); in compile_assert_matchingpath()
8526 … OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_MEM1(STACK_TOP), STACK(-1)); in compile_assert_matchingpath()
8535 … OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_MEM1(STACK_TOP), STACK(-1)); in compile_assert_matchingpath()
8541 …OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_MEM1(STACK_TOP), STACK(-frame… in compile_assert_matchingpath()
8542 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_assert_matchingpath()
8576 compile_backtrackingpath(common, altbacktrack.top); in compile_assert_matchingpath()
8581 common->local_quit_available = save_local_quit_available; in compile_assert_matchingpath()
8582 common->quit_label = save_quit_label; in compile_assert_matchingpath()
8583 common->quit = save_quit; in compile_assert_matchingpath()
8585 common->in_positive_assertion = save_in_positive_assertion; in compile_assert_matchingpath()
8586 common->then_trap = save_then_trap; in compile_assert_matchingpath()
8587 common->accept_label = save_accept_label; in compile_assert_matchingpath()
8588 common->positive_assertion_quit = save_positive_assertion_quit; in compile_assert_matchingpath()
8589 common->accept = save_accept; in compile_assert_matchingpath()
8603 SLJIT_ASSERT(common->positive_assertion_quit == NULL); in compile_assert_matchingpath()
8605 common->positive_assertion_quit = common->quit; in compile_assert_matchingpath()
8609 if (common->positive_assertion_quit != NULL) in compile_assert_matchingpath()
8612 set_jumps(common->positive_assertion_quit, LABEL()); in compile_assert_matchingpath()
8619 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_assert_matchingpath()
8626 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_MEM1(STACK_TOP), STACK(1)); in compile_assert_matchingpath()
8640 free_stack(common, 1); in compile_assert_matchingpath()
8644 free_stack(common, extrasize); in compile_assert_matchingpath()
8652 free_stack(common, framesize + extrasize - 1); in compile_assert_matchingpath()
8656 free_stack(common, framesize + extrasize); in compile_assert_matchingpath()
8722 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_assert_matchingpath()
8727 set_jumps(backtrack->common.topbacktracks, LABEL()); in compile_assert_matchingpath()
8741 free_stack(common, 1); in compile_assert_matchingpath()
8745 free_stack(common, extrasize); in compile_assert_matchingpath()
8754 free_stack(common, framesize + extrasize - 1); in compile_assert_matchingpath()
8758 free_stack(common, framesize + extrasize); in compile_assert_matchingpath()
8772 SLJIT_ASSERT(found == &backtrack->common.topbacktracks); in compile_assert_matchingpath()
8773 set_jumps(backtrack->common.topbacktracks, LABEL()); in compile_assert_matchingpath()
8774 backtrack->common.topbacktracks = NULL; in compile_assert_matchingpath()
8780 common->local_quit_available = save_local_quit_available; in compile_assert_matchingpath()
8781 common->quit_label = save_quit_label; in compile_assert_matchingpath()
8782 common->quit = save_quit; in compile_assert_matchingpath()
8784 common->in_positive_assertion = save_in_positive_assertion; in compile_assert_matchingpath()
8785 common->then_trap = save_then_trap; in compile_assert_matchingpath()
8786 common->accept_label = save_accept_label; in compile_assert_matchingpath()
8787 common->positive_assertion_quit = save_positive_assertion_quit; in compile_assert_matchingpath()
8788 common->accept = save_accept; in compile_assert_matchingpath()
8792 static SLJIT_INLINE void match_once_common(compiler_common *common, PCRE2_UCHAR ket, int framesize,… in match_once_common() argument
8808 free_stack(common, stacksize); in match_once_common()
8837 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, TMP1, 0); in match_once_common()
8840 static SLJIT_INLINE int match_capture_common(compiler_common *common, int stacksize, int offset, in… in match_capture_common() argument
8844 if (common->capture_last_ptr != 0) in match_capture_common()
8846 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr); in match_capture_common()
8847 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr, SLJIT_IMM, offset >> 1); in match_capture_common()
8851 if (common->optimized_cbracket[offset >> 1] == 0) in match_capture_common()
8918 static PCRE2_SPTR compile_bracket_matchingpath(compiler_common *common, PCRE2_SPTR cc, backtrack_co… in compile_bracket_matchingpath() argument
8987 if (common->optimized_cbracket[offset] == 0) in compile_bracket_matchingpath()
9007 …BACKTRACK_AS(bracket_backtrack)->u.framesize = get_framesize(common, ccbegin, NULL, FALSE, &needs_… in compile_bracket_matchingpath()
9018 allocate_stack(common, stacksize); in compile_bracket_matchingpath()
9036 free_stack(common, 1); in compile_bracket_matchingpath()
9094 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_bracket_matchingpath()
9116 allocate_stack(common, stacksize); in compile_bracket_matchingpath()
9143 allocate_stack(common, stacksize); in compile_bracket_matchingpath()
9164 …init_frame(common, ccbegin, NULL, BACKTRACK_AS(bracket_backtrack)->u.framesize + stacksize, stacks… in compile_bracket_matchingpath()
9170 if (common->optimized_cbracket[offset >> 1] != 0) in compile_bracket_matchingpath()
9173 allocate_stack(common, 2); in compile_bracket_matchingpath()
9183 allocate_stack(common, 1); in compile_bracket_matchingpath()
9192 allocate_stack(common, 1); in compile_bracket_matchingpath()
9199 allocate_stack(common, 1); in compile_bracket_matchingpath()
9218 slot = common->name_table + GET2(matchingpath, 1) * common->name_entry_size; in compile_bracket_matchingpath()
9222 slot += common->name_entry_size; in compile_bracket_matchingpath()
9228 slot += common->name_entry_size; in compile_bracket_matchingpath()
9250 if (common->currententry == NULL) in compile_bracket_matchingpath()
9254 else if (common->currententry->start == 0) in compile_bracket_matchingpath()
9257 … stacksize = stacksize == (int)GET2(common->start, common->currententry->start + 1 + LINK_SIZE); in compile_bracket_matchingpath()
9264 if (common->currententry == NULL || common->currententry->start == 0) in compile_bracket_matchingpath()
9269 slot = common->name_table + GET2(matchingpath, 1) * common->name_entry_size; in compile_bracket_matchingpath()
9270 i = (int)GET2(common->start, common->currententry->start + 1 + LINK_SIZE); in compile_bracket_matchingpath()
9275 slot += common->name_entry_size; in compile_bracket_matchingpath()
9304 assert->common.cc = matchingpath; in compile_bracket_matchingpath()
9306 matchingpath = compile_assert_matchingpath(common, matchingpath, assert, TRUE); in compile_bracket_matchingpath()
9310 compile_matchingpath(common, matchingpath, cc, backtrack); in compile_bracket_matchingpath()
9315 …match_once_common(common, ket, BACKTRACK_AS(bracket_backtrack)->u.framesize, private_data_ptr, has… in compile_bracket_matchingpath()
9328 if (common->capture_last_ptr != 0) in compile_bracket_matchingpath()
9330 if (common->optimized_cbracket[offset >> 1] == 0) in compile_bracket_matchingpath()
9337 allocate_stack(common, stacksize); in compile_bracket_matchingpath()
9357 stacksize = match_capture_common(common, stacksize, offset, private_data_ptr); in compile_bracket_matchingpath()
9368 if (offset != 0 && common->optimized_cbracket[offset >> 1] != 0) in compile_bracket_matchingpath()
9384 free_stack(common, 1); in compile_bracket_matchingpath()
9396 free_stack(common, 1); in compile_bracket_matchingpath()
9409 count_match(common); in compile_bracket_matchingpath()
9417 allocate_stack(common, 1); in compile_bracket_matchingpath()
9437 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_bracket_matchingpath()
9441 free_stack(common, 1); in compile_bracket_matchingpath()
9447 count_match(common); in compile_bracket_matchingpath()
9464 static PCRE2_SPTR compile_bracketpos_matchingpath(compiler_common *common, PCRE2_SPTR cc, backtrack… in compile_bracketpos_matchingpath() argument
9504 SLJIT_ASSERT(common->optimized_cbracket[offset] == 0); in compile_bracketpos_matchingpath()
9515 framesize = get_framesize(common, cc, NULL, FALSE, &needs_control_head); in compile_bracketpos_matchingpath()
9522 if (common->capture_last_ptr != 0) in compile_bracketpos_matchingpath()
9534 allocate_stack(common, stacksize); in compile_bracketpos_matchingpath()
9545 if (common->capture_last_ptr != 0) in compile_bracketpos_matchingpath()
9546 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr); in compile_bracketpos_matchingpath()
9549 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_bracketpos_matchingpath()
9550 if (common->capture_last_ptr != 0) in compile_bracketpos_matchingpath()
9559 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_bracketpos_matchingpath()
9585 allocate_stack(common, stacksize); in compile_bracketpos_matchingpath()
9588 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_bracketpos_matchingpath()
9608 init_frame(common, cc, NULL, stacksize - 1, stacksize - framesize); in compile_bracketpos_matchingpath()
9622 compile_matchingpath(common, ccbegin, cc, backtrack); in compile_bracketpos_matchingpath()
9636 if (common->capture_last_ptr != 0) in compile_bracketpos_matchingpath()
9637 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr, SLJIT_IMM, offset >> 1); in compile_bracketpos_matchingpath()
9649 …OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_MEM1(STACK_TOP), STACK(stack)… in compile_bracketpos_matchingpath()
9665 if (common->capture_last_ptr != 0) in compile_bracketpos_matchingpath()
9666 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr, SLJIT_IMM, offset >> 1); in compile_bracketpos_matchingpath()
9680 …OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_MEM1(STACK_TOP), STACK(stack)… in compile_bracketpos_matchingpath()
9695 flush_stubs(common); in compile_bracketpos_matchingpath()
9697 compile_backtrackingpath(common, backtrack->top); in compile_bracketpos_matchingpath()
9743 count_match(common); in compile_bracketpos_matchingpath()
9747 static SLJIT_INLINE PCRE2_SPTR get_iterator_parameters(compiler_common *common, PCRE2_SPTR cc, PCRE… in get_iterator_parameters() argument
9880 *end = next_opcode(common, cc); in get_iterator_parameters()
9887 if (common->utf && HAS_EXTRALEN(*cc)) *end += GET_EXTRALEN(*cc); in get_iterator_parameters()
9892 static PCRE2_SPTR compile_iterator_matchingpath(compiler_common *common, PCRE2_SPTR cc, backtrack_c… in compile_iterator_matchingpath() argument
9920 SLJIT_ASSERT(common->fast_forward_bc_ptr == NULL || fast_str_ptr == 0 || cc == common->fast_forward… in compile_iterator_matchingpath()
9922 if (cc == common->fast_forward_bc_ptr) in compile_iterator_matchingpath()
9924 else if (common->fast_fail_start_ptr == 0) in compile_iterator_matchingpath()
9927 SLJIT_ASSERT(common->fast_forward_bc_ptr != NULL || fast_str_ptr == 0 in compile_iterator_matchingpath()
9928 || (fast_str_ptr >= common->fast_fail_start_ptr && fast_str_ptr <= common->fast_fail_end_ptr)); in compile_iterator_matchingpath()
9930 cc = get_iterator_parameters(common, cc, &opcode, &type, &max, &exact, &end); in compile_iterator_matchingpath()
9950 if (common->mode == PCRE2_JIT_COMPLETE in compile_iterator_matchingpath()
9952 && !common->utf in compile_iterator_matchingpath()
9960 compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks, FALSE); in compile_iterator_matchingpath()
9968 compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks, TRUE); in compile_iterator_matchingpath()
9974 compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks, TRUE); in compile_iterator_matchingpath()
9987 allocate_stack(common, 2); in compile_iterator_matchingpath()
9995 …compile_char1_matchingpath(common, type, cc, &BACKTRACK_AS(char_iterator_backtrack)->u.backtracks,… in compile_iterator_matchingpath()
10005 allocate_stack(common, 1); in compile_iterator_matchingpath()
10021 charpos_enabled = !common->utf || !HAS_EXTRALEN(end[1]); in compile_iterator_matchingpath()
10023 if (charpos_enabled && *end == OP_CHARI && char_has_othercase(common, end + 1)) in compile_iterator_matchingpath()
10025 charpos_othercasebit = char_get_othercase_bit(common, end + 1); in compile_iterator_matchingpath()
10064 compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks, FALSE); in compile_iterator_matchingpath()
10069 detect_partial_match(common, &backtrack->topbacktracks); in compile_iterator_matchingpath()
10076 allocate_stack(common, 2); in compile_iterator_matchingpath()
10087 compile_char1_matchingpath(common, type, cc, &no_match, FALSE); in compile_iterator_matchingpath()
10090 detect_partial_match(common, &no_match); in compile_iterator_matchingpath()
10120 else if (common->utf) in compile_iterator_matchingpath()
10123 allocate_stack(common, 2); in compile_iterator_matchingpath()
10132 compile_char1_matchingpath(common, type, cc, &no_match, TRUE); in compile_iterator_matchingpath()
10152 allocate_stack(common, 2); in compile_iterator_matchingpath()
10159 detect_partial_match(common, &no_match); in compile_iterator_matchingpath()
10160 compile_char1_matchingpath(common, type, cc, &no_char1_match, FALSE); in compile_iterator_matchingpath()
10183 allocate_stack(common, 1); in compile_iterator_matchingpath()
10193 allocate_stack(common, 2); in compile_iterator_matchingpath()
10203 allocate_stack(common, 1); in compile_iterator_matchingpath()
10206 …compile_char1_matchingpath(common, type, cc, &BACKTRACK_AS(char_iterator_backtrack)->u.backtracks,… in compile_iterator_matchingpath()
10215 if (common->utf) in compile_iterator_matchingpath()
10219 compile_char1_matchingpath(common, type, cc, &no_match, TRUE); in compile_iterator_matchingpath()
10230 detect_partial_match(common, &no_match); in compile_iterator_matchingpath()
10231 compile_char1_matchingpath(common, type, cc, &no_char1_match, FALSE); in compile_iterator_matchingpath()
10243 if (common->utf) in compile_iterator_matchingpath()
10248 compile_char1_matchingpath(common, type, cc, &no_match, TRUE); in compile_iterator_matchingpath()
10259 detect_partial_match(common, &no_match); in compile_iterator_matchingpath()
10260 compile_char1_matchingpath(common, type, cc, &no_char1_match, FALSE); in compile_iterator_matchingpath()
10272 compile_char1_matchingpath(common, type, cc, &no_match, TRUE); in compile_iterator_matchingpath()
10283 count_match(common); in compile_iterator_matchingpath()
10287 static SLJIT_INLINE PCRE2_SPTR compile_fail_accept_matchingpath(compiler_common *common, PCRE2_SPTR… in compile_fail_accept_matchingpath() argument
10300 if (*cc == OP_ACCEPT && common->currententry == NULL && (common->re->overall_options & PCRE2_ENDANC… in compile_fail_accept_matchingpath()
10301 add_jump(compiler, &common->reset_match, CMP(SLJIT_NOT_EQUAL, STR_PTR, 0, STR_END, 0)); in compile_fail_accept_matchingpath()
10303 if (*cc == OP_ASSERT_ACCEPT || common->currententry != NULL || !common->might_be_empty) in compile_fail_accept_matchingpath()
10306 if (common->accept_label == NULL) in compile_fail_accept_matchingpath()
10307 add_jump(compiler, &common->accept, JUMP(SLJIT_JUMP)); in compile_fail_accept_matchingpath()
10309 JUMPTO(SLJIT_JUMP, common->accept_label); in compile_fail_accept_matchingpath()
10313 if (common->accept_label == NULL) in compile_fail_accept_matchingpath()
10314 …add_jump(compiler, &common->accept, CMP(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR… in compile_fail_accept_matchingpath()
10316 CMPTO(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(0), common->accept_label); in compile_fail_accept_matchingpath()
10322 if (common->accept_label == NULL) in compile_fail_accept_matchingpath()
10323 add_jump(compiler, &common->accept, JUMP(SLJIT_ZERO)); in compile_fail_accept_matchingpath()
10325 JUMPTO(SLJIT_ZERO, common->accept_label); in compile_fail_accept_matchingpath()
10327 if (common->accept_label == NULL) in compile_fail_accept_matchingpath()
10328 add_jump(compiler, &common->accept, CMP(SLJIT_NOT_EQUAL, TMP2, 0, STR_PTR, 0)); in compile_fail_accept_matchingpath()
10330 CMPTO(SLJIT_NOT_EQUAL, TMP2, 0, STR_PTR, 0, common->accept_label); in compile_fail_accept_matchingpath()
10335 static SLJIT_INLINE PCRE2_SPTR compile_close_matchingpath(compiler_common *common, PCRE2_SPTR cc) in compile_close_matchingpath() argument
10339 BOOL optimized_cbracket = common->optimized_cbracket[offset] != 0; in compile_close_matchingpath()
10342 if (common->currententry != NULL) in compile_close_matchingpath()
10354 static SLJIT_INLINE PCRE2_SPTR compile_control_verb_matchingpath(compiler_common *common, PCRE2_SPT… in compile_control_verb_matchingpath() argument
10369 allocate_stack(common, 1); in compile_control_verb_matchingpath()
10378 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->mark_ptr, TMP2, 0); in compile_control_verb_matchingpath()
10387 static SLJIT_INLINE void compile_then_trap_matchingpath(compiler_common *common, PCRE2_SPTR cc, PCR… in compile_then_trap_matchingpath() argument
10395 common->then_trap = BACKTRACK_AS(then_trap_backtrack); in compile_then_trap_matchingpath()
10396 BACKTRACK_AS(then_trap_backtrack)->common.cc = then_trap_opcode; in compile_then_trap_matchingpath()
10397 BACKTRACK_AS(then_trap_backtrack)->start = (sljit_sw)(cc - common->start); in compile_then_trap_matchingpath()
10398 BACKTRACK_AS(then_trap_backtrack)->framesize = get_framesize(common, cc, ccend, FALSE, &needs_contr… in compile_then_trap_matchingpath()
10403 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_then_trap_matchingpath()
10404 allocate_stack(common, size); in compile_then_trap_matchingpath()
10406 …OP2(SLJIT_ADD, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, STACK_TOP, 0, SLJIT_IMM, (size - 3)… in compile_then_trap_matchingpath()
10408 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, STACK_TOP, 0); in compile_then_trap_matchingpath()
10415 init_frame(common, cc, ccend, size - 1, 0); in compile_then_trap_matchingpath()
10418 static void compile_matchingpath(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend, backtrac… in compile_matchingpath() argument
10427 if (common->has_then && common->then_offsets[cc - common->start] != 0) in compile_matchingpath()
10429 SLJIT_ASSERT(*ccend != OP_END && common->control_head_ptr != 0); in compile_matchingpath()
10431 save_then_trap = common->then_trap; in compile_matchingpath()
10433 compile_then_trap_matchingpath(common, cc, ccend, parent); in compile_matchingpath()
10451 …cc = compile_simple_assertion_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top… in compile_matchingpath()
10473 …cc = compile_char1_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top->nextbackt… in compile_matchingpath()
10479 allocate_stack(common, 1); in compile_matchingpath()
10487 if (common->mode == PCRE2_JIT_COMPLETE) in compile_matchingpath()
10488 …cc = compile_charn_matchingpath(common, cc, ccend, parent->top != NULL ? &parent->top->nextbacktra… in compile_matchingpath()
10490 …cc = compile_char1_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top->nextbackt… in compile_matchingpath()
10558 cc = compile_iterator_matchingpath(common, cc, parent); in compile_matchingpath()
10564 cc = compile_iterator_matchingpath(common, cc, parent); in compile_matchingpath()
10566 …cc = compile_char1_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top->nextbackt… in compile_matchingpath()
10572 cc = compile_iterator_matchingpath(common, cc, parent); in compile_matchingpath()
10574 …cc = compile_char1_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top->nextbackt… in compile_matchingpath()
10581 cc = compile_ref_iterator_matchingpath(common, cc, parent); in compile_matchingpath()
10584 …compile_ref_matchingpath(common, cc, parent->top != NULL ? &parent->top->nextbacktracks : &parent-… in compile_matchingpath()
10592 cc = compile_ref_iterator_matchingpath(common, cc, parent); in compile_matchingpath()
10595 …compile_dnref_search(common, cc, parent->top != NULL ? &parent->top->nextbacktracks : &parent->top… in compile_matchingpath()
10596 …compile_ref_matchingpath(common, cc, parent->top != NULL ? &parent->top->nextbacktracks : &parent-… in compile_matchingpath()
10602 cc = compile_recurse_matchingpath(common, cc, parent); in compile_matchingpath()
10607 cc = compile_callout_matchingpath(common, cc, parent); in compile_matchingpath()
10615 cc = compile_assert_matchingpath(common, cc, BACKTRACK_AS(assert_backtrack), FALSE); in compile_matchingpath()
10623 allocate_stack(common, 1); in compile_matchingpath()
10628 allocate_stack(common, 2); in compile_matchingpath()
10633 count_match(common); in compile_matchingpath()
10643 cc = compile_bracket_matchingpath(common, cc, parent); in compile_matchingpath()
10648 cc = compile_bracket_matchingpath(common, cc, parent); in compile_matchingpath()
10652 cc = compile_assert_matchingpath(common, cc, BACKTRACK_AS(assert_backtrack), FALSE); in compile_matchingpath()
10661 cc = compile_bracketpos_matchingpath(common, cc, parent); in compile_matchingpath()
10666 SLJIT_ASSERT(common->mark_ptr != 0); in compile_matchingpath()
10667 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->mark_ptr); in compile_matchingpath()
10668 allocate_stack(common, common->has_skip_arg ? 5 : 1); in compile_matchingpath()
10670 OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(common->has_skip_arg ? 4 : 0), TMP2, 0); in compile_matchingpath()
10672 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->mark_ptr, TMP2, 0); in compile_matchingpath()
10674 if (common->has_skip_arg) in compile_matchingpath()
10676 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_matchingpath()
10677 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, STACK_TOP, 0); in compile_matchingpath()
10694 cc = compile_control_verb_matchingpath(common, cc, parent); in compile_matchingpath()
10700 cc = compile_fail_accept_matchingpath(common, cc, parent); in compile_matchingpath()
10704 cc = compile_close_matchingpath(common, cc); in compile_matchingpath()
10723 BACKTRACK_AS(then_trap_backtrack)->common.cc = then_trap_opcode; in compile_matchingpath()
10724 BACKTRACK_AS(then_trap_backtrack)->then_trap = common->then_trap; in compile_matchingpath()
10725 common->then_trap = save_then_trap; in compile_matchingpath()
10737 compile_backtrackingpath(common, (current)); \
10745 static void compile_iterator_backtrackingpath(compiler_common *common, struct backtrack_common *cur… in compile_iterator_backtrackingpath() argument
10761 cc = get_iterator_parameters(common, cc, &opcode, &type, &max, &exact, &end); in compile_iterator_backtrackingpath()
10772 free_stack(common, 1); in compile_iterator_backtrackingpath()
10790 skip_char_back(common); in compile_iterator_backtrackingpath()
10797 skip_char_back(common); in compile_iterator_backtrackingpath()
10803 free_stack(common, 2); in compile_iterator_backtrackingpath()
10809 compile_char1_matchingpath(common, type, cc, &jumplist, TRUE); in compile_iterator_backtrackingpath()
10814 free_stack(common, 1); in compile_iterator_backtrackingpath()
10824 compile_char1_matchingpath(common, type, cc, &jumplist, TRUE); in compile_iterator_backtrackingpath()
10830 free_stack(common, 2); in compile_iterator_backtrackingpath()
10844 free_stack(common, 1); in compile_iterator_backtrackingpath()
10851 compile_char1_matchingpath(common, type, cc, &jumplist, TRUE); in compile_iterator_backtrackingpath()
10856 free_stack(common, 1); in compile_iterator_backtrackingpath()
10873 static SLJIT_INLINE void compile_ref_iterator_backtrackingpath(compiler_common *common, struct back… in compile_ref_iterator_backtrackingpath() argument
10887 free_stack(common, 1); in compile_ref_iterator_backtrackingpath()
10895 free_stack(common, ref ? 2 : 3); in compile_ref_iterator_backtrackingpath()
10898 static SLJIT_INLINE void compile_recurse_backtrackingpath(compiler_common *common, struct backtrack… in compile_recurse_backtrackingpath() argument
10913 compile_backtrackingpath(common, current->top); in compile_recurse_backtrackingpath()
10918 static void compile_assert_backtrackingpath(compiler_common *common, struct backtrack_common *curre… in compile_assert_backtrackingpath() argument
10946 free_stack(common, 1); in compile_assert_backtrackingpath()
10957 free_stack(common, 1); in compile_assert_backtrackingpath()
10960 free_stack(common, 1); in compile_assert_backtrackingpath()
10967 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_assert_backtrackingpath()
10987 static void compile_bracket_backtrackingpath(compiler_common *common, struct backtrack_common *curr… in compile_bracket_backtrackingpath() argument
11054 free_stack(common, 1); in compile_bracket_backtrackingpath()
11066 free_stack(common, 1); in compile_bracket_backtrackingpath()
11081 free_stack(common, 1); in compile_bracket_backtrackingpath()
11095 free_stack(common, 1); in compile_bracket_backtrackingpath()
11107 free_stack(common, 1); in compile_bracket_backtrackingpath()
11118 if (common->capture_last_ptr != 0) in compile_bracket_backtrackingpath()
11120 SLJIT_ASSERT(common->optimized_cbracket[offset >> 1] == 0); in compile_bracket_backtrackingpath()
11123 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr, TMP1, 0); in compile_bracket_backtrackingpath()
11125 free_stack(common, 3); in compile_bracket_backtrackingpath()
11129 else if (common->optimized_cbracket[offset >> 1] == 0) in compile_bracket_backtrackingpath()
11133 free_stack(common, 2); in compile_bracket_backtrackingpath()
11144 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_bracket_backtrackingpath()
11155 free_stack(common, 1); in compile_bracket_backtrackingpath()
11164 free_stack(common, 1); in compile_bracket_backtrackingpath()
11169 next_update_addr = allocate_read_only_data(common, alt_max * sizeof(sljit_uw)); in compile_bracket_backtrackingpath()
11173 add_label_addr(common, next_update_addr++); in compile_bracket_backtrackingpath()
11197 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_bracket_backtrackingpath()
11240 compile_matchingpath(common, ccprev, cc, current); in compile_bracket_backtrackingpath()
11248 …match_once_common(common, ket, CURRENT_AS(bracket_backtrack)->u.framesize, private_data_ptr, has_a… in compile_bracket_backtrackingpath()
11261 if (common->capture_last_ptr != 0) in compile_bracket_backtrackingpath()
11263 if (common->optimized_cbracket[offset >> 1] == 0) in compile_bracket_backtrackingpath()
11270 allocate_stack(common, stacksize); in compile_bracket_backtrackingpath()
11290 stacksize = match_capture_common(common, stacksize, offset, private_data_ptr); in compile_bracket_backtrackingpath()
11295 if (offset != 0 && ket == OP_KETRMAX && common->optimized_cbracket[offset >> 1] != 0) in compile_bracket_backtrackingpath()
11307 add_label_addr(common, next_update_addr++); in compile_bracket_backtrackingpath()
11340 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_bracket_backtrackingpath()
11350 free_stack(common, 1); in compile_bracket_backtrackingpath()
11356 if (common->optimized_cbracket[offset >> 1] != 0) in compile_bracket_backtrackingpath()
11360 free_stack(common, 2); in compile_bracket_backtrackingpath()
11367 free_stack(common, 1); in compile_bracket_backtrackingpath()
11374 free_stack(common, 1); in compile_bracket_backtrackingpath()
11393 free_stack(common, stacksize); in compile_bracket_backtrackingpath()
11403 free_stack(common, 2); in compile_bracket_backtrackingpath()
11418 free_stack(common, 1); in compile_bracket_backtrackingpath()
11426 free_stack(common, 1); in compile_bracket_backtrackingpath()
11437 free_stack(common, 1); in compile_bracket_backtrackingpath()
11440 free_stack(common, bra == OP_BRAMINZERO ? 2 : 1); in compile_bracket_backtrackingpath()
11442 free_stack(common, 1); in compile_bracket_backtrackingpath()
11452 static SLJIT_INLINE void compile_bracketpos_backtrackingpath(compiler_common *common, struct backtr… in compile_bracketpos_backtrackingpath() argument
11466 if (common->capture_last_ptr != 0) in compile_bracketpos_backtrackingpath()
11469 if (common->capture_last_ptr != 0) in compile_bracketpos_backtrackingpath()
11470 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr, TMP1, 0); in compile_bracketpos_backtrackingpath()
11473 free_stack(common, CURRENT_AS(bracketpos_backtrack)->stacksize); in compile_bracketpos_backtrackingpath()
11478 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_bracketpos_backtrackingpath()
11486 free_stack(common, CURRENT_AS(bracketpos_backtrack)->stacksize); in compile_bracketpos_backtrackingpath()
11492 static SLJIT_INLINE void compile_braminzero_backtrackingpath(compiler_common *common, struct backtr… in compile_braminzero_backtrackingpath() argument
11502 compile_bracket_matchingpath(common, current->cc, current); in compile_braminzero_backtrackingpath()
11503 compile_bracket_backtrackingpath(common, current->top); in compile_braminzero_backtrackingpath()
11508 backtrack.common.cc = current->cc; in compile_braminzero_backtrackingpath()
11511 compile_assert_matchingpath(common, current->cc, &backtrack, FALSE); in compile_braminzero_backtrackingpath()
11516 static SLJIT_INLINE void compile_control_verb_backtrackingpath(compiler_common *common, struct back… in compile_control_verb_backtrackingpath() argument
11525 if (common->then_trap != NULL) in compile_control_verb_backtrackingpath()
11527 SLJIT_ASSERT(common->control_head_ptr != 0); in compile_control_verb_backtrackingpath()
11529 OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_control_verb_backtrackingpath()
11531 OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, common->then_trap->start); in compile_control_verb_backtrackingpath()
11539 add_jump(compiler, &common->then_trap->quit, JUMP(SLJIT_JUMP)); in compile_control_verb_backtrackingpath()
11542 else if (!common->local_quit_available && common->in_positive_assertion) in compile_control_verb_backtrackingpath()
11544 add_jump(compiler, &common->positive_assertion_quit, JUMP(SLJIT_JUMP)); in compile_control_verb_backtrackingpath()
11549 if (common->local_quit_available) in compile_control_verb_backtrackingpath()
11552 if (common->quit_label == NULL) in compile_control_verb_backtrackingpath()
11553 add_jump(compiler, &common->quit, JUMP(SLJIT_JUMP)); in compile_control_verb_backtrackingpath()
11555 JUMPTO(SLJIT_JUMP, common->quit_label); in compile_control_verb_backtrackingpath()
11561 SLJIT_ASSERT(common->control_head_ptr != 0 && TMP1 == SLJIT_R0 && STR_PTR == SLJIT_R1); in compile_control_verb_backtrackingpath()
11562 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_control_verb_backtrackingpath()
11567 add_jump(compiler, &common->reset_match, CMP(SLJIT_NOT_EQUAL, SLJIT_R0, 0, SLJIT_IMM, 0)); in compile_control_verb_backtrackingpath()
11575 add_jump(compiler, &common->reset_match, JUMP(SLJIT_JUMP)); in compile_control_verb_backtrackingpath()
11578 static SLJIT_INLINE void compile_then_trap_backtrackingpath(compiler_common *common, struct backtra… in compile_then_trap_backtrackingpath() argument
11586 common->then_trap = CURRENT_AS(then_trap_backtrack)->then_trap; in compile_then_trap_backtrackingpath()
11594 free_stack(common, size); in compile_then_trap_backtrackingpath()
11601 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_then_trap_backtrackingpath()
11605 free_stack(common, 3); in compile_then_trap_backtrackingpath()
11608 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, TMP1, 0); in compile_then_trap_backtrackingpath()
11611 static void compile_backtrackingpath(compiler_common *common, struct backtrack_common *current) in compile_backtrackingpath() argument
11614 then_trap_backtrack *save_then_trap = common->then_trap; in compile_backtrackingpath()
11624 free_stack(common, 1); in compile_backtrackingpath()
11698 compile_iterator_backtrackingpath(common, current); in compile_backtrackingpath()
11705 compile_ref_iterator_backtrackingpath(common, current); in compile_backtrackingpath()
11709 compile_recurse_backtrackingpath(common, current); in compile_backtrackingpath()
11716 compile_assert_backtrackingpath(common, current); in compile_backtrackingpath()
11726 compile_bracket_backtrackingpath(common, current); in compile_backtrackingpath()
11731 compile_bracket_backtrackingpath(common, current); in compile_backtrackingpath()
11733 compile_assert_backtrackingpath(common, current); in compile_backtrackingpath()
11741 compile_bracketpos_backtrackingpath(common, current); in compile_backtrackingpath()
11745 compile_braminzero_backtrackingpath(common, current); in compile_backtrackingpath()
11749 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), STACK(common->has_skip_arg ? 4 : 0)); in compile_backtrackingpath()
11750 if (common->has_skip_arg) in compile_backtrackingpath()
11752 free_stack(common, common->has_skip_arg ? 5 : 1); in compile_backtrackingpath()
11753 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->mark_ptr, TMP1, 0); in compile_backtrackingpath()
11754 if (common->has_skip_arg) in compile_backtrackingpath()
11755 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, TMP2, 0); in compile_backtrackingpath()
11764 compile_control_verb_backtrackingpath(common, current); in compile_backtrackingpath()
11769 if (!common->local_quit_available) in compile_backtrackingpath()
11771 if (common->quit_label == NULL) in compile_backtrackingpath()
11772 add_jump(compiler, &common->quit, JUMP(SLJIT_JUMP)); in compile_backtrackingpath()
11774 JUMPTO(SLJIT_JUMP, common->quit_label); in compile_backtrackingpath()
11787 compile_then_trap_backtrackingpath(common, current); in compile_backtrackingpath()
11796 common->then_trap = save_then_trap; in compile_backtrackingpath()
11799 static SLJIT_INLINE void compile_recurse(compiler_common *common) in compile_recurse() argument
11802 PCRE2_SPTR cc = common->start + common->currententry->start; in compile_recurse()
11808 int private_data_size = get_recurse_data_length(common, ccbegin, ccend, &needs_control_head, &has_q… in compile_recurse()
11819 common->then_trap = NULL; in compile_recurse()
11827 SLJIT_ASSERT(common->currententry->entry_label == NULL && common->recursive_head_ptr != 0); in compile_recurse()
11828 common->currententry->entry_label = LABEL(); in compile_recurse()
11829 set_jumps(common->currententry->entry_calls, common->currententry->entry_label); in compile_recurse()
11832 count_match(common); in compile_recurse()
11839 allocate_stack(common, private_data_size + local_size); in compile_recurse()
11843 copy_recurse_data(common, ccbegin, ccend, recurse_copy_from_global, local_size, private_data_size +… in compile_recurse()
11846 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->recursive_head_ptr, STACK_TOP, 0); in compile_recurse()
11849 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_IMM, 0); in compile_recurse()
11855 common->quit_label = NULL; in compile_recurse()
11856 common->accept_label = NULL; in compile_recurse()
11857 common->quit = NULL; in compile_recurse()
11858 common->accept = NULL; in compile_recurse()
11869 compile_matchingpath(common, altbacktrack.cc, cc, &altbacktrack); in compile_recurse()
11873 allocate_stack(common, (alt_max > 1 || has_accept) ? 2 : 1); in compile_recurse()
11874 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->recursive_head_ptr); in compile_recurse()
11884 SLJIT_ASSERT(common->currententry->backtrack_label == NULL); in compile_recurse()
11885 common->currententry->backtrack_label = LABEL(); in compile_recurse()
11886 set_jumps(common->currententry->backtrack_calls, common->currententry->backtrack_label); in compile_recurse()
11897 …copy_recurse_data(common, ccbegin, ccend, recurse_swap_global, local_size, private_data_size + loc… in compile_recurse()
11902 free_stack(common, 2); in compile_recurse()
11907 next_update_addr = allocate_read_only_data(common, alt_max * sizeof(sljit_uw)); in compile_recurse()
11911 add_label_addr(common, next_update_addr++); in compile_recurse()
11921 free_stack(common, has_accept ? 2 : 1); in compile_recurse()
11924 add_label_addr(common, next_update_addr++); in compile_recurse()
11943 compile_backtrackingpath(common, altbacktrack.top); in compile_recurse()
11959 copy_recurse_data(common, ccbegin, ccend, recurse_copy_private_to_global, local_size, private_data_… in compile_recurse()
11962 free_stack(common, private_data_size + local_size); in compile_recurse()
11966 if (common->quit != NULL) in compile_recurse()
11970 set_jumps(common->quit, LABEL()); in compile_recurse()
11971 OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), common->recursive_head_ptr); in compile_recurse()
11972 …copy_recurse_data(common, ccbegin, ccend, recurse_copy_shared_to_global, local_size, private_data_… in compile_recurse()
11979 free_stack(common, 2); in compile_recurse()
11984 …copy_recurse_data(common, ccbegin, ccend, recurse_copy_kept_shared_to_global, local_size, private_… in compile_recurse()
11987 free_stack(common, private_data_size + local_size); in compile_recurse()
11992 if (common->accept != NULL) in compile_recurse()
11996 set_jumps(common->accept, LABEL()); in compile_recurse()
11998 OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), common->recursive_head_ptr); in compile_recurse()
12001 allocate_stack(common, 2); in compile_recurse()
12009 copy_recurse_data(common, ccbegin, ccend, recurse_swap_global, local_size, private_data_size + loca… in compile_recurse()
12025 compiler_common *common = &common_data; in jit_compile() local
12050 memset(common, 0, sizeof(compiler_common)); in jit_compile()
12051 common->re = re; in jit_compile()
12052 common->name_table = (PCRE2_SPTR)((uint8_t *)re + sizeof(pcre2_real_code)); in jit_compile()
12053 rootbacktrack.cc = common->name_table + re->name_count * re->name_entry_size; in jit_compile()
12055 common->start = rootbacktrack.cc; in jit_compile()
12056 common->read_only_data_head = NULL; in jit_compile()
12057 common->fcc = tables + fcc_offset; in jit_compile()
12058 common->lcc = (sljit_sw)(tables + lcc_offset); in jit_compile()
12059 common->mode = mode; in jit_compile()
12060 common->might_be_empty = re->minlength == 0; in jit_compile()
12061 common->nltype = NLTYPE_FIXED; in jit_compile()
12064 case PCRE2_NEWLINE_CR: common->newline = CHAR_CR; break; in jit_compile()
12065 case PCRE2_NEWLINE_LF: common->newline = CHAR_NL; break; in jit_compile()
12066 case PCRE2_NEWLINE_CRLF: common->newline = (CHAR_CR << 8) | CHAR_NL; break; in jit_compile()
12067 …case PCRE2_NEWLINE_ANY: common->newline = (CHAR_CR << 8) | CHAR_NL; common->nltype = NLTYPE_ANY; b… in jit_compile()
12068 …case PCRE2_NEWLINE_ANYCRLF: common->newline = (CHAR_CR << 8) | CHAR_NL; common->nltype = NLTYPE_AN… in jit_compile()
12071 common->nlmax = READ_CHAR_MAX; in jit_compile()
12072 common->nlmin = 0; in jit_compile()
12074 common->bsr_nltype = NLTYPE_ANY; in jit_compile()
12076 common->bsr_nltype = NLTYPE_ANYCRLF; in jit_compile()
12080 common->bsr_nltype = NLTYPE_ANYCRLF; in jit_compile()
12082 common->bsr_nltype = NLTYPE_ANY; in jit_compile()
12085 common->bsr_nlmax = READ_CHAR_MAX; in jit_compile()
12086 common->bsr_nlmin = 0; in jit_compile()
12087 common->endonly = (re->overall_options & PCRE2_DOLLAR_ENDONLY) != 0; in jit_compile()
12088 common->ctypes = (sljit_sw)(tables + ctypes_offset); in jit_compile()
12089 common->name_count = re->name_count; in jit_compile()
12090 common->name_entry_size = re->name_entry_size; in jit_compile()
12091 common->unset_backref = (re->overall_options & PCRE2_MATCH_UNSET_BACKREF) != 0; in jit_compile()
12092 common->alt_circumflex = (re->overall_options & PCRE2_ALT_CIRCUMFLEX) != 0; in jit_compile()
12095 common->utf = (re->overall_options & PCRE2_UTF) != 0; in jit_compile()
12096 common->use_ucp = (re->overall_options & PCRE2_UCP) != 0; in jit_compile()
12097 if (common->utf) in jit_compile()
12099 if (common->nltype == NLTYPE_ANY) in jit_compile()
12100 common->nlmax = 0x2029; in jit_compile()
12101 else if (common->nltype == NLTYPE_ANYCRLF) in jit_compile()
12102 common->nlmax = (CHAR_CR > CHAR_NL) ? CHAR_CR : CHAR_NL; in jit_compile()
12106 common->nlmax = common->newline & 0xff; in jit_compile()
12109 if (common->nltype == NLTYPE_FIXED) in jit_compile()
12110 common->nlmin = common->newline & 0xff; in jit_compile()
12112 common->nlmin = (CHAR_CR < CHAR_NL) ? CHAR_CR : CHAR_NL; in jit_compile()
12114 if (common->bsr_nltype == NLTYPE_ANY) in jit_compile()
12115 common->bsr_nlmax = 0x2029; in jit_compile()
12117 common->bsr_nlmax = (CHAR_CR > CHAR_NL) ? CHAR_CR : CHAR_NL; in jit_compile()
12118 common->bsr_nlmin = (CHAR_CR < CHAR_NL) ? CHAR_CR : CHAR_NL; in jit_compile()
12121 ccend = bracketend(common->start); in jit_compile()
12124 common->ovector_start = LIMIT_MATCH + sizeof(sljit_sw); in jit_compile()
12125 common->optimized_cbracket = (sljit_u8 *)SLJIT_MALLOC(re->top_bracket + 1, allocator_data); in jit_compile()
12126 if (!common->optimized_cbracket) in jit_compile()
12129 memset(common->optimized_cbracket, 0, re->top_bracket + 1); in jit_compile()
12131 memset(common->optimized_cbracket, 1, re->top_bracket + 1); in jit_compile()
12134 SLJIT_ASSERT(*common->start == OP_BRA && ccend[-(1 + LINK_SIZE)] == OP_KET); in jit_compile()
12136 common->capture_last_ptr = common->ovector_start; in jit_compile()
12137 common->ovector_start += sizeof(sljit_sw); in jit_compile()
12139 if (!check_opcode_types(common, common->start, ccend)) in jit_compile()
12141 SLJIT_FREE(common->optimized_cbracket, allocator_data); in jit_compile()
12148 common->req_char_ptr = common->ovector_start; in jit_compile()
12149 common->ovector_start += sizeof(sljit_sw); in jit_compile()
12153 common->start_used_ptr = common->ovector_start; in jit_compile()
12154 common->ovector_start += sizeof(sljit_sw); in jit_compile()
12157 common->hit_start = common->ovector_start; in jit_compile()
12158 common->ovector_start += sizeof(sljit_sw); in jit_compile()
12163 common->match_end_ptr = common->ovector_start; in jit_compile()
12164 common->ovector_start += sizeof(sljit_sw); in jit_compile()
12167 common->control_head_ptr = 1; in jit_compile()
12169 if (common->control_head_ptr != 0) in jit_compile()
12171 common->control_head_ptr = common->ovector_start; in jit_compile()
12172 common->ovector_start += sizeof(sljit_sw); in jit_compile()
12174 if (common->has_set_som) in jit_compile()
12177 common->start_ptr = common->ovector_start; in jit_compile()
12178 common->ovector_start += sizeof(sljit_sw); in jit_compile()
12182 if ((common->ovector_start & sizeof(sljit_sw)) != 0) in jit_compile()
12183 common->ovector_start += sizeof(sljit_sw); in jit_compile()
12185 if (common->start_ptr == 0) in jit_compile()
12186 common->start_ptr = OVECTOR(0); in jit_compile()
12189 if (common->capture_last_ptr != 0) in jit_compile()
12190 memset(common->optimized_cbracket, 0, re->top_bracket + 1); in jit_compile()
12192 SLJIT_ASSERT(!(common->req_char_ptr != 0 && common->start_used_ptr != 0)); in jit_compile()
12193 common->cbra_ptr = OVECTOR_START + (re->top_bracket + 1) * 2 * sizeof(sljit_sw); in jit_compile()
12195 total_length = ccend - common->start; in jit_compile()
12196 common->private_data_ptrs = (sljit_s32 *)SLJIT_MALLOC(total_length * (sizeof(sljit_s32) + (common->… in jit_compile()
12197 if (!common->private_data_ptrs) in jit_compile()
12199 SLJIT_FREE(common->optimized_cbracket, allocator_data); in jit_compile()
12202 memset(common->private_data_ptrs, 0, total_length * sizeof(sljit_s32)); in jit_compile()
12204 private_data_size = common->cbra_ptr + (re->top_bracket + 1) * sizeof(sljit_sw); in jit_compile()
12205 set_private_data_ptrs(common, &private_data_size, ccend); in jit_compile()
12208 if (!detect_fast_forward_skip(common, &private_data_size) && !common->has_skip_in_assert_back) in jit_compile()
12209 detect_fast_fail(common, common->start, &private_data_size, 4); in jit_compile()
12212 SLJIT_ASSERT(common->fast_fail_start_ptr <= common->fast_fail_end_ptr); in jit_compile()
12216 SLJIT_FREE(common->private_data_ptrs, allocator_data); in jit_compile()
12217 SLJIT_FREE(common->optimized_cbracket, allocator_data); in jit_compile()
12221 if (common->has_then) in jit_compile()
12223 common->then_offsets = (sljit_u8 *)(common->private_data_ptrs + total_length); in jit_compile()
12224 memset(common->then_offsets, 0, total_length); in jit_compile()
12225 set_then_offsets(common, common->start, NULL); in jit_compile()
12231 SLJIT_FREE(common->optimized_cbracket, allocator_data); in jit_compile()
12232 SLJIT_FREE(common->private_data_ptrs, allocator_data); in jit_compile()
12235 common->compiler = compiler; in jit_compile()
12241 reset_ovector(common, (re->top_bracket + 1) * 2); in jit_compile()
12242 if (common->req_char_ptr != 0) in jit_compile()
12243 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->req_char_ptr, SLJIT_R0, 0); in jit_compile()
12256 if (common->fast_fail_start_ptr < common->fast_fail_end_ptr) in jit_compile()
12257 reset_fast_fail(common); in jit_compile()
12260 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, -1); in jit_compile()
12261 if (common->mark_ptr != 0) in jit_compile()
12262 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->mark_ptr, SLJIT_IMM, 0); in jit_compile()
12263 if (common->control_head_ptr != 0) in jit_compile()
12264 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_IMM, 0); in jit_compile()
12269 mainloop_label = mainloop_entry(common); in jit_compile()
12274 if (mode == PCRE2_JIT_COMPLETE && fast_forward_first_n_chars(common)) in jit_compile()
12277 fast_forward_first_char(common); in jit_compile()
12279 fast_forward_newline(common); in jit_compile()
12281 fast_forward_start_bits(common); in jit_compile()
12293 if (common->req_char_ptr != 0) in jit_compile()
12294 …reqbyte_notfound = search_requested_char(common, (PCRE2_UCHAR)(re->last_codeunit), (re->flags & PC… in jit_compile()
12300 if (common->capture_last_ptr != 0) in jit_compile()
12301 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr, SLJIT_IMM, 0); in jit_compile()
12302 if (common->fast_forward_bc_ptr != NULL) in jit_compile()
12303 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), PRIVATE_DATA(common->fast_forward_bc_ptr + 1), STR_PTR, 0); in jit_compile()
12305 if (common->start_ptr != OVECTOR(0)) in jit_compile()
12306 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->start_ptr, STR_PTR, 0); in jit_compile()
12311 jump = CMP(SLJIT_NOT_EQUAL, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, -1); in jit_compile()
12312 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0); in jit_compile()
12316 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0); in jit_compile()
12318 compile_matchingpath(common, common->start, ccend, &rootbacktrack); in jit_compile()
12322 SLJIT_FREE(common->optimized_cbracket, allocator_data); in jit_compile()
12323 SLJIT_FREE(common->private_data_ptrs, allocator_data); in jit_compile()
12324 PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data); in jit_compile()
12331 if (common->might_be_empty) in jit_compile()
12337 common->accept_label = LABEL(); in jit_compile()
12338 if (common->accept != NULL) in jit_compile()
12339 set_jumps(common->accept, common->accept_label); in jit_compile()
12342 copy_ovector(common, re->top_bracket + 1); in jit_compile()
12343 common->quit_label = common->abort_label = LABEL(); in jit_compile()
12344 if (common->quit != NULL) in jit_compile()
12345 set_jumps(common->quit, common->quit_label); in jit_compile()
12346 if (common->abort != NULL) in jit_compile()
12347 set_jumps(common->abort, common->abort_label); in jit_compile()
12349 SET_LABEL(minlength_check_failed, common->abort_label); in jit_compile()
12352 if (common->failed_match != NULL) in jit_compile()
12354 SLJIT_ASSERT(common->mode == PCRE2_JIT_COMPLETE); in jit_compile()
12355 set_jumps(common->failed_match, LABEL()); in jit_compile()
12357 JUMPTO(SLJIT_JUMP, common->abort_label); in jit_compile()
12365 common->partialmatchlabel = LABEL(); in jit_compile()
12366 set_jumps(common->partialmatch, common->partialmatchlabel); in jit_compile()
12367 return_with_partial_match(common, common->quit_label); in jit_compile()
12370 if (common->might_be_empty) in jit_compile()
12372 compile_backtrackingpath(common, rootbacktrack.top); in jit_compile()
12376 SLJIT_FREE(common->optimized_cbracket, allocator_data); in jit_compile()
12377 SLJIT_FREE(common->private_data_ptrs, allocator_data); in jit_compile()
12378 PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data); in jit_compile()
12388 jump = CMP(SLJIT_NOT_EQUAL, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, 0); in jit_compile()
12389 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->start_ptr); in jit_compile()
12390 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, SLJIT_IMM, -1); in jit_compile()
12391 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->hit_start, TMP1, 0); in jit_compile()
12396 if ((re->overall_options & PCRE2_ANCHORED) == 0 && common->match_end_ptr != 0) in jit_compile()
12398 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr); in jit_compile()
12402 …(common->fast_forward_bc_ptr != NULL) ? (PRIVATE_DATA(common->fast_forward_bc_ptr + 1)) : common->… in jit_compile()
12406 if (common->ff_newline_shortcut != NULL) in jit_compile()
12411 if (common->match_end_ptr != 0) in jit_compile()
12415 CMPTO(SLJIT_LESS, STR_PTR, 0, TMP1, 0, common->ff_newline_shortcut); in jit_compile()
12419 CMPTO(SLJIT_LESS, STR_PTR, 0, STR_END, 0, common->ff_newline_shortcut); in jit_compile()
12423 CMPTO(SLJIT_LESS, STR_PTR, 0, (common->match_end_ptr == 0) ? STR_END : TMP1, 0, mainloop_label); in jit_compile()
12431 …CMPTO(SLJIT_NOT_EQUAL, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, -1, common->partialmatc… in jit_compile()
12434 JUMPTO(SLJIT_JUMP, common->quit_label); in jit_compile()
12436 flush_stubs(common); in jit_compile()
12438 if (common->might_be_empty) in jit_compile()
12452 common->fast_forward_bc_ptr = NULL; in jit_compile()
12453 common->fast_fail_start_ptr = 0; in jit_compile()
12454 common->fast_fail_end_ptr = 0; in jit_compile()
12455 common->currententry = common->entries; in jit_compile()
12456 common->local_quit_available = TRUE; in jit_compile()
12457 quit_label = common->quit_label; in jit_compile()
12458 while (common->currententry != NULL) in jit_compile()
12461 compile_recurse(common); in jit_compile()
12465 SLJIT_FREE(common->optimized_cbracket, allocator_data); in jit_compile()
12466 SLJIT_FREE(common->private_data_ptrs, allocator_data); in jit_compile()
12467 PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data); in jit_compile()
12470 flush_stubs(common); in jit_compile()
12471 common->currententry = common->currententry->next; in jit_compile()
12473 common->local_quit_available = FALSE; in jit_compile()
12474 common->quit_label = quit_label; in jit_compile()
12478 set_jumps(common->stackalloc, LABEL()); in jit_compile()
12503 JUMPTO(SLJIT_JUMP, common->quit_label); in jit_compile()
12506 set_jumps(common->calllimit, LABEL()); in jit_compile()
12508 JUMPTO(SLJIT_JUMP, common->quit_label); in jit_compile()
12510 if (common->revertframes != NULL) in jit_compile()
12512 set_jumps(common->revertframes, LABEL()); in jit_compile()
12513 do_revertframes(common); in jit_compile()
12515 if (common->wordboundary != NULL) in jit_compile()
12517 set_jumps(common->wordboundary, LABEL()); in jit_compile()
12518 check_wordboundary(common); in jit_compile()
12520 if (common->anynewline != NULL) in jit_compile()
12522 set_jumps(common->anynewline, LABEL()); in jit_compile()
12523 check_anynewline(common); in jit_compile()
12525 if (common->hspace != NULL) in jit_compile()
12527 set_jumps(common->hspace, LABEL()); in jit_compile()
12528 check_hspace(common); in jit_compile()
12530 if (common->vspace != NULL) in jit_compile()
12532 set_jumps(common->vspace, LABEL()); in jit_compile()
12533 check_vspace(common); in jit_compile()
12535 if (common->casefulcmp != NULL) in jit_compile()
12537 set_jumps(common->casefulcmp, LABEL()); in jit_compile()
12538 do_casefulcmp(common); in jit_compile()
12540 if (common->caselesscmp != NULL) in jit_compile()
12542 set_jumps(common->caselesscmp, LABEL()); in jit_compile()
12543 do_caselesscmp(common); in jit_compile()
12545 if (common->reset_match != NULL) in jit_compile()
12547 set_jumps(common->reset_match, LABEL()); in jit_compile()
12548 do_reset_match(common, (re->top_bracket + 1) * 2); in jit_compile()
12555 if (common->utfreadchar != NULL) in jit_compile()
12557 set_jumps(common->utfreadchar, LABEL()); in jit_compile()
12558 do_utfreadchar(common); in jit_compile()
12560 if (common->utfreadchar16 != NULL) in jit_compile()
12562 set_jumps(common->utfreadchar16, LABEL()); in jit_compile()
12563 do_utfreadchar16(common); in jit_compile()
12565 if (common->utfreadtype8 != NULL) in jit_compile()
12567 set_jumps(common->utfreadtype8, LABEL()); in jit_compile()
12568 do_utfreadtype8(common); in jit_compile()
12571 if (common->getucd != NULL) in jit_compile()
12573 set_jumps(common->getucd, LABEL()); in jit_compile()
12574 do_getucd(common); in jit_compile()
12578 SLJIT_FREE(common->optimized_cbracket, allocator_data); in jit_compile()
12579 SLJIT_FREE(common->private_data_ptrs, allocator_data); in jit_compile()
12583 label_addr = common->label_addrs; in jit_compile()
12592 PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data); in jit_compile()
12607 PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data); in jit_compile()
12624 functions->read_only_data_heads[mode] = common->read_only_data_head; in jit_compile()