Lines Matching refs:common
250 backtrack_common common; member
261 backtrack_common common; member
283 backtrack_common common; member
293 backtrack_common common; member
298 backtrack_common common; member
312 backtrack_common common; member
332 backtrack_common common; member
344 backtrack_common common; member
592 #define OVECTOR_START (common->ovector_start)
594 #define OVECTOR_PRIV(i) (common->cbra_ptr + (i) * (sljit_sw)sizeof(sljit_sw))
595 #define PRIVATE_DATA(cc) (common->private_data_ptrs[(cc) - common->start])
614 struct sljit_compiler *compiler = common->compiler
870 static PCRE2_SPTR next_opcode(compiler_common *common, PCRE2_SPTR cc) in next_opcode() argument
872 SLJIT_UNUSED_ARG(common); in next_opcode()
1024 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in next_opcode()
1046 if (common->utf) return NULL; in next_opcode()
1071 static BOOL check_opcode_types(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend) in check_opcode_types() argument
1084 common->has_set_som = TRUE; in check_opcode_types()
1085 common->might_be_empty = TRUE; in check_opcode_types()
1091 if (common->iref_ptr == 0) in check_opcode_types()
1093 common->iref_ptr = common->ovector_start; in check_opcode_types()
1094 common->ovector_start += 3 * sizeof(sljit_sw); in check_opcode_types()
1099 common->optimized_cbracket[GET2(cc, 1)] = 0; in check_opcode_types()
1113 common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] = 0; in check_opcode_types()
1127 common->optimized_cbracket[GET2(cc, 1)] = 0; in check_opcode_types()
1135 slot = common->name_table + GET2(cc, 1) * common->name_entry_size; in check_opcode_types()
1138 common->optimized_cbracket[GET2(slot, 0)] = 0; in check_opcode_types()
1139 slot += common->name_entry_size; in check_opcode_types()
1146 if (common->recursive_head_ptr == 0) in check_opcode_types()
1148 common->recursive_head_ptr = common->ovector_start; in check_opcode_types()
1149 common->ovector_start += sizeof(sljit_sw); in check_opcode_types()
1156 if (common->capture_last_ptr == 0) in check_opcode_types()
1158 common->capture_last_ptr = common->ovector_start; in check_opcode_types()
1159 common->ovector_start += sizeof(sljit_sw); in check_opcode_types()
1172 common->has_then = TRUE; in check_opcode_types()
1173 common->control_head_ptr = 1; in check_opcode_types()
1182 if (common->mark_ptr == 0) in check_opcode_types()
1184 common->mark_ptr = common->ovector_start; in check_opcode_types()
1185 common->ovector_start += sizeof(sljit_sw); in check_opcode_types()
1191 common->has_then = TRUE; in check_opcode_types()
1192 common->control_head_ptr = 1; in check_opcode_types()
1198 common->has_skip_in_assert_back = TRUE; in check_opcode_types()
1205 common->control_head_ptr = 1; in check_opcode_types()
1206 common->has_skip_arg = TRUE; in check_opcode_types()
1208 common->has_skip_in_assert_back = TRUE; in check_opcode_types()
1223 cc = next_opcode(common, cc); in check_opcode_types()
1242 static int detect_early_fail(compiler_common *common, PCRE2_SPTR cc, int *private_data_start, in detect_early_fail() argument
1254 SLJIT_ASSERT(*cc != OP_CBRA || common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] != 0); in detect_early_fail()
1325 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in detect_early_fail()
1396 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in detect_early_fail()
1436 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in detect_early_fail()
1492 …if (*end != OP_KET || (*cc == OP_CBRA && common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] == 0)) in detect_early_fail()
1495 …count = detect_early_fail(common, cc, private_data_start, depth + 1, count, prev_fast_forward_allo… in detect_early_fail()
1498 common->private_data_ptrs[begin - common->start] = 1; in detect_early_fail()
1523 common->fast_forward_bc_ptr = accelerated_start; in detect_early_fail()
1524 …common->private_data_ptrs[(accelerated_start + 1) - common->start] = ((*private_data_start) << 3) … in detect_early_fail()
1529 …common->private_data_ptrs[(accelerated_start + 1) - common->start] = ((*private_data_start) << 3) … in detect_early_fail()
1531 if (common->early_fail_start_ptr == 0) in detect_early_fail()
1532 common->early_fail_start_ptr = *private_data_start; in detect_early_fail()
1535 common->early_fail_end_ptr = *private_data_start; in detect_early_fail()
1543 …common->private_data_ptrs[(accelerated_start + 1) - common->start] = ((*private_data_start) << 3) … in detect_early_fail()
1545 if (common->early_fail_start_ptr == 0) in detect_early_fail()
1546 common->early_fail_start_ptr = *private_data_start; in detect_early_fail()
1549 common->early_fail_end_ptr = *private_data_start; in detect_early_fail()
1556 common->private_data_ptrs[begin - common->start] = 1; in detect_early_fail()
1611 static BOOL detect_repeat(compiler_common *common, PCRE2_SPTR begin) in detect_repeat() argument
1673 common->private_data_ptrs[max_end - common->start - LINK_SIZE] = next_end - max_end; in detect_repeat()
1674 …common->private_data_ptrs[max_end - common->start - LINK_SIZE + 1] = (type == OP_BRAZERO) ? OP_UPT… in detect_repeat()
1676 common->private_data_ptrs[max_end - common->start - LINK_SIZE + 2] = max + 2; in detect_repeat()
1688 common->private_data_ptrs[end - common->start - LINK_SIZE] = max_end - end; in detect_repeat()
1689 common->private_data_ptrs[end - common->start - LINK_SIZE + 1] = OP_EXACT; in detect_repeat()
1690 common->private_data_ptrs[end - common->start - LINK_SIZE + 2] = min; in detect_repeat()
1749 static void set_private_data_ptrs(compiler_common *common, int *private_data_start, PCRE2_SPTR ccen… in set_private_data_ptrs() argument
1751 PCRE2_SPTR cc = common->start; in set_private_data_ptrs()
1769 if (detect_repeat(common, cc)) in set_private_data_ptrs()
1782 if (common->private_data_ptrs[cc + 1 - common->start] != 0) in set_private_data_ptrs()
1784 common->private_data_ptrs[cc - common->start] = private_data_ptr; in set_private_data_ptrs()
1786 cc += common->private_data_ptrs[cc + 1 - common->start]; in set_private_data_ptrs()
1803 common->private_data_ptrs[cc - common->start] = private_data_ptr; in set_private_data_ptrs()
1810 common->private_data_ptrs[cc - common->start] = private_data_ptr; in set_private_data_ptrs()
1817 common->private_data_ptrs[cc - common->start] = 0; in set_private_data_ptrs()
1821 common->private_data_ptrs[cc - common->start] = private_data_ptr; in set_private_data_ptrs()
1894 cc = next_opcode(common, cc); in set_private_data_ptrs()
1903 common->private_data_ptrs[cc - common->start] = private_data_ptr; in set_private_data_ptrs()
1913 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in set_private_data_ptrs()
1935 static int get_framesize(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend, BOOL recursive, … in get_framesize() argument
1946 SLJIT_ASSERT(common->control_head_ptr != 0); in get_framesize()
1957 possessive = length = (common->capture_last_ptr != 0) ? 5 : 3; in get_framesize()
1961 cc = next_opcode(common, cc); in get_framesize()
1969 SLJIT_ASSERT(common->has_set_som); in get_framesize()
1983 SLJIT_ASSERT(common->mark_ptr != 0); in get_framesize()
1990 if (common->control_head_ptr != 0) in get_framesize()
1997 if (common->has_set_som && !setsom_found) in get_framesize()
2002 if (common->mark_ptr != 0 && !setmark_found) in get_framesize()
2007 if (common->capture_last_ptr != 0 && !capture_last_found) in get_framesize()
2020 if (common->capture_last_ptr != 0 && !capture_last_found) in get_framesize()
2031 if (common->control_head_ptr != 0) in get_framesize()
2107 cc = next_opcode(common, cc); in get_framesize()
2121 static void init_frame(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend, int stackpos, int … in init_frame() argument
2139 cc = next_opcode(common, cc); in init_frame()
2147 SLJIT_ASSERT(common->has_set_som); in init_frame()
2164 SLJIT_ASSERT(common->mark_ptr != 0); in init_frame()
2167 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->mark_ptr); in init_frame()
2168 OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, SLJIT_IMM, -common->mark_ptr); in init_frame()
2178 if (common->has_set_som && !setsom_found) in init_frame()
2187 if (common->mark_ptr != 0 && !setmark_found) in init_frame()
2189 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->mark_ptr); in init_frame()
2190 OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, SLJIT_IMM, -common->mark_ptr); in init_frame()
2196 if (common->capture_last_ptr != 0 && !capture_last_found) in init_frame()
2198 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr); in init_frame()
2199 OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, SLJIT_IMM, -common->capture_last_ptr); in init_frame()
2212 if (common->capture_last_ptr != 0 && !capture_last_found) in init_frame()
2214 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr); in init_frame()
2215 OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, SLJIT_IMM, -common->capture_last_ptr); in init_frame()
2235 cc = next_opcode(common, cc); in init_frame()
2255 static void delayed_mem_copy_init(delayed_mem_copy_status *status, compiler_common *common) in delayed_mem_copy_init() argument
2267 status->compiler = common->compiler; in delayed_mem_copy_init()
2321 static BOOL recurse_check_bit(compiler_common *common, sljit_sw bit_index) in recurse_check_bit() argument
2331 byte = common->recurse_bitset + (bit_index >> 3); in recurse_check_bit()
2340 static int get_recurse_data_length(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend, in get_recurse_data_length() argument
2352 memset(common->recurse_bitset, 0, common->recurse_bitset_size); in get_recurse_data_length()
2355 SLJIT_ASSERT(common->control_head_ptr != 0); in get_recurse_data_length()
2366 SLJIT_ASSERT(common->has_set_som); in get_recurse_data_length()
2372 if (common->has_set_som) in get_recurse_data_length()
2374 if (common->mark_ptr != 0) in get_recurse_data_length()
2376 if (common->capture_last_ptr != 0 && recurse_check_bit(common, common->capture_last_ptr)) in get_recurse_data_length()
2385 if (recurse_check_bit(common, offset)) in get_recurse_data_length()
2406 if (recurse_check_bit(common, PRIVATE_DATA(cc))) in get_recurse_data_length()
2414 if (recurse_check_bit(common, OVECTOR(offset << 1))) in get_recurse_data_length()
2416 SLJIT_ASSERT(recurse_check_bit(common, OVECTOR((offset << 1) + 1))); in get_recurse_data_length()
2419 if (common->optimized_cbracket[offset] == 0 && recurse_check_bit(common, OVECTOR_PRIV(offset))) in get_recurse_data_length()
2421 if (common->capture_last_ptr != 0 && recurse_check_bit(common, common->capture_last_ptr)) in get_recurse_data_length()
2429 if (recurse_check_bit(common, OVECTOR(offset << 1))) in get_recurse_data_length()
2431 SLJIT_ASSERT(recurse_check_bit(common, OVECTOR((offset << 1) + 1))); in get_recurse_data_length()
2434 if (recurse_check_bit(common, OVECTOR_PRIV(offset))) in get_recurse_data_length()
2436 if (recurse_check_bit(common, PRIVATE_DATA(cc))) in get_recurse_data_length()
2438 if (common->capture_last_ptr != 0 && recurse_check_bit(common, common->capture_last_ptr)) in get_recurse_data_length()
2446 …if ((*alternative == OP_KETRMAX || *alternative == OP_KETRMIN) && recurse_check_bit(common, PRIVAT… in get_recurse_data_length()
2453 if (offset != 0 && recurse_check_bit(common, offset)) in get_recurse_data_length()
2457 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in get_recurse_data_length()
2463 if (offset != 0 && recurse_check_bit(common, offset)) in get_recurse_data_length()
2465 SLJIT_ASSERT(recurse_check_bit(common, offset + sizeof(sljit_sw))); in get_recurse_data_length()
2470 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in get_recurse_data_length()
2476 if (offset != 0 && recurse_check_bit(common, offset)) in get_recurse_data_length()
2478 SLJIT_ASSERT(recurse_check_bit(common, offset + sizeof(sljit_sw))); in get_recurse_data_length()
2483 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in get_recurse_data_length()
2489 if (offset != 0 && recurse_check_bit(common, offset)) in get_recurse_data_length()
2496 if (offset != 0 && recurse_check_bit(common, offset)) in get_recurse_data_length()
2498 SLJIT_ASSERT(recurse_check_bit(common, offset + sizeof(sljit_sw))); in get_recurse_data_length()
2506 if (offset != 0 && recurse_check_bit(common, offset)) in get_recurse_data_length()
2508 SLJIT_ASSERT(recurse_check_bit(common, offset + sizeof(sljit_sw))); in get_recurse_data_length()
2524 if (offset != 0 && recurse_check_bit(common, offset)) in get_recurse_data_length()
2533 SLJIT_ASSERT(common->mark_ptr != 0); in get_recurse_data_length()
2536 if (common->control_head_ptr != 0) in get_recurse_data_length()
2557 SLJIT_ASSERT(common->control_head_ptr != 0); in get_recurse_data_length()
2570 cc = next_opcode(common, cc); in get_recurse_data_length()
2601 static void copy_recurse_data(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend, in copy_recurse_data() argument
2612 memset(common->recurse_bitset, 0, common->recurse_bitset_size); in copy_recurse_data()
2615 SLJIT_ASSERT(common->control_head_ptr != 0); in copy_recurse_data()
2616 recurse_check_bit(common, common->control_head_ptr); in copy_recurse_data()
2666 delayed_mem_copy_init(&status, common); in copy_recurse_data()
2673 delayed_mem_copy_move(&status, base_reg, stackptr, SLJIT_SP, common->recursive_head_ptr); in copy_recurse_data()
2676 delayed_mem_copy_move(&status, SLJIT_SP, common->recursive_head_ptr, base_reg, stackptr); in copy_recurse_data()
2685 delayed_mem_copy_move(&status, base_reg, stackptr, SLJIT_SP, common->control_head_ptr); in copy_recurse_data()
2688 delayed_mem_copy_move(&status, SLJIT_SP, common->control_head_ptr, base_reg, stackptr); in copy_recurse_data()
2703 SLJIT_ASSERT(common->has_set_som); in copy_recurse_data()
2704 if (has_quit && recurse_check_bit(common, OVECTOR(0))) in copy_recurse_data()
2715 if (common->has_set_som && recurse_check_bit(common, OVECTOR(0))) in copy_recurse_data()
2720 if (common->mark_ptr != 0 && recurse_check_bit(common, common->mark_ptr)) in copy_recurse_data()
2722 kept_shared_srcw[kept_shared_count] = common->mark_ptr; in copy_recurse_data()
2726 if (common->capture_last_ptr != 0 && recurse_check_bit(common, common->capture_last_ptr)) in copy_recurse_data()
2728 shared_srcw[0] = common->capture_last_ptr; in copy_recurse_data()
2738 if (recurse_check_bit(common, private_srcw[0])) in copy_recurse_data()
2759 if (recurse_check_bit(common, private_srcw[0])) in copy_recurse_data()
2768 if (recurse_check_bit(common, shared_srcw[0])) in copy_recurse_data()
2771 SLJIT_ASSERT(recurse_check_bit(common, shared_srcw[1])); in copy_recurse_data()
2775 if (common->capture_last_ptr != 0 && recurse_check_bit(common, common->capture_last_ptr)) in copy_recurse_data()
2777 shared_srcw[shared_count] = common->capture_last_ptr; in copy_recurse_data()
2781 if (common->optimized_cbracket[offset] == 0) in copy_recurse_data()
2784 if (recurse_check_bit(common, private_srcw[0])) in copy_recurse_data()
2795 if (recurse_check_bit(common, shared_srcw[0])) in copy_recurse_data()
2798 SLJIT_ASSERT(recurse_check_bit(common, shared_srcw[1])); in copy_recurse_data()
2802 if (common->capture_last_ptr != 0 && recurse_check_bit(common, common->capture_last_ptr)) in copy_recurse_data()
2804 shared_srcw[shared_count] = common->capture_last_ptr; in copy_recurse_data()
2809 if (recurse_check_bit(common, private_srcw[0])) in copy_recurse_data()
2813 if (recurse_check_bit(common, offset)) in copy_recurse_data()
2827 if (recurse_check_bit(common, private_srcw[0])) in copy_recurse_data()
2835 if (private_srcw[0] != 0 && recurse_check_bit(common, private_srcw[0])) in copy_recurse_data()
2839 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in copy_recurse_data()
2845 if (private_srcw[0] != 0 && recurse_check_bit(common, private_srcw[0])) in copy_recurse_data()
2849 SLJIT_ASSERT(recurse_check_bit(common, private_srcw[1])); in copy_recurse_data()
2853 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in copy_recurse_data()
2859 if (private_srcw[0] != 0 && recurse_check_bit(common, private_srcw[0])) in copy_recurse_data()
2863 SLJIT_ASSERT(recurse_check_bit(common, private_srcw[1])); in copy_recurse_data()
2867 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in copy_recurse_data()
2873 if (private_srcw[0] != 0 && recurse_check_bit(common, private_srcw[0])) in copy_recurse_data()
2880 if (private_srcw[0] != 0 && recurse_check_bit(common, private_srcw[0])) in copy_recurse_data()
2884 SLJIT_ASSERT(recurse_check_bit(common, private_srcw[1])); in copy_recurse_data()
2891 if (private_srcw[0] != 0 && recurse_check_bit(common, private_srcw[0])) in copy_recurse_data()
2895 SLJIT_ASSERT(recurse_check_bit(common, private_srcw[1])); in copy_recurse_data()
2917 if (recurse_check_bit(common, private_srcw[0])) in copy_recurse_data()
2921 SLJIT_ASSERT(recurse_check_bit(common, private_srcw[1])); in copy_recurse_data()
2936 SLJIT_ASSERT(common->mark_ptr != 0); in copy_recurse_data()
2937 if (has_quit && recurse_check_bit(common, common->mark_ptr)) in copy_recurse_data()
2939 kept_shared_srcw[0] = common->mark_ptr; in copy_recurse_data()
2942 if (common->control_head_ptr != 0 && recurse_check_bit(common, common->control_head_ptr)) in copy_recurse_data()
2944 private_srcw[0] = common->control_head_ptr; in copy_recurse_data()
2951 SLJIT_ASSERT(common->control_head_ptr != 0); in copy_recurse_data()
2952 if (recurse_check_bit(common, common->control_head_ptr)) in copy_recurse_data()
2954 private_srcw[0] = common->control_head_ptr; in copy_recurse_data()
2961 cc = next_opcode(common, cc); in copy_recurse_data()
3032 static SLJIT_INLINE PCRE2_SPTR set_then_offsets(compiler_common *common, PCRE2_SPTR cc, sljit_u8 *c… in set_then_offsets() argument
3044 cc = next_opcode(common, cc); in set_then_offsets()
3046 current_offset = common->then_offsets + (cc - common->start); in set_then_offsets()
3051 cc = set_then_offsets(common, cc, current_offset); in set_then_offsets()
3055 current_offset = common->then_offsets + (cc + 1 + LINK_SIZE - common->start); in set_then_offsets()
3058 cc = next_opcode(common, cc); in set_then_offsets()
3099 static void add_stub(compiler_common *common, struct sljit_jump *start) in add_stub() argument
3108 list_item->next = common->stubs; in add_stub()
3109 common->stubs = list_item; in add_stub()
3113 static void flush_stubs(compiler_common *common) in flush_stubs() argument
3116 stub_list *list_item = common->stubs; in flush_stubs()
3121 add_jump(compiler, &common->stackalloc, JUMP(SLJIT_FAST_CALL)); in flush_stubs()
3125 common->stubs = NULL; in flush_stubs()
3128 static SLJIT_INLINE void count_match(compiler_common *common) in count_match() argument
3133 add_jump(compiler, &common->calllimit, JUMP(SLJIT_ZERO)); in count_match()
3136 static SLJIT_INLINE void allocate_stack(compiler_common *common, int size) in allocate_stack() argument
3150 add_stub(common, CMP(SLJIT_LESS, STACK_TOP, 0, STACK_LIMIT, 0)); in allocate_stack()
3153 static SLJIT_INLINE void free_stack(compiler_common *common, int size) in free_stack() argument
3161 static sljit_uw * allocate_read_only_data(compiler_common *common, sljit_uw size) in allocate_read_only_data() argument
3176 *(void**)result = common->read_only_data_head; in allocate_read_only_data()
3177 common->read_only_data_head = (void *)result; in allocate_read_only_data()
3181 static SLJIT_INLINE void reset_ovector(compiler_common *common, int length) in reset_ovector() argument
3220 static SLJIT_INLINE void reset_early_fail(compiler_common *common) in reset_early_fail() argument
3223 sljit_u32 size = (sljit_u32)(common->early_fail_end_ptr - common->early_fail_start_ptr); in reset_early_fail()
3229 SLJIT_ASSERT(common->early_fail_start_ptr < common->early_fail_end_ptr); in reset_early_fail()
3233 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->early_fail_start_ptr, SLJIT_IMM, 0); in reset_early_fail()
3245 for (i = common->early_fail_start_ptr; i < common->early_fail_end_ptr; i += sizeof(sljit_sw)) in reset_early_fail()
3250 GET_LOCAL_BASE(TMP1, 0, common->early_fail_start_ptr); in reset_early_fail()
3270 static SLJIT_INLINE void do_reset_match(compiler_common *common, int length) in do_reset_match() argument
3313 if (common->mark_ptr != 0) in do_reset_match()
3314 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->mark_ptr, SLJIT_IMM, 0); in do_reset_match()
3315 if (common->control_head_ptr != 0) in do_reset_match()
3316 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_IMM, 0); in do_reset_match()
3320 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->start_ptr); in do_reset_match()
3348 static SLJIT_INLINE void copy_ovector(compiler_common *common, int topbracket) in copy_ovector() argument
3361 OP1(SLJIT_MOV, SLJIT_S0, 0, SLJIT_MEM1(SLJIT_SP), common->start_ptr); in copy_ovector()
3362 if (common->mark_ptr != 0) in copy_ovector()
3363 OP1(SLJIT_MOV, SLJIT_R2, 0, SLJIT_MEM1(SLJIT_SP), common->mark_ptr); in copy_ovector()
3366 if (common->mark_ptr != 0) in copy_ovector()
3373 OP1(SLJIT_MOV, SLJIT_S0, 0, SLJIT_MEM1(SLJIT_SP), common->start_ptr); in copy_ovector()
3375 if (common->mark_ptr != 0) in copy_ovector()
3376 OP1(SLJIT_MOV, SLJIT_R0, 0, SLJIT_MEM1(SLJIT_SP), common->mark_ptr); in copy_ovector()
3379 if (common->mark_ptr != 0) in copy_ovector()
3445 static SLJIT_INLINE void return_with_partial_match(compiler_common *common, struct sljit_label *qui… in return_with_partial_match() argument
3452 SLJIT_ASSERT(common->start_used_ptr != 0 && common->start_ptr != 0 in return_with_partial_match()
3453 && (common->mode == PCRE2_JIT_PARTIAL_SOFT ? common->hit_start != 0 : common->hit_start == 0)); in return_with_partial_match()
3458 common->mode == PCRE2_JIT_PARTIAL_SOFT ? common->hit_start : common->start_ptr); in return_with_partial_match()
3483 static SLJIT_INLINE void check_start_used_ptr(compiler_common *common) in check_start_used_ptr() argument
3489 if (common->mode == PCRE2_JIT_PARTIAL_SOFT) in check_start_used_ptr()
3492 OP2(SLJIT_ADD, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, SLJIT_IMM, 1); in check_start_used_ptr()
3496 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0); in check_start_used_ptr()
3499 else if (common->mode == PCRE2_JIT_PARTIAL_HARD) in check_start_used_ptr()
3501 jump = CMP(SLJIT_LESS_EQUAL, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0); in check_start_used_ptr()
3502 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0); in check_start_used_ptr()
3507 static SLJIT_INLINE BOOL char_has_othercase(compiler_common *common, PCRE2_SPTR cc) in char_has_othercase() argument
3513 if (common->utf || common->ucp) in char_has_othercase()
3515 if (common->utf) in char_has_othercase()
3525 return common->fcc[c] != c; in char_has_othercase()
3530 return MAX_255(c) ? common->fcc[c] != c : FALSE; in char_has_othercase()
3533 static SLJIT_INLINE unsigned int char_othercase(compiler_common *common, unsigned int c) in char_othercase() argument
3537 if ((common->utf || common->ucp) && c > 127) in char_othercase()
3540 return TABLE_GET(c, common->fcc, c); in char_othercase()
3543 static unsigned int char_get_othercase_bit(compiler_common *common, PCRE2_SPTR cc) in char_get_othercase_bit() argument
3552 if (common->utf || common->ucp) in char_get_othercase_bit()
3554 if (common->utf) in char_get_othercase_bit()
3562 oc = common->fcc[c]; in char_get_othercase_bit()
3569 oc = TABLE_GET(c, common->fcc, c); in char_get_othercase_bit()
3573 oc = TABLE_GET(c, common->fcc, c); in char_get_othercase_bit()
3590 if (common->utf && c > 127) in char_get_othercase_bit()
3606 if (common->utf && c > 65535) in char_get_othercase_bit()
3619 static void check_partial(compiler_common *common, BOOL force) in check_partial() argument
3625 SLJIT_ASSERT(!force || common->mode != PCRE2_JIT_COMPLETE); in check_partial()
3627 if (common->mode == PCRE2_JIT_COMPLETE) in check_partial()
3630 if (!force && !common->allow_empty_partial) in check_partial()
3631 jump = CMP(SLJIT_GREATER_EQUAL, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0); in check_partial()
3632 else if (common->mode == PCRE2_JIT_PARTIAL_SOFT) in check_partial()
3633 jump = CMP(SLJIT_EQUAL, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, SLJIT_IMM, -1); in check_partial()
3635 if (common->mode == PCRE2_JIT_PARTIAL_SOFT) in check_partial()
3636 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, 0); in check_partial()
3639 if (common->partialmatchlabel != NULL) in check_partial()
3640 JUMPTO(SLJIT_JUMP, common->partialmatchlabel); in check_partial()
3642 add_jump(compiler, &common->partialmatch, JUMP(SLJIT_JUMP)); in check_partial()
3649 static void check_str_end(compiler_common *common, jump_list **end_reached) in check_str_end() argument
3655 if (common->mode == PCRE2_JIT_COMPLETE) in check_str_end()
3662 if (common->mode == PCRE2_JIT_PARTIAL_SOFT) in check_str_end()
3664 …add_jump(compiler, end_reached, CMP(SLJIT_GREATER_EQUAL, SLJIT_MEM1(SLJIT_SP), common->start_used_… in check_str_end()
3665 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, 0); in check_str_end()
3670 …add_jump(compiler, end_reached, CMP(SLJIT_GREATER_EQUAL, SLJIT_MEM1(SLJIT_SP), common->start_used_… in check_str_end()
3671 if (common->partialmatchlabel != NULL) in check_str_end()
3672 JUMPTO(SLJIT_JUMP, common->partialmatchlabel); in check_str_end()
3674 add_jump(compiler, &common->partialmatch, JUMP(SLJIT_JUMP)); in check_str_end()
3679 static void detect_partial_match(compiler_common *common, jump_list **backtracks) in detect_partial_match() argument
3684 if (common->mode == PCRE2_JIT_COMPLETE) in detect_partial_match()
3692 if (!common->allow_empty_partial) in detect_partial_match()
3693 …add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, SLJIT_MEM1(SLJIT_SP), common->start_used_p… in detect_partial_match()
3694 else if (common->mode == PCRE2_JIT_PARTIAL_SOFT) in detect_partial_match()
3695 …add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, SLJI… in detect_partial_match()
3697 if (common->mode == PCRE2_JIT_PARTIAL_SOFT) in detect_partial_match()
3699 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, 0); in detect_partial_match()
3704 if (common->partialmatchlabel != NULL) in detect_partial_match()
3705 JUMPTO(SLJIT_JUMP, common->partialmatchlabel); in detect_partial_match()
3707 add_jump(compiler, &common->partialmatch, JUMP(SLJIT_JUMP)); in detect_partial_match()
3712 static void process_partial_match(compiler_common *common) in process_partial_match() argument
3718 if (common->mode == PCRE2_JIT_PARTIAL_SOFT) in process_partial_match()
3720 jump = CMP(SLJIT_GREATER_EQUAL, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0); in process_partial_match()
3721 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, 0); in process_partial_match()
3724 else if (common->mode == PCRE2_JIT_PARTIAL_HARD) in process_partial_match()
3726 if (common->partialmatchlabel != NULL) in process_partial_match()
3727 …CMPTO(SLJIT_LESS, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0, common->partialmatchla… in process_partial_match()
3729 …add_jump(compiler, &common->partialmatch, CMP(SLJIT_LESS, SLJIT_MEM1(SLJIT_SP), common->start_used… in process_partial_match()
3733 static void detect_partial_match_to(compiler_common *common, struct sljit_label *label) in detect_partial_match_to() argument
3738 process_partial_match(common); in detect_partial_match_to()
3741 static void peek_char(compiler_common *common, sljit_u32 max, sljit_s32 dst, sljit_sw dstw, jump_li… in peek_char() argument
3759 if (common->utf) in peek_char()
3766 …add_jump(compiler, common->invalid_utf ? &common->utfreadchar_invalid : &common->utfreadchar, JUMP… in peek_char()
3768 if (backtracks && common->invalid_utf) in peek_char()
3773 if (common->utf) in peek_char()
3779 if (common->invalid_utf) in peek_char()
3784 add_jump(compiler, &common->utfreadchar_invalid, JUMP(SLJIT_FAST_CALL)); in peek_char()
3786 if (backtracks && common->invalid_utf) in peek_char()
3802 if (common->invalid_utf) in peek_char()
3825 static void peek_char_back(compiler_common *common, sljit_u32 max, jump_list **backtracks) in peek_char_back() argument
3842 if (common->utf) in peek_char_back()
3847 if (common->invalid_utf) in peek_char_back()
3849 add_jump(compiler, &common->utfpeakcharback_invalid, JUMP(SLJIT_FAST_CALL)); in peek_char_back()
3854 add_jump(compiler, &common->utfpeakcharback, JUMP(SLJIT_FAST_CALL)); in peek_char_back()
3858 if (common->utf) in peek_char_back()
3862 if (common->invalid_utf) in peek_char_back()
3865 add_jump(compiler, &common->utfpeakcharback_invalid, JUMP(SLJIT_FAST_CALL)); in peek_char_back()
3883 if (common->invalid_utf) in peek_char_back()
3898 static void read_char(compiler_common *common, sljit_u32 min, sljit_u32 max, in read_char() argument
3923 if (common->utf) in read_char()
3927 if (common->invalid_utf && !(options & READ_CHAR_VALID_UTF)) in read_char()
3932 add_jump(compiler, &common->utfreadnewline_invalid, JUMP(SLJIT_FAST_CALL)); in read_char()
3934 add_jump(compiler, &common->utfreadchar_invalid, JUMP(SLJIT_FAST_CALL)); in read_char()
3989 add_jump(compiler, &common->utfreadchar, JUMP(SLJIT_FAST_CALL)); in read_char()
4013 if (common->utf) in read_char()
4017 if (common->invalid_utf && !(options & READ_CHAR_VALID_UTF)) in read_char()
4023 add_jump(compiler, &common->utfreadnewline_invalid, JUMP(SLJIT_FAST_CALL)); in read_char()
4025 add_jump(compiler, &common->utfreadchar_invalid, JUMP(SLJIT_FAST_CALL)); in read_char()
4071 if (common->invalid_utf) in read_char()
4111 static void read_char7_type(compiler_common *common, jump_list **backtracks, BOOL negated) in read_char7_type() argument
4119 SLJIT_ASSERT(common->utf); in read_char7_type()
4125 OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); in read_char7_type()
4131 if (common->invalid_utf) in read_char7_type()
4133 add_jump(compiler, &common->utfreadchar_invalid, JUMP(SLJIT_FAST_CALL)); in read_char7_type()
4148 static void read_char8_type(compiler_common *common, jump_list **backtracks, BOOL negated) in read_char8_type() argument
4166 if (common->utf) in read_char8_type()
4169 OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); in read_char8_type()
4174 if (common->invalid_utf) in read_char8_type()
4180 if (common->invalid_utf) in read_char8_type()
4186 if (common->invalid_utf) in read_char8_type()
4191 OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); in read_char8_type()
4194 else if (common->invalid_utf) in read_char8_type()
4196 add_jump(compiler, &common->utfreadchar_invalid, JUMP(SLJIT_FAST_CALL)); in read_char8_type()
4202 OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); in read_char8_type()
4206 add_jump(compiler, &common->utfreadtype8, JUMP(SLJIT_FAST_CALL)); in read_char8_type()
4214 if (common->invalid_utf && negated) in read_char8_type()
4223 OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); in read_char8_type()
4229 if (common->utf && negated) in read_char8_type()
4232 if (!common->invalid_utf) in read_char8_type()
4267 static void move_back(compiler_common *common, jump_list **backtracks, BOOL must_be_valid) in move_back() argument
4282 if (common->utf) in move_back()
4284 if (!must_be_valid && common->invalid_utf) in move_back()
4289 add_jump(compiler, &common->utfmoveback_invalid, JUMP(SLJIT_FAST_CALL)); in move_back()
4304 if (common->utf) in move_back()
4309 if (!must_be_valid && common->invalid_utf) in move_back()
4313 add_jump(compiler, &common->utfmoveback_invalid, JUMP(SLJIT_FAST_CALL)); in move_back()
4329 if (common->invalid_utf && !must_be_valid) in move_back()
4354 static void check_newlinechar(compiler_common *common, int nltype, jump_list **backtracks, BOOL jum… in check_newlinechar() argument
4362 add_jump(compiler, &common->anynewline, JUMP(SLJIT_FAST_CALL)); in check_newlinechar()
4382 SLJIT_ASSERT(nltype == NLTYPE_FIXED && common->newline < 256); in check_newlinechar()
4383 …backtracks, CMP(jumpifmatch ? SLJIT_EQUAL : SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, common->newline)); in check_newlinechar()
4390 static void do_utfreadchar(compiler_common *common) in do_utfreadchar() argument
4435 static void do_utfreadtype8(compiler_common *common) in do_utfreadtype8() argument
4456 OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); in do_utfreadtype8()
4471 static void do_utfreadchar_invalid(compiler_common *common) in do_utfreadchar_invalid() argument
4630 static void do_utfreadnewline_invalid(compiler_common *common) in do_utfreadnewline_invalid() argument
4643 if (common->nltype != NLTYPE_ANY) in do_utfreadnewline_invalid()
4645 SLJIT_ASSERT(common->nltype != NLTYPE_FIXED || common->newline < 128); in do_utfreadnewline_invalid()
4721 static void do_utfmoveback_invalid(compiler_common *common) in do_utfmoveback_invalid() argument
4817 static void do_utfpeakcharback(compiler_common *common) in do_utfpeakcharback() argument
4854 static void do_utfpeakcharback_invalid(compiler_common *common) in do_utfpeakcharback_invalid() argument
4990 static void do_utfreadchar_invalid(compiler_common *common) in do_utfreadchar_invalid() argument
5022 static void do_utfreadnewline_invalid(compiler_common *common) in do_utfreadnewline_invalid() argument
5054 static void do_utfmoveback_invalid(compiler_common *common) in do_utfmoveback_invalid() argument
5082 static void do_utfpeakcharback_invalid(compiler_common *common) in do_utfpeakcharback_invalid() argument
5120 static void do_getucd(compiler_common *common) in do_getucd() argument
5141 if (!common->utf) in do_getucd()
5160 static void do_getucdtype(compiler_common *common) in do_getucdtype() argument
5181 if (!common->utf) in do_getucdtype()
5209 static SLJIT_INLINE struct sljit_label *mainloop_entry(compiler_common *common) in mainloop_entry() argument
5222 sljit_u32 overall_options = common->re->overall_options; in mainloop_entry()
5223 BOOL hascrorlf = (common->re->flags & PCRE2_HASCRORLF) != 0; in mainloop_entry()
5228 && (common->nltype == NLTYPE_ANY || common->nltype == NLTYPE_ANYCRLF || common->newline > 255)) in mainloop_entry()
5231 SLJIT_ASSERT(common->abort_label == NULL); in mainloop_entry()
5236 SLJIT_ASSERT(common->match_end_ptr != 0); in mainloop_entry()
5239 if (common->nltype == NLTYPE_FIXED && common->newline > 255) in mainloop_entry()
5246 CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff, mainloop); in mainloop_entry()
5247 CMPTO(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, common->newline & 0xff, mainloop); in mainloop_entry()
5249 … OP2(SLJIT_SUB, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); in mainloop_entry()
5256 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr, STR_PTR, 0); in mainloop_entry()
5257 read_char(common, common->nlmin, common->nlmax, NULL, READ_CHAR_NEWLINE); in mainloop_entry()
5258 check_newlinechar(common, common->nltype, &newline, TRUE); in mainloop_entry()
5261 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr, STR_PTR, 0); in mainloop_entry()
5270 SLJIT_ASSERT(common->match_end_ptr != 0); in mainloop_entry()
5298 add_jump(compiler, &common->abort, CMP(SLJIT_LESS, TMP2, 0, STR_PTR, 0)); in mainloop_entry()
5300 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr, TMP2, 0); in mainloop_entry()
5311 OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, common->newline & 0xff); in mainloop_entry()
5324 if (common->utf && !common->invalid_utf) readuchar = TRUE; in mainloop_entry()
5332 CMPTO(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff, newlinelabel); in mainloop_entry()
5337 if (common->invalid_utf) in mainloop_entry()
5349 else if (common->utf) in mainloop_entry()
5357 if (common->invalid_utf) in mainloop_entry()
5369 else if (common->utf) in mainloop_entry()
5435 static int scan_prefix(compiler_common *common, PCRE2_SPTR cc, fast_forward_char_data *chars, int m… in scan_prefix() argument
5528 if (common->utf && HAS_EXTRALEN(*cc)) len += GET_EXTRALEN(*cc); in scan_prefix()
5530 max_chars = scan_prefix(common, cc + len, chars, max_chars, rec_count); in scan_prefix()
5552 max_chars = scan_prefix(common, alternative + 1 + LINK_SIZE, chars, max_chars, rec_count); in scan_prefix()
5565 if (common->utf && !is_char7_bitset((const sljit_u8 *)(cc + 1), FALSE)) in scan_prefix()
5573 if (common->utf) return consumed; in scan_prefix()
5581 if (common->utf) return consumed; in scan_prefix()
5590 …if (common->utf && !is_char7_bitset((const sljit_u8 *)common->ctypes - cbit_length + cbit_digit, F… in scan_prefix()
5599 …if (common->utf && !is_char7_bitset((const sljit_u8 *)common->ctypes - cbit_length + cbit_space, F… in scan_prefix()
5608 …if (common->utf && !is_char7_bitset((const sljit_u8 *)common->ctypes - cbit_length + cbit_word, FA… in scan_prefix()
5625 if (common->utf) return consumed; in scan_prefix()
5635 if (common->utf) return consumed; in scan_prefix()
5650 if (common->utf) return consumed; in scan_prefix()
5691 max_chars = scan_prefix(common, cc + 1, chars, max_chars, rec_count); in scan_prefix()
5777 if (common->utf && HAS_EXTRALEN(*cc)) len += GET_EXTRALEN(*cc); in scan_prefix()
5780 if (caseless && char_has_othercase(common, cc)) in scan_prefix()
5783 if (common->utf) in scan_prefix()
5786 if ((int)PRIV(ord2utf)(char_othercase(common, chr), othercase) != len) in scan_prefix()
5794 if (common->ucp && chr > 127) in scan_prefix()
5798 othercase[0] = TABLE_GET(chr, common->fcc, chr); in scan_prefix()
5863 static BOOL check_fast_forward_char_pair_simd(compiler_common *common, fast_forward_char_data *char… in check_fast_forward_char_pair_simd() argument
5904 fast_forward_char_pair_simd(common, max_i, chars[max_i].chars[0], chars[max_i].chars[1], max_j, cha… in check_fast_forward_char_pair_simd()
5910 static void fast_forward_first_char2(compiler_common *common, PCRE2_UCHAR char1, PCRE2_UCHAR char2,… in fast_forward_first_char2() argument
5917 BOOL has_match_end = (common->match_end_ptr != 0); in fast_forward_first_char2()
5919 SLJIT_ASSERT(common->mode == PCRE2_JIT_COMPLETE || offset == 0); in fast_forward_first_char2()
5922 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr); in fast_forward_first_char2()
5940 fast_forward_char_simd(common, char1, char2, offset); in fast_forward_first_char2()
5955 if (common->mode == PCRE2_JIT_COMPLETE) in fast_forward_first_char2()
5956 add_jump(compiler, &common->failed_match, partial_quit); in fast_forward_first_char2()
5980 if (common->utf && offset > 0) in fast_forward_first_char2()
5989 if (common->mode != PCRE2_JIT_COMPLETE) in fast_forward_first_char2()
5996 static SLJIT_INLINE BOOL fast_forward_first_n_chars(compiler_common *common) in fast_forward_first_n_chars() argument
6018 max = scan_prefix(common, common->start, chars, MAX_N_CHARS, &rec_count); in fast_forward_first_n_chars()
6048 if (JIT_HAS_FAST_FORWARD_CHAR_PAIR_SIMD && check_fast_forward_char_pair_simd(common, chars, max)) in fast_forward_first_n_chars()
6079 update_table = (sljit_u8 *)allocate_read_only_data(common, 256); in fast_forward_first_n_chars()
6123 fast_forward_first_char2(common, chars[offset].chars[0], chars[offset].chars[1], offset); in fast_forward_first_n_chars()
6129 if (common->match_end_ptr != 0) in fast_forward_first_n_chars()
6131 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr); in fast_forward_first_n_chars()
6134 add_jump(compiler, &common->failed_match, JUMP(SLJIT_LESS)); in fast_forward_first_n_chars()
6141 add_jump(compiler, &common->failed_match, JUMP(SLJIT_LESS)); in fast_forward_first_n_chars()
6150 add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER, STR_PTR, 0, STR_END, 0)); in fast_forward_first_n_chars()
6191 if (common->utf && offset != 0) in fast_forward_first_n_chars()
6211 if (common->match_end_ptr != 0) in fast_forward_first_n_chars()
6218 static SLJIT_INLINE void fast_forward_first_char(compiler_common *common) in fast_forward_first_char() argument
6220 PCRE2_UCHAR first_char = (PCRE2_UCHAR)(common->re->first_codeunit); in fast_forward_first_char()
6224 if ((common->re->flags & PCRE2_FIRSTCASELESS) != 0) in fast_forward_first_char()
6226 oc = TABLE_GET(first_char, common->fcc, first_char); in fast_forward_first_char()
6228 if (first_char > 127 && (common->utf || common->ucp)) in fast_forward_first_char()
6233 fast_forward_first_char2(common, first_char, oc, 0); in fast_forward_first_char()
6236 static SLJIT_INLINE void fast_forward_newline(compiler_common *common) in fast_forward_newline() argument
6247 if (common->match_end_ptr != 0) in fast_forward_newline()
6250 OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr); in fast_forward_newline()
6253 if (common->nltype == NLTYPE_FIXED && common->newline > 255) in fast_forward_newline()
6256 if (JIT_HAS_FAST_FORWARD_CHAR_PAIR_SIMD && common->mode == PCRE2_JIT_COMPLETE) in fast_forward_newline()
6279 …st_forward_char_pair_simd(common, 1, common->newline & 0xff, common->newline & 0xff, 0, (common->n… in fast_forward_newline()
6312 CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff, loop); in fast_forward_newline()
6313 CMPTO(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, common->newline & 0xff, loop); in fast_forward_newline()
6321 if (common->match_end_ptr != 0) in fast_forward_newline()
6337 if (common->nltype == NLTYPE_ANY) in fast_forward_newline()
6338 move_back(common, NULL, FALSE); in fast_forward_newline()
6343 common->ff_newline_shortcut = loop; in fast_forward_newline()
6346 if (JIT_HAS_FAST_FORWARD_CHAR_SIMD && (common->nltype == NLTYPE_FIXED || common->nltype == NLTYPE_A… in fast_forward_newline()
6348 if (common->nltype == NLTYPE_ANYCRLF) in fast_forward_newline()
6350 fast_forward_char_simd(common, CHAR_CR, CHAR_LF, 0); in fast_forward_newline()
6351 if (common->mode != PCRE2_JIT_COMPLETE) in fast_forward_newline()
6360 fast_forward_char_simd(common, common->newline, common->newline, 0); in fast_forward_newline()
6363 if (common->mode != PCRE2_JIT_COMPLETE) in fast_forward_newline()
6373 read_char(common, common->nlmin, common->nlmax, NULL, READ_CHAR_NEWLINE); in fast_forward_newline()
6375 if (common->nltype == NLTYPE_ANY || common->nltype == NLTYPE_ANYCRLF) in fast_forward_newline()
6377 check_newlinechar(common, common->nltype, &newline, FALSE); in fast_forward_newline()
6381 if (common->nltype == NLTYPE_ANY || common->nltype == NLTYPE_ANYCRLF) in fast_forward_newline()
6405 if (common->match_end_ptr != 0) in fast_forward_newline()
6409 static BOOL optimize_class(compiler_common *common, const sljit_u8 *bits, BOOL nclass, BOOL invert,…
6411 static SLJIT_INLINE void fast_forward_start_bits(compiler_common *common) in fast_forward_start_bits() argument
6414 const sljit_u8 *start_bits = common->re->start_bitmap; in fast_forward_start_bits()
6422 if (common->match_end_ptr != 0) in fast_forward_start_bits()
6424 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr); in fast_forward_start_bits()
6434 if (common->mode == PCRE2_JIT_COMPLETE) in fast_forward_start_bits()
6435 add_jump(compiler, &common->failed_match, partial_quit); in fast_forward_start_bits()
6440 if (!optimize_class(common, start_bits, (start_bits[31] & 0x80) != 0, FALSE, &matches)) in fast_forward_start_bits()
6448 if (common->utf && is_char7_bitset(start_bits, FALSE)) in fast_forward_start_bits()
6476 if (common->mode != PCRE2_JIT_COMPLETE) in fast_forward_start_bits()
6479 if (common->match_end_ptr != 0) in fast_forward_start_bits()
6483 static SLJIT_INLINE jump_list *search_requested_char(compiler_common *common, PCRE2_UCHAR req_char,… in search_requested_char() argument
6494 SLJIT_ASSERT(common->req_char_ptr != 0); in search_requested_char()
6496 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->req_char_ptr); in search_requested_char()
6508 oc = TABLE_GET(req_char, common->fcc, req_char); in search_requested_char()
6510 if (req_char > 127 && (common->utf || common->ucp)) in search_requested_char()
6518 not_found = fast_requested_char_simd(common, req_char, oc); in search_requested_char()
6552 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->req_char_ptr, TMP1, 0); in search_requested_char()
6559 static void do_revertframes(compiler_common *common) in do_revertframes() argument
6613 static void check_wordboundary(compiler_common *common) in check_wordboundary() argument
6637 if (common->invalid_utf) in check_wordboundary()
6639 peek_char_back(common, READ_CHAR_MAX, &invalid_utf1); in check_wordboundary()
6641 if (common->mode != PCRE2_JIT_COMPLETE) in check_wordboundary()
6645 move_back(common, NULL, TRUE); in check_wordboundary()
6646 check_start_used_ptr(common); in check_wordboundary()
6654 if (common->mode == PCRE2_JIT_COMPLETE) in check_wordboundary()
6655 peek_char_back(common, READ_CHAR_MAX, NULL); in check_wordboundary()
6658 move_back(common, NULL, TRUE); in check_wordboundary()
6659 check_start_used_ptr(common); in check_wordboundary()
6660 read_char(common, 0, READ_CHAR_MAX, NULL, READ_CHAR_UPDATE_STR_PTR); in check_wordboundary()
6666 if (common->ucp) in check_wordboundary()
6670 add_jump(compiler, &common->getucdtype, JUMP(SLJIT_FAST_CALL)); in check_wordboundary()
6688 if (common->utf) in check_wordboundary()
6691 OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), common->ctypes); in check_wordboundary()
6704 check_str_end(common, &skipread_list); in check_wordboundary()
6705 peek_char(common, READ_CHAR_MAX, SLJIT_MEM1(SLJIT_SP), LOCALS1, &invalid_utf2); in check_wordboundary()
6712 if (common->ucp) in check_wordboundary()
6716 add_jump(compiler, &common->getucdtype, JUMP(SLJIT_FAST_CALL)); in check_wordboundary()
6735 if (common->utf) in check_wordboundary()
6738 OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP1), common->ctypes); in check_wordboundary()
6755 if (common->invalid_utf) in check_wordboundary()
6759 peek_char(common, READ_CHAR_MAX, SLJIT_MEM1(SLJIT_SP), LOCALS1, NULL); in check_wordboundary()
6774 static BOOL optimize_class_ranges(compiler_common *common, const sljit_u8 *bits, BOOL nclass, BOOL … in optimize_class_ranges() argument
6926 static BOOL optimize_class_chars(compiler_common *common, const sljit_u8 *bits, BOOL nclass, BOOL i… in optimize_class_chars() argument
7027 static BOOL optimize_class(compiler_common *common, const sljit_u8 *bits, BOOL nclass, BOOL invert,… in optimize_class() argument
7030 if (optimize_class_ranges(common, bits, nclass, invert, backtracks)) in optimize_class()
7032 return optimize_class_chars(common, bits, nclass, invert, backtracks); in optimize_class()
7035 static void check_anynewline(compiler_common *common) in check_anynewline() argument
7048 if (common->utf) in check_anynewline()
7062 static void check_hspace(compiler_common *common) in check_hspace() argument
7076 if (common->utf) in check_hspace()
7101 static void check_vspace(compiler_common *common) in check_vspace() argument
7114 if (common->utf) in check_vspace()
7129 static void do_casefulcmp(compiler_common *common) in do_casefulcmp() argument
7209 static void do_caselesscmp(compiler_common *common) in do_caselesscmp() argument
7246 OP1(SLJIT_MOV, lcc_table, 0, SLJIT_IMM, common->lcc); in do_caselesscmp()
7307 static PCRE2_SPTR byte_sequence_compare(compiler_common *common, BOOL caseless, PCRE2_SPTR cc, in byte_sequence_compare() argument
7317 if (caseless && char_has_othercase(common, cc)) in byte_sequence_compare()
7319 othercasebit = char_get_othercase_bit(common, cc); in byte_sequence_compare()
7364 if (common->utf && HAS_EXTRALEN(*cc)) in byte_sequence_compare()
7482 static PCRE2_SPTR compile_char1_matchingpath(compiler_common *common, PCRE2_UCHAR type, PCRE2_SPTR …
7484 static void compile_xclass_matchingpath(compiler_common *common, PCRE2_SPTR cc, jump_list **backtra… in compile_xclass_matchingpath() argument
7494 BOOL utf = common->utf; in compile_xclass_matchingpath()
7567 compile_char1_matchingpath(common, OP_ALLANY, cc, backtracks, FALSE); in compile_xclass_matchingpath()
7613 read_char(common, min, max, backtracks, READ_CHAR_UPDATE_STR_PTR); in compile_xclass_matchingpath()
7617 read_char(common, min, max, (needstype || needsscript) ? backtracks : NULL, 0); in compile_xclass_matchingpath()
7619 read_char(common, min, max, NULL, 0); in compile_xclass_matchingpath()
7628 …if (!optimize_class(common, (const sljit_u8 *)cc, (((const sljit_u8 *)cc)[31] & 0x80) != 0, TRUE, … in compile_xclass_matchingpath()
7655 if (!optimize_class(common, (const sljit_u8 *)cc, FALSE, TRUE, list)) in compile_xclass_matchingpath()
7659 if (common->utf) in compile_xclass_matchingpath()
7671 if (common->utf) in compile_xclass_matchingpath()
7687 if (!common->utf) in compile_xclass_matchingpath()
8082 static PCRE2_SPTR compile_simple_assertion_matchingpath(compiler_common *common, PCRE2_UCHAR type, … in compile_simple_assertion_matchingpath() argument
8117 add_jump(compiler, &common->wordboundary, JUMP(SLJIT_FAST_CALL)); in compile_simple_assertion_matchingpath()
8119 if (common->invalid_utf) in compile_simple_assertion_matchingpath()
8132 if (common->nltype == NLTYPE_FIXED && common->newline > 255) in compile_simple_assertion_matchingpath()
8136 if (common->mode == PCRE2_JIT_COMPLETE) in compile_simple_assertion_matchingpath()
8143 … OP2(SLJIT_SUB | SLJIT_SET_Z, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff); in compile_simple_assertion_matchingpath()
8146 check_partial(common, TRUE); in compile_simple_assertion_matchingpath()
8151 …add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0… in compile_simple_assertion_matchingpath()
8152 … add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, common->newline & 0xff)); in compile_simple_assertion_matchingpath()
8154 else if (common->nltype == NLTYPE_FIXED) in compile_simple_assertion_matchingpath()
8159 add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, common->newline)); in compile_simple_assertion_matchingpath()
8175 if (common->nltype == NLTYPE_ANYCRLF) in compile_simple_assertion_matchingpath()
8184 read_char(common, common->nlmin, common->nlmax, backtracks, READ_CHAR_UPDATE_STR_PTR); in compile_simple_assertion_matchingpath()
8186 add_jump(compiler, &common->anynewline, JUMP(SLJIT_FAST_CALL)); in compile_simple_assertion_matchingpath()
8195 if (common->mode != PCRE2_JIT_COMPLETE) in compile_simple_assertion_matchingpath()
8196 check_partial(common, TRUE); in compile_simple_assertion_matchingpath()
8201 if (common->mode != PCRE2_JIT_COMPLETE) in compile_simple_assertion_matchingpath()
8202 check_partial(common, TRUE); in compile_simple_assertion_matchingpath()
8215 if (!common->endonly) in compile_simple_assertion_matchingpath()
8216 compile_simple_assertion_matchingpath(common, OP_EODN, cc, backtracks); in compile_simple_assertion_matchingpath()
8220 check_partial(common, FALSE); in compile_simple_assertion_matchingpath()
8234 check_partial(common, FALSE); in compile_simple_assertion_matchingpath()
8238 if (common->nltype == NLTYPE_FIXED && common->newline > 255) in compile_simple_assertion_matchingpath()
8242 if (common->mode == PCRE2_JIT_COMPLETE) in compile_simple_assertion_matchingpath()
8248 …add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0… in compile_simple_assertion_matchingpath()
8249 check_partial(common, TRUE); in compile_simple_assertion_matchingpath()
8255 …add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0… in compile_simple_assertion_matchingpath()
8256 … add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, common->newline & 0xff)); in compile_simple_assertion_matchingpath()
8260 peek_char(common, common->nlmax, TMP3, 0, NULL); in compile_simple_assertion_matchingpath()
8261 check_newlinechar(common, common->nltype, backtracks, FALSE); in compile_simple_assertion_matchingpath()
8303 if (!common->alt_circumflex) in compile_simple_assertion_matchingpath()
8306 if (common->nltype == NLTYPE_FIXED && common->newline > 255) in compile_simple_assertion_matchingpath()
8312 …add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0… in compile_simple_assertion_matchingpath()
8313 … add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, common->newline & 0xff)); in compile_simple_assertion_matchingpath()
8317 peek_char_back(common, common->nlmax, backtracks); in compile_simple_assertion_matchingpath()
8318 check_newlinechar(common, common->nltype, backtracks, FALSE); in compile_simple_assertion_matchingpath()
8335 if (common->utf) in compile_simple_assertion_matchingpath()
8340 move_back(common, backtracks, FALSE); in compile_simple_assertion_matchingpath()
8350 check_start_used_ptr(common); in compile_simple_assertion_matchingpath()
8566 static PCRE2_SPTR compile_char1_matchingpath(compiler_common *common, PCRE2_UCHAR type, PCRE2_SPTR … in compile_char1_matchingpath() argument
8584 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
8586 …if (common->utf && is_char7_bitset((const sljit_u8*)common->ctypes - cbit_length + cbit_digit, FAL… in compile_char1_matchingpath()
8587 read_char7_type(common, backtracks, type == OP_NOT_DIGIT); in compile_char1_matchingpath()
8590 read_char8_type(common, backtracks, type == OP_NOT_DIGIT); in compile_char1_matchingpath()
8599 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
8601 …if (common->utf && is_char7_bitset((const sljit_u8*)common->ctypes - cbit_length + cbit_space, FAL… in compile_char1_matchingpath()
8602 read_char7_type(common, backtracks, type == OP_NOT_WHITESPACE); in compile_char1_matchingpath()
8605 read_char8_type(common, backtracks, type == OP_NOT_WHITESPACE); in compile_char1_matchingpath()
8613 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
8615 …if (common->utf && is_char7_bitset((const sljit_u8*)common->ctypes - cbit_length + cbit_word, FALS… in compile_char1_matchingpath()
8616 read_char7_type(common, backtracks, type == OP_NOT_WORDCHAR); in compile_char1_matchingpath()
8619 read_char8_type(common, backtracks, type == OP_NOT_WORDCHAR); in compile_char1_matchingpath()
8626 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
8627 read_char(common, common->nlmin, common->nlmax, backtracks, READ_CHAR_UPDATE_STR_PTR); in compile_char1_matchingpath()
8628 if (common->nltype == NLTYPE_FIXED && common->newline > 255) in compile_char1_matchingpath()
8630 jump[0] = CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff); in compile_char1_matchingpath()
8632 if (common->mode != PCRE2_JIT_PARTIAL_HARD) in compile_char1_matchingpath()
8635 check_str_end(common, &end_list); in compile_char1_matchingpath()
8638 add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, common->newline & 0xff)); in compile_char1_matchingpath()
8643 check_newlinechar(common, common->nltype, backtracks, TRUE); in compile_char1_matchingpath()
8648 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
8650 if (common->utf) in compile_char1_matchingpath()
8652 if (common->invalid_utf) in compile_char1_matchingpath()
8654 read_char(common, 0, READ_CHAR_MAX, backtracks, READ_CHAR_UPDATE_STR_PTR); in compile_char1_matchingpath()
8683 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
8696 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
8697 compile_xclass_matchingpath(common, propdata, backtracks); in compile_char1_matchingpath()
8703 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
8704 read_char(common, common->bsr_nlmin, common->bsr_nlmax, NULL, 0); in compile_char1_matchingpath()
8708 if (common->mode != PCRE2_JIT_PARTIAL_HARD) in compile_char1_matchingpath()
8711 check_str_end(common, &end_list); in compile_char1_matchingpath()
8717 check_newlinechar(common, common->bsr_nltype, backtracks, FALSE); in compile_char1_matchingpath()
8726 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
8729 read_char(common, 0x9, 0x3000, backtracks, READ_CHAR_UPDATE_STR_PTR); in compile_char1_matchingpath()
8731 read_char(common, 0x9, 0x3000, NULL, 0); in compile_char1_matchingpath()
8733 add_jump(compiler, &common->hspace, JUMP(SLJIT_FAST_CALL)); in compile_char1_matchingpath()
8741 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
8744 read_char(common, 0xa, 0x2029, backtracks, READ_CHAR_UPDATE_STR_PTR); in compile_char1_matchingpath()
8746 read_char(common, 0xa, 0x2029, NULL, 0); in compile_char1_matchingpath()
8748 add_jump(compiler, &common->vspace, JUMP(SLJIT_FAST_CALL)); in compile_char1_matchingpath()
8756 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
8763 …common->utf ? (common->invalid_utf ? SLJIT_FUNC_OFFSET(do_extuni_utf_invalid) : SLJIT_FUNC_OFFSET(… in compile_char1_matchingpath()
8764 if (common->invalid_utf) in compile_char1_matchingpath()
8768 …common->invalid_utf ? SLJIT_FUNC_OFFSET(do_extuni_utf_invalid) : SLJIT_FUNC_OFFSET(do_extuni_no_ut… in compile_char1_matchingpath()
8769 if (!common->utf || common->invalid_utf) in compile_char1_matchingpath()
8775 if (common->mode == PCRE2_JIT_PARTIAL_HARD) in compile_char1_matchingpath()
8779 check_partial(common, TRUE); in compile_char1_matchingpath()
8789 if (common->utf && HAS_EXTRALEN(*cc)) length += GET_EXTRALEN(*cc); in compile_char1_matchingpath()
8792 if (check_str_ptr && common->mode != PCRE2_JIT_COMPLETE) in compile_char1_matchingpath()
8793 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
8795 if (type == OP_CHAR || !char_has_othercase(common, cc) || char_get_othercase_bit(common, cc) != 0) in compile_char1_matchingpath()
8798 if (length > 1 || (check_str_ptr && common->mode == PCRE2_JIT_COMPLETE)) in compile_char1_matchingpath()
8806 return byte_sequence_compare(common, type == OP_CHARI, cc, &context, backtracks); in compile_char1_matchingpath()
8810 if (common->utf) in compile_char1_matchingpath()
8818 SLJIT_ASSERT(type == OP_CHARI && char_has_othercase(common, cc)); in compile_char1_matchingpath()
8820 if (check_str_ptr && common->mode == PCRE2_JIT_COMPLETE) in compile_char1_matchingpath()
8823 oc = char_othercase(common, c); in compile_char1_matchingpath()
8824 read_char(common, c < oc ? c : oc, c > oc ? c : oc, NULL, 0); in compile_char1_matchingpath()
8845 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
8849 if (common->utf) in compile_char1_matchingpath()
8853 if (c < 128 && !common->invalid_utf) in compile_char1_matchingpath()
8856 if (type == OP_NOT || !char_has_othercase(common, cc)) in compile_char1_matchingpath()
8882 if (type == OP_NOT || !char_has_othercase(common, cc)) in compile_char1_matchingpath()
8884 read_char(common, c, c, backtracks, READ_CHAR_UPDATE_STR_PTR); in compile_char1_matchingpath()
8889 oc = char_othercase(common, c); in compile_char1_matchingpath()
8890 read_char(common, c < oc ? c : oc, c > oc ? c : oc, backtracks, READ_CHAR_UPDATE_STR_PTR); in compile_char1_matchingpath()
8908 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
8911 bit = (common->utf && is_char7_bitset((const sljit_u8 *)cc, type == OP_NCLASS)) ? 127 : 255; in compile_char1_matchingpath()
8913 read_char(common, 0, bit, backtracks, READ_CHAR_UPDATE_STR_PTR); in compile_char1_matchingpath()
8915 read_char(common, 0, bit, NULL, 0); in compile_char1_matchingpath()
8918 read_char(common, 0, 255, backtracks, READ_CHAR_UPDATE_STR_PTR); in compile_char1_matchingpath()
8920 read_char(common, 0, 255, NULL, 0); in compile_char1_matchingpath()
8923 if (optimize_class(common, (const sljit_u8 *)cc, type == OP_NCLASS, FALSE, backtracks)) in compile_char1_matchingpath()
8928 if (common->utf) in compile_char1_matchingpath()
8962 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
8963 compile_xclass_matchingpath(common, cc + LINK_SIZE, backtracks); in compile_char1_matchingpath()
8971 static SLJIT_INLINE PCRE2_SPTR compile_charn_matchingpath(compiler_common *common, PCRE2_SPTR cc, P… in compile_charn_matchingpath() argument
8990 if (common->utf && HAS_EXTRALEN(cc[1])) in compile_charn_matchingpath()
8998 if (common->utf) in compile_charn_matchingpath()
9000 if (char_has_othercase(common, cc + 1) && char_get_othercase_bit(common, cc + 1) == 0) in compile_charn_matchingpath()
9007 if (char_has_othercase(common, cc + 1) && char_get_othercase_bit(common, cc + 1) == 0) in compile_charn_matchingpath()
9029 …do cc = byte_sequence_compare(common, *cc == OP_CHARI, cc + 1, &context, backtracks); while (conte… in compile_charn_matchingpath()
9034 return compile_char1_matchingpath(common, *cc, cc + 1, backtracks, TRUE); in compile_charn_matchingpath()
9069 static void compile_dnref_search(compiler_common *common, PCRE2_SPTR cc, jump_list **backtracks) in compile_dnref_search() argument
9074 PCRE2_SPTR slot = common->name_table + GET2(cc, 1) * common->name_entry_size; in compile_dnref_search()
9088 slot += common->name_entry_size; in compile_dnref_search()
9093 if (backtracks != NULL && !common->unset_backref) in compile_dnref_search()
9099 static void compile_ref_matchingpath(compiler_common *common, PCRE2_SPTR cc, jump_list **backtracks… in compile_ref_matchingpath() argument
9121 if (withchecks && !common->unset_backref) in compile_ref_matchingpath()
9128 if (common->utf && *cc == OP_REFI) in compile_ref_matchingpath()
9130 SLJIT_ASSERT(common->iref_ptr != 0); in compile_ref_matchingpath()
9140 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->iref_ptr, source_reg, 0); in compile_ref_matchingpath()
9141 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw), source_end_reg, 0); in compile_ref_matchingpath()
9142 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw) * 2, char1_reg, 0); in compile_ref_matchingpath()
9155 read_char(common, 0, READ_CHAR_MAX, NULL, READ_CHAR_UPDATE_STR_PTR | READ_CHAR_VALID_UTF); in compile_ref_matchingpath()
9162 read_char(common, 0, READ_CHAR_MAX, &no_match, READ_CHAR_UPDATE_STR_PTR); in compile_ref_matchingpath()
9168 add_jump(compiler, &common->getucd, JUMP(SLJIT_FAST_CALL)); in compile_ref_matchingpath()
9193 if (common->mode == PCRE2_JIT_COMPLETE) in compile_ref_matchingpath()
9196 OP1(SLJIT_MOV, source_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr); in compile_ref_matchingpath()
9197 OP1(SLJIT_MOV, source_end_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw)); in compile_ref_matchingpath()
9198 OP1(SLJIT_MOV, char1_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw) * 2); in compile_ref_matchingpath()
9201 if (common->mode != PCRE2_JIT_COMPLETE) in compile_ref_matchingpath()
9204 OP1(SLJIT_MOV, source_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr); in compile_ref_matchingpath()
9205 OP1(SLJIT_MOV, source_end_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw)); in compile_ref_matchingpath()
9206 OP1(SLJIT_MOV, char1_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw) * 2); in compile_ref_matchingpath()
9208 check_partial(common, FALSE); in compile_ref_matchingpath()
9213 OP1(SLJIT_MOV, source_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr); in compile_ref_matchingpath()
9214 OP1(SLJIT_MOV, source_end_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw)); in compile_ref_matchingpath()
9215 OP1(SLJIT_MOV, char1_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw) * 2); in compile_ref_matchingpath()
9231 if (common->mode == PCRE2_JIT_COMPLETE) in compile_ref_matchingpath()
9234 …add_jump(compiler, *cc == OP_REF ? &common->casefulcmp : &common->caselesscmp, JUMP(SLJIT_FAST_CAL… in compile_ref_matchingpath()
9237 if (common->mode != PCRE2_JIT_COMPLETE) in compile_ref_matchingpath()
9246 …add_jump(compiler, *cc == OP_REF ? &common->casefulcmp : &common->caselesscmp, JUMP(SLJIT_FAST_CAL… in compile_ref_matchingpath()
9249 check_partial(common, FALSE); in compile_ref_matchingpath()
9264 static SLJIT_INLINE PCRE2_SPTR compile_ref_iterator_matchingpath(compiler_common *common, PCRE2_SPT… in compile_ref_iterator_matchingpath() argument
9323 allocate_stack(common, 2); in compile_ref_iterator_matchingpath()
9336 compile_dnref_search(common, ccbegin, NULL); in compile_ref_iterator_matchingpath()
9346 allocate_stack(common, 1); in compile_ref_iterator_matchingpath()
9357 compile_dnref_search(common, ccbegin, &backtrack->topbacktracks); in compile_ref_iterator_matchingpath()
9370 compile_ref_matchingpath(common, ccbegin, &backtrack->topbacktracks, FALSE, FALSE); in compile_ref_iterator_matchingpath()
9382 allocate_stack(common, 1); in compile_ref_iterator_matchingpath()
9392 allocate_stack(common, 1); in compile_ref_iterator_matchingpath()
9400 count_match(common); in compile_ref_iterator_matchingpath()
9404 allocate_stack(common, ref ? 2 : 3); in compile_ref_iterator_matchingpath()
9419 compile_dnref_search(common, ccbegin, NULL); in compile_ref_iterator_matchingpath()
9437 compile_dnref_search(common, ccbegin, &backtrack->topbacktracks); in compile_ref_iterator_matchingpath()
9450 compile_ref_matchingpath(common, ccbegin, &backtrack->topbacktracks, TRUE, TRUE); in compile_ref_iterator_matchingpath()
9467 count_match(common); in compile_ref_iterator_matchingpath()
9471 static SLJIT_INLINE PCRE2_SPTR compile_recurse_matchingpath(compiler_common *common, PCRE2_SPTR cc,… in compile_recurse_matchingpath() argument
9475 recurse_entry *entry = common->entries; in compile_recurse_matchingpath()
9484 if (get_framesize(common, common->start + start, NULL, TRUE, &needs_control_head) == no_stack) in compile_recurse_matchingpath()
9486 start_cc = common->start + start; in compile_recurse_matchingpath()
9487 …compile_matchingpath(common, next_opcode(common, start_cc), bracketend(start_cc) - (1 + LINK_SIZE)… in compile_recurse_matchingpath()
9515 common->entries = entry; in compile_recurse_matchingpath()
9587 static SLJIT_INLINE PCRE2_SPTR compile_callout_matchingpath(compiler_common *common, PCRE2_SPTR cc,… in compile_callout_matchingpath() argument
9597 sljit_uw callout_arg_size = (common->re->top_bracket + 1) * 2 * sizeof(sljit_sw); in compile_callout_matchingpath()
9603 allocate_stack(common, callout_arg_size); in compile_callout_matchingpath()
9605 SLJIT_ASSERT(common->capture_last_ptr != 0); in compile_callout_matchingpath()
9606 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr); in compile_callout_matchingpath()
9611 OP1(SLJIT_MOV_U32, SLJIT_MEM1(STACK_TOP), CALLOUT_ARG_OFFSET(capture_top), SLJIT_IMM, common->re->t… in compile_callout_matchingpath()
9616 if (common->mark_ptr != 0) in compile_callout_matchingpath()
9638 OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), CALLOUT_ARG_OFFSET(mark), (common->mark_ptr != 0) ? TMP2 : SL… in compile_callout_matchingpath()
9649 free_stack(common, callout_arg_size); in compile_callout_matchingpath()
9654 if (common->abort_label == NULL) in compile_callout_matchingpath()
9655 add_jump(compiler, &common->abort, JUMP(SLJIT_NOT_EQUAL) /* SIG_LESS */); in compile_callout_matchingpath()
9657 JUMPTO(SLJIT_NOT_EQUAL /* SIG_LESS */, common->abort_label); in compile_callout_matchingpath()
9694 static PCRE2_SPTR compile_assert_matchingpath(compiler_common *common, PCRE2_SPTR cc, assert_backtr… in compile_assert_matchingpath() argument
9707 jump_list **target = (conditional) ? &backtrack->condfailed : &backtrack->common.topbacktracks; in compile_assert_matchingpath()
9710 BOOL save_local_quit_available = common->local_quit_available; in compile_assert_matchingpath()
9711 BOOL save_in_positive_assertion = common->in_positive_assertion; in compile_assert_matchingpath()
9712 then_trap_backtrack *save_then_trap = common->then_trap; in compile_assert_matchingpath()
9713 struct sljit_label *save_quit_label = common->quit_label; in compile_assert_matchingpath()
9714 struct sljit_label *save_accept_label = common->accept_label; in compile_assert_matchingpath()
9715 jump_list *save_quit = common->quit; in compile_assert_matchingpath()
9716 jump_list *save_positive_assertion_quit = common->positive_assertion_quit; in compile_assert_matchingpath()
9717 jump_list *save_accept = common->accept; in compile_assert_matchingpath()
9722 common->then_trap = NULL; in compile_assert_matchingpath()
9732 framesize = get_framesize(common, cc, NULL, FALSE, &needs_control_head); in compile_assert_matchingpath()
9745 free_stack(common, 1); in compile_assert_matchingpath()
9762 allocate_stack(common, extrasize); in compile_assert_matchingpath()
9765 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_assert_matchingpath()
9773 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_IMM, 0); in compile_assert_matchingpath()
9780 allocate_stack(common, framesize + extrasize); in compile_assert_matchingpath()
9786 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_assert_matchingpath()
9793 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_IMM, 0); in compile_assert_matchingpath()
9798 init_frame(common, ccbegin, NULL, framesize + extrasize - 1, extrasize); in compile_assert_matchingpath()
9806 common->local_quit_available = TRUE; in compile_assert_matchingpath()
9807 common->quit_label = NULL; in compile_assert_matchingpath()
9808 common->quit = NULL; in compile_assert_matchingpath()
9811 common->in_positive_assertion = (opcode == OP_ASSERT || opcode == OP_ASSERTBACK); in compile_assert_matchingpath()
9812 common->positive_assertion_quit = NULL; in compile_assert_matchingpath()
9816 common->accept_label = NULL; in compile_assert_matchingpath()
9817 common->accept = NULL; in compile_assert_matchingpath()
9825 compile_matchingpath(common, ccbegin + 1 + LINK_SIZE, cc, &altbacktrack); in compile_assert_matchingpath()
9830 common->local_quit_available = save_local_quit_available; in compile_assert_matchingpath()
9831 common->quit_label = save_quit_label; in compile_assert_matchingpath()
9832 common->quit = save_quit; in compile_assert_matchingpath()
9834 common->in_positive_assertion = save_in_positive_assertion; in compile_assert_matchingpath()
9835 common->then_trap = save_then_trap; in compile_assert_matchingpath()
9836 common->accept_label = save_accept_label; in compile_assert_matchingpath()
9837 common->positive_assertion_quit = save_positive_assertion_quit; in compile_assert_matchingpath()
9838 common->accept = save_accept; in compile_assert_matchingpath()
9841 common->accept_label = LABEL(); in compile_assert_matchingpath()
9842 if (common->accept != NULL) in compile_assert_matchingpath()
9843 set_jumps(common->accept, common->accept_label); in compile_assert_matchingpath()
9851 free_stack(common, extrasize); in compile_assert_matchingpath()
9854 … OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_MEM1(STACK_TOP), STACK(-1)); in compile_assert_matchingpath()
9863 … OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_MEM1(STACK_TOP), STACK(-1)); in compile_assert_matchingpath()
9869 …OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_MEM1(STACK_TOP), STACK(-frame… in compile_assert_matchingpath()
9870 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_assert_matchingpath()
9904 compile_backtrackingpath(common, altbacktrack.top); in compile_assert_matchingpath()
9909 common->local_quit_available = save_local_quit_available; in compile_assert_matchingpath()
9910 common->quit_label = save_quit_label; in compile_assert_matchingpath()
9911 common->quit = save_quit; in compile_assert_matchingpath()
9913 common->in_positive_assertion = save_in_positive_assertion; in compile_assert_matchingpath()
9914 common->then_trap = save_then_trap; in compile_assert_matchingpath()
9915 common->accept_label = save_accept_label; in compile_assert_matchingpath()
9916 common->positive_assertion_quit = save_positive_assertion_quit; in compile_assert_matchingpath()
9917 common->accept = save_accept; in compile_assert_matchingpath()
9931 SLJIT_ASSERT(common->positive_assertion_quit == NULL); in compile_assert_matchingpath()
9933 common->positive_assertion_quit = common->quit; in compile_assert_matchingpath()
9937 if (common->positive_assertion_quit != NULL) in compile_assert_matchingpath()
9940 set_jumps(common->positive_assertion_quit, LABEL()); in compile_assert_matchingpath()
9947 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_assert_matchingpath()
9954 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_MEM1(STACK_TOP), STACK(1)); in compile_assert_matchingpath()
9968 free_stack(common, 1); in compile_assert_matchingpath()
9972 free_stack(common, extrasize); in compile_assert_matchingpath()
9980 free_stack(common, framesize + extrasize - 1); in compile_assert_matchingpath()
9984 free_stack(common, framesize + extrasize); in compile_assert_matchingpath()
10051 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_assert_matchingpath()
10056 set_jumps(backtrack->common.topbacktracks, LABEL()); in compile_assert_matchingpath()
10070 free_stack(common, 1); in compile_assert_matchingpath()
10074 free_stack(common, extrasize); in compile_assert_matchingpath()
10083 free_stack(common, framesize + extrasize - 1); in compile_assert_matchingpath()
10087 free_stack(common, framesize + extrasize); in compile_assert_matchingpath()
10101 SLJIT_ASSERT(found == &backtrack->common.topbacktracks); in compile_assert_matchingpath()
10102 set_jumps(backtrack->common.topbacktracks, LABEL()); in compile_assert_matchingpath()
10103 backtrack->common.topbacktracks = NULL; in compile_assert_matchingpath()
10109 common->local_quit_available = save_local_quit_available; in compile_assert_matchingpath()
10110 common->quit_label = save_quit_label; in compile_assert_matchingpath()
10111 common->quit = save_quit; in compile_assert_matchingpath()
10113 common->in_positive_assertion = save_in_positive_assertion; in compile_assert_matchingpath()
10114 common->then_trap = save_then_trap; in compile_assert_matchingpath()
10115 common->accept_label = save_accept_label; in compile_assert_matchingpath()
10116 common->positive_assertion_quit = save_positive_assertion_quit; in compile_assert_matchingpath()
10117 common->accept = save_accept; in compile_assert_matchingpath()
10121 static SLJIT_INLINE void match_once_common(compiler_common *common, PCRE2_UCHAR ket, int framesize,… in match_once_common() argument
10137 free_stack(common, stacksize); in match_once_common()
10166 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, TMP1, 0); in match_once_common()
10169 static SLJIT_INLINE int match_capture_common(compiler_common *common, int stacksize, int offset, in… in match_capture_common() argument
10173 if (common->capture_last_ptr != 0) in match_capture_common()
10175 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr); in match_capture_common()
10176 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr, SLJIT_IMM, offset >> 1); in match_capture_common()
10180 if (common->optimized_cbracket[offset >> 1] == 0) in match_capture_common()
10212 static SLJIT_INLINE void match_script_run_common(compiler_common *common, int private_data_ptr, bac… in match_script_run_common() argument
10221 common->utf ? SLJIT_FUNC_OFFSET(do_script_run_utf) : SLJIT_FUNC_OFFSET(do_script_run)); in match_script_run_common()
10283 static PCRE2_SPTR compile_bracket_matchingpath(compiler_common *common, PCRE2_SPTR cc, backtrack_co… in compile_bracket_matchingpath() argument
10352 if (common->optimized_cbracket[offset] == 0) in compile_bracket_matchingpath()
10372 …BACKTRACK_AS(bracket_backtrack)->u.framesize = get_framesize(common, ccbegin, NULL, FALSE, &needs_… in compile_bracket_matchingpath()
10383 allocate_stack(common, stacksize); in compile_bracket_matchingpath()
10401 free_stack(common, 1); in compile_bracket_matchingpath()
10456 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_bracket_matchingpath()
10478 allocate_stack(common, stacksize); in compile_bracket_matchingpath()
10505 allocate_stack(common, stacksize); in compile_bracket_matchingpath()
10526 …init_frame(common, ccbegin, NULL, BACKTRACK_AS(bracket_backtrack)->u.framesize + stacksize, stacks… in compile_bracket_matchingpath()
10532 if (common->optimized_cbracket[offset >> 1] != 0) in compile_bracket_matchingpath()
10535 allocate_stack(common, 2); in compile_bracket_matchingpath()
10545 allocate_stack(common, 1); in compile_bracket_matchingpath()
10554 allocate_stack(common, 1); in compile_bracket_matchingpath()
10561 allocate_stack(common, 1); in compile_bracket_matchingpath()
10580 slot = common->name_table + GET2(matchingpath, 1) * common->name_entry_size; in compile_bracket_matchingpath()
10584 slot += common->name_entry_size; in compile_bracket_matchingpath()
10590 slot += common->name_entry_size; in compile_bracket_matchingpath()
10612 if (common->currententry == NULL) in compile_bracket_matchingpath()
10616 else if (common->currententry->start == 0) in compile_bracket_matchingpath()
10619 … stacksize = stacksize == (int)GET2(common->start, common->currententry->start + 1 + LINK_SIZE); in compile_bracket_matchingpath()
10626 if (common->currententry == NULL || common->currententry->start == 0) in compile_bracket_matchingpath()
10631 slot = common->name_table + GET2(matchingpath, 1) * common->name_entry_size; in compile_bracket_matchingpath()
10632 i = (int)GET2(common->start, common->currententry->start + 1 + LINK_SIZE); in compile_bracket_matchingpath()
10637 slot += common->name_entry_size; in compile_bracket_matchingpath()
10666 assert->common.cc = matchingpath; in compile_bracket_matchingpath()
10668 matchingpath = compile_assert_matchingpath(common, matchingpath, assert, TRUE); in compile_bracket_matchingpath()
10672 compile_matchingpath(common, matchingpath, cc, backtrack); in compile_bracket_matchingpath()
10680 …match_once_common(common, ket, BACKTRACK_AS(bracket_backtrack)->u.framesize, private_data_ptr, has… in compile_bracket_matchingpath()
10683 match_script_run_common(common, private_data_ptr, backtrack); in compile_bracket_matchingpath()
10696 if (common->capture_last_ptr != 0) in compile_bracket_matchingpath()
10698 if (common->optimized_cbracket[offset >> 1] == 0) in compile_bracket_matchingpath()
10705 allocate_stack(common, stacksize); in compile_bracket_matchingpath()
10725 stacksize = match_capture_common(common, stacksize, offset, private_data_ptr); in compile_bracket_matchingpath()
10749 if (offset != 0 && common->optimized_cbracket[offset >> 1] != 0) in compile_bracket_matchingpath()
10765 free_stack(common, 1); in compile_bracket_matchingpath()
10779 free_stack(common, 1); in compile_bracket_matchingpath()
10792 count_match(common); in compile_bracket_matchingpath()
10800 allocate_stack(common, 1); in compile_bracket_matchingpath()
10820 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_bracket_matchingpath()
10824 free_stack(common, 1); in compile_bracket_matchingpath()
10830 count_match(common); in compile_bracket_matchingpath()
10844 static PCRE2_SPTR compile_bracketpos_matchingpath(compiler_common *common, PCRE2_SPTR cc, backtrack… in compile_bracketpos_matchingpath() argument
10884 SLJIT_ASSERT(common->optimized_cbracket[offset] == 0); in compile_bracketpos_matchingpath()
10895 framesize = get_framesize(common, cc, NULL, FALSE, &needs_control_head); in compile_bracketpos_matchingpath()
10902 if (common->capture_last_ptr != 0) in compile_bracketpos_matchingpath()
10914 allocate_stack(common, stacksize); in compile_bracketpos_matchingpath()
10925 if (common->capture_last_ptr != 0) in compile_bracketpos_matchingpath()
10926 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr); in compile_bracketpos_matchingpath()
10929 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_bracketpos_matchingpath()
10930 if (common->capture_last_ptr != 0) in compile_bracketpos_matchingpath()
10939 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_bracketpos_matchingpath()
10965 allocate_stack(common, stacksize); in compile_bracketpos_matchingpath()
10968 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_bracketpos_matchingpath()
10988 init_frame(common, cc, NULL, stacksize - 1, stacksize - framesize); in compile_bracketpos_matchingpath()
11002 compile_matchingpath(common, ccbegin, cc, backtrack); in compile_bracketpos_matchingpath()
11016 if (common->capture_last_ptr != 0) in compile_bracketpos_matchingpath()
11017 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr, SLJIT_IMM, offset >> 1); in compile_bracketpos_matchingpath()
11029 …OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_MEM1(STACK_TOP), STACK(stack)… in compile_bracketpos_matchingpath()
11045 if (common->capture_last_ptr != 0) in compile_bracketpos_matchingpath()
11046 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr, SLJIT_IMM, offset >> 1); in compile_bracketpos_matchingpath()
11060 …OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_MEM1(STACK_TOP), STACK(stack)… in compile_bracketpos_matchingpath()
11075 flush_stubs(common); in compile_bracketpos_matchingpath()
11077 compile_backtrackingpath(common, backtrack->top); in compile_bracketpos_matchingpath()
11123 count_match(common); in compile_bracketpos_matchingpath()
11127 static SLJIT_INLINE PCRE2_SPTR get_iterator_parameters(compiler_common *common, PCRE2_SPTR cc, PCRE… in get_iterator_parameters() argument
11260 *end = next_opcode(common, cc); in get_iterator_parameters()
11267 if (common->utf && HAS_EXTRALEN(*cc)) *end += GET_EXTRALEN(*cc); in get_iterator_parameters()
11272 static PCRE2_SPTR compile_iterator_matchingpath(compiler_common *common, PCRE2_SPTR cc, backtrack_c… in compile_iterator_matchingpath() argument
11304 if (common->early_fail_start_ptr == 0 && common->fast_forward_bc_ptr == NULL) in compile_iterator_matchingpath()
11310 SLJIT_ASSERT(common->fast_forward_bc_ptr != NULL || early_fail_ptr == 0 in compile_iterator_matchingpath()
11311 …|| (early_fail_ptr >= common->early_fail_start_ptr && early_fail_ptr <= common->early_fail_end_ptr… in compile_iterator_matchingpath()
11316 cc = get_iterator_parameters(common, cc, &opcode, &type, &max, &exact, &end); in compile_iterator_matchingpath()
11334 if (common->mode == PCRE2_JIT_COMPLETE in compile_iterator_matchingpath()
11336 && !common->utf in compile_iterator_matchingpath()
11344 compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks, FALSE); in compile_iterator_matchingpath()
11352 compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks, TRUE); in compile_iterator_matchingpath()
11359 compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks, TRUE); in compile_iterator_matchingpath()
11384 allocate_stack(common, 2); in compile_iterator_matchingpath()
11392 …compile_char1_matchingpath(common, type, cc, &BACKTRACK_AS(char_iterator_backtrack)->u.backtracks,… in compile_iterator_matchingpath()
11402 allocate_stack(common, 1); in compile_iterator_matchingpath()
11411 else if (type == OP_ALLANY && !common->invalid_utf) in compile_iterator_matchingpath()
11419 allocate_stack(common, 2); in compile_iterator_matchingpath()
11425 process_partial_match(common); in compile_iterator_matchingpath()
11433 else if (!common->utf) in compile_iterator_matchingpath()
11439 allocate_stack(common, 2); in compile_iterator_matchingpath()
11444 if (common->mode == PCRE2_JIT_COMPLETE) in compile_iterator_matchingpath()
11452 process_partial_match(common); in compile_iterator_matchingpath()
11472 charpos_enabled = !common->utf || !HAS_EXTRALEN(end[1]); in compile_iterator_matchingpath()
11476 if (charpos_enabled && *end == OP_CHARI && char_has_othercase(common, end + 1)) in compile_iterator_matchingpath()
11478 charpos_othercasebit = char_get_othercase_bit(common, end + 1); in compile_iterator_matchingpath()
11517 compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks, FALSE); in compile_iterator_matchingpath()
11522 detect_partial_match(common, &backtrack->topbacktracks); in compile_iterator_matchingpath()
11529 allocate_stack(common, 2); in compile_iterator_matchingpath()
11541 compile_char1_matchingpath(common, type, cc, &no_match, FALSE); in compile_iterator_matchingpath()
11544 detect_partial_match(common, &no_match); in compile_iterator_matchingpath()
11571 allocate_stack(common, 2); in compile_iterator_matchingpath()
11578 if (common->utf) in compile_iterator_matchingpath()
11584 detect_partial_match(common, &no_match); in compile_iterator_matchingpath()
11586 compile_char1_matchingpath(common, type, cc, &no_char1_match, FALSE); in compile_iterator_matchingpath()
11588 if (common->utf) in compile_iterator_matchingpath()
11598 detect_partial_match_to(common, label); in compile_iterator_matchingpath()
11603 if (common->utf) in compile_iterator_matchingpath()
11631 allocate_stack(common, 1); in compile_iterator_matchingpath()
11641 allocate_stack(common, 2); in compile_iterator_matchingpath()
11651 allocate_stack(common, 1); in compile_iterator_matchingpath()
11654 …compile_char1_matchingpath(common, type, cc, &BACKTRACK_AS(char_iterator_backtrack)->u.backtracks,… in compile_iterator_matchingpath()
11663 if (type == OP_ALLANY && !common->invalid_utf) in compile_iterator_matchingpath()
11669 process_partial_match(common); in compile_iterator_matchingpath()
11676 if (common->utf) in compile_iterator_matchingpath()
11679 detect_partial_match(common, &no_match); in compile_iterator_matchingpath()
11681 compile_char1_matchingpath(common, type, cc, &no_match, FALSE); in compile_iterator_matchingpath()
11683 detect_partial_match_to(common, label); in compile_iterator_matchingpath()
11698 detect_partial_match(common, &no_match); in compile_iterator_matchingpath()
11700 compile_char1_matchingpath(common, type, cc, &no_char1_match, FALSE); in compile_iterator_matchingpath()
11701 detect_partial_match_to(common, label); in compile_iterator_matchingpath()
11714 if (common->utf) in compile_iterator_matchingpath()
11719 detect_partial_match(common, &no_match); in compile_iterator_matchingpath()
11721 compile_char1_matchingpath(common, type, cc, &no_match, FALSE); in compile_iterator_matchingpath()
11725 detect_partial_match_to(common, label); in compile_iterator_matchingpath()
11737 if (common->mode == PCRE2_JIT_COMPLETE) in compile_iterator_matchingpath()
11745 process_partial_match(common); in compile_iterator_matchingpath()
11753 detect_partial_match(common, &no_match); in compile_iterator_matchingpath()
11755 compile_char1_matchingpath(common, type, cc, &no_char1_match, FALSE); in compile_iterator_matchingpath()
11758 detect_partial_match_to(common, label); in compile_iterator_matchingpath()
11769 compile_char1_matchingpath(common, type, cc, &no_match, TRUE); in compile_iterator_matchingpath()
11780 count_match(common); in compile_iterator_matchingpath()
11784 static SLJIT_INLINE PCRE2_SPTR compile_fail_accept_matchingpath(compiler_common *common, PCRE2_SPTR… in compile_fail_accept_matchingpath() argument
11797 if (*cc == OP_ACCEPT && common->currententry == NULL && (common->re->overall_options & PCRE2_ENDANC… in compile_fail_accept_matchingpath()
11798 add_jump(compiler, &common->reset_match, CMP(SLJIT_NOT_EQUAL, STR_PTR, 0, STR_END, 0)); in compile_fail_accept_matchingpath()
11800 if (*cc == OP_ASSERT_ACCEPT || common->currententry != NULL || !common->might_be_empty) in compile_fail_accept_matchingpath()
11803 if (common->accept_label == NULL) in compile_fail_accept_matchingpath()
11804 add_jump(compiler, &common->accept, JUMP(SLJIT_JUMP)); in compile_fail_accept_matchingpath()
11806 JUMPTO(SLJIT_JUMP, common->accept_label); in compile_fail_accept_matchingpath()
11810 if (common->accept_label == NULL) in compile_fail_accept_matchingpath()
11811 …add_jump(compiler, &common->accept, CMP(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR… in compile_fail_accept_matchingpath()
11813 CMPTO(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(0), common->accept_label); in compile_fail_accept_matchingpath()
11826 if (common->accept_label == NULL) in compile_fail_accept_matchingpath()
11827 add_jump(compiler, &common->accept, JUMP(SLJIT_ZERO)); in compile_fail_accept_matchingpath()
11829 JUMPTO(SLJIT_ZERO, common->accept_label); in compile_fail_accept_matchingpath()
11832 if (common->accept_label == NULL) in compile_fail_accept_matchingpath()
11833 add_jump(compiler, &common->accept, CMP(SLJIT_NOT_EQUAL, TMP2, 0, STR_PTR, 0)); in compile_fail_accept_matchingpath()
11835 CMPTO(SLJIT_NOT_EQUAL, TMP2, 0, STR_PTR, 0, common->accept_label); in compile_fail_accept_matchingpath()
11840 static SLJIT_INLINE PCRE2_SPTR compile_close_matchingpath(compiler_common *common, PCRE2_SPTR cc) in compile_close_matchingpath() argument
11844 BOOL optimized_cbracket = common->optimized_cbracket[offset] != 0; in compile_close_matchingpath()
11847 if (common->currententry != NULL) in compile_close_matchingpath()
11859 static SLJIT_INLINE PCRE2_SPTR compile_control_verb_matchingpath(compiler_common *common, PCRE2_SPT… in compile_control_verb_matchingpath() argument
11874 allocate_stack(common, 1); in compile_control_verb_matchingpath()
11884 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->mark_ptr, TMP2, 0); in compile_control_verb_matchingpath()
11893 static SLJIT_INLINE void compile_then_trap_matchingpath(compiler_common *common, PCRE2_SPTR cc, PCR… in compile_then_trap_matchingpath() argument
11901 common->then_trap = BACKTRACK_AS(then_trap_backtrack); in compile_then_trap_matchingpath()
11902 BACKTRACK_AS(then_trap_backtrack)->common.cc = then_trap_opcode; in compile_then_trap_matchingpath()
11903 BACKTRACK_AS(then_trap_backtrack)->start = (sljit_sw)(cc - common->start); in compile_then_trap_matchingpath()
11904 BACKTRACK_AS(then_trap_backtrack)->framesize = get_framesize(common, cc, ccend, FALSE, &needs_contr… in compile_then_trap_matchingpath()
11909 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_then_trap_matchingpath()
11910 allocate_stack(common, size); in compile_then_trap_matchingpath()
11912 …OP2(SLJIT_ADD, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, STACK_TOP, 0, SLJIT_IMM, (size - 3)… in compile_then_trap_matchingpath()
11914 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, STACK_TOP, 0); in compile_then_trap_matchingpath()
11921 init_frame(common, cc, ccend, size - 1, 0); in compile_then_trap_matchingpath()
11924 static void compile_matchingpath(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend, backtrac… in compile_matchingpath() argument
11933 if (common->has_then && common->then_offsets[cc - common->start] != 0) in compile_matchingpath()
11935 SLJIT_ASSERT(*ccend != OP_END && common->control_head_ptr != 0); in compile_matchingpath()
11937 save_then_trap = common->then_trap; in compile_matchingpath()
11939 compile_then_trap_matchingpath(common, cc, ccend, parent); in compile_matchingpath()
11957 …cc = compile_simple_assertion_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top… in compile_matchingpath()
11979 …cc = compile_char1_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top->nextbackt… in compile_matchingpath()
11985 allocate_stack(common, 1); in compile_matchingpath()
11993 if (common->mode == PCRE2_JIT_COMPLETE) in compile_matchingpath()
11994 …cc = compile_charn_matchingpath(common, cc, ccend, parent->top != NULL ? &parent->top->nextbacktra… in compile_matchingpath()
11996 …cc = compile_char1_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top->nextbackt… in compile_matchingpath()
12064 cc = compile_iterator_matchingpath(common, cc, parent); in compile_matchingpath()
12070 cc = compile_iterator_matchingpath(common, cc, parent); in compile_matchingpath()
12072 …cc = compile_char1_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top->nextbackt… in compile_matchingpath()
12078 cc = compile_iterator_matchingpath(common, cc, parent); in compile_matchingpath()
12080 …cc = compile_char1_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top->nextbackt… in compile_matchingpath()
12087 cc = compile_ref_iterator_matchingpath(common, cc, parent); in compile_matchingpath()
12090 …compile_ref_matchingpath(common, cc, parent->top != NULL ? &parent->top->nextbacktracks : &parent-… in compile_matchingpath()
12098 cc = compile_ref_iterator_matchingpath(common, cc, parent); in compile_matchingpath()
12101 …compile_dnref_search(common, cc, parent->top != NULL ? &parent->top->nextbacktracks : &parent->top… in compile_matchingpath()
12102 …compile_ref_matchingpath(common, cc, parent->top != NULL ? &parent->top->nextbacktracks : &parent-… in compile_matchingpath()
12108 cc = compile_recurse_matchingpath(common, cc, parent); in compile_matchingpath()
12113 cc = compile_callout_matchingpath(common, cc, parent); in compile_matchingpath()
12121 cc = compile_assert_matchingpath(common, cc, BACKTRACK_AS(assert_backtrack), FALSE); in compile_matchingpath()
12129 allocate_stack(common, 1); in compile_matchingpath()
12134 allocate_stack(common, 2); in compile_matchingpath()
12139 count_match(common); in compile_matchingpath()
12152 cc = compile_bracket_matchingpath(common, cc, parent); in compile_matchingpath()
12157 cc = compile_bracket_matchingpath(common, cc, parent); in compile_matchingpath()
12161 cc = compile_assert_matchingpath(common, cc, BACKTRACK_AS(assert_backtrack), FALSE); in compile_matchingpath()
12170 cc = compile_bracketpos_matchingpath(common, cc, parent); in compile_matchingpath()
12175 SLJIT_ASSERT(common->mark_ptr != 0); in compile_matchingpath()
12176 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->mark_ptr); in compile_matchingpath()
12177 allocate_stack(common, common->has_skip_arg ? 5 : 1); in compile_matchingpath()
12180 OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(common->has_skip_arg ? 4 : 0), TMP2, 0); in compile_matchingpath()
12182 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->mark_ptr, TMP2, 0); in compile_matchingpath()
12184 if (common->has_skip_arg) in compile_matchingpath()
12186 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_matchingpath()
12187 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, STACK_TOP, 0); in compile_matchingpath()
12204 cc = compile_control_verb_matchingpath(common, cc, parent); in compile_matchingpath()
12210 cc = compile_fail_accept_matchingpath(common, cc, parent); in compile_matchingpath()
12214 cc = compile_close_matchingpath(common, cc); in compile_matchingpath()
12233 BACKTRACK_AS(then_trap_backtrack)->common.cc = then_trap_opcode; in compile_matchingpath()
12234 BACKTRACK_AS(then_trap_backtrack)->then_trap = common->then_trap; in compile_matchingpath()
12235 common->then_trap = save_then_trap; in compile_matchingpath()
12247 compile_backtrackingpath(common, (current)); \
12255 static void compile_iterator_backtrackingpath(compiler_common *common, struct backtrack_common *cur… in compile_iterator_backtrackingpath() argument
12271 cc = get_iterator_parameters(common, cc, &opcode, &type, &max, &exact, &end); in compile_iterator_backtrackingpath()
12282 free_stack(common, 1); in compile_iterator_backtrackingpath()
12300 move_back(common, NULL, TRUE); in compile_iterator_backtrackingpath()
12307 move_back(common, NULL, TRUE); in compile_iterator_backtrackingpath()
12313 free_stack(common, 2); in compile_iterator_backtrackingpath()
12319 compile_char1_matchingpath(common, type, cc, &jumplist, TRUE); in compile_iterator_backtrackingpath()
12324 free_stack(common, 1); in compile_iterator_backtrackingpath()
12334 compile_char1_matchingpath(common, type, cc, &jumplist, TRUE); in compile_iterator_backtrackingpath()
12340 free_stack(common, 2); in compile_iterator_backtrackingpath()
12354 free_stack(common, 1); in compile_iterator_backtrackingpath()
12361 compile_char1_matchingpath(common, type, cc, &jumplist, TRUE); in compile_iterator_backtrackingpath()
12366 free_stack(common, 1); in compile_iterator_backtrackingpath()
12383 static SLJIT_INLINE void compile_ref_iterator_backtrackingpath(compiler_common *common, struct back… in compile_ref_iterator_backtrackingpath() argument
12397 free_stack(common, 1); in compile_ref_iterator_backtrackingpath()
12405 free_stack(common, ref ? 2 : 3); in compile_ref_iterator_backtrackingpath()
12408 static SLJIT_INLINE void compile_recurse_backtrackingpath(compiler_common *common, struct backtrack… in compile_recurse_backtrackingpath() argument
12423 compile_backtrackingpath(common, current->top); in compile_recurse_backtrackingpath()
12428 static void compile_assert_backtrackingpath(compiler_common *common, struct backtrack_common *curre… in compile_assert_backtrackingpath() argument
12456 free_stack(common, 1); in compile_assert_backtrackingpath()
12467 free_stack(common, 1); in compile_assert_backtrackingpath()
12470 free_stack(common, 1); in compile_assert_backtrackingpath()
12477 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_assert_backtrackingpath()
12497 static void compile_bracket_backtrackingpath(compiler_common *common, struct backtrack_common *curr… in compile_bracket_backtrackingpath() argument
12563 free_stack(common, 1); in compile_bracket_backtrackingpath()
12575 free_stack(common, 1); in compile_bracket_backtrackingpath()
12590 free_stack(common, 1); in compile_bracket_backtrackingpath()
12604 free_stack(common, 1); in compile_bracket_backtrackingpath()
12616 free_stack(common, 1); in compile_bracket_backtrackingpath()
12627 if (common->capture_last_ptr != 0) in compile_bracket_backtrackingpath()
12629 SLJIT_ASSERT(common->optimized_cbracket[offset >> 1] == 0); in compile_bracket_backtrackingpath()
12632 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr, TMP1, 0); in compile_bracket_backtrackingpath()
12634 free_stack(common, 3); in compile_bracket_backtrackingpath()
12638 else if (common->optimized_cbracket[offset >> 1] == 0) in compile_bracket_backtrackingpath()
12642 free_stack(common, 2); in compile_bracket_backtrackingpath()
12653 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_bracket_backtrackingpath()
12664 free_stack(common, 1); in compile_bracket_backtrackingpath()
12673 free_stack(common, 1); in compile_bracket_backtrackingpath()
12701 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_bracket_backtrackingpath()
12744 compile_matchingpath(common, ccprev, cc, current); in compile_bracket_backtrackingpath()
12752 match_script_run_common(common, private_data_ptr, current); in compile_bracket_backtrackingpath()
12758 …match_once_common(common, ket, CURRENT_AS(bracket_backtrack)->u.framesize, private_data_ptr, has_a… in compile_bracket_backtrackingpath()
12771 if (common->capture_last_ptr != 0) in compile_bracket_backtrackingpath()
12773 if (common->optimized_cbracket[offset >> 1] == 0) in compile_bracket_backtrackingpath()
12780 allocate_stack(common, stacksize); in compile_bracket_backtrackingpath()
12800 stacksize = match_capture_common(common, stacksize, offset, private_data_ptr); in compile_bracket_backtrackingpath()
12810 if (offset != 0 && ket == OP_KETRMAX && common->optimized_cbracket[offset >> 1] != 0) in compile_bracket_backtrackingpath()
12852 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_bracket_backtrackingpath()
12862 free_stack(common, 1); in compile_bracket_backtrackingpath()
12868 if (common->optimized_cbracket[offset >> 1] != 0) in compile_bracket_backtrackingpath()
12872 free_stack(common, 2); in compile_bracket_backtrackingpath()
12879 free_stack(common, 1); in compile_bracket_backtrackingpath()
12886 free_stack(common, 1); in compile_bracket_backtrackingpath()
12905 free_stack(common, stacksize); in compile_bracket_backtrackingpath()
12915 free_stack(common, 2); in compile_bracket_backtrackingpath()
12930 free_stack(common, 1); in compile_bracket_backtrackingpath()
12938 free_stack(common, 1); in compile_bracket_backtrackingpath()
12949 free_stack(common, 1); in compile_bracket_backtrackingpath()
12952 free_stack(common, bra == OP_BRAMINZERO ? 2 : 1); in compile_bracket_backtrackingpath()
12954 free_stack(common, 1); in compile_bracket_backtrackingpath()
12964 static SLJIT_INLINE void compile_bracketpos_backtrackingpath(compiler_common *common, struct backtr… in compile_bracketpos_backtrackingpath() argument
12978 if (common->capture_last_ptr != 0) in compile_bracketpos_backtrackingpath()
12981 if (common->capture_last_ptr != 0) in compile_bracketpos_backtrackingpath()
12982 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr, TMP1, 0); in compile_bracketpos_backtrackingpath()
12985 free_stack(common, CURRENT_AS(bracketpos_backtrack)->stacksize); in compile_bracketpos_backtrackingpath()
12990 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_bracketpos_backtrackingpath()
12998 free_stack(common, CURRENT_AS(bracketpos_backtrack)->stacksize); in compile_bracketpos_backtrackingpath()
13004 static SLJIT_INLINE void compile_braminzero_backtrackingpath(compiler_common *common, struct backtr… in compile_braminzero_backtrackingpath() argument
13014 compile_bracket_matchingpath(common, current->cc, current); in compile_braminzero_backtrackingpath()
13015 compile_bracket_backtrackingpath(common, current->top); in compile_braminzero_backtrackingpath()
13020 backtrack.common.cc = current->cc; in compile_braminzero_backtrackingpath()
13023 compile_assert_matchingpath(common, current->cc, &backtrack, FALSE); in compile_braminzero_backtrackingpath()
13028 static SLJIT_INLINE void compile_control_verb_backtrackingpath(compiler_common *common, struct back… in compile_control_verb_backtrackingpath() argument
13037 if (common->then_trap != NULL) in compile_control_verb_backtrackingpath()
13039 SLJIT_ASSERT(common->control_head_ptr != 0); in compile_control_verb_backtrackingpath()
13041 OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_control_verb_backtrackingpath()
13043 OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, common->then_trap->start); in compile_control_verb_backtrackingpath()
13051 add_jump(compiler, &common->then_trap->quit, JUMP(SLJIT_JUMP)); in compile_control_verb_backtrackingpath()
13054 else if (!common->local_quit_available && common->in_positive_assertion) in compile_control_verb_backtrackingpath()
13056 add_jump(compiler, &common->positive_assertion_quit, JUMP(SLJIT_JUMP)); in compile_control_verb_backtrackingpath()
13061 if (common->local_quit_available) in compile_control_verb_backtrackingpath()
13064 if (common->quit_label == NULL) in compile_control_verb_backtrackingpath()
13065 add_jump(compiler, &common->quit, JUMP(SLJIT_JUMP)); in compile_control_verb_backtrackingpath()
13067 JUMPTO(SLJIT_JUMP, common->quit_label); in compile_control_verb_backtrackingpath()
13073 SLJIT_ASSERT(common->control_head_ptr != 0 && TMP1 == SLJIT_R0 && STR_PTR == SLJIT_R1); in compile_control_verb_backtrackingpath()
13074 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_control_verb_backtrackingpath()
13079 add_jump(compiler, &common->reset_match, CMP(SLJIT_NOT_EQUAL, SLJIT_R0, 0, SLJIT_IMM, 0)); in compile_control_verb_backtrackingpath()
13087 add_jump(compiler, &common->reset_match, JUMP(SLJIT_JUMP)); in compile_control_verb_backtrackingpath()
13090 static SLJIT_INLINE void compile_then_trap_backtrackingpath(compiler_common *common, struct backtra… in compile_then_trap_backtrackingpath() argument
13098 common->then_trap = CURRENT_AS(then_trap_backtrack)->then_trap; in compile_then_trap_backtrackingpath()
13106 free_stack(common, size); in compile_then_trap_backtrackingpath()
13113 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_then_trap_backtrackingpath()
13117 free_stack(common, 3); in compile_then_trap_backtrackingpath()
13120 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, TMP1, 0); in compile_then_trap_backtrackingpath()
13123 static void compile_backtrackingpath(compiler_common *common, struct backtrack_common *current) in compile_backtrackingpath() argument
13126 then_trap_backtrack *save_then_trap = common->then_trap; in compile_backtrackingpath()
13136 free_stack(common, 1); in compile_backtrackingpath()
13210 compile_iterator_backtrackingpath(common, current); in compile_backtrackingpath()
13217 compile_ref_iterator_backtrackingpath(common, current); in compile_backtrackingpath()
13221 compile_recurse_backtrackingpath(common, current); in compile_backtrackingpath()
13228 compile_assert_backtrackingpath(common, current); in compile_backtrackingpath()
13241 compile_bracket_backtrackingpath(common, current); in compile_backtrackingpath()
13246 compile_bracket_backtrackingpath(common, current); in compile_backtrackingpath()
13248 compile_assert_backtrackingpath(common, current); in compile_backtrackingpath()
13256 compile_bracketpos_backtrackingpath(common, current); in compile_backtrackingpath()
13260 compile_braminzero_backtrackingpath(common, current); in compile_backtrackingpath()
13264 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), STACK(common->has_skip_arg ? 4 : 0)); in compile_backtrackingpath()
13265 if (common->has_skip_arg) in compile_backtrackingpath()
13267 free_stack(common, common->has_skip_arg ? 5 : 1); in compile_backtrackingpath()
13268 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->mark_ptr, TMP1, 0); in compile_backtrackingpath()
13269 if (common->has_skip_arg) in compile_backtrackingpath()
13270 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, TMP2, 0); in compile_backtrackingpath()
13279 compile_control_verb_backtrackingpath(common, current); in compile_backtrackingpath()
13284 if (!common->local_quit_available) in compile_backtrackingpath()
13286 if (common->quit_label == NULL) in compile_backtrackingpath()
13287 add_jump(compiler, &common->quit, JUMP(SLJIT_JUMP)); in compile_backtrackingpath()
13289 JUMPTO(SLJIT_JUMP, common->quit_label); in compile_backtrackingpath()
13302 compile_then_trap_backtrackingpath(common, current); in compile_backtrackingpath()
13311 common->then_trap = save_then_trap; in compile_backtrackingpath()
13314 static SLJIT_INLINE void compile_recurse(compiler_common *common) in compile_recurse() argument
13317 PCRE2_SPTR cc = common->start + common->currententry->start; in compile_recurse()
13323 int private_data_size = get_recurse_data_length(common, ccbegin, ccend, &needs_control_head, &has_q… in compile_recurse()
13333 common->then_trap = NULL; in compile_recurse()
13341 SLJIT_ASSERT(common->currententry->entry_label == NULL && common->recursive_head_ptr != 0); in compile_recurse()
13342 common->currententry->entry_label = LABEL(); in compile_recurse()
13343 set_jumps(common->currententry->entry_calls, common->currententry->entry_label); in compile_recurse()
13346 count_match(common); in compile_recurse()
13353 allocate_stack(common, private_data_size + local_size); in compile_recurse()
13357 copy_recurse_data(common, ccbegin, ccend, recurse_copy_from_global, local_size, private_data_size +… in compile_recurse()
13360 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->recursive_head_ptr, STACK_TOP, 0); in compile_recurse()
13363 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_IMM, 0); in compile_recurse()
13369 common->quit_label = NULL; in compile_recurse()
13370 common->accept_label = NULL; in compile_recurse()
13371 common->quit = NULL; in compile_recurse()
13372 common->accept = NULL; in compile_recurse()
13383 compile_matchingpath(common, altbacktrack.cc, cc, &altbacktrack); in compile_recurse()
13387 allocate_stack(common, (alt_max > 1 || has_accept) ? 2 : 1); in compile_recurse()
13388 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->recursive_head_ptr); in compile_recurse()
13403 SLJIT_ASSERT(common->currententry->backtrack_label == NULL); in compile_recurse()
13404 common->currententry->backtrack_label = LABEL(); in compile_recurse()
13405 set_jumps(common->currententry->backtrack_calls, common->currententry->backtrack_label); in compile_recurse()
13416 …copy_recurse_data(common, ccbegin, ccend, recurse_swap_global, local_size, private_data_size + loc… in compile_recurse()
13421 free_stack(common, 2); in compile_recurse()
13433 free_stack(common, has_accept ? 2 : 1); in compile_recurse()
13452 compile_backtrackingpath(common, altbacktrack.top); in compile_recurse()
13468 copy_recurse_data(common, ccbegin, ccend, recurse_copy_private_to_global, local_size, private_data_… in compile_recurse()
13471 free_stack(common, private_data_size + local_size); in compile_recurse()
13475 if (common->quit != NULL) in compile_recurse()
13479 set_jumps(common->quit, LABEL()); in compile_recurse()
13480 OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), common->recursive_head_ptr); in compile_recurse()
13481 …copy_recurse_data(common, ccbegin, ccend, recurse_copy_shared_to_global, local_size, private_data_… in compile_recurse()
13488 free_stack(common, 2); in compile_recurse()
13493 …copy_recurse_data(common, ccbegin, ccend, recurse_copy_kept_shared_to_global, local_size, private_… in compile_recurse()
13496 free_stack(common, private_data_size + local_size); in compile_recurse()
13501 if (common->accept != NULL) in compile_recurse()
13505 set_jumps(common->accept, LABEL()); in compile_recurse()
13507 OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), common->recursive_head_ptr); in compile_recurse()
13510 allocate_stack(common, 2); in compile_recurse()
13518 copy_recurse_data(common, ccbegin, ccend, recurse_swap_global, local_size, private_data_size + loca… in compile_recurse()
13537 compiler_common *common = &common_data; in jit_compile() local
13569 memset(common, 0, sizeof(compiler_common)); in jit_compile()
13570 common->re = re; in jit_compile()
13571 common->name_table = (PCRE2_SPTR)((uint8_t *)re + sizeof(pcre2_real_code)); in jit_compile()
13572 rootbacktrack.cc = common->name_table + re->name_count * re->name_entry_size; in jit_compile()
13575 common->invalid_utf = (mode & PCRE2_JIT_INVALID_UTF) != 0; in jit_compile()
13579 common->start = rootbacktrack.cc; in jit_compile()
13580 common->read_only_data_head = NULL; in jit_compile()
13581 common->fcc = tables + fcc_offset; in jit_compile()
13582 common->lcc = (sljit_sw)(tables + lcc_offset); in jit_compile()
13583 common->mode = mode; in jit_compile()
13584 common->might_be_empty = (re->minlength == 0) || (re->flags & PCRE2_MATCH_EMPTY); in jit_compile()
13585 common->allow_empty_partial = (re->max_lookbehind > 0) || (re->flags & PCRE2_MATCH_EMPTY); in jit_compile()
13586 common->nltype = NLTYPE_FIXED; in jit_compile()
13589 case PCRE2_NEWLINE_CR: common->newline = CHAR_CR; break; in jit_compile()
13590 case PCRE2_NEWLINE_LF: common->newline = CHAR_NL; break; in jit_compile()
13591 case PCRE2_NEWLINE_CRLF: common->newline = (CHAR_CR << 8) | CHAR_NL; break; in jit_compile()
13592 …case PCRE2_NEWLINE_ANY: common->newline = (CHAR_CR << 8) | CHAR_NL; common->nltype = NLTYPE_ANY; b… in jit_compile()
13593 …case PCRE2_NEWLINE_ANYCRLF: common->newline = (CHAR_CR << 8) | CHAR_NL; common->nltype = NLTYPE_AN… in jit_compile()
13594 case PCRE2_NEWLINE_NUL: common->newline = CHAR_NUL; break; in jit_compile()
13597 common->nlmax = READ_CHAR_MAX; in jit_compile()
13598 common->nlmin = 0; in jit_compile()
13600 common->bsr_nltype = NLTYPE_ANY; in jit_compile()
13602 common->bsr_nltype = NLTYPE_ANYCRLF; in jit_compile()
13606 common->bsr_nltype = NLTYPE_ANYCRLF; in jit_compile()
13608 common->bsr_nltype = NLTYPE_ANY; in jit_compile()
13611 common->bsr_nlmax = READ_CHAR_MAX; in jit_compile()
13612 common->bsr_nlmin = 0; in jit_compile()
13613 common->endonly = (re->overall_options & PCRE2_DOLLAR_ENDONLY) != 0; in jit_compile()
13614 common->ctypes = (sljit_sw)(tables + ctypes_offset); in jit_compile()
13615 common->name_count = re->name_count; in jit_compile()
13616 common->name_entry_size = re->name_entry_size; in jit_compile()
13617 common->unset_backref = (re->overall_options & PCRE2_MATCH_UNSET_BACKREF) != 0; in jit_compile()
13618 common->alt_circumflex = (re->overall_options & PCRE2_ALT_CIRCUMFLEX) != 0; in jit_compile()
13621 common->utf = (re->overall_options & PCRE2_UTF) != 0; in jit_compile()
13622 common->ucp = (re->overall_options & PCRE2_UCP) != 0; in jit_compile()
13623 if (common->utf) in jit_compile()
13625 if (common->nltype == NLTYPE_ANY) in jit_compile()
13626 common->nlmax = 0x2029; in jit_compile()
13627 else if (common->nltype == NLTYPE_ANYCRLF) in jit_compile()
13628 common->nlmax = (CHAR_CR > CHAR_NL) ? CHAR_CR : CHAR_NL; in jit_compile()
13632 common->nlmax = common->newline & 0xff; in jit_compile()
13635 if (common->nltype == NLTYPE_FIXED) in jit_compile()
13636 common->nlmin = common->newline & 0xff; in jit_compile()
13638 common->nlmin = (CHAR_CR < CHAR_NL) ? CHAR_CR : CHAR_NL; in jit_compile()
13640 if (common->bsr_nltype == NLTYPE_ANY) in jit_compile()
13641 common->bsr_nlmax = 0x2029; in jit_compile()
13643 common->bsr_nlmax = (CHAR_CR > CHAR_NL) ? CHAR_CR : CHAR_NL; in jit_compile()
13644 common->bsr_nlmin = (CHAR_CR < CHAR_NL) ? CHAR_CR : CHAR_NL; in jit_compile()
13647 common->invalid_utf = FALSE; in jit_compile()
13649 ccend = bracketend(common->start); in jit_compile()
13652 common->ovector_start = LIMIT_MATCH + sizeof(sljit_sw); in jit_compile()
13653 common->optimized_cbracket = (sljit_u8 *)SLJIT_MALLOC(re->top_bracket + 1, allocator_data); in jit_compile()
13654 if (!common->optimized_cbracket) in jit_compile()
13657 memset(common->optimized_cbracket, 0, re->top_bracket + 1); in jit_compile()
13659 memset(common->optimized_cbracket, 1, re->top_bracket + 1); in jit_compile()
13662 SLJIT_ASSERT(*common->start == OP_BRA && ccend[-(1 + LINK_SIZE)] == OP_KET); in jit_compile()
13664 common->capture_last_ptr = common->ovector_start; in jit_compile()
13665 common->ovector_start += sizeof(sljit_sw); in jit_compile()
13667 if (!check_opcode_types(common, common->start, ccend)) in jit_compile()
13669 SLJIT_FREE(common->optimized_cbracket, allocator_data); in jit_compile()
13676 common->req_char_ptr = common->ovector_start; in jit_compile()
13677 common->ovector_start += sizeof(sljit_sw); in jit_compile()
13681 common->start_used_ptr = common->ovector_start; in jit_compile()
13682 common->ovector_start += sizeof(sljit_sw); in jit_compile()
13685 common->hit_start = common->ovector_start; in jit_compile()
13686 common->ovector_start += sizeof(sljit_sw); in jit_compile()
13691 common->match_end_ptr = common->ovector_start; in jit_compile()
13692 common->ovector_start += sizeof(sljit_sw); in jit_compile()
13695 common->control_head_ptr = 1; in jit_compile()
13697 if (common->control_head_ptr != 0) in jit_compile()
13699 common->control_head_ptr = common->ovector_start; in jit_compile()
13700 common->ovector_start += sizeof(sljit_sw); in jit_compile()
13702 if (common->has_set_som) in jit_compile()
13705 common->start_ptr = common->ovector_start; in jit_compile()
13706 common->ovector_start += sizeof(sljit_sw); in jit_compile()
13710 if ((common->ovector_start & sizeof(sljit_sw)) != 0) in jit_compile()
13711 common->ovector_start += sizeof(sljit_sw); in jit_compile()
13713 if (common->start_ptr == 0) in jit_compile()
13714 common->start_ptr = OVECTOR(0); in jit_compile()
13717 if (common->capture_last_ptr != 0) in jit_compile()
13718 memset(common->optimized_cbracket, 0, re->top_bracket + 1); in jit_compile()
13720 SLJIT_ASSERT(!(common->req_char_ptr != 0 && common->start_used_ptr != 0)); in jit_compile()
13721 common->cbra_ptr = OVECTOR_START + (re->top_bracket + 1) * 2 * sizeof(sljit_sw); in jit_compile()
13723 total_length = ccend - common->start; in jit_compile()
13724 common->private_data_ptrs = (sljit_s32*)SLJIT_MALLOC(total_length * (sizeof(sljit_s32) + (common->h… in jit_compile()
13725 if (!common->private_data_ptrs) in jit_compile()
13727 SLJIT_FREE(common->optimized_cbracket, allocator_data); in jit_compile()
13730 memset(common->private_data_ptrs, 0, total_length * sizeof(sljit_s32)); in jit_compile()
13732 private_data_size = common->cbra_ptr + (re->top_bracket + 1) * sizeof(sljit_sw); in jit_compile()
13734 …CHORED) == 0 && (re->overall_options & PCRE2_NO_START_OPTIMIZE) == 0 && !common->has_skip_in_asser… in jit_compile()
13735 detect_early_fail(common, common->start, &private_data_size, 0, 0, TRUE); in jit_compile()
13737 set_private_data_ptrs(common, &private_data_size, ccend); in jit_compile()
13739 SLJIT_ASSERT(common->early_fail_start_ptr <= common->early_fail_end_ptr); in jit_compile()
13743 SLJIT_FREE(common->private_data_ptrs, allocator_data); in jit_compile()
13744 SLJIT_FREE(common->optimized_cbracket, allocator_data); in jit_compile()
13748 if (common->has_then) in jit_compile()
13750 common->then_offsets = (sljit_u8 *)(common->private_data_ptrs + total_length); in jit_compile()
13751 memset(common->then_offsets, 0, total_length); in jit_compile()
13752 set_then_offsets(common, common->start, NULL); in jit_compile()
13758 SLJIT_FREE(common->optimized_cbracket, allocator_data); in jit_compile()
13759 SLJIT_FREE(common->private_data_ptrs, allocator_data); in jit_compile()
13762 common->compiler = compiler; in jit_compile()
13769 reset_ovector(common, (re->top_bracket + 1) * 2); in jit_compile()
13770 if (common->req_char_ptr != 0) in jit_compile()
13771 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->req_char_ptr, SLJIT_R0, 0); in jit_compile()
13784 if (common->early_fail_start_ptr < common->early_fail_end_ptr) in jit_compile()
13785 reset_early_fail(common); in jit_compile()
13788 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, -1); in jit_compile()
13789 if (common->mark_ptr != 0) in jit_compile()
13790 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->mark_ptr, SLJIT_IMM, 0); in jit_compile()
13791 if (common->control_head_ptr != 0) in jit_compile()
13792 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_IMM, 0); in jit_compile()
13797 mainloop_label = mainloop_entry(common); in jit_compile()
13802 if (mode == PCRE2_JIT_COMPLETE && fast_forward_first_n_chars(common)) in jit_compile()
13805 fast_forward_first_char(common); in jit_compile()
13807 fast_forward_newline(common); in jit_compile()
13809 fast_forward_start_bits(common); in jit_compile()
13821 if (common->req_char_ptr != 0) in jit_compile()
13822 …reqcu_not_found = search_requested_char(common, (PCRE2_UCHAR)(re->last_codeunit), (re->flags & PCR… in jit_compile()
13828 if (common->capture_last_ptr != 0) in jit_compile()
13829 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr, SLJIT_IMM, 0); in jit_compile()
13830 if (common->fast_forward_bc_ptr != NULL) in jit_compile()
13831 …OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), PRIVATE_DATA(common->fast_forward_bc_ptr + 1) >> 3, STR_PTR, … in jit_compile()
13833 if (common->start_ptr != OVECTOR(0)) in jit_compile()
13834 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->start_ptr, STR_PTR, 0); in jit_compile()
13839 jump = CMP(SLJIT_NOT_EQUAL, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, -1); in jit_compile()
13840 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0); in jit_compile()
13844 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0); in jit_compile()
13846 compile_matchingpath(common, common->start, ccend, &rootbacktrack); in jit_compile()
13850 SLJIT_FREE(common->optimized_cbracket, allocator_data); in jit_compile()
13851 SLJIT_FREE(common->private_data_ptrs, allocator_data); in jit_compile()
13852 PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data); in jit_compile()
13859 if (common->might_be_empty) in jit_compile()
13865 common->accept_label = LABEL(); in jit_compile()
13866 if (common->accept != NULL) in jit_compile()
13867 set_jumps(common->accept, common->accept_label); in jit_compile()
13870 copy_ovector(common, re->top_bracket + 1); in jit_compile()
13871 common->quit_label = common->abort_label = LABEL(); in jit_compile()
13872 if (common->quit != NULL) in jit_compile()
13873 set_jumps(common->quit, common->quit_label); in jit_compile()
13874 if (common->abort != NULL) in jit_compile()
13875 set_jumps(common->abort, common->abort_label); in jit_compile()
13877 SET_LABEL(minlength_check_failed, common->abort_label); in jit_compile()
13882 if (common->failed_match != NULL) in jit_compile()
13884 SLJIT_ASSERT(common->mode == PCRE2_JIT_COMPLETE); in jit_compile()
13885 set_jumps(common->failed_match, LABEL()); in jit_compile()
13887 JUMPTO(SLJIT_JUMP, common->abort_label); in jit_compile()
13895 common->partialmatchlabel = LABEL(); in jit_compile()
13896 set_jumps(common->partialmatch, common->partialmatchlabel); in jit_compile()
13897 return_with_partial_match(common, common->quit_label); in jit_compile()
13900 if (common->might_be_empty) in jit_compile()
13902 compile_backtrackingpath(common, rootbacktrack.top); in jit_compile()
13906 SLJIT_FREE(common->optimized_cbracket, allocator_data); in jit_compile()
13907 SLJIT_FREE(common->private_data_ptrs, allocator_data); in jit_compile()
13908 PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data); in jit_compile()
13918 jump = CMP(SLJIT_NOT_EQUAL, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, 0); in jit_compile()
13919 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->start_ptr); in jit_compile()
13920 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, SLJIT_IMM, -1); in jit_compile()
13921 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->hit_start, TMP1, 0); in jit_compile()
13926 if ((re->overall_options & PCRE2_ANCHORED) == 0 && common->match_end_ptr != 0) in jit_compile()
13928 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr); in jit_compile()
13932 …(common->fast_forward_bc_ptr != NULL) ? (PRIVATE_DATA(common->fast_forward_bc_ptr + 1) >> 3) : com… in jit_compile()
13936 if (common->ff_newline_shortcut != NULL) in jit_compile()
13941 if (common->match_end_ptr != 0) in jit_compile()
13945 CMPTO(SLJIT_LESS, STR_PTR, 0, TMP1, 0, common->ff_newline_shortcut); in jit_compile()
13949 CMPTO(SLJIT_LESS, STR_PTR, 0, STR_END, 0, common->ff_newline_shortcut); in jit_compile()
13953 CMPTO(SLJIT_LESS, STR_PTR, 0, (common->match_end_ptr == 0) ? STR_END : TMP1, 0, mainloop_label); in jit_compile()
13961 …CMPTO(SLJIT_NOT_EQUAL, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, -1, common->partialmatc… in jit_compile()
13964 JUMPTO(SLJIT_JUMP, common->quit_label); in jit_compile()
13966 flush_stubs(common); in jit_compile()
13968 if (common->might_be_empty) in jit_compile()
13982 common->fast_forward_bc_ptr = NULL; in jit_compile()
13983 common->early_fail_start_ptr = 0; in jit_compile()
13984 common->early_fail_end_ptr = 0; in jit_compile()
13985 common->currententry = common->entries; in jit_compile()
13986 common->local_quit_available = TRUE; in jit_compile()
13987 quit_label = common->quit_label; in jit_compile()
13988 if (common->currententry != NULL) in jit_compile()
13991 common->recurse_bitset_size = ((private_data_size / (int)sizeof(sljit_sw)) + 7) >> 3; in jit_compile()
13992 SLJIT_ASSERT(common->recurse_bitset_size > 0); in jit_compile()
13993 common->recurse_bitset = (sljit_u8*)SLJIT_MALLOC(common->recurse_bitset_size, allocator_data);; in jit_compile()
13995 if (common->recurse_bitset != NULL) in jit_compile()
14000 compile_recurse(common); in jit_compile()
14003 flush_stubs(common); in jit_compile()
14004 common->currententry = common->currententry->next; in jit_compile()
14006 while (common->currententry != NULL); in jit_compile()
14008 SLJIT_FREE(common->recurse_bitset, allocator_data); in jit_compile()
14011 if (common->currententry != NULL) in jit_compile()
14014 SLJIT_ASSERT(sljit_get_compiler_error(compiler) || common->recurse_bitset == NULL); in jit_compile()
14017 SLJIT_FREE(common->optimized_cbracket, allocator_data); in jit_compile()
14018 SLJIT_FREE(common->private_data_ptrs, allocator_data); in jit_compile()
14019 PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data); in jit_compile()
14023 common->local_quit_available = FALSE; in jit_compile()
14024 common->quit_label = quit_label; in jit_compile()
14028 set_jumps(common->stackalloc, LABEL()); in jit_compile()
14053 JUMPTO(SLJIT_JUMP, common->quit_label); in jit_compile()
14056 set_jumps(common->calllimit, LABEL()); in jit_compile()
14058 JUMPTO(SLJIT_JUMP, common->quit_label); in jit_compile()
14060 if (common->revertframes != NULL) in jit_compile()
14062 set_jumps(common->revertframes, LABEL()); in jit_compile()
14063 do_revertframes(common); in jit_compile()
14065 if (common->wordboundary != NULL) in jit_compile()
14067 set_jumps(common->wordboundary, LABEL()); in jit_compile()
14068 check_wordboundary(common); in jit_compile()
14070 if (common->anynewline != NULL) in jit_compile()
14072 set_jumps(common->anynewline, LABEL()); in jit_compile()
14073 check_anynewline(common); in jit_compile()
14075 if (common->hspace != NULL) in jit_compile()
14077 set_jumps(common->hspace, LABEL()); in jit_compile()
14078 check_hspace(common); in jit_compile()
14080 if (common->vspace != NULL) in jit_compile()
14082 set_jumps(common->vspace, LABEL()); in jit_compile()
14083 check_vspace(common); in jit_compile()
14085 if (common->casefulcmp != NULL) in jit_compile()
14087 set_jumps(common->casefulcmp, LABEL()); in jit_compile()
14088 do_casefulcmp(common); in jit_compile()
14090 if (common->caselesscmp != NULL) in jit_compile()
14092 set_jumps(common->caselesscmp, LABEL()); in jit_compile()
14093 do_caselesscmp(common); in jit_compile()
14095 if (common->reset_match != NULL) in jit_compile()
14097 set_jumps(common->reset_match, LABEL()); in jit_compile()
14098 do_reset_match(common, (re->top_bracket + 1) * 2); in jit_compile()
14105 if (common->utfreadchar != NULL) in jit_compile()
14107 set_jumps(common->utfreadchar, LABEL()); in jit_compile()
14108 do_utfreadchar(common); in jit_compile()
14110 if (common->utfreadtype8 != NULL) in jit_compile()
14112 set_jumps(common->utfreadtype8, LABEL()); in jit_compile()
14113 do_utfreadtype8(common); in jit_compile()
14115 if (common->utfpeakcharback != NULL) in jit_compile()
14117 set_jumps(common->utfpeakcharback, LABEL()); in jit_compile()
14118 do_utfpeakcharback(common); in jit_compile()
14122 if (common->utfreadchar_invalid != NULL) in jit_compile()
14124 set_jumps(common->utfreadchar_invalid, LABEL()); in jit_compile()
14125 do_utfreadchar_invalid(common); in jit_compile()
14127 if (common->utfreadnewline_invalid != NULL) in jit_compile()
14129 set_jumps(common->utfreadnewline_invalid, LABEL()); in jit_compile()
14130 do_utfreadnewline_invalid(common); in jit_compile()
14132 if (common->utfmoveback_invalid) in jit_compile()
14134 set_jumps(common->utfmoveback_invalid, LABEL()); in jit_compile()
14135 do_utfmoveback_invalid(common); in jit_compile()
14137 if (common->utfpeakcharback_invalid) in jit_compile()
14139 set_jumps(common->utfpeakcharback_invalid, LABEL()); in jit_compile()
14140 do_utfpeakcharback_invalid(common); in jit_compile()
14143 if (common->getucd != NULL) in jit_compile()
14145 set_jumps(common->getucd, LABEL()); in jit_compile()
14146 do_getucd(common); in jit_compile()
14148 if (common->getucdtype != NULL) in jit_compile()
14150 set_jumps(common->getucdtype, LABEL()); in jit_compile()
14151 do_getucdtype(common); in jit_compile()
14155 SLJIT_FREE(common->optimized_cbracket, allocator_data); in jit_compile()
14156 SLJIT_FREE(common->private_data_ptrs, allocator_data); in jit_compile()
14164 PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data); in jit_compile()
14179 PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data); in jit_compile()
14196 functions->read_only_data_heads[mode] = common->read_only_data_head; in jit_compile()