Lines Matching refs:common
265 backtrack_common common; member
276 backtrack_common common; member
298 backtrack_common common; member
308 backtrack_common common; member
313 backtrack_common common; member
327 backtrack_common common; member
347 backtrack_common common; member
357 backtrack_common common; member
365 backtrack_common common; member
618 #define OVECTOR_START (common->ovector_start)
620 #define OVECTOR_PRIV(i) (common->cbra_ptr + (i) * SSIZE_OF(sw))
621 #define PRIVATE_DATA(cc) (common->private_data_ptrs[(cc) - common->start])
640 struct sljit_compiler *compiler = common->compiler
913 static PCRE2_SPTR next_opcode(compiler_common *common, PCRE2_SPTR cc) in next_opcode() argument
915 SLJIT_UNUSED_ARG(common); in next_opcode()
1070 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in next_opcode()
1092 if (common->utf) return NULL; in next_opcode()
1117 static BOOL check_opcode_types(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend) in check_opcode_types() argument
1130 common->has_set_som = TRUE; in check_opcode_types()
1131 common->might_be_empty = TRUE; in check_opcode_types()
1137 if (common->iref_ptr == 0) in check_opcode_types()
1139 common->iref_ptr = common->ovector_start; in check_opcode_types()
1140 common->ovector_start += 3 * sizeof(sljit_sw); in check_opcode_types()
1145 common->optimized_cbracket[GET2(cc, 1)] = 0; in check_opcode_types()
1159 common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] = 0; in check_opcode_types()
1173 common->optimized_cbracket[GET2(cc, 1)] = 0; in check_opcode_types()
1181 slot = common->name_table + GET2(cc, 1) * common->name_entry_size; in check_opcode_types()
1184 common->optimized_cbracket[GET2(slot, 0)] = 0; in check_opcode_types()
1185 slot += common->name_entry_size; in check_opcode_types()
1192 if (common->recursive_head_ptr == 0) in check_opcode_types()
1194 common->recursive_head_ptr = common->ovector_start; in check_opcode_types()
1195 common->ovector_start += sizeof(sljit_sw); in check_opcode_types()
1202 if (common->capture_last_ptr == 0) in check_opcode_types()
1204 common->capture_last_ptr = common->ovector_start; in check_opcode_types()
1205 common->ovector_start += sizeof(sljit_sw); in check_opcode_types()
1218 common->has_then = TRUE; in check_opcode_types()
1219 common->control_head_ptr = 1; in check_opcode_types()
1228 if (common->mark_ptr == 0) in check_opcode_types()
1230 common->mark_ptr = common->ovector_start; in check_opcode_types()
1231 common->ovector_start += sizeof(sljit_sw); in check_opcode_types()
1237 common->has_then = TRUE; in check_opcode_types()
1238 common->control_head_ptr = 1; in check_opcode_types()
1244 common->has_skip_in_assert_back = TRUE; in check_opcode_types()
1251 common->control_head_ptr = 1; in check_opcode_types()
1252 common->has_skip_arg = TRUE; in check_opcode_types()
1254 common->has_skip_in_assert_back = TRUE; in check_opcode_types()
1269 cc = next_opcode(common, cc); in check_opcode_types()
1292 static int detect_early_fail(compiler_common *common, PCRE2_SPTR cc, in detect_early_fail() argument
1303 SLJIT_ASSERT(*cc != OP_CBRA || common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] != 0); in detect_early_fail()
1378 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in detect_early_fail()
1460 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in detect_early_fail()
1469 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in detect_early_fail()
1507 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in detect_early_fail()
1580 …if (end[-1 - LINK_SIZE] != OP_KET || (*cc == OP_CBRA && common->optimized_cbracket[GET2(cc, 1 + LI… in detect_early_fail()
1583 prev_count = detect_early_fail(common, cc, private_data_start, depth + 1, prev_count); in detect_early_fail()
1589 common->private_data_ptrs[begin - common->start] = 1; in detect_early_fail()
1611 common->fast_forward_bc_ptr = accelerated_start; in detect_early_fail()
1612 …common->private_data_ptrs[(accelerated_start + 1) - common->start] = ((*private_data_start) << 3) … in detect_early_fail()
1618 …common->private_data_ptrs[(accelerated_start + 1) - common->start] = ((*private_data_start) << 3) … in detect_early_fail()
1620 if (common->early_fail_start_ptr == 0) in detect_early_fail()
1621 common->early_fail_start_ptr = *private_data_start; in detect_early_fail()
1624 common->early_fail_end_ptr = *private_data_start; in detect_early_fail()
1633 …common->private_data_ptrs[(accelerated_start + 1) - common->start] = ((*private_data_start) << 3) … in detect_early_fail()
1635 if (common->early_fail_start_ptr == 0) in detect_early_fail()
1636 common->early_fail_start_ptr = *private_data_start; in detect_early_fail()
1639 common->early_fail_end_ptr = *private_data_start; in detect_early_fail()
1648 common->private_data_ptrs[begin - common->start] = 1; in detect_early_fail()
1699 static BOOL detect_repeat(compiler_common *common, PCRE2_SPTR begin) in detect_repeat() argument
1761 common->private_data_ptrs[max_end - common->start - LINK_SIZE] = next_end - max_end; in detect_repeat()
1762 …common->private_data_ptrs[max_end - common->start - LINK_SIZE + 1] = (type == OP_BRAZERO) ? OP_UPT… in detect_repeat()
1764 common->private_data_ptrs[max_end - common->start - LINK_SIZE + 2] = max + 2; in detect_repeat()
1776 common->private_data_ptrs[end - common->start - LINK_SIZE] = max_end - end; in detect_repeat()
1777 common->private_data_ptrs[end - common->start - LINK_SIZE + 1] = OP_EXACT; in detect_repeat()
1778 common->private_data_ptrs[end - common->start - LINK_SIZE + 2] = min; in detect_repeat()
1837 static void set_private_data_ptrs(compiler_common *common, int *private_data_start, PCRE2_SPTR ccen… in set_private_data_ptrs() argument
1839 PCRE2_SPTR cc = common->start; in set_private_data_ptrs()
1857 if (detect_repeat(common, cc)) in set_private_data_ptrs()
1870 if (common->private_data_ptrs[cc + 1 - common->start] != 0) in set_private_data_ptrs()
1872 common->private_data_ptrs[cc - common->start] = private_data_ptr; in set_private_data_ptrs()
1874 cc += common->private_data_ptrs[cc + 1 - common->start]; in set_private_data_ptrs()
1890 common->private_data_ptrs[cc - common->start] = private_data_ptr; in set_private_data_ptrs()
1896 common->private_data_ptrs[cc - common->start] = private_data_ptr; in set_private_data_ptrs()
1901 common->private_data_ptrs[cc + 1 - common->start] = 1; in set_private_data_ptrs()
1910 common->private_data_ptrs[cc - common->start] = private_data_ptr; in set_private_data_ptrs()
1917 common->private_data_ptrs[cc - common->start] = 0; in set_private_data_ptrs()
1921 common->private_data_ptrs[cc - common->start] = private_data_ptr; in set_private_data_ptrs()
1994 cc = next_opcode(common, cc); in set_private_data_ptrs()
2003 common->private_data_ptrs[cc - common->start] = private_data_ptr; in set_private_data_ptrs()
2013 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in set_private_data_ptrs()
2035 static int get_framesize(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend, BOOL recursive, … in get_framesize() argument
2046 SLJIT_ASSERT(common->control_head_ptr != 0); in get_framesize()
2057 possessive = length = (common->capture_last_ptr != 0) ? 5 : 3; in get_framesize()
2061 cc = next_opcode(common, cc); in get_framesize()
2069 SLJIT_ASSERT(common->has_set_som); in get_framesize()
2083 SLJIT_ASSERT(common->mark_ptr != 0); in get_framesize()
2090 if (common->control_head_ptr != 0) in get_framesize()
2097 if (common->has_set_som && !setsom_found) in get_framesize()
2102 if (common->mark_ptr != 0 && !setmark_found) in get_framesize()
2107 if (common->capture_last_ptr != 0 && !capture_last_found) in get_framesize()
2120 if (common->capture_last_ptr != 0 && !capture_last_found) in get_framesize()
2131 if (common->control_head_ptr != 0) in get_framesize()
2210 cc = next_opcode(common, cc); in get_framesize()
2224 static void init_frame(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend, int stackpos, int … in init_frame() argument
2242 cc = next_opcode(common, cc); in init_frame()
2250 SLJIT_ASSERT(common->has_set_som); in init_frame()
2267 SLJIT_ASSERT(common->mark_ptr != 0); in init_frame()
2270 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->mark_ptr); in init_frame()
2271 OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, SLJIT_IMM, -common->mark_ptr); in init_frame()
2281 if (common->has_set_som && !setsom_found) in init_frame()
2290 if (common->mark_ptr != 0 && !setmark_found) in init_frame()
2292 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->mark_ptr); in init_frame()
2293 OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, SLJIT_IMM, -common->mark_ptr); in init_frame()
2299 if (common->capture_last_ptr != 0 && !capture_last_found) in init_frame()
2301 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr); in init_frame()
2302 OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, SLJIT_IMM, -common->capture_last_ptr); in init_frame()
2315 if (common->capture_last_ptr != 0 && !capture_last_found) in init_frame()
2317 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr); in init_frame()
2318 OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, SLJIT_IMM, -common->capture_last_ptr); in init_frame()
2338 cc = next_opcode(common, cc); in init_frame()
2358 static void delayed_mem_copy_init(delayed_mem_copy_status *status, compiler_common *common) in delayed_mem_copy_init() argument
2370 status->compiler = common->compiler; in delayed_mem_copy_init()
2424 static BOOL recurse_check_bit(compiler_common *common, sljit_sw bit_index) in recurse_check_bit() argument
2433 SLJIT_ASSERT((bit_index >> 3) < common->recurse_bitset_size); in recurse_check_bit()
2436 byte = common->recurse_bitset + (bit_index >> 3); in recurse_check_bit()
2453 static int get_recurse_data_length(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend, uint32… in get_recurse_data_length() argument
2460 memset(common->recurse_bitset, 0, common->recurse_bitset_size); in get_recurse_data_length()
2463 SLJIT_ASSERT(common->control_head_ptr != 0); in get_recurse_data_length()
2474 SLJIT_ASSERT(common->has_set_som); in get_recurse_data_length()
2480 if (common->has_set_som) in get_recurse_data_length()
2482 if (common->mark_ptr != 0) in get_recurse_data_length()
2484 if (common->capture_last_ptr != 0 && recurse_check_bit(common, common->capture_last_ptr)) in get_recurse_data_length()
2493 if (recurse_check_bit(common, offset)) in get_recurse_data_length()
2514 if (recurse_check_bit(common, PRIVATE_DATA(cc))) in get_recurse_data_length()
2522 if (recurse_check_bit(common, OVECTOR(offset << 1))) in get_recurse_data_length()
2524 SLJIT_ASSERT(recurse_check_bit(common, OVECTOR((offset << 1) + 1))); in get_recurse_data_length()
2527 if (common->optimized_cbracket[offset] == 0 && recurse_check_bit(common, OVECTOR_PRIV(offset))) in get_recurse_data_length()
2529 if (common->capture_last_ptr != 0 && recurse_check_bit(common, common->capture_last_ptr)) in get_recurse_data_length()
2537 if (recurse_check_bit(common, OVECTOR(offset << 1))) in get_recurse_data_length()
2539 SLJIT_ASSERT(recurse_check_bit(common, OVECTOR((offset << 1) + 1))); in get_recurse_data_length()
2542 if (recurse_check_bit(common, OVECTOR_PRIV(offset))) in get_recurse_data_length()
2544 if (recurse_check_bit(common, PRIVATE_DATA(cc))) in get_recurse_data_length()
2546 if (common->capture_last_ptr != 0 && recurse_check_bit(common, common->capture_last_ptr)) in get_recurse_data_length()
2554 …if ((*alternative == OP_KETRMAX || *alternative == OP_KETRMIN) && recurse_check_bit(common, PRIVAT… in get_recurse_data_length()
2561 if (offset != 0 && recurse_check_bit(common, offset)) in get_recurse_data_length()
2565 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in get_recurse_data_length()
2571 if (offset != 0 && recurse_check_bit(common, offset)) in get_recurse_data_length()
2573 SLJIT_ASSERT(recurse_check_bit(common, offset + sizeof(sljit_sw))); in get_recurse_data_length()
2578 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in get_recurse_data_length()
2584 if (offset != 0 && recurse_check_bit(common, offset)) in get_recurse_data_length()
2586 SLJIT_ASSERT(recurse_check_bit(common, offset + sizeof(sljit_sw))); in get_recurse_data_length()
2591 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in get_recurse_data_length()
2597 if (offset != 0 && recurse_check_bit(common, offset)) in get_recurse_data_length()
2604 if (offset != 0 && recurse_check_bit(common, offset)) in get_recurse_data_length()
2606 SLJIT_ASSERT(recurse_check_bit(common, offset + sizeof(sljit_sw))); in get_recurse_data_length()
2614 if (offset != 0 && recurse_check_bit(common, offset)) in get_recurse_data_length()
2616 SLJIT_ASSERT(recurse_check_bit(common, offset + sizeof(sljit_sw))); in get_recurse_data_length()
2632 if (offset != 0 && recurse_check_bit(common, offset)) in get_recurse_data_length()
2641 SLJIT_ASSERT(common->mark_ptr != 0); in get_recurse_data_length()
2643 if (common->control_head_ptr != 0) in get_recurse_data_length()
2664 SLJIT_ASSERT(common->control_head_ptr != 0); in get_recurse_data_length()
2676 cc = next_opcode(common, cc); in get_recurse_data_length()
2705 static void copy_recurse_data(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend, in copy_recurse_data() argument
2716 memset(common->recurse_bitset, 0, common->recurse_bitset_size); in copy_recurse_data()
2719 SLJIT_ASSERT(common->control_head_ptr != 0); in copy_recurse_data()
2720 recurse_check_bit(common, common->control_head_ptr); in copy_recurse_data()
2770 delayed_mem_copy_init(&status, common); in copy_recurse_data()
2777 delayed_mem_copy_move(&status, base_reg, stackptr, SLJIT_SP, common->recursive_head_ptr); in copy_recurse_data()
2780 delayed_mem_copy_move(&status, SLJIT_SP, common->recursive_head_ptr, base_reg, stackptr); in copy_recurse_data()
2789 delayed_mem_copy_move(&status, base_reg, stackptr, SLJIT_SP, common->control_head_ptr); in copy_recurse_data()
2792 delayed_mem_copy_move(&status, SLJIT_SP, common->control_head_ptr, base_reg, stackptr); in copy_recurse_data()
2807 SLJIT_ASSERT(common->has_set_som); in copy_recurse_data()
2808 if ((recurse_flags & recurse_flag_quit_found) && recurse_check_bit(common, OVECTOR(0))) in copy_recurse_data()
2819 if (common->has_set_som && recurse_check_bit(common, OVECTOR(0))) in copy_recurse_data()
2824 if (common->mark_ptr != 0 && recurse_check_bit(common, common->mark_ptr)) in copy_recurse_data()
2826 kept_shared_srcw[kept_shared_count] = common->mark_ptr; in copy_recurse_data()
2830 if (common->capture_last_ptr != 0 && recurse_check_bit(common, common->capture_last_ptr)) in copy_recurse_data()
2832 shared_srcw[0] = common->capture_last_ptr; in copy_recurse_data()
2842 if (recurse_check_bit(common, private_srcw[0])) in copy_recurse_data()
2863 if (recurse_check_bit(common, private_srcw[0])) in copy_recurse_data()
2872 if (recurse_check_bit(common, shared_srcw[0])) in copy_recurse_data()
2875 SLJIT_ASSERT(recurse_check_bit(common, shared_srcw[1])); in copy_recurse_data()
2879 if (common->capture_last_ptr != 0 && recurse_check_bit(common, common->capture_last_ptr)) in copy_recurse_data()
2881 shared_srcw[shared_count] = common->capture_last_ptr; in copy_recurse_data()
2885 if (common->optimized_cbracket[offset] == 0) in copy_recurse_data()
2888 if (recurse_check_bit(common, private_srcw[0])) in copy_recurse_data()
2899 if (recurse_check_bit(common, shared_srcw[0])) in copy_recurse_data()
2902 SLJIT_ASSERT(recurse_check_bit(common, shared_srcw[1])); in copy_recurse_data()
2906 if (common->capture_last_ptr != 0 && recurse_check_bit(common, common->capture_last_ptr)) in copy_recurse_data()
2908 shared_srcw[shared_count] = common->capture_last_ptr; in copy_recurse_data()
2913 if (recurse_check_bit(common, private_srcw[0])) in copy_recurse_data()
2917 if (recurse_check_bit(common, offset)) in copy_recurse_data()
2931 if (recurse_check_bit(common, private_srcw[0])) in copy_recurse_data()
2939 if (private_srcw[0] != 0 && recurse_check_bit(common, private_srcw[0])) in copy_recurse_data()
2943 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in copy_recurse_data()
2949 if (private_srcw[0] != 0 && recurse_check_bit(common, private_srcw[0])) in copy_recurse_data()
2953 SLJIT_ASSERT(recurse_check_bit(common, private_srcw[1])); in copy_recurse_data()
2957 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in copy_recurse_data()
2963 if (private_srcw[0] != 0 && recurse_check_bit(common, private_srcw[0])) in copy_recurse_data()
2967 SLJIT_ASSERT(recurse_check_bit(common, private_srcw[1])); in copy_recurse_data()
2971 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in copy_recurse_data()
2977 if (private_srcw[0] != 0 && recurse_check_bit(common, private_srcw[0])) in copy_recurse_data()
2984 if (private_srcw[0] != 0 && recurse_check_bit(common, private_srcw[0])) in copy_recurse_data()
2988 SLJIT_ASSERT(recurse_check_bit(common, private_srcw[1])); in copy_recurse_data()
2995 if (private_srcw[0] != 0 && recurse_check_bit(common, private_srcw[0])) in copy_recurse_data()
2999 SLJIT_ASSERT(recurse_check_bit(common, private_srcw[1])); in copy_recurse_data()
3022 if (recurse_check_bit(common, private_srcw[0])) in copy_recurse_data()
3026 SLJIT_ASSERT(recurse_check_bit(common, private_srcw[1])); in copy_recurse_data()
3042 SLJIT_ASSERT(common->mark_ptr != 0); in copy_recurse_data()
3043 if ((recurse_flags & recurse_flag_quit_found) && recurse_check_bit(common, common->mark_ptr)) in copy_recurse_data()
3045 kept_shared_srcw[0] = common->mark_ptr; in copy_recurse_data()
3048 if (common->control_head_ptr != 0 && recurse_check_bit(common, common->control_head_ptr)) in copy_recurse_data()
3050 private_srcw[0] = common->control_head_ptr; in copy_recurse_data()
3057 SLJIT_ASSERT(common->control_head_ptr != 0); in copy_recurse_data()
3058 if (recurse_check_bit(common, common->control_head_ptr)) in copy_recurse_data()
3060 private_srcw[0] = common->control_head_ptr; in copy_recurse_data()
3067 cc = next_opcode(common, cc); in copy_recurse_data()
3138 static SLJIT_INLINE PCRE2_SPTR set_then_offsets(compiler_common *common, PCRE2_SPTR cc, sljit_u8 *c… in set_then_offsets() argument
3150 cc = next_opcode(common, cc); in set_then_offsets()
3159 current_offset = common->then_offsets + (cc - common->start); in set_then_offsets()
3165 cc = set_then_offsets(common, cc, current_offset); in set_then_offsets()
3177 current_offset = common->then_offsets + (cc - common->start); in set_then_offsets()
3183 cc = next_opcode(common, cc); in set_then_offsets()
3224 static void add_stub(compiler_common *common, struct sljit_jump *start) in add_stub() argument
3233 list_item->next = common->stubs; in add_stub()
3234 common->stubs = list_item; in add_stub()
3238 static void flush_stubs(compiler_common *common) in flush_stubs() argument
3241 stub_list *list_item = common->stubs; in flush_stubs()
3246 add_jump(compiler, &common->stackalloc, JUMP(SLJIT_FAST_CALL)); in flush_stubs()
3250 common->stubs = NULL; in flush_stubs()
3253 static SLJIT_INLINE void count_match(compiler_common *common) in count_match() argument
3258 add_jump(compiler, &common->calllimit, JUMP(SLJIT_ZERO)); in count_match()
3261 static SLJIT_INLINE void allocate_stack(compiler_common *common, int size) in allocate_stack() argument
3275 add_stub(common, CMP(SLJIT_LESS, STACK_TOP, 0, STACK_LIMIT, 0)); in allocate_stack()
3278 static SLJIT_INLINE void free_stack(compiler_common *common, int size) in free_stack() argument
3286 static sljit_uw * allocate_read_only_data(compiler_common *common, sljit_uw size) in allocate_read_only_data() argument
3301 *(void**)result = common->read_only_data_head; in allocate_read_only_data()
3302 common->read_only_data_head = (void *)result; in allocate_read_only_data()
3306 static SLJIT_INLINE void reset_ovector(compiler_common *common, int length) in reset_ovector() argument
3345 static SLJIT_INLINE void reset_early_fail(compiler_common *common) in reset_early_fail() argument
3348 sljit_u32 size = (sljit_u32)(common->early_fail_end_ptr - common->early_fail_start_ptr); in reset_early_fail()
3354 SLJIT_ASSERT(common->early_fail_start_ptr < common->early_fail_end_ptr); in reset_early_fail()
3358 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->early_fail_start_ptr, SLJIT_IMM, 0); in reset_early_fail()
3370 for (i = common->early_fail_start_ptr; i < common->early_fail_end_ptr; i += sizeof(sljit_sw)) in reset_early_fail()
3375 GET_LOCAL_BASE(TMP1, 0, common->early_fail_start_ptr); in reset_early_fail()
3395 static SLJIT_INLINE void do_reset_match(compiler_common *common, int length) in do_reset_match() argument
3438 if (common->mark_ptr != 0) in do_reset_match()
3439 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->mark_ptr, SLJIT_IMM, 0); in do_reset_match()
3440 if (common->control_head_ptr != 0) in do_reset_match()
3441 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_IMM, 0); in do_reset_match()
3445 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->start_ptr); in do_reset_match()
3473 static SLJIT_INLINE void copy_ovector(compiler_common *common, int topbracket) in copy_ovector() argument
3486 OP1(SLJIT_MOV, SLJIT_S0, 0, SLJIT_MEM1(SLJIT_SP), common->start_ptr); in copy_ovector()
3487 if (common->mark_ptr != 0) in copy_ovector()
3488 OP1(SLJIT_MOV, SLJIT_R2, 0, SLJIT_MEM1(SLJIT_SP), common->mark_ptr); in copy_ovector()
3491 if (common->mark_ptr != 0) in copy_ovector()
3498 OP1(SLJIT_MOV, SLJIT_S0, 0, SLJIT_MEM1(SLJIT_SP), common->start_ptr); in copy_ovector()
3500 if (common->mark_ptr != 0) in copy_ovector()
3501 OP1(SLJIT_MOV, SLJIT_R0, 0, SLJIT_MEM1(SLJIT_SP), common->mark_ptr); in copy_ovector()
3504 if (common->mark_ptr != 0) in copy_ovector()
3570 static SLJIT_INLINE void return_with_partial_match(compiler_common *common, struct sljit_label *qui… in return_with_partial_match() argument
3577 SLJIT_ASSERT(common->start_used_ptr != 0 && common->start_ptr != 0 in return_with_partial_match()
3578 && (common->mode == PCRE2_JIT_PARTIAL_SOFT ? common->hit_start != 0 : common->hit_start == 0)); in return_with_partial_match()
3583 common->mode == PCRE2_JIT_PARTIAL_SOFT ? common->hit_start : common->start_ptr); in return_with_partial_match()
3608 static SLJIT_INLINE void check_start_used_ptr(compiler_common *common) in check_start_used_ptr() argument
3614 if (common->mode == PCRE2_JIT_PARTIAL_SOFT) in check_start_used_ptr()
3617 OP2(SLJIT_ADD, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, SLJIT_IMM, 1); in check_start_used_ptr()
3621 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0); in check_start_used_ptr()
3624 else if (common->mode == PCRE2_JIT_PARTIAL_HARD) in check_start_used_ptr()
3626 jump = CMP(SLJIT_LESS_EQUAL, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0); in check_start_used_ptr()
3627 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0); in check_start_used_ptr()
3632 static SLJIT_INLINE BOOL char_has_othercase(compiler_common *common, PCRE2_SPTR cc) in char_has_othercase() argument
3638 if (common->utf || common->ucp) in char_has_othercase()
3640 if (common->utf) in char_has_othercase()
3650 return common->fcc[c] != c; in char_has_othercase()
3655 return MAX_255(c) ? common->fcc[c] != c : FALSE; in char_has_othercase()
3658 static SLJIT_INLINE unsigned int char_othercase(compiler_common *common, unsigned int c) in char_othercase() argument
3662 if ((common->utf || common->ucp) && c > 127) in char_othercase()
3665 return TABLE_GET(c, common->fcc, c); in char_othercase()
3668 static unsigned int char_get_othercase_bit(compiler_common *common, PCRE2_SPTR cc) in char_get_othercase_bit() argument
3677 if (common->utf || common->ucp) in char_get_othercase_bit()
3679 if (common->utf) in char_get_othercase_bit()
3687 oc = common->fcc[c]; in char_get_othercase_bit()
3694 oc = TABLE_GET(c, common->fcc, c); in char_get_othercase_bit()
3698 oc = TABLE_GET(c, common->fcc, c); in char_get_othercase_bit()
3715 if (common->utf && c > 127) in char_get_othercase_bit()
3731 if (common->utf && c > 65535) in char_get_othercase_bit()
3744 static void check_partial(compiler_common *common, BOOL force) in check_partial() argument
3750 SLJIT_ASSERT(!force || common->mode != PCRE2_JIT_COMPLETE); in check_partial()
3752 if (common->mode == PCRE2_JIT_COMPLETE) in check_partial()
3755 if (!force && !common->allow_empty_partial) in check_partial()
3756 jump = CMP(SLJIT_GREATER_EQUAL, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0); in check_partial()
3757 else if (common->mode == PCRE2_JIT_PARTIAL_SOFT) in check_partial()
3758 jump = CMP(SLJIT_EQUAL, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, SLJIT_IMM, -1); in check_partial()
3760 if (common->mode == PCRE2_JIT_PARTIAL_SOFT) in check_partial()
3761 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, 0); in check_partial()
3764 if (common->partialmatchlabel != NULL) in check_partial()
3765 JUMPTO(SLJIT_JUMP, common->partialmatchlabel); in check_partial()
3767 add_jump(compiler, &common->partialmatch, JUMP(SLJIT_JUMP)); in check_partial()
3774 static void check_str_end(compiler_common *common, jump_list **end_reached) in check_str_end() argument
3780 if (common->mode == PCRE2_JIT_COMPLETE) in check_str_end()
3787 if (common->mode == PCRE2_JIT_PARTIAL_SOFT) in check_str_end()
3789 …add_jump(compiler, end_reached, CMP(SLJIT_GREATER_EQUAL, SLJIT_MEM1(SLJIT_SP), common->start_used_… in check_str_end()
3790 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, 0); in check_str_end()
3795 …add_jump(compiler, end_reached, CMP(SLJIT_GREATER_EQUAL, SLJIT_MEM1(SLJIT_SP), common->start_used_… in check_str_end()
3796 if (common->partialmatchlabel != NULL) in check_str_end()
3797 JUMPTO(SLJIT_JUMP, common->partialmatchlabel); in check_str_end()
3799 add_jump(compiler, &common->partialmatch, JUMP(SLJIT_JUMP)); in check_str_end()
3804 static void detect_partial_match(compiler_common *common, jump_list **backtracks) in detect_partial_match() argument
3809 if (common->mode == PCRE2_JIT_COMPLETE) in detect_partial_match()
3817 if (!common->allow_empty_partial) in detect_partial_match()
3818 …add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, SLJIT_MEM1(SLJIT_SP), common->start_used_p… in detect_partial_match()
3819 else if (common->mode == PCRE2_JIT_PARTIAL_SOFT) in detect_partial_match()
3820 …add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, SLJI… in detect_partial_match()
3822 if (common->mode == PCRE2_JIT_PARTIAL_SOFT) in detect_partial_match()
3824 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, 0); in detect_partial_match()
3829 if (common->partialmatchlabel != NULL) in detect_partial_match()
3830 JUMPTO(SLJIT_JUMP, common->partialmatchlabel); in detect_partial_match()
3832 add_jump(compiler, &common->partialmatch, JUMP(SLJIT_JUMP)); in detect_partial_match()
3837 static void process_partial_match(compiler_common *common) in process_partial_match() argument
3843 if (common->mode == PCRE2_JIT_PARTIAL_SOFT) in process_partial_match()
3845 jump = CMP(SLJIT_GREATER_EQUAL, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0); in process_partial_match()
3846 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, 0); in process_partial_match()
3849 else if (common->mode == PCRE2_JIT_PARTIAL_HARD) in process_partial_match()
3851 if (common->partialmatchlabel != NULL) in process_partial_match()
3852 …CMPTO(SLJIT_LESS, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0, common->partialmatchla… in process_partial_match()
3854 …add_jump(compiler, &common->partialmatch, CMP(SLJIT_LESS, SLJIT_MEM1(SLJIT_SP), common->start_used… in process_partial_match()
3858 static void detect_partial_match_to(compiler_common *common, struct sljit_label *label) in detect_partial_match_to() argument
3863 process_partial_match(common); in detect_partial_match_to()
3866 static void peek_char(compiler_common *common, sljit_u32 max, sljit_s32 dst, sljit_sw dstw, jump_li… in peek_char() argument
3884 if (common->utf) in peek_char()
3891 …add_jump(compiler, common->invalid_utf ? &common->utfreadchar_invalid : &common->utfreadchar, JUMP… in peek_char()
3893 if (backtracks && common->invalid_utf) in peek_char()
3898 if (common->utf) in peek_char()
3904 if (common->invalid_utf) in peek_char()
3909 add_jump(compiler, &common->utfreadchar_invalid, JUMP(SLJIT_FAST_CALL)); in peek_char()
3911 if (backtracks && common->invalid_utf) in peek_char()
3927 if (common->invalid_utf) in peek_char()
3950 static void peek_char_back(compiler_common *common, sljit_u32 max, jump_list **backtracks) in peek_char_back() argument
3967 if (common->utf) in peek_char_back()
3972 if (common->invalid_utf) in peek_char_back()
3974 add_jump(compiler, &common->utfpeakcharback_invalid, JUMP(SLJIT_FAST_CALL)); in peek_char_back()
3979 add_jump(compiler, &common->utfpeakcharback, JUMP(SLJIT_FAST_CALL)); in peek_char_back()
3983 if (common->utf) in peek_char_back()
3987 if (common->invalid_utf) in peek_char_back()
3990 add_jump(compiler, &common->utfpeakcharback_invalid, JUMP(SLJIT_FAST_CALL)); in peek_char_back()
4008 if (common->invalid_utf) in peek_char_back()
4023 static void read_char(compiler_common *common, sljit_u32 min, sljit_u32 max, in read_char() argument
4048 if (common->utf) in read_char()
4052 if (common->invalid_utf && !(options & READ_CHAR_VALID_UTF)) in read_char()
4057 add_jump(compiler, &common->utfreadnewline_invalid, JUMP(SLJIT_FAST_CALL)); in read_char()
4059 add_jump(compiler, &common->utfreadchar_invalid, JUMP(SLJIT_FAST_CALL)); in read_char()
4114 add_jump(compiler, &common->utfreadchar, JUMP(SLJIT_FAST_CALL)); in read_char()
4138 if (common->utf) in read_char()
4142 if (common->invalid_utf && !(options & READ_CHAR_VALID_UTF)) in read_char()
4148 add_jump(compiler, &common->utfreadnewline_invalid, JUMP(SLJIT_FAST_CALL)); in read_char()
4150 add_jump(compiler, &common->utfreadchar_invalid, JUMP(SLJIT_FAST_CALL)); in read_char()
4196 if (common->invalid_utf) in read_char()
4217 static void skip_valid_char(compiler_common *common) in skip_valid_char() argument
4225 if (common->utf) in skip_valid_char()
4267 static void read_char7_type(compiler_common *common, jump_list **backtracks, BOOL negated) in read_char7_type() argument
4275 SLJIT_ASSERT(common->utf); in read_char7_type()
4281 OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); in read_char7_type()
4287 if (common->invalid_utf) in read_char7_type()
4290 add_jump(compiler, &common->utfreadchar_invalid, JUMP(SLJIT_FAST_CALL)); in read_char7_type()
4305 static void read_char8_type(compiler_common *common, jump_list **backtracks, BOOL negated) in read_char8_type() argument
4323 if (common->utf) in read_char8_type()
4326 OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); in read_char8_type()
4331 if (common->invalid_utf) in read_char8_type()
4337 if (common->invalid_utf) in read_char8_type()
4343 if (common->invalid_utf) in read_char8_type()
4348 OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); in read_char8_type()
4351 else if (common->invalid_utf) in read_char8_type()
4353 add_jump(compiler, &common->utfreadchar_invalid, JUMP(SLJIT_FAST_CALL)); in read_char8_type()
4359 OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); in read_char8_type()
4363 add_jump(compiler, &common->utfreadtype8, JUMP(SLJIT_FAST_CALL)); in read_char8_type()
4371 if (common->invalid_utf && negated) in read_char8_type()
4380 OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); in read_char8_type()
4386 if (common->utf && negated) in read_char8_type()
4389 if (!common->invalid_utf) in read_char8_type()
4424 static void move_back(compiler_common *common, jump_list **backtracks, BOOL must_be_valid) in move_back() argument
4439 if (common->utf) in move_back()
4441 if (!must_be_valid && common->invalid_utf) in move_back()
4446 add_jump(compiler, &common->utfmoveback_invalid, JUMP(SLJIT_FAST_CALL)); in move_back()
4461 if (common->utf) in move_back()
4466 if (!must_be_valid && common->invalid_utf) in move_back()
4470 add_jump(compiler, &common->utfmoveback_invalid, JUMP(SLJIT_FAST_CALL)); in move_back()
4486 if (common->invalid_utf && !must_be_valid) in move_back()
4511 static void check_newlinechar(compiler_common *common, int nltype, jump_list **backtracks, BOOL jum… in check_newlinechar() argument
4519 add_jump(compiler, &common->anynewline, JUMP(SLJIT_FAST_CALL)); in check_newlinechar()
4539 SLJIT_ASSERT(nltype == NLTYPE_FIXED && common->newline < 256); in check_newlinechar()
4540 …backtracks, CMP(jumpifmatch ? SLJIT_EQUAL : SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, common->newline)); in check_newlinechar()
4547 static void do_utfreadchar(compiler_common *common) in do_utfreadchar() argument
4592 static void do_utfreadtype8(compiler_common *common) in do_utfreadtype8() argument
4613 OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); in do_utfreadtype8()
4628 static void do_utfreadchar_invalid(compiler_common *common) in do_utfreadchar_invalid() argument
4787 static void do_utfreadnewline_invalid(compiler_common *common) in do_utfreadnewline_invalid() argument
4800 if (common->nltype != NLTYPE_ANY) in do_utfreadnewline_invalid()
4802 SLJIT_ASSERT(common->nltype != NLTYPE_FIXED || common->newline < 128); in do_utfreadnewline_invalid()
4878 static void do_utfmoveback_invalid(compiler_common *common) in do_utfmoveback_invalid() argument
4974 static void do_utfpeakcharback(compiler_common *common) in do_utfpeakcharback() argument
5011 static void do_utfpeakcharback_invalid(compiler_common *common) in do_utfpeakcharback_invalid() argument
5147 static void do_utfreadchar_invalid(compiler_common *common) in do_utfreadchar_invalid() argument
5179 static void do_utfreadnewline_invalid(compiler_common *common) in do_utfreadnewline_invalid() argument
5211 static void do_utfmoveback_invalid(compiler_common *common) in do_utfmoveback_invalid() argument
5239 static void do_utfpeakcharback_invalid(compiler_common *common) in do_utfpeakcharback_invalid() argument
5277 static void do_getucd(compiler_common *common) in do_getucd() argument
5298 if (!common->utf) in do_getucd()
5317 static void do_getucdtype(compiler_common *common) in do_getucdtype() argument
5338 if (!common->utf) in do_getucdtype()
5366 static SLJIT_INLINE struct sljit_label *mainloop_entry(compiler_common *common) in mainloop_entry() argument
5379 sljit_u32 overall_options = common->re->overall_options; in mainloop_entry()
5380 BOOL hascrorlf = (common->re->flags & PCRE2_HASCRORLF) != 0; in mainloop_entry()
5385 && (common->nltype == NLTYPE_ANY || common->nltype == NLTYPE_ANYCRLF || common->newline > 255)) in mainloop_entry()
5388 SLJIT_ASSERT(common->abort_label == NULL); in mainloop_entry()
5393 SLJIT_ASSERT(common->match_end_ptr != 0); in mainloop_entry()
5396 if (common->nltype == NLTYPE_FIXED && common->newline > 255) in mainloop_entry()
5403 CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff, mainloop); in mainloop_entry()
5404 CMPTO(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, common->newline & 0xff, mainloop); in mainloop_entry()
5406 … OP2(SLJIT_SUB, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); in mainloop_entry()
5413 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr, STR_PTR, 0); in mainloop_entry()
5414 read_char(common, common->nlmin, common->nlmax, NULL, READ_CHAR_NEWLINE); in mainloop_entry()
5415 check_newlinechar(common, common->nltype, &newline, TRUE); in mainloop_entry()
5418 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr, STR_PTR, 0); in mainloop_entry()
5427 SLJIT_ASSERT(common->match_end_ptr != 0); in mainloop_entry()
5455 add_jump(compiler, &common->abort, CMP(SLJIT_LESS, TMP2, 0, STR_PTR, 0)); in mainloop_entry()
5457 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr, TMP2, 0); in mainloop_entry()
5468 OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, common->newline & 0xff); in mainloop_entry()
5481 if (common->utf && !common->invalid_utf) readuchar = TRUE; in mainloop_entry()
5489 CMPTO(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff, newlinelabel); in mainloop_entry()
5494 if (common->invalid_utf) in mainloop_entry()
5506 else if (common->utf) in mainloop_entry()
5514 if (common->invalid_utf) in mainloop_entry()
5526 else if (common->utf) in mainloop_entry()
5592 static int scan_prefix(compiler_common *common, PCRE2_SPTR cc, fast_forward_char_data *chars, int m… in scan_prefix() argument
5687 if (common->utf && HAS_EXTRALEN(*cc)) len += GET_EXTRALEN(*cc); in scan_prefix()
5689 max_chars = scan_prefix(common, cc + len, chars, max_chars, rec_count); in scan_prefix()
5711 max_chars = scan_prefix(common, alternative + 1 + LINK_SIZE, chars, max_chars, rec_count); in scan_prefix()
5724 if (common->utf && !is_char7_bitset((const sljit_u8 *)(cc + 1), FALSE)) in scan_prefix()
5732 if (common->utf) return consumed; in scan_prefix()
5740 if (common->utf) return consumed; in scan_prefix()
5749 …if (common->utf && !is_char7_bitset((const sljit_u8 *)common->ctypes - cbit_length + cbit_digit, F… in scan_prefix()
5758 …if (common->utf && !is_char7_bitset((const sljit_u8 *)common->ctypes - cbit_length + cbit_space, F… in scan_prefix()
5767 …if (common->utf && !is_char7_bitset((const sljit_u8 *)common->ctypes - cbit_length + cbit_word, FA… in scan_prefix()
5784 if (common->utf) return consumed; in scan_prefix()
5794 if (common->utf) return consumed; in scan_prefix()
5809 if (common->utf) return consumed; in scan_prefix()
5850 max_chars = scan_prefix(common, cc + 1, chars, max_chars, rec_count); in scan_prefix()
5936 if (common->utf && HAS_EXTRALEN(*cc)) len += GET_EXTRALEN(*cc); in scan_prefix()
5939 if (caseless && char_has_othercase(common, cc)) in scan_prefix()
5942 if (common->utf) in scan_prefix()
5945 if ((int)PRIV(ord2utf)(char_othercase(common, chr), othercase) != len) in scan_prefix()
5953 if (common->ucp && chr > 127) in scan_prefix()
5960 othercase[0] = TABLE_GET(chr, common->fcc, chr); in scan_prefix()
6025 static BOOL check_fast_forward_char_pair_simd(compiler_common *common, fast_forward_char_data *char… in check_fast_forward_char_pair_simd() argument
6067 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()
6073 static void fast_forward_first_char2(compiler_common *common, PCRE2_UCHAR char1, PCRE2_UCHAR char2,… in fast_forward_first_char2() argument
6080 BOOL has_match_end = (common->match_end_ptr != 0); in fast_forward_first_char2()
6082 SLJIT_ASSERT(common->mode == PCRE2_JIT_COMPLETE || offset == 0); in fast_forward_first_char2()
6085 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr); in fast_forward_first_char2()
6103 fast_forward_char_simd(common, char1, char2, offset); in fast_forward_first_char2()
6118 if (common->mode == PCRE2_JIT_COMPLETE) in fast_forward_first_char2()
6119 add_jump(compiler, &common->failed_match, partial_quit); in fast_forward_first_char2()
6143 if (common->utf && offset > 0) in fast_forward_first_char2()
6152 if (common->mode != PCRE2_JIT_COMPLETE) in fast_forward_first_char2()
6159 static SLJIT_INLINE BOOL fast_forward_first_n_chars(compiler_common *common) in fast_forward_first_n_chars() argument
6181 max = scan_prefix(common, common->start, chars, MAX_N_CHARS, &rec_count); in fast_forward_first_n_chars()
6220 if (JIT_HAS_FAST_FORWARD_CHAR_PAIR_SIMD && check_fast_forward_char_pair_simd(common, chars, max)) in fast_forward_first_n_chars()
6251 update_table = (sljit_u8 *)allocate_read_only_data(common, 256); in fast_forward_first_n_chars()
6295 fast_forward_first_char2(common, chars[offset].chars[0], chars[offset].chars[1], offset); in fast_forward_first_n_chars()
6301 if (common->match_end_ptr != 0) in fast_forward_first_n_chars()
6303 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr); in fast_forward_first_n_chars()
6306 add_jump(compiler, &common->failed_match, JUMP(SLJIT_LESS)); in fast_forward_first_n_chars()
6313 add_jump(compiler, &common->failed_match, JUMP(SLJIT_LESS)); in fast_forward_first_n_chars()
6322 add_jump(compiler, &common->failed_match, CMP(SLJIT_GREATER, STR_PTR, 0, STR_END, 0)); in fast_forward_first_n_chars()
6363 if (common->utf && offset != 0) in fast_forward_first_n_chars()
6383 if (common->match_end_ptr != 0) in fast_forward_first_n_chars()
6390 static SLJIT_INLINE void fast_forward_first_char(compiler_common *common) in fast_forward_first_char() argument
6392 PCRE2_UCHAR first_char = (PCRE2_UCHAR)(common->re->first_codeunit); in fast_forward_first_char()
6396 if ((common->re->flags & PCRE2_FIRSTCASELESS) != 0) in fast_forward_first_char()
6398 oc = TABLE_GET(first_char, common->fcc, first_char); in fast_forward_first_char()
6400 if (first_char > 127 && (common->utf || common->ucp)) in fast_forward_first_char()
6405 fast_forward_first_char2(common, first_char, oc, 0); in fast_forward_first_char()
6408 static SLJIT_INLINE void fast_forward_newline(compiler_common *common) in fast_forward_newline() argument
6419 if (common->match_end_ptr != 0) in fast_forward_newline()
6422 OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr); in fast_forward_newline()
6425 if (common->nltype == NLTYPE_FIXED && common->newline > 255) in fast_forward_newline()
6428 if (JIT_HAS_FAST_FORWARD_CHAR_PAIR_SIMD && common->mode == PCRE2_JIT_COMPLETE) in fast_forward_newline()
6451 …st_forward_char_pair_simd(common, 1, common->newline & 0xff, common->newline & 0xff, 0, (common->n… in fast_forward_newline()
6484 CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff, loop); in fast_forward_newline()
6485 CMPTO(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, common->newline & 0xff, loop); in fast_forward_newline()
6493 if (common->match_end_ptr != 0) in fast_forward_newline()
6509 if (common->nltype == NLTYPE_ANY) in fast_forward_newline()
6510 move_back(common, NULL, FALSE); in fast_forward_newline()
6515 common->ff_newline_shortcut = loop; in fast_forward_newline()
6518 if (JIT_HAS_FAST_FORWARD_CHAR_SIMD && (common->nltype == NLTYPE_FIXED || common->nltype == NLTYPE_A… in fast_forward_newline()
6520 if (common->nltype == NLTYPE_ANYCRLF) in fast_forward_newline()
6522 fast_forward_char_simd(common, CHAR_CR, CHAR_LF, 0); in fast_forward_newline()
6523 if (common->mode != PCRE2_JIT_COMPLETE) in fast_forward_newline()
6532 fast_forward_char_simd(common, common->newline, common->newline, 0); in fast_forward_newline()
6535 if (common->mode != PCRE2_JIT_COMPLETE) in fast_forward_newline()
6545 read_char(common, common->nlmin, common->nlmax, NULL, READ_CHAR_NEWLINE); in fast_forward_newline()
6547 if (common->nltype == NLTYPE_ANY || common->nltype == NLTYPE_ANYCRLF) in fast_forward_newline()
6549 check_newlinechar(common, common->nltype, &newline, FALSE); in fast_forward_newline()
6553 if (common->nltype == NLTYPE_ANY || common->nltype == NLTYPE_ANYCRLF) in fast_forward_newline()
6577 if (common->match_end_ptr != 0) in fast_forward_newline()
6581 static BOOL optimize_class(compiler_common *common, const sljit_u8 *bits, BOOL nclass, BOOL invert,…
6583 static SLJIT_INLINE void fast_forward_start_bits(compiler_common *common) in fast_forward_start_bits() argument
6586 const sljit_u8 *start_bits = common->re->start_bitmap; in fast_forward_start_bits()
6594 if (common->match_end_ptr != 0) in fast_forward_start_bits()
6596 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr); in fast_forward_start_bits()
6606 if (common->mode == PCRE2_JIT_COMPLETE) in fast_forward_start_bits()
6607 add_jump(compiler, &common->failed_match, partial_quit); in fast_forward_start_bits()
6612 if (!optimize_class(common, start_bits, (start_bits[31] & 0x80) != 0, FALSE, &matches)) in fast_forward_start_bits()
6620 if (common->utf && is_char7_bitset(start_bits, FALSE)) in fast_forward_start_bits()
6648 if (common->mode != PCRE2_JIT_COMPLETE) in fast_forward_start_bits()
6651 if (common->match_end_ptr != 0) in fast_forward_start_bits()
6655 static SLJIT_INLINE jump_list *search_requested_char(compiler_common *common, PCRE2_UCHAR req_char,… in search_requested_char() argument
6666 SLJIT_ASSERT(common->req_char_ptr != 0); in search_requested_char()
6668 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->req_char_ptr); in search_requested_char()
6680 oc = TABLE_GET(req_char, common->fcc, req_char); in search_requested_char()
6682 if (req_char > 127 && (common->utf || common->ucp)) in search_requested_char()
6690 not_found = fast_requested_char_simd(common, req_char, oc); in search_requested_char()
6724 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->req_char_ptr, TMP1, 0); in search_requested_char()
6731 static void do_revertframes(compiler_common *common) in do_revertframes() argument
6797 static void check_wordboundary(compiler_common *common, BOOL ucp) in check_wordboundary() argument
6822 if (common->invalid_utf) in check_wordboundary()
6824 peek_char_back(common, READ_CHAR_MAX, &invalid_utf1); in check_wordboundary()
6826 if (common->mode != PCRE2_JIT_COMPLETE) in check_wordboundary()
6830 move_back(common, NULL, TRUE); in check_wordboundary()
6831 check_start_used_ptr(common); in check_wordboundary()
6839 if (common->mode == PCRE2_JIT_COMPLETE) in check_wordboundary()
6840 peek_char_back(common, READ_CHAR_MAX, NULL); in check_wordboundary()
6843 move_back(common, NULL, TRUE); in check_wordboundary()
6844 check_start_used_ptr(common); in check_wordboundary()
6845 read_char(common, 0, READ_CHAR_MAX, NULL, READ_CHAR_UPDATE_STR_PTR); in check_wordboundary()
6853 add_jump(compiler, &common->getucdtype, JUMP(SLJIT_FAST_CALL)); in check_wordboundary()
6866 if (common->utf) in check_wordboundary()
6869 OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), common->ctypes); in check_wordboundary()
6882 check_str_end(common, &skipread_list); in check_wordboundary()
6883 peek_char(common, READ_CHAR_MAX, SLJIT_MEM1(SLJIT_SP), LOCALS1, &invalid_utf2); in check_wordboundary()
6892 add_jump(compiler, &common->getucdtype, JUMP(SLJIT_FAST_CALL)); in check_wordboundary()
6907 if (common->utf) in check_wordboundary()
6910 OP1(SLJIT_MOV_U8, TMP2, 0, SLJIT_MEM1(TMP1), common->ctypes); in check_wordboundary()
6927 if (common->invalid_utf) in check_wordboundary()
6931 peek_char(common, READ_CHAR_MAX, SLJIT_MEM1(SLJIT_SP), LOCALS1, NULL); in check_wordboundary()
6946 static BOOL optimize_class_ranges(compiler_common *common, const sljit_u8 *bits, BOOL nclass, BOOL … in optimize_class_ranges() argument
7098 static BOOL optimize_class_chars(compiler_common *common, const sljit_u8 *bits, BOOL nclass, BOOL i… in optimize_class_chars() argument
7199 static BOOL optimize_class(compiler_common *common, const sljit_u8 *bits, BOOL nclass, BOOL invert,… in optimize_class() argument
7202 if (optimize_class_ranges(common, bits, nclass, invert, backtracks)) in optimize_class()
7204 return optimize_class_chars(common, bits, nclass, invert, backtracks); in optimize_class()
7207 static void check_anynewline(compiler_common *common) in check_anynewline() argument
7220 if (common->utf) in check_anynewline()
7234 static void check_hspace(compiler_common *common) in check_hspace() argument
7248 if (common->utf) in check_hspace()
7273 static void check_vspace(compiler_common *common) in check_vspace() argument
7286 if (common->utf) in check_vspace()
7301 static void do_casefulcmp(compiler_common *common) in do_casefulcmp() argument
7381 static void do_caselesscmp(compiler_common *common) in do_caselesscmp() argument
7418 OP1(SLJIT_MOV, lcc_table, 0, SLJIT_IMM, common->lcc); in do_caselesscmp()
7479 static PCRE2_SPTR byte_sequence_compare(compiler_common *common, BOOL caseless, PCRE2_SPTR cc, in byte_sequence_compare() argument
7489 if (caseless && char_has_othercase(common, cc)) in byte_sequence_compare()
7491 othercasebit = char_get_othercase_bit(common, cc); in byte_sequence_compare()
7536 if (common->utf && HAS_EXTRALEN(*cc)) in byte_sequence_compare()
7644 static PCRE2_SPTR compile_char1_matchingpath(compiler_common *common, PCRE2_UCHAR type, PCRE2_SPTR …
7660 static void compile_xclass_matchingpath(compiler_common *common, PCRE2_SPTR cc, jump_list **backtra… in compile_xclass_matchingpath() argument
7670 BOOL utf = common->utf; in compile_xclass_matchingpath()
7830 compile_char1_matchingpath(common, OP_ALLANY, cc, backtracks, FALSE); in compile_xclass_matchingpath()
7839 compile_char1_matchingpath(common, OP_ALLANY, cc, backtracks, FALSE); in compile_xclass_matchingpath()
7851 read_char(common, min, max, backtracks, READ_CHAR_UPDATE_STR_PTR); in compile_xclass_matchingpath()
7855 read_char(common, min, max, (unicode_status & XCLASS_NEEDS_UCD) ? backtracks : NULL, 0); in compile_xclass_matchingpath()
7857 read_char(common, min, max, NULL, 0); in compile_xclass_matchingpath()
7866 …if (!optimize_class(common, (const sljit_u8 *)cc, (((const sljit_u8 *)cc)[31] & 0x80) != 0, TRUE, … in compile_xclass_matchingpath()
7893 if (!optimize_class(common, (const sljit_u8 *)cc, FALSE, TRUE, list)) in compile_xclass_matchingpath()
7897 if (common->utf) in compile_xclass_matchingpath()
7909 if (common->utf) in compile_xclass_matchingpath()
7925 if (!common->utf) in compile_xclass_matchingpath()
8453 static PCRE2_SPTR compile_simple_assertion_matchingpath(compiler_common *common, PCRE2_UCHAR type, … in compile_simple_assertion_matchingpath() argument
8486 …type == OP_NOT_WORD_BOUNDARY || type == OP_WORD_BOUNDARY) ? &common->wordboundary : &common->ucp_w… in compile_simple_assertion_matchingpath()
8488 if (common->invalid_utf) in compile_simple_assertion_matchingpath()
8501 if (common->nltype == NLTYPE_FIXED && common->newline > 255) in compile_simple_assertion_matchingpath()
8505 if (common->mode == PCRE2_JIT_COMPLETE) in compile_simple_assertion_matchingpath()
8512 OP2U(SLJIT_SUB | SLJIT_SET_Z, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff); in compile_simple_assertion_matchingpath()
8515 check_partial(common, TRUE); in compile_simple_assertion_matchingpath()
8520 …add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0… in compile_simple_assertion_matchingpath()
8521 … add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, common->newline & 0xff)); in compile_simple_assertion_matchingpath()
8523 else if (common->nltype == NLTYPE_FIXED) in compile_simple_assertion_matchingpath()
8528 add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, common->newline)); in compile_simple_assertion_matchingpath()
8544 if (common->nltype == NLTYPE_ANYCRLF) in compile_simple_assertion_matchingpath()
8553 read_char(common, common->nlmin, common->nlmax, backtracks, READ_CHAR_UPDATE_STR_PTR); in compile_simple_assertion_matchingpath()
8555 add_jump(compiler, &common->anynewline, JUMP(SLJIT_FAST_CALL)); in compile_simple_assertion_matchingpath()
8564 if (common->mode != PCRE2_JIT_COMPLETE) in compile_simple_assertion_matchingpath()
8565 check_partial(common, TRUE); in compile_simple_assertion_matchingpath()
8570 if (common->mode != PCRE2_JIT_COMPLETE) in compile_simple_assertion_matchingpath()
8571 check_partial(common, TRUE); in compile_simple_assertion_matchingpath()
8584 if (!common->endonly) in compile_simple_assertion_matchingpath()
8585 compile_simple_assertion_matchingpath(common, OP_EODN, cc, backtracks); in compile_simple_assertion_matchingpath()
8589 check_partial(common, FALSE); in compile_simple_assertion_matchingpath()
8603 check_partial(common, FALSE); in compile_simple_assertion_matchingpath()
8607 if (common->nltype == NLTYPE_FIXED && common->newline > 255) in compile_simple_assertion_matchingpath()
8611 if (common->mode == PCRE2_JIT_COMPLETE) in compile_simple_assertion_matchingpath()
8617 …add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0… in compile_simple_assertion_matchingpath()
8618 check_partial(common, TRUE); in compile_simple_assertion_matchingpath()
8624 …add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0… in compile_simple_assertion_matchingpath()
8625 … add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, common->newline & 0xff)); in compile_simple_assertion_matchingpath()
8629 peek_char(common, common->nlmax, TMP3, 0, NULL); in compile_simple_assertion_matchingpath()
8630 check_newlinechar(common, common->nltype, backtracks, FALSE); in compile_simple_assertion_matchingpath()
8672 if (!common->alt_circumflex) in compile_simple_assertion_matchingpath()
8675 if (common->nltype == NLTYPE_FIXED && common->newline > 255) in compile_simple_assertion_matchingpath()
8681 …add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0… in compile_simple_assertion_matchingpath()
8682 … add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, common->newline & 0xff)); in compile_simple_assertion_matchingpath()
8686 peek_char_back(common, common->nlmax, backtracks); in compile_simple_assertion_matchingpath()
8687 check_newlinechar(common, common->nltype, backtracks, FALSE); in compile_simple_assertion_matchingpath()
8950 static PCRE2_SPTR compile_char1_matchingpath(compiler_common *common, PCRE2_UCHAR type, PCRE2_SPTR … in compile_char1_matchingpath() argument
8968 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
8970 …if (common->utf && is_char7_bitset((const sljit_u8*)common->ctypes - cbit_length + cbit_digit, FAL… in compile_char1_matchingpath()
8971 read_char7_type(common, backtracks, type == OP_NOT_DIGIT); in compile_char1_matchingpath()
8974 read_char8_type(common, backtracks, type == OP_NOT_DIGIT); in compile_char1_matchingpath()
8983 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
8985 …if (common->utf && is_char7_bitset((const sljit_u8*)common->ctypes - cbit_length + cbit_space, FAL… in compile_char1_matchingpath()
8986 read_char7_type(common, backtracks, type == OP_NOT_WHITESPACE); in compile_char1_matchingpath()
8989 read_char8_type(common, backtracks, type == OP_NOT_WHITESPACE); in compile_char1_matchingpath()
8997 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
8999 …if (common->utf && is_char7_bitset((const sljit_u8*)common->ctypes - cbit_length + cbit_word, FALS… in compile_char1_matchingpath()
9000 read_char7_type(common, backtracks, type == OP_NOT_WORDCHAR); in compile_char1_matchingpath()
9003 read_char8_type(common, backtracks, type == OP_NOT_WORDCHAR); in compile_char1_matchingpath()
9010 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
9011 read_char(common, common->nlmin, common->nlmax, backtracks, READ_CHAR_UPDATE_STR_PTR); in compile_char1_matchingpath()
9012 if (common->nltype == NLTYPE_FIXED && common->newline > 255) in compile_char1_matchingpath()
9014 jump[0] = CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff); in compile_char1_matchingpath()
9016 if (common->mode != PCRE2_JIT_PARTIAL_HARD) in compile_char1_matchingpath()
9019 check_str_end(common, &end_list); in compile_char1_matchingpath()
9022 add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, common->newline & 0xff)); in compile_char1_matchingpath()
9027 check_newlinechar(common, common->nltype, backtracks, TRUE); in compile_char1_matchingpath()
9032 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
9034 if (common->utf && common->invalid_utf) in compile_char1_matchingpath()
9036 read_char(common, 0, READ_CHAR_MAX, backtracks, READ_CHAR_UPDATE_STR_PTR); in compile_char1_matchingpath()
9041 skip_valid_char(common); in compile_char1_matchingpath()
9046 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
9059 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
9060 compile_xclass_matchingpath(common, propdata, backtracks); in compile_char1_matchingpath()
9066 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
9067 read_char(common, common->bsr_nlmin, common->bsr_nlmax, NULL, 0); in compile_char1_matchingpath()
9071 if (common->mode != PCRE2_JIT_PARTIAL_HARD) in compile_char1_matchingpath()
9074 check_str_end(common, &end_list); in compile_char1_matchingpath()
9080 check_newlinechar(common, common->bsr_nltype, backtracks, FALSE); in compile_char1_matchingpath()
9089 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
9092 read_char(common, 0x9, 0x3000, backtracks, READ_CHAR_UPDATE_STR_PTR); in compile_char1_matchingpath()
9094 read_char(common, 0x9, 0x3000, NULL, 0); in compile_char1_matchingpath()
9096 add_jump(compiler, &common->hspace, JUMP(SLJIT_FAST_CALL)); in compile_char1_matchingpath()
9104 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
9107 read_char(common, 0xa, 0x2029, backtracks, READ_CHAR_UPDATE_STR_PTR); in compile_char1_matchingpath()
9109 read_char(common, 0xa, 0x2029, NULL, 0); in compile_char1_matchingpath()
9111 add_jump(compiler, &common->vspace, JUMP(SLJIT_FAST_CALL)); in compile_char1_matchingpath()
9119 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
9126 …common->utf ? (common->invalid_utf ? SLJIT_FUNC_ADDR(do_extuni_utf_invalid) : SLJIT_FUNC_ADDR(do_e… in compile_char1_matchingpath()
9127 if (common->invalid_utf) in compile_char1_matchingpath()
9131 … common->invalid_utf ? SLJIT_FUNC_ADDR(do_extuni_utf_invalid) : SLJIT_FUNC_ADDR(do_extuni_no_utf)); in compile_char1_matchingpath()
9132 if (common->invalid_utf) in compile_char1_matchingpath()
9138 if (common->mode == PCRE2_JIT_PARTIAL_HARD) in compile_char1_matchingpath()
9142 check_partial(common, TRUE); in compile_char1_matchingpath()
9152 if (common->utf && HAS_EXTRALEN(*cc)) length += GET_EXTRALEN(*cc); in compile_char1_matchingpath()
9155 if (check_str_ptr && common->mode != PCRE2_JIT_COMPLETE) in compile_char1_matchingpath()
9156 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
9158 if (type == OP_CHAR || !char_has_othercase(common, cc) || char_get_othercase_bit(common, cc) != 0) in compile_char1_matchingpath()
9161 if (length > 1 || (check_str_ptr && common->mode == PCRE2_JIT_COMPLETE)) in compile_char1_matchingpath()
9169 return byte_sequence_compare(common, type == OP_CHARI, cc, &context, backtracks); in compile_char1_matchingpath()
9173 if (common->utf) in compile_char1_matchingpath()
9181 SLJIT_ASSERT(type == OP_CHARI && char_has_othercase(common, cc)); in compile_char1_matchingpath()
9183 if (check_str_ptr && common->mode == PCRE2_JIT_COMPLETE) in compile_char1_matchingpath()
9186 oc = char_othercase(common, c); in compile_char1_matchingpath()
9187 read_char(common, c < oc ? c : oc, c > oc ? c : oc, NULL, 0); in compile_char1_matchingpath()
9208 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
9212 if (common->utf) in compile_char1_matchingpath()
9216 if (c < 128 && !common->invalid_utf) in compile_char1_matchingpath()
9219 if (type == OP_NOT || !char_has_othercase(common, cc)) in compile_char1_matchingpath()
9245 if (type == OP_NOT || !char_has_othercase(common, cc)) in compile_char1_matchingpath()
9247 read_char(common, c, c, backtracks, READ_CHAR_UPDATE_STR_PTR); in compile_char1_matchingpath()
9252 oc = char_othercase(common, c); in compile_char1_matchingpath()
9253 read_char(common, c < oc ? c : oc, c > oc ? c : oc, backtracks, READ_CHAR_UPDATE_STR_PTR); in compile_char1_matchingpath()
9271 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
9274 bit = (common->utf && is_char7_bitset((const sljit_u8 *)cc, type == OP_NCLASS)) ? 127 : 255; in compile_char1_matchingpath()
9276 read_char(common, 0, bit, backtracks, READ_CHAR_UPDATE_STR_PTR); in compile_char1_matchingpath()
9278 read_char(common, 0, bit, NULL, 0); in compile_char1_matchingpath()
9281 read_char(common, 0, 255, backtracks, READ_CHAR_UPDATE_STR_PTR); in compile_char1_matchingpath()
9283 read_char(common, 0, 255, NULL, 0); in compile_char1_matchingpath()
9286 if (optimize_class(common, (const sljit_u8 *)cc, type == OP_NCLASS, FALSE, backtracks)) in compile_char1_matchingpath()
9291 if (common->utf) in compile_char1_matchingpath()
9325 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
9326 compile_xclass_matchingpath(common, cc + LINK_SIZE, backtracks); in compile_char1_matchingpath()
9334 static SLJIT_INLINE PCRE2_SPTR compile_charn_matchingpath(compiler_common *common, PCRE2_SPTR cc, P… in compile_charn_matchingpath() argument
9353 if (common->utf && HAS_EXTRALEN(cc[1])) in compile_charn_matchingpath()
9361 if (common->utf) in compile_charn_matchingpath()
9363 if (char_has_othercase(common, cc + 1) && char_get_othercase_bit(common, cc + 1) == 0) in compile_charn_matchingpath()
9370 if (char_has_othercase(common, cc + 1) && char_get_othercase_bit(common, cc + 1) == 0) in compile_charn_matchingpath()
9392 …do cc = byte_sequence_compare(common, *cc == OP_CHARI, cc + 1, &context, backtracks); while (conte… in compile_charn_matchingpath()
9397 return compile_char1_matchingpath(common, *cc, cc + 1, backtracks, TRUE); in compile_charn_matchingpath()
9432 static void compile_dnref_search(compiler_common *common, PCRE2_SPTR cc, jump_list **backtracks) in compile_dnref_search() argument
9437 PCRE2_SPTR slot = common->name_table + GET2(cc, 1) * common->name_entry_size; in compile_dnref_search()
9451 slot += common->name_entry_size; in compile_dnref_search()
9456 if (backtracks != NULL && !common->unset_backref) in compile_dnref_search()
9462 static void compile_ref_matchingpath(compiler_common *common, PCRE2_SPTR cc, jump_list **backtracks… in compile_ref_matchingpath() argument
9484 if (withchecks && !common->unset_backref) in compile_ref_matchingpath()
9491 if (common->utf && *cc == OP_REFI) in compile_ref_matchingpath()
9493 SLJIT_ASSERT(common->iref_ptr != 0); in compile_ref_matchingpath()
9503 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->iref_ptr, source_reg, 0); in compile_ref_matchingpath()
9504 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw), source_end_reg, 0); in compile_ref_matchingpath()
9505 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw) * 2, char1_reg, 0); in compile_ref_matchingpath()
9518 read_char(common, 0, READ_CHAR_MAX, NULL, READ_CHAR_UPDATE_STR_PTR | READ_CHAR_VALID_UTF); in compile_ref_matchingpath()
9525 read_char(common, 0, READ_CHAR_MAX, &no_match, READ_CHAR_UPDATE_STR_PTR); in compile_ref_matchingpath()
9531 add_jump(compiler, &common->getucd, JUMP(SLJIT_FAST_CALL)); in compile_ref_matchingpath()
9556 if (common->mode == PCRE2_JIT_COMPLETE) in compile_ref_matchingpath()
9559 OP1(SLJIT_MOV, source_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr); in compile_ref_matchingpath()
9560 OP1(SLJIT_MOV, source_end_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw)); in compile_ref_matchingpath()
9561 OP1(SLJIT_MOV, char1_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw) * 2); in compile_ref_matchingpath()
9564 if (common->mode != PCRE2_JIT_COMPLETE) in compile_ref_matchingpath()
9567 OP1(SLJIT_MOV, source_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr); in compile_ref_matchingpath()
9568 OP1(SLJIT_MOV, source_end_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw)); in compile_ref_matchingpath()
9569 OP1(SLJIT_MOV, char1_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw) * 2); in compile_ref_matchingpath()
9571 check_partial(common, FALSE); in compile_ref_matchingpath()
9576 OP1(SLJIT_MOV, source_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr); in compile_ref_matchingpath()
9577 OP1(SLJIT_MOV, source_end_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw)); in compile_ref_matchingpath()
9578 OP1(SLJIT_MOV, char1_reg, 0, SLJIT_MEM1(SLJIT_SP), common->iref_ptr + sizeof(sljit_sw) * 2); in compile_ref_matchingpath()
9594 if (common->mode == PCRE2_JIT_COMPLETE) in compile_ref_matchingpath()
9597 …add_jump(compiler, *cc == OP_REF ? &common->casefulcmp : &common->caselesscmp, JUMP(SLJIT_FAST_CAL… in compile_ref_matchingpath()
9600 if (common->mode != PCRE2_JIT_COMPLETE) in compile_ref_matchingpath()
9609 …add_jump(compiler, *cc == OP_REF ? &common->casefulcmp : &common->caselesscmp, JUMP(SLJIT_FAST_CAL… in compile_ref_matchingpath()
9612 check_partial(common, FALSE); in compile_ref_matchingpath()
9627 static SLJIT_INLINE PCRE2_SPTR compile_ref_iterator_matchingpath(compiler_common *common, PCRE2_SPT… in compile_ref_iterator_matchingpath() argument
9686 allocate_stack(common, 2); in compile_ref_iterator_matchingpath()
9699 compile_dnref_search(common, ccbegin, NULL); in compile_ref_iterator_matchingpath()
9709 allocate_stack(common, 1); in compile_ref_iterator_matchingpath()
9716 if (!common->unset_backref) in compile_ref_iterator_matchingpath()
9722 compile_dnref_search(common, ccbegin, &backtrack->own_backtracks); in compile_ref_iterator_matchingpath()
9735 compile_ref_matchingpath(common, ccbegin, &backtrack->own_backtracks, FALSE, FALSE); in compile_ref_iterator_matchingpath()
9747 allocate_stack(common, 1); in compile_ref_iterator_matchingpath()
9757 allocate_stack(common, 1); in compile_ref_iterator_matchingpath()
9765 count_match(common); in compile_ref_iterator_matchingpath()
9769 allocate_stack(common, ref ? 2 : 3); in compile_ref_iterator_matchingpath()
9784 compile_dnref_search(common, ccbegin, NULL); in compile_ref_iterator_matchingpath()
9797 if (!common->unset_backref) in compile_ref_iterator_matchingpath()
9803 compile_dnref_search(common, ccbegin, &backtrack->own_backtracks); in compile_ref_iterator_matchingpath()
9816 compile_ref_matchingpath(common, ccbegin, &backtrack->own_backtracks, TRUE, TRUE); in compile_ref_iterator_matchingpath()
9833 count_match(common); in compile_ref_iterator_matchingpath()
9837 static SLJIT_INLINE PCRE2_SPTR compile_recurse_matchingpath(compiler_common *common, PCRE2_SPTR cc,… in compile_recurse_matchingpath() argument
9841 recurse_entry *entry = common->entries; in compile_recurse_matchingpath()
9850 if (get_framesize(common, common->start + start, NULL, TRUE, &needs_control_head) == no_stack) in compile_recurse_matchingpath()
9852 start_cc = common->start + start; in compile_recurse_matchingpath()
9853 …compile_matchingpath(common, next_opcode(common, start_cc), bracketend(start_cc) - (1 + LINK_SIZE)… in compile_recurse_matchingpath()
9881 common->entries = entry; in compile_recurse_matchingpath()
9953 static SLJIT_INLINE PCRE2_SPTR compile_callout_matchingpath(compiler_common *common, PCRE2_SPTR cc,… in compile_callout_matchingpath() argument
9963 sljit_uw callout_arg_size = (common->re->top_bracket + 1) * 2 * SSIZE_OF(sw); in compile_callout_matchingpath()
9969 allocate_stack(common, callout_arg_size); in compile_callout_matchingpath()
9971 SLJIT_ASSERT(common->capture_last_ptr != 0); in compile_callout_matchingpath()
9972 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr); in compile_callout_matchingpath()
9977 OP1(SLJIT_MOV_U32, SLJIT_MEM1(STACK_TOP), CALLOUT_ARG_OFFSET(capture_top), SLJIT_IMM, common->re->t… in compile_callout_matchingpath()
9982 if (common->mark_ptr != 0) in compile_callout_matchingpath()
10004 OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), CALLOUT_ARG_OFFSET(mark), (common->mark_ptr != 0) ? TMP2 : SL… in compile_callout_matchingpath()
10015 free_stack(common, callout_arg_size); in compile_callout_matchingpath()
10020 if (common->abort_label == NULL) in compile_callout_matchingpath()
10021 add_jump(compiler, &common->abort, JUMP(SLJIT_NOT_EQUAL) /* SIG_LESS */); in compile_callout_matchingpath()
10023 JUMPTO(SLJIT_NOT_EQUAL /* SIG_LESS */, common->abort_label); in compile_callout_matchingpath()
10030 static PCRE2_SPTR compile_reverse_matchingpath(compiler_common *common, PCRE2_SPTR cc, backtrack_co… in compile_reverse_matchingpath() argument
10074 if (common->utf) in compile_reverse_matchingpath()
10081 move_back(common, reverse_failed, FALSE); in compile_reverse_matchingpath()
10093 move_back(common, reverse_failed, FALSE); in compile_reverse_matchingpath()
10122 check_start_used_ptr(common); in compile_reverse_matchingpath()
10162 static PCRE2_SPTR compile_assert_matchingpath(compiler_common *common, PCRE2_SPTR cc, assert_backtr… in compile_assert_matchingpath() argument
10177 jump_list **target = (conditional) ? &backtrack->condfailed : &backtrack->common.own_backtracks; in compile_assert_matchingpath()
10180 BOOL save_local_quit_available = common->local_quit_available; in compile_assert_matchingpath()
10181 BOOL save_in_positive_assertion = common->in_positive_assertion; in compile_assert_matchingpath()
10182 then_trap_backtrack *save_then_trap = common->then_trap; in compile_assert_matchingpath()
10183 struct sljit_label *save_quit_label = common->quit_label; in compile_assert_matchingpath()
10184 struct sljit_label *save_accept_label = common->accept_label; in compile_assert_matchingpath()
10185 jump_list *save_quit = common->quit; in compile_assert_matchingpath()
10186 jump_list *save_positive_assertion_quit = common->positive_assertion_quit; in compile_assert_matchingpath()
10187 jump_list *save_accept = common->accept; in compile_assert_matchingpath()
10192 common->then_trap = NULL; in compile_assert_matchingpath()
10203 framesize = get_framesize(common, cc, NULL, FALSE, &needs_control_head); in compile_assert_matchingpath()
10216 free_stack(common, 1); in compile_assert_matchingpath()
10238 allocate_stack(common, extrasize); in compile_assert_matchingpath()
10241 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_assert_matchingpath()
10249 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_IMM, 0); in compile_assert_matchingpath()
10258 allocate_stack(common, framesize + extrasize); in compile_assert_matchingpath()
10263 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_assert_matchingpath()
10270 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_IMM, 0); in compile_assert_matchingpath()
10275 init_frame(common, ccbegin, NULL, framesize + extrasize - 1, extrasize); in compile_assert_matchingpath()
10289 common->local_quit_available = TRUE; in compile_assert_matchingpath()
10290 common->quit_label = NULL; in compile_assert_matchingpath()
10291 common->quit = NULL; in compile_assert_matchingpath()
10294 common->in_positive_assertion = (opcode == OP_ASSERT || opcode == OP_ASSERTBACK); in compile_assert_matchingpath()
10295 common->positive_assertion_quit = NULL; in compile_assert_matchingpath()
10299 common->accept_label = NULL; in compile_assert_matchingpath()
10300 common->accept = NULL; in compile_assert_matchingpath()
10312 ccbegin = compile_reverse_matchingpath(common, ccbegin, &altbacktrack); in compile_assert_matchingpath()
10314 compile_matchingpath(common, ccbegin, cc, &altbacktrack); in compile_assert_matchingpath()
10319 common->local_quit_available = save_local_quit_available; in compile_assert_matchingpath()
10320 common->quit_label = save_quit_label; in compile_assert_matchingpath()
10321 common->quit = save_quit; in compile_assert_matchingpath()
10323 common->in_positive_assertion = save_in_positive_assertion; in compile_assert_matchingpath()
10324 common->then_trap = save_then_trap; in compile_assert_matchingpath()
10325 common->accept_label = save_accept_label; in compile_assert_matchingpath()
10326 common->positive_assertion_quit = save_positive_assertion_quit; in compile_assert_matchingpath()
10327 common->accept = save_accept; in compile_assert_matchingpath()
10337 common->accept_label = LABEL(); in compile_assert_matchingpath()
10338 if (common->accept != NULL) in compile_assert_matchingpath()
10339 set_jumps(common->accept, common->accept_label); in compile_assert_matchingpath()
10347 free_stack(common, extrasize); in compile_assert_matchingpath()
10353 … OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_MEM1(STACK_TOP), STACK(-1)); in compile_assert_matchingpath()
10366 … OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_MEM1(STACK_TOP), STACK(-1)); in compile_assert_matchingpath()
10376 …OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_MEM1(STACK_TOP), STACK(-frame… in compile_assert_matchingpath()
10377 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_assert_matchingpath()
10411 compile_backtrackingpath(common, altbacktrack.top); in compile_assert_matchingpath()
10416 common->local_quit_available = save_local_quit_available; in compile_assert_matchingpath()
10417 common->quit_label = save_quit_label; in compile_assert_matchingpath()
10418 common->quit = save_quit; in compile_assert_matchingpath()
10420 common->in_positive_assertion = save_in_positive_assertion; in compile_assert_matchingpath()
10421 common->then_trap = save_then_trap; in compile_assert_matchingpath()
10422 common->accept_label = save_accept_label; in compile_assert_matchingpath()
10423 common->positive_assertion_quit = save_positive_assertion_quit; in compile_assert_matchingpath()
10424 common->accept = save_accept; in compile_assert_matchingpath()
10438 SLJIT_ASSERT(common->positive_assertion_quit == NULL); in compile_assert_matchingpath()
10440 common->positive_assertion_quit = common->quit; in compile_assert_matchingpath()
10444 if (common->positive_assertion_quit != NULL) in compile_assert_matchingpath()
10447 set_jumps(common->positive_assertion_quit, LABEL()); in compile_assert_matchingpath()
10454 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_assert_matchingpath()
10464 …OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_MEM1(STACK_TOP), STACK(end_bl… in compile_assert_matchingpath()
10478 free_stack(common, extrasize - 1); in compile_assert_matchingpath()
10482 free_stack(common, extrasize); in compile_assert_matchingpath()
10490 free_stack(common, framesize + extrasize - 1); in compile_assert_matchingpath()
10494 free_stack(common, framesize + extrasize); in compile_assert_matchingpath()
10563 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_assert_matchingpath()
10568 set_jumps(backtrack->common.own_backtracks, LABEL()); in compile_assert_matchingpath()
10582 free_stack(common, extrasize - 1); in compile_assert_matchingpath()
10586 free_stack(common, extrasize); in compile_assert_matchingpath()
10595 free_stack(common, framesize + extrasize - 1); in compile_assert_matchingpath()
10599 free_stack(common, framesize + extrasize); in compile_assert_matchingpath()
10613 SLJIT_ASSERT(found == &backtrack->common.own_backtracks); in compile_assert_matchingpath()
10614 set_jumps(backtrack->common.own_backtracks, LABEL()); in compile_assert_matchingpath()
10615 backtrack->common.own_backtracks = NULL; in compile_assert_matchingpath()
10621 common->local_quit_available = save_local_quit_available; in compile_assert_matchingpath()
10622 common->quit_label = save_quit_label; in compile_assert_matchingpath()
10623 common->quit = save_quit; in compile_assert_matchingpath()
10625 common->in_positive_assertion = save_in_positive_assertion; in compile_assert_matchingpath()
10626 common->then_trap = save_then_trap; in compile_assert_matchingpath()
10627 common->accept_label = save_accept_label; in compile_assert_matchingpath()
10628 common->positive_assertion_quit = save_positive_assertion_quit; in compile_assert_matchingpath()
10629 common->accept = save_accept; in compile_assert_matchingpath()
10633 static SLJIT_INLINE void match_once_common(compiler_common *common, PCRE2_UCHAR ket, int framesize,… in match_once_common() argument
10649 free_stack(common, stacksize); in match_once_common()
10678 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, TMP1, 0); in match_once_common()
10681 static SLJIT_INLINE int match_capture_common(compiler_common *common, int stacksize, int offset, in… in match_capture_common() argument
10685 if (common->capture_last_ptr != 0) in match_capture_common()
10687 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr); in match_capture_common()
10688 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr, SLJIT_IMM, offset >> 1); in match_capture_common()
10692 if (common->optimized_cbracket[offset >> 1] == 0) in match_capture_common()
10724 static void match_script_run_common(compiler_common *common, int private_data_ptr, backtrack_common… in match_script_run_common() argument
10733 common->utf ? SLJIT_FUNC_ADDR(do_script_run_utf) : SLJIT_FUNC_ADDR(do_script_run)); in match_script_run_common()
10795 static PCRE2_SPTR compile_bracket_matchingpath(compiler_common *common, PCRE2_SPTR cc, backtrack_co… in compile_bracket_matchingpath() argument
10865 if (common->optimized_cbracket[offset] == 0) in compile_bracket_matchingpath()
10885 …BACKTRACK_AS(bracket_backtrack)->u.framesize = get_framesize(common, ccbegin, NULL, FALSE, &needs_… in compile_bracket_matchingpath()
10896 allocate_stack(common, stacksize); in compile_bracket_matchingpath()
10914 free_stack(common, 1); in compile_bracket_matchingpath()
10969 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_bracket_matchingpath()
10991 allocate_stack(common, stacksize); in compile_bracket_matchingpath()
11018 allocate_stack(common, stacksize); in compile_bracket_matchingpath()
11039 …init_frame(common, ccbegin, NULL, BACKTRACK_AS(bracket_backtrack)->u.framesize + stacksize, stacks… in compile_bracket_matchingpath()
11045 if (common->optimized_cbracket[offset >> 1] != 0) in compile_bracket_matchingpath()
11048 allocate_stack(common, 2); in compile_bracket_matchingpath()
11058 allocate_stack(common, 1); in compile_bracket_matchingpath()
11066 allocate_stack(common, 4); in compile_bracket_matchingpath()
11076 matchingpath = compile_reverse_matchingpath(common, matchingpath, backtrack); in compile_bracket_matchingpath()
11082 allocate_stack(common, 1); in compile_bracket_matchingpath()
11087 matchingpath = compile_reverse_matchingpath(common, matchingpath, backtrack); in compile_bracket_matchingpath()
11092 allocate_stack(common, 1); in compile_bracket_matchingpath()
11111 slot = common->name_table + GET2(matchingpath, 1) * common->name_entry_size; in compile_bracket_matchingpath()
11115 slot += common->name_entry_size; in compile_bracket_matchingpath()
11121 slot += common->name_entry_size; in compile_bracket_matchingpath()
11143 if (common->currententry == NULL) in compile_bracket_matchingpath()
11147 else if (common->currententry->start == 0) in compile_bracket_matchingpath()
11150 … stacksize = stacksize == (int)GET2(common->start, common->currententry->start + 1 + LINK_SIZE); in compile_bracket_matchingpath()
11157 if (common->currententry == NULL || common->currententry->start == 0) in compile_bracket_matchingpath()
11162 slot = common->name_table + GET2(matchingpath, 1) * common->name_entry_size; in compile_bracket_matchingpath()
11163 i = (int)GET2(common->start, common->currententry->start + 1 + LINK_SIZE); in compile_bracket_matchingpath()
11168 slot += common->name_entry_size; in compile_bracket_matchingpath()
11197 assert->common.cc = matchingpath; in compile_bracket_matchingpath()
11199 matchingpath = compile_assert_matchingpath(common, matchingpath, assert, TRUE); in compile_bracket_matchingpath()
11203 compile_matchingpath(common, matchingpath, cc, backtrack); in compile_bracket_matchingpath()
11223 …match_once_common(common, ket, BACKTRACK_AS(bracket_backtrack)->u.framesize, private_data_ptr, has… in compile_bracket_matchingpath()
11226 match_script_run_common(common, private_data_ptr, backtrack); in compile_bracket_matchingpath()
11241 if (common->capture_last_ptr != 0) in compile_bracket_matchingpath()
11243 if (common->optimized_cbracket[offset >> 1] == 0) in compile_bracket_matchingpath()
11250 allocate_stack(common, stacksize); in compile_bracket_matchingpath()
11270 stacksize = match_capture_common(common, stacksize, offset, private_data_ptr); in compile_bracket_matchingpath()
11294 if (offset != 0 && common->optimized_cbracket[offset >> 1] != 0) in compile_bracket_matchingpath()
11310 free_stack(common, 1); in compile_bracket_matchingpath()
11324 free_stack(common, 1); in compile_bracket_matchingpath()
11337 count_match(common); in compile_bracket_matchingpath()
11345 allocate_stack(common, 1); in compile_bracket_matchingpath()
11365 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_bracket_matchingpath()
11369 free_stack(common, 1); in compile_bracket_matchingpath()
11375 count_match(common); in compile_bracket_matchingpath()
11394 static PCRE2_SPTR compile_bracketpos_matchingpath(compiler_common *common, PCRE2_SPTR cc, backtrack… in compile_bracketpos_matchingpath() argument
11434 SLJIT_ASSERT(common->optimized_cbracket[offset] == 0); in compile_bracketpos_matchingpath()
11445 framesize = get_framesize(common, cc, NULL, FALSE, &needs_control_head); in compile_bracketpos_matchingpath()
11452 if (common->capture_last_ptr != 0) in compile_bracketpos_matchingpath()
11464 allocate_stack(common, stacksize); in compile_bracketpos_matchingpath()
11475 if (common->capture_last_ptr != 0) in compile_bracketpos_matchingpath()
11476 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr); in compile_bracketpos_matchingpath()
11479 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_bracketpos_matchingpath()
11480 if (common->capture_last_ptr != 0) in compile_bracketpos_matchingpath()
11489 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_bracketpos_matchingpath()
11515 allocate_stack(common, stacksize); in compile_bracketpos_matchingpath()
11518 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_bracketpos_matchingpath()
11538 init_frame(common, cc, NULL, stacksize - 1, stacksize - framesize); in compile_bracketpos_matchingpath()
11552 compile_matchingpath(common, ccbegin, cc, backtrack); in compile_bracketpos_matchingpath()
11566 if (common->capture_last_ptr != 0) in compile_bracketpos_matchingpath()
11567 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr, SLJIT_IMM, offset >> 1); in compile_bracketpos_matchingpath()
11579 …OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_MEM1(STACK_TOP), STACK(stack)… in compile_bracketpos_matchingpath()
11595 if (common->capture_last_ptr != 0) in compile_bracketpos_matchingpath()
11596 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr, SLJIT_IMM, offset >> 1); in compile_bracketpos_matchingpath()
11610 …OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_MEM1(STACK_TOP), STACK(stack)… in compile_bracketpos_matchingpath()
11625 flush_stubs(common); in compile_bracketpos_matchingpath()
11627 compile_backtrackingpath(common, backtrack->top); in compile_bracketpos_matchingpath()
11673 count_match(common); in compile_bracketpos_matchingpath()
11677 static SLJIT_INLINE PCRE2_SPTR get_iterator_parameters(compiler_common *common, PCRE2_SPTR cc, PCRE… in get_iterator_parameters() argument
11810 *end = next_opcode(common, cc); in get_iterator_parameters()
11817 if (common->utf && HAS_EXTRALEN(*cc)) *end += GET_EXTRALEN(*cc); in get_iterator_parameters()
11822 static PCRE2_SPTR compile_iterator_matchingpath(compiler_common *common, PCRE2_SPTR cc, backtrack_c… in compile_iterator_matchingpath() argument
11854 if (common->early_fail_start_ptr == 0 && common->fast_forward_bc_ptr == NULL) in compile_iterator_matchingpath()
11860 SLJIT_ASSERT(common->fast_forward_bc_ptr != NULL || early_fail_ptr == 0 in compile_iterator_matchingpath()
11861 …|| (early_fail_ptr >= common->early_fail_start_ptr && early_fail_ptr <= common->early_fail_end_ptr… in compile_iterator_matchingpath()
11866 cc = get_iterator_parameters(common, cc, &opcode, &type, &max, &exact, &end); in compile_iterator_matchingpath()
11884 if (common->mode == PCRE2_JIT_COMPLETE in compile_iterator_matchingpath()
11886 && !common->utf in compile_iterator_matchingpath()
11894 compile_char1_matchingpath(common, type, cc, &backtrack->own_backtracks, FALSE); in compile_iterator_matchingpath()
11902 compile_char1_matchingpath(common, type, cc, &backtrack->own_backtracks, TRUE); in compile_iterator_matchingpath()
11908 compile_char1_matchingpath(common, type, cc, &backtrack->own_backtracks, TRUE); in compile_iterator_matchingpath()
11934 allocate_stack(common, 2); in compile_iterator_matchingpath()
11942 …compile_char1_matchingpath(common, type, cc, &BACKTRACK_AS(char_iterator_backtrack)->u.backtracks,… in compile_iterator_matchingpath()
11952 allocate_stack(common, 1); in compile_iterator_matchingpath()
11961 else if (type == OP_ALLANY && !common->invalid_utf) in compile_iterator_matchingpath()
11969 allocate_stack(common, 2); in compile_iterator_matchingpath()
11975 process_partial_match(common); in compile_iterator_matchingpath()
11983 else if (!common->utf) in compile_iterator_matchingpath()
11989 allocate_stack(common, 2); in compile_iterator_matchingpath()
11994 if (common->mode == PCRE2_JIT_COMPLETE) in compile_iterator_matchingpath()
12002 process_partial_match(common); in compile_iterator_matchingpath()
12022 charpos_enabled = !common->utf || !HAS_EXTRALEN(end[1]); in compile_iterator_matchingpath()
12026 if (charpos_enabled && *end == OP_CHARI && char_has_othercase(common, end + 1)) in compile_iterator_matchingpath()
12028 charpos_othercasebit = char_get_othercase_bit(common, end + 1); in compile_iterator_matchingpath()
12067 compile_char1_matchingpath(common, type, cc, &backtrack->own_backtracks, FALSE); in compile_iterator_matchingpath()
12072 detect_partial_match(common, &backtrack->own_backtracks); in compile_iterator_matchingpath()
12079 allocate_stack(common, 2); in compile_iterator_matchingpath()
12091 compile_char1_matchingpath(common, type, cc, &no_match, FALSE); in compile_iterator_matchingpath()
12094 detect_partial_match(common, &no_match); in compile_iterator_matchingpath()
12121 allocate_stack(common, 2); in compile_iterator_matchingpath()
12128 if (common->utf) in compile_iterator_matchingpath()
12134 detect_partial_match(common, &no_match); in compile_iterator_matchingpath()
12136 compile_char1_matchingpath(common, type, cc, &no_char1_match, FALSE); in compile_iterator_matchingpath()
12138 if (common->utf) in compile_iterator_matchingpath()
12148 detect_partial_match_to(common, label); in compile_iterator_matchingpath()
12153 if (common->utf) in compile_iterator_matchingpath()
12181 allocate_stack(common, 1); in compile_iterator_matchingpath()
12191 allocate_stack(common, 2); in compile_iterator_matchingpath()
12201 allocate_stack(common, 1); in compile_iterator_matchingpath()
12204 …compile_char1_matchingpath(common, type, cc, &BACKTRACK_AS(char_iterator_backtrack)->u.backtracks,… in compile_iterator_matchingpath()
12213 if (type == OP_ALLANY && !common->invalid_utf) in compile_iterator_matchingpath()
12219 process_partial_match(common); in compile_iterator_matchingpath()
12226 if (type == OP_EXTUNI || common->utf) in compile_iterator_matchingpath()
12229 detect_partial_match(common, &no_match); in compile_iterator_matchingpath()
12231 compile_char1_matchingpath(common, type, cc, &no_match, FALSE); in compile_iterator_matchingpath()
12233 detect_partial_match_to(common, label); in compile_iterator_matchingpath()
12248 detect_partial_match(common, &no_match); in compile_iterator_matchingpath()
12250 compile_char1_matchingpath(common, type, cc, &no_char1_match, FALSE); in compile_iterator_matchingpath()
12251 detect_partial_match_to(common, label); in compile_iterator_matchingpath()
12264 if (common->utf) in compile_iterator_matchingpath()
12269 detect_partial_match(common, &no_match); in compile_iterator_matchingpath()
12271 compile_char1_matchingpath(common, type, cc, &no_match, FALSE); in compile_iterator_matchingpath()
12275 detect_partial_match_to(common, label); in compile_iterator_matchingpath()
12287 if (common->mode == PCRE2_JIT_COMPLETE) in compile_iterator_matchingpath()
12295 process_partial_match(common); in compile_iterator_matchingpath()
12303 detect_partial_match(common, &no_match); in compile_iterator_matchingpath()
12305 compile_char1_matchingpath(common, type, cc, &no_char1_match, FALSE); in compile_iterator_matchingpath()
12308 detect_partial_match_to(common, label); in compile_iterator_matchingpath()
12319 compile_char1_matchingpath(common, type, cc, &no_match, TRUE); in compile_iterator_matchingpath()
12330 count_match(common); in compile_iterator_matchingpath()
12334 static SLJIT_INLINE PCRE2_SPTR compile_fail_accept_matchingpath(compiler_common *common, PCRE2_SPTR… in compile_fail_accept_matchingpath() argument
12347 if (*cc == OP_ACCEPT && common->currententry == NULL && (common->re->overall_options & PCRE2_ENDANC… in compile_fail_accept_matchingpath()
12348 add_jump(compiler, &common->restart_match, CMP(SLJIT_NOT_EQUAL, STR_PTR, 0, STR_END, 0)); in compile_fail_accept_matchingpath()
12350 if (*cc == OP_ASSERT_ACCEPT || common->currententry != NULL || !common->might_be_empty) in compile_fail_accept_matchingpath()
12353 if (common->accept_label == NULL) in compile_fail_accept_matchingpath()
12354 add_jump(compiler, &common->accept, JUMP(SLJIT_JUMP)); in compile_fail_accept_matchingpath()
12356 JUMPTO(SLJIT_JUMP, common->accept_label); in compile_fail_accept_matchingpath()
12360 if (common->accept_label == NULL) in compile_fail_accept_matchingpath()
12361 …add_jump(compiler, &common->accept, CMP(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR… in compile_fail_accept_matchingpath()
12363 CMPTO(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(0), common->accept_label); in compile_fail_accept_matchingpath()
12376 if (common->accept_label == NULL) in compile_fail_accept_matchingpath()
12377 add_jump(compiler, &common->accept, JUMP(SLJIT_ZERO)); in compile_fail_accept_matchingpath()
12379 JUMPTO(SLJIT_ZERO, common->accept_label); in compile_fail_accept_matchingpath()
12382 if (common->accept_label == NULL) in compile_fail_accept_matchingpath()
12383 add_jump(compiler, &common->accept, CMP(SLJIT_NOT_EQUAL, TMP2, 0, STR_PTR, 0)); in compile_fail_accept_matchingpath()
12385 CMPTO(SLJIT_NOT_EQUAL, TMP2, 0, STR_PTR, 0, common->accept_label); in compile_fail_accept_matchingpath()
12390 static SLJIT_INLINE PCRE2_SPTR compile_close_matchingpath(compiler_common *common, PCRE2_SPTR cc) in compile_close_matchingpath() argument
12394 BOOL optimized_cbracket = common->optimized_cbracket[offset] != 0; in compile_close_matchingpath()
12397 if (common->currententry != NULL) in compile_close_matchingpath()
12409 static SLJIT_INLINE PCRE2_SPTR compile_control_verb_matchingpath(compiler_common *common, PCRE2_SPT… in compile_control_verb_matchingpath() argument
12424 allocate_stack(common, 1); in compile_control_verb_matchingpath()
12434 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->mark_ptr, TMP2, 0); in compile_control_verb_matchingpath()
12443 static SLJIT_INLINE void compile_then_trap_matchingpath(compiler_common *common, PCRE2_SPTR cc, PCR… in compile_then_trap_matchingpath() argument
12451 common->then_trap = BACKTRACK_AS(then_trap_backtrack); in compile_then_trap_matchingpath()
12452 BACKTRACK_AS(then_trap_backtrack)->common.cc = then_trap_opcode; in compile_then_trap_matchingpath()
12453 BACKTRACK_AS(then_trap_backtrack)->start = (sljit_sw)(cc - common->start); in compile_then_trap_matchingpath()
12454 BACKTRACK_AS(then_trap_backtrack)->framesize = get_framesize(common, cc, ccend, FALSE, &needs_contr… in compile_then_trap_matchingpath()
12459 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_then_trap_matchingpath()
12460 allocate_stack(common, size); in compile_then_trap_matchingpath()
12462 …OP2(SLJIT_ADD, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, STACK_TOP, 0, SLJIT_IMM, (size - 3)… in compile_then_trap_matchingpath()
12464 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, STACK_TOP, 0); in compile_then_trap_matchingpath()
12471 init_frame(common, cc, ccend, size - 1, 0); in compile_then_trap_matchingpath()
12474 static void compile_matchingpath(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend, backtrac… in compile_matchingpath() argument
12483 if (common->has_then && common->then_offsets[cc - common->start] != 0) in compile_matchingpath()
12485 SLJIT_ASSERT(*ccend != OP_END && common->control_head_ptr != 0); in compile_matchingpath()
12487 save_then_trap = common->then_trap; in compile_matchingpath()
12489 compile_then_trap_matchingpath(common, cc, ccend, parent); in compile_matchingpath()
12508 …cc = compile_simple_assertion_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top… in compile_matchingpath()
12530 …cc = compile_char1_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top->simple_ba… in compile_matchingpath()
12536 allocate_stack(common, 1); in compile_matchingpath()
12544 if (common->mode == PCRE2_JIT_COMPLETE) in compile_matchingpath()
12545 …cc = compile_charn_matchingpath(common, cc, ccend, parent->top != NULL ? &parent->top->simple_back… in compile_matchingpath()
12547 …cc = compile_char1_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top->simple_ba… in compile_matchingpath()
12615 cc = compile_iterator_matchingpath(common, cc, parent); in compile_matchingpath()
12621 cc = compile_iterator_matchingpath(common, cc, parent); in compile_matchingpath()
12623 …cc = compile_char1_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top->simple_ba… in compile_matchingpath()
12629 cc = compile_iterator_matchingpath(common, cc, parent); in compile_matchingpath()
12631 …cc = compile_char1_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top->simple_ba… in compile_matchingpath()
12638 cc = compile_ref_iterator_matchingpath(common, cc, parent); in compile_matchingpath()
12641 …compile_ref_matchingpath(common, cc, parent->top != NULL ? &parent->top->simple_backtracks : &pare… in compile_matchingpath()
12649 cc = compile_ref_iterator_matchingpath(common, cc, parent); in compile_matchingpath()
12652 …compile_dnref_search(common, cc, parent->top != NULL ? &parent->top->simple_backtracks : &parent->… in compile_matchingpath()
12653 …compile_ref_matchingpath(common, cc, parent->top != NULL ? &parent->top->simple_backtracks : &pare… in compile_matchingpath()
12659 cc = compile_recurse_matchingpath(common, cc, parent); in compile_matchingpath()
12664 cc = compile_callout_matchingpath(common, cc, parent); in compile_matchingpath()
12672 cc = compile_assert_matchingpath(common, cc, BACKTRACK_AS(assert_backtrack), FALSE); in compile_matchingpath()
12680 allocate_stack(common, 1); in compile_matchingpath()
12685 allocate_stack(common, 2); in compile_matchingpath()
12690 count_match(common); in compile_matchingpath()
12703 cc = compile_bracket_matchingpath(common, cc, parent); in compile_matchingpath()
12708 cc = compile_bracket_matchingpath(common, cc, parent); in compile_matchingpath()
12712 cc = compile_assert_matchingpath(common, cc, BACKTRACK_AS(assert_backtrack), FALSE); in compile_matchingpath()
12721 cc = compile_bracketpos_matchingpath(common, cc, parent); in compile_matchingpath()
12726 SLJIT_ASSERT(common->mark_ptr != 0); in compile_matchingpath()
12727 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->mark_ptr); in compile_matchingpath()
12728 allocate_stack(common, common->has_skip_arg ? 5 : 1); in compile_matchingpath()
12731 OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(common->has_skip_arg ? 4 : 0), TMP2, 0); in compile_matchingpath()
12733 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->mark_ptr, TMP2, 0); in compile_matchingpath()
12735 if (common->has_skip_arg) in compile_matchingpath()
12737 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_matchingpath()
12738 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, STACK_TOP, 0); in compile_matchingpath()
12755 cc = compile_control_verb_matchingpath(common, cc, parent); in compile_matchingpath()
12761 cc = compile_fail_accept_matchingpath(common, cc, parent); in compile_matchingpath()
12765 cc = compile_close_matchingpath(common, cc); in compile_matchingpath()
12784 BACKTRACK_AS(then_trap_backtrack)->common.cc = then_trap_opcode; in compile_matchingpath()
12785 BACKTRACK_AS(then_trap_backtrack)->then_trap = common->then_trap; in compile_matchingpath()
12786 common->then_trap = save_then_trap; in compile_matchingpath()
12798 compile_backtrackingpath(common, (current)); \
12806 static void compile_iterator_backtrackingpath(compiler_common *common, struct backtrack_common *cur… in compile_iterator_backtrackingpath() argument
12822 cc = get_iterator_parameters(common, cc, &opcode, &type, &max, &exact, &end); in compile_iterator_backtrackingpath()
12833 free_stack(common, 1); in compile_iterator_backtrackingpath()
12851 move_back(common, NULL, TRUE); in compile_iterator_backtrackingpath()
12858 move_back(common, NULL, TRUE); in compile_iterator_backtrackingpath()
12864 free_stack(common, 2); in compile_iterator_backtrackingpath()
12870 compile_char1_matchingpath(common, type, cc, &jumplist, TRUE); in compile_iterator_backtrackingpath()
12875 free_stack(common, 1); in compile_iterator_backtrackingpath()
12885 compile_char1_matchingpath(common, type, cc, &jumplist, TRUE); in compile_iterator_backtrackingpath()
12891 free_stack(common, 2); in compile_iterator_backtrackingpath()
12905 free_stack(common, 1); in compile_iterator_backtrackingpath()
12912 compile_char1_matchingpath(common, type, cc, &jumplist, TRUE); in compile_iterator_backtrackingpath()
12917 free_stack(common, 1); in compile_iterator_backtrackingpath()
12934 static SLJIT_INLINE void compile_ref_iterator_backtrackingpath(compiler_common *common, struct back… in compile_ref_iterator_backtrackingpath() argument
12948 free_stack(common, 1); in compile_ref_iterator_backtrackingpath()
12956 free_stack(common, ref ? 2 : 3); in compile_ref_iterator_backtrackingpath()
12959 static SLJIT_INLINE void compile_recurse_backtrackingpath(compiler_common *common, struct backtrack… in compile_recurse_backtrackingpath() argument
12974 compile_backtrackingpath(common, current->top); in compile_recurse_backtrackingpath()
12979 static void compile_assert_backtrackingpath(compiler_common *common, struct backtrack_common *curre… in compile_assert_backtrackingpath() argument
13007 free_stack(common, 1); in compile_assert_backtrackingpath()
13018 free_stack(common, 1); in compile_assert_backtrackingpath()
13021 free_stack(common, 1); in compile_assert_backtrackingpath()
13028 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_assert_backtrackingpath()
13048 static void compile_bracket_backtrackingpath(compiler_common *common, struct backtrack_common *curr… in compile_bracket_backtrackingpath() argument
13115 free_stack(common, 1); in compile_bracket_backtrackingpath()
13127 free_stack(common, 1); in compile_bracket_backtrackingpath()
13142 free_stack(common, 1); in compile_bracket_backtrackingpath()
13156 free_stack(common, 1); in compile_bracket_backtrackingpath()
13168 free_stack(common, 1); in compile_bracket_backtrackingpath()
13179 if (common->capture_last_ptr != 0) in compile_bracket_backtrackingpath()
13181 SLJIT_ASSERT(common->optimized_cbracket[offset >> 1] == 0); in compile_bracket_backtrackingpath()
13184 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr, TMP1, 0); in compile_bracket_backtrackingpath()
13186 free_stack(common, 3); in compile_bracket_backtrackingpath()
13190 else if (common->optimized_cbracket[offset >> 1] == 0) in compile_bracket_backtrackingpath()
13194 free_stack(common, 2); in compile_bracket_backtrackingpath()
13205 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_bracket_backtrackingpath()
13216 free_stack(common, 1); in compile_bracket_backtrackingpath()
13225 free_stack(common, 1); in compile_bracket_backtrackingpath()
13253 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_bracket_backtrackingpath()
13293 ccprev = compile_reverse_matchingpath(common, ccprev, current); in compile_bracket_backtrackingpath()
13308 compile_matchingpath(common, ccprev, cc, current); in compile_bracket_backtrackingpath()
13328 match_script_run_common(common, private_data_ptr, current); in compile_bracket_backtrackingpath()
13336 …match_once_common(common, ket, CURRENT_AS(bracket_backtrack)->u.framesize, private_data_ptr, has_a… in compile_bracket_backtrackingpath()
13349 if (common->capture_last_ptr != 0) in compile_bracket_backtrackingpath()
13351 if (common->optimized_cbracket[offset >> 1] == 0) in compile_bracket_backtrackingpath()
13358 allocate_stack(common, stacksize); in compile_bracket_backtrackingpath()
13378 stacksize = match_capture_common(common, stacksize, offset, private_data_ptr); in compile_bracket_backtrackingpath()
13388 if (offset != 0 && ket == OP_KETRMAX && common->optimized_cbracket[offset >> 1] != 0) in compile_bracket_backtrackingpath()
13430 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_bracket_backtrackingpath()
13440 free_stack(common, 1); in compile_bracket_backtrackingpath()
13446 if (common->optimized_cbracket[offset >> 1] != 0) in compile_bracket_backtrackingpath()
13450 free_stack(common, 2); in compile_bracket_backtrackingpath()
13457 free_stack(common, 1); in compile_bracket_backtrackingpath()
13468 free_stack(common, 4); in compile_bracket_backtrackingpath()
13473 free_stack(common, 1); in compile_bracket_backtrackingpath()
13492 free_stack(common, stacksize); in compile_bracket_backtrackingpath()
13502 free_stack(common, 2); in compile_bracket_backtrackingpath()
13517 free_stack(common, 1); in compile_bracket_backtrackingpath()
13525 free_stack(common, 1); in compile_bracket_backtrackingpath()
13536 free_stack(common, 1); in compile_bracket_backtrackingpath()
13539 free_stack(common, bra == OP_BRAMINZERO ? 2 : 1); in compile_bracket_backtrackingpath()
13541 free_stack(common, 1); in compile_bracket_backtrackingpath()
13551 static SLJIT_INLINE void compile_bracketpos_backtrackingpath(compiler_common *common, struct backtr… in compile_bracketpos_backtrackingpath() argument
13572 if (common->capture_last_ptr != 0) in compile_bracketpos_backtrackingpath()
13575 if (common->capture_last_ptr != 0) in compile_bracketpos_backtrackingpath()
13576 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr, TMP1, 0); in compile_bracketpos_backtrackingpath()
13579 free_stack(common, CURRENT_AS(bracketpos_backtrack)->stacksize); in compile_bracketpos_backtrackingpath()
13584 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_bracketpos_backtrackingpath()
13592 free_stack(common, CURRENT_AS(bracketpos_backtrack)->stacksize); in compile_bracketpos_backtrackingpath()
13598 static SLJIT_INLINE void compile_braminzero_backtrackingpath(compiler_common *common, struct backtr… in compile_braminzero_backtrackingpath() argument
13608 compile_bracket_matchingpath(common, current->cc, current); in compile_braminzero_backtrackingpath()
13609 compile_bracket_backtrackingpath(common, current->top); in compile_braminzero_backtrackingpath()
13614 backtrack.common.cc = current->cc; in compile_braminzero_backtrackingpath()
13617 compile_assert_matchingpath(common, current->cc, &backtrack, FALSE); in compile_braminzero_backtrackingpath()
13622 static SLJIT_INLINE void compile_control_verb_backtrackingpath(compiler_common *common, struct back… in compile_control_verb_backtrackingpath() argument
13631 if (common->then_trap != NULL) in compile_control_verb_backtrackingpath()
13633 SLJIT_ASSERT(common->control_head_ptr != 0); in compile_control_verb_backtrackingpath()
13635 OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_control_verb_backtrackingpath()
13637 OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, common->then_trap->start); in compile_control_verb_backtrackingpath()
13645 add_jump(compiler, &common->then_trap->quit, JUMP(SLJIT_JUMP)); in compile_control_verb_backtrackingpath()
13648 else if (!common->local_quit_available && common->in_positive_assertion) in compile_control_verb_backtrackingpath()
13650 add_jump(compiler, &common->positive_assertion_quit, JUMP(SLJIT_JUMP)); in compile_control_verb_backtrackingpath()
13655 if (common->local_quit_available) in compile_control_verb_backtrackingpath()
13658 if (common->quit_label == NULL) in compile_control_verb_backtrackingpath()
13659 add_jump(compiler, &common->quit, JUMP(SLJIT_JUMP)); in compile_control_verb_backtrackingpath()
13661 JUMPTO(SLJIT_JUMP, common->quit_label); in compile_control_verb_backtrackingpath()
13667 SLJIT_ASSERT(common->control_head_ptr != 0 && TMP1 == SLJIT_R0 && STR_PTR == SLJIT_R1); in compile_control_verb_backtrackingpath()
13668 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_control_verb_backtrackingpath()
13673 add_jump(compiler, &common->reset_match, CMP(SLJIT_NOT_EQUAL, SLJIT_R0, 0, SLJIT_IMM, 0)); in compile_control_verb_backtrackingpath()
13681 add_jump(compiler, &common->reset_match, JUMP(SLJIT_JUMP)); in compile_control_verb_backtrackingpath()
13684 static SLJIT_INLINE void compile_vreverse_backtrackingpath(compiler_common *common, struct backtrac… in compile_vreverse_backtrackingpath() argument
13692 skip_valid_char(common); in compile_vreverse_backtrackingpath()
13701 static SLJIT_INLINE void compile_then_trap_backtrackingpath(compiler_common *common, struct backtra… in compile_then_trap_backtrackingpath() argument
13709 common->then_trap = CURRENT_AS(then_trap_backtrack)->then_trap; in compile_then_trap_backtrackingpath()
13717 free_stack(common, size); in compile_then_trap_backtrackingpath()
13724 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_then_trap_backtrackingpath()
13728 free_stack(common, 3); in compile_then_trap_backtrackingpath()
13731 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, TMP1, 0); in compile_then_trap_backtrackingpath()
13734 static void compile_backtrackingpath(compiler_common *common, struct backtrack_common *current) in compile_backtrackingpath() argument
13737 then_trap_backtrack *save_then_trap = common->then_trap; in compile_backtrackingpath()
13747 free_stack(common, 1); in compile_backtrackingpath()
13821 compile_iterator_backtrackingpath(common, current); in compile_backtrackingpath()
13828 compile_ref_iterator_backtrackingpath(common, current); in compile_backtrackingpath()
13832 compile_recurse_backtrackingpath(common, current); in compile_backtrackingpath()
13839 compile_assert_backtrackingpath(common, current); in compile_backtrackingpath()
13852 compile_bracket_backtrackingpath(common, current); in compile_backtrackingpath()
13857 compile_bracket_backtrackingpath(common, current); in compile_backtrackingpath()
13859 compile_assert_backtrackingpath(common, current); in compile_backtrackingpath()
13867 compile_bracketpos_backtrackingpath(common, current); in compile_backtrackingpath()
13871 compile_braminzero_backtrackingpath(common, current); in compile_backtrackingpath()
13875 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), STACK(common->has_skip_arg ? 4 : 0)); in compile_backtrackingpath()
13876 if (common->has_skip_arg) in compile_backtrackingpath()
13878 free_stack(common, common->has_skip_arg ? 5 : 1); in compile_backtrackingpath()
13879 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->mark_ptr, TMP1, 0); in compile_backtrackingpath()
13880 if (common->has_skip_arg) in compile_backtrackingpath()
13881 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, TMP2, 0); in compile_backtrackingpath()
13890 compile_control_verb_backtrackingpath(common, current); in compile_backtrackingpath()
13895 if (!common->local_quit_available) in compile_backtrackingpath()
13897 if (common->quit_label == NULL) in compile_backtrackingpath()
13898 add_jump(compiler, &common->quit, JUMP(SLJIT_JUMP)); in compile_backtrackingpath()
13900 JUMPTO(SLJIT_JUMP, common->quit_label); in compile_backtrackingpath()
13912 compile_vreverse_backtrackingpath(common, current); in compile_backtrackingpath()
13917 compile_then_trap_backtrackingpath(common, current); in compile_backtrackingpath()
13926 common->then_trap = save_then_trap; in compile_backtrackingpath()
13929 static SLJIT_INLINE void compile_recurse(compiler_common *common) in compile_recurse() argument
13932 PCRE2_SPTR cc = common->start + common->currententry->start; in compile_recurse()
13936 int private_data_size = get_recurse_data_length(common, ccbegin, ccend, &recurse_flags); in compile_recurse()
13946 common->then_trap = NULL; in compile_recurse()
13954 SLJIT_ASSERT(common->currententry->entry_label == NULL && common->recursive_head_ptr != 0); in compile_recurse()
13955 common->currententry->entry_label = LABEL(); in compile_recurse()
13956 set_jumps(common->currententry->entry_calls, common->currententry->entry_label); in compile_recurse()
13959 count_match(common); in compile_recurse()
13966 allocate_stack(common, private_data_size + local_size); in compile_recurse()
13970 copy_recurse_data(common, ccbegin, ccend, recurse_copy_from_global, local_size, private_data_size +… in compile_recurse()
13973 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->recursive_head_ptr, STACK_TOP, 0); in compile_recurse()
13976 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_IMM, 0); in compile_recurse()
13982 common->quit_label = NULL; in compile_recurse()
13983 common->accept_label = NULL; in compile_recurse()
13984 common->quit = NULL; in compile_recurse()
13985 common->accept = NULL; in compile_recurse()
13996 compile_matchingpath(common, altbacktrack.cc, cc, &altbacktrack); in compile_recurse()
14000 allocate_stack(common, (alt_max > 1 || (recurse_flags & recurse_flag_accept_found)) ? 2 : 1); in compile_recurse()
14001 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->recursive_head_ptr); in compile_recurse()
14016 SLJIT_ASSERT(common->currententry->backtrack_label == NULL); in compile_recurse()
14017 common->currententry->backtrack_label = LABEL(); in compile_recurse()
14018 set_jumps(common->currententry->backtrack_calls, common->currententry->backtrack_label); in compile_recurse()
14029 …copy_recurse_data(common, ccbegin, ccend, recurse_swap_global, local_size, private_data_size + loc… in compile_recurse()
14034 free_stack(common, 2); in compile_recurse()
14046 free_stack(common, (recurse_flags & recurse_flag_accept_found) ? 2 : 1); in compile_recurse()
14065 compile_backtrackingpath(common, altbacktrack.top); in compile_recurse()
14081 copy_recurse_data(common, ccbegin, ccend, recurse_copy_private_to_global, local_size, private_data_… in compile_recurse()
14084 free_stack(common, private_data_size + local_size); in compile_recurse()
14088 if (common->quit != NULL) in compile_recurse()
14092 set_jumps(common->quit, LABEL()); in compile_recurse()
14093 OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), common->recursive_head_ptr); in compile_recurse()
14094 …copy_recurse_data(common, ccbegin, ccend, recurse_copy_shared_to_global, local_size, private_data_… in compile_recurse()
14101 free_stack(common, 2); in compile_recurse()
14106 …copy_recurse_data(common, ccbegin, ccend, recurse_copy_kept_shared_to_global, local_size, private_… in compile_recurse()
14109 free_stack(common, private_data_size + local_size); in compile_recurse()
14114 if (common->accept != NULL) in compile_recurse()
14118 set_jumps(common->accept, LABEL()); in compile_recurse()
14120 OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), common->recursive_head_ptr); in compile_recurse()
14123 allocate_stack(common, 2); in compile_recurse()
14131 copy_recurse_data(common, ccbegin, ccend, recurse_swap_global, local_size, private_data_size + loca… in compile_recurse()
14150 compiler_common *common = &common_data; in jit_compile() local
14182 memset(common, 0, sizeof(compiler_common)); in jit_compile()
14183 common->re = re; in jit_compile()
14184 common->name_table = (PCRE2_SPTR)((uint8_t *)re + sizeof(pcre2_real_code)); in jit_compile()
14185 rootbacktrack.cc = common->name_table + re->name_count * re->name_entry_size; in jit_compile()
14188 common->invalid_utf = (mode & PCRE2_JIT_INVALID_UTF) != 0; in jit_compile()
14192 common->start = rootbacktrack.cc; in jit_compile()
14193 common->read_only_data_head = NULL; in jit_compile()
14194 common->fcc = tables + fcc_offset; in jit_compile()
14195 common->lcc = (sljit_sw)(tables + lcc_offset); in jit_compile()
14196 common->mode = mode; in jit_compile()
14197 common->might_be_empty = (re->minlength == 0) || (re->flags & PCRE2_MATCH_EMPTY); in jit_compile()
14198 common->allow_empty_partial = (re->max_lookbehind > 0) || (re->flags & PCRE2_MATCH_EMPTY); in jit_compile()
14199 common->nltype = NLTYPE_FIXED; in jit_compile()
14202 case PCRE2_NEWLINE_CR: common->newline = CHAR_CR; break; in jit_compile()
14203 case PCRE2_NEWLINE_LF: common->newline = CHAR_NL; break; in jit_compile()
14204 case PCRE2_NEWLINE_CRLF: common->newline = (CHAR_CR << 8) | CHAR_NL; break; in jit_compile()
14205 …case PCRE2_NEWLINE_ANY: common->newline = (CHAR_CR << 8) | CHAR_NL; common->nltype = NLTYPE_ANY; b… in jit_compile()
14206 …case PCRE2_NEWLINE_ANYCRLF: common->newline = (CHAR_CR << 8) | CHAR_NL; common->nltype = NLTYPE_AN… in jit_compile()
14207 case PCRE2_NEWLINE_NUL: common->newline = CHAR_NUL; break; in jit_compile()
14210 common->nlmax = READ_CHAR_MAX; in jit_compile()
14211 common->nlmin = 0; in jit_compile()
14213 common->bsr_nltype = NLTYPE_ANY; in jit_compile()
14215 common->bsr_nltype = NLTYPE_ANYCRLF; in jit_compile()
14219 common->bsr_nltype = NLTYPE_ANYCRLF; in jit_compile()
14221 common->bsr_nltype = NLTYPE_ANY; in jit_compile()
14224 common->bsr_nlmax = READ_CHAR_MAX; in jit_compile()
14225 common->bsr_nlmin = 0; in jit_compile()
14226 common->endonly = (re->overall_options & PCRE2_DOLLAR_ENDONLY) != 0; in jit_compile()
14227 common->ctypes = (sljit_sw)(tables + ctypes_offset); in jit_compile()
14228 common->name_count = re->name_count; in jit_compile()
14229 common->name_entry_size = re->name_entry_size; in jit_compile()
14230 common->unset_backref = (re->overall_options & PCRE2_MATCH_UNSET_BACKREF) != 0; in jit_compile()
14231 common->alt_circumflex = (re->overall_options & PCRE2_ALT_CIRCUMFLEX) != 0; in jit_compile()
14234 common->utf = (re->overall_options & PCRE2_UTF) != 0; in jit_compile()
14235 common->ucp = (re->overall_options & PCRE2_UCP) != 0; in jit_compile()
14236 if (common->utf) in jit_compile()
14238 if (common->nltype == NLTYPE_ANY) in jit_compile()
14239 common->nlmax = 0x2029; in jit_compile()
14240 else if (common->nltype == NLTYPE_ANYCRLF) in jit_compile()
14241 common->nlmax = (CHAR_CR > CHAR_NL) ? CHAR_CR : CHAR_NL; in jit_compile()
14245 common->nlmax = common->newline & 0xff; in jit_compile()
14248 if (common->nltype == NLTYPE_FIXED) in jit_compile()
14249 common->nlmin = common->newline & 0xff; in jit_compile()
14251 common->nlmin = (CHAR_CR < CHAR_NL) ? CHAR_CR : CHAR_NL; in jit_compile()
14253 if (common->bsr_nltype == NLTYPE_ANY) in jit_compile()
14254 common->bsr_nlmax = 0x2029; in jit_compile()
14256 common->bsr_nlmax = (CHAR_CR > CHAR_NL) ? CHAR_CR : CHAR_NL; in jit_compile()
14257 common->bsr_nlmin = (CHAR_CR < CHAR_NL) ? CHAR_CR : CHAR_NL; in jit_compile()
14260 common->invalid_utf = FALSE; in jit_compile()
14262 ccend = bracketend(common->start); in jit_compile()
14265 common->ovector_start = LIMIT_MATCH + sizeof(sljit_sw); in jit_compile()
14266 common->optimized_cbracket = (sljit_u8 *)SLJIT_MALLOC(re->top_bracket + 1, allocator_data); in jit_compile()
14267 if (!common->optimized_cbracket) in jit_compile()
14270 memset(common->optimized_cbracket, 0, re->top_bracket + 1); in jit_compile()
14272 memset(common->optimized_cbracket, 1, re->top_bracket + 1); in jit_compile()
14275 SLJIT_ASSERT(*common->start == OP_BRA && ccend[-(1 + LINK_SIZE)] == OP_KET); in jit_compile()
14277 common->capture_last_ptr = common->ovector_start; in jit_compile()
14278 common->ovector_start += sizeof(sljit_sw); in jit_compile()
14280 if (!check_opcode_types(common, common->start, ccend)) in jit_compile()
14282 SLJIT_FREE(common->optimized_cbracket, allocator_data); in jit_compile()
14289 common->req_char_ptr = common->ovector_start; in jit_compile()
14290 common->ovector_start += sizeof(sljit_sw); in jit_compile()
14294 common->start_used_ptr = common->ovector_start; in jit_compile()
14295 common->ovector_start += sizeof(sljit_sw); in jit_compile()
14298 common->hit_start = common->ovector_start; in jit_compile()
14299 common->ovector_start += sizeof(sljit_sw); in jit_compile()
14304 common->match_end_ptr = common->ovector_start; in jit_compile()
14305 common->ovector_start += sizeof(sljit_sw); in jit_compile()
14308 common->control_head_ptr = 1; in jit_compile()
14310 if (common->control_head_ptr != 0) in jit_compile()
14312 common->control_head_ptr = common->ovector_start; in jit_compile()
14313 common->ovector_start += sizeof(sljit_sw); in jit_compile()
14315 if (common->has_set_som) in jit_compile()
14318 common->start_ptr = common->ovector_start; in jit_compile()
14319 common->ovector_start += sizeof(sljit_sw); in jit_compile()
14323 if ((common->ovector_start & sizeof(sljit_sw)) != 0) in jit_compile()
14324 common->ovector_start += sizeof(sljit_sw); in jit_compile()
14326 if (common->start_ptr == 0) in jit_compile()
14327 common->start_ptr = OVECTOR(0); in jit_compile()
14330 if (common->capture_last_ptr != 0) in jit_compile()
14331 memset(common->optimized_cbracket, 0, re->top_bracket + 1); in jit_compile()
14333 SLJIT_ASSERT(!(common->req_char_ptr != 0 && common->start_used_ptr != 0)); in jit_compile()
14334 common->cbra_ptr = OVECTOR_START + (re->top_bracket + 1) * 2 * sizeof(sljit_sw); in jit_compile()
14336 total_length = ccend - common->start; in jit_compile()
14337 common->private_data_ptrs = (sljit_s32*)SLJIT_MALLOC(total_length * (sizeof(sljit_s32) + (common->h… in jit_compile()
14338 if (!common->private_data_ptrs) in jit_compile()
14340 SLJIT_FREE(common->optimized_cbracket, allocator_data); in jit_compile()
14343 memset(common->private_data_ptrs, 0, total_length * sizeof(sljit_s32)); in jit_compile()
14345 private_data_size = common->cbra_ptr + (re->top_bracket + 1) * sizeof(sljit_sw); in jit_compile()
14347 …CHORED) == 0 && (re->overall_options & PCRE2_NO_START_OPTIMIZE) == 0 && !common->has_skip_in_asser… in jit_compile()
14348 detect_early_fail(common, common->start, &private_data_size, 0, 0); in jit_compile()
14350 set_private_data_ptrs(common, &private_data_size, ccend); in jit_compile()
14352 SLJIT_ASSERT(common->early_fail_start_ptr <= common->early_fail_end_ptr); in jit_compile()
14356 SLJIT_FREE(common->private_data_ptrs, allocator_data); in jit_compile()
14357 SLJIT_FREE(common->optimized_cbracket, allocator_data); in jit_compile()
14361 if (common->has_then) in jit_compile()
14363 common->then_offsets = (sljit_u8 *)(common->private_data_ptrs + total_length); in jit_compile()
14364 memset(common->then_offsets, 0, total_length); in jit_compile()
14365 set_then_offsets(common, common->start, NULL); in jit_compile()
14371 SLJIT_FREE(common->optimized_cbracket, allocator_data); in jit_compile()
14372 SLJIT_FREE(common->private_data_ptrs, allocator_data); in jit_compile()
14375 common->compiler = compiler; in jit_compile()
14382 reset_ovector(common, (re->top_bracket + 1) * 2); in jit_compile()
14383 if (common->req_char_ptr != 0) in jit_compile()
14384 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->req_char_ptr, SLJIT_R0, 0); in jit_compile()
14397 if (common->early_fail_start_ptr < common->early_fail_end_ptr) in jit_compile()
14398 reset_early_fail(common); in jit_compile()
14401 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, -1); in jit_compile()
14402 if (common->mark_ptr != 0) in jit_compile()
14403 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->mark_ptr, SLJIT_IMM, 0); in jit_compile()
14404 if (common->control_head_ptr != 0) in jit_compile()
14405 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_IMM, 0); in jit_compile()
14410 mainloop_label = mainloop_entry(common); in jit_compile()
14415 if (mode == PCRE2_JIT_COMPLETE && fast_forward_first_n_chars(common)) in jit_compile()
14418 fast_forward_first_char(common); in jit_compile()
14420 fast_forward_newline(common); in jit_compile()
14422 fast_forward_start_bits(common); in jit_compile()
14434 if (common->req_char_ptr != 0) in jit_compile()
14435 …reqcu_not_found = search_requested_char(common, (PCRE2_UCHAR)(re->last_codeunit), (re->flags & PCR… in jit_compile()
14441 if (common->capture_last_ptr != 0) in jit_compile()
14442 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr, SLJIT_IMM, 0); in jit_compile()
14443 if (common->fast_forward_bc_ptr != NULL) in jit_compile()
14444 …OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), PRIVATE_DATA(common->fast_forward_bc_ptr + 1) >> 3, STR_PTR, … in jit_compile()
14446 if (common->start_ptr != OVECTOR(0)) in jit_compile()
14447 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->start_ptr, STR_PTR, 0); in jit_compile()
14452 jump = CMP(SLJIT_NOT_EQUAL, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, -1); in jit_compile()
14453 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0); in jit_compile()
14457 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0); in jit_compile()
14459 compile_matchingpath(common, common->start, ccend, &rootbacktrack); in jit_compile()
14463 SLJIT_FREE(common->optimized_cbracket, allocator_data); in jit_compile()
14464 SLJIT_FREE(common->private_data_ptrs, allocator_data); in jit_compile()
14465 PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data); in jit_compile()
14472 if (common->might_be_empty) in jit_compile()
14478 common->accept_label = LABEL(); in jit_compile()
14479 if (common->accept != NULL) in jit_compile()
14480 set_jumps(common->accept, common->accept_label); in jit_compile()
14483 copy_ovector(common, re->top_bracket + 1); in jit_compile()
14484 common->quit_label = common->abort_label = LABEL(); in jit_compile()
14485 if (common->quit != NULL) in jit_compile()
14486 set_jumps(common->quit, common->quit_label); in jit_compile()
14487 if (common->abort != NULL) in jit_compile()
14488 set_jumps(common->abort, common->abort_label); in jit_compile()
14490 SET_LABEL(minlength_check_failed, common->abort_label); in jit_compile()
14495 if (common->failed_match != NULL) in jit_compile()
14497 SLJIT_ASSERT(common->mode == PCRE2_JIT_COMPLETE); in jit_compile()
14498 set_jumps(common->failed_match, LABEL()); in jit_compile()
14500 JUMPTO(SLJIT_JUMP, common->abort_label); in jit_compile()
14508 common->partialmatchlabel = LABEL(); in jit_compile()
14509 set_jumps(common->partialmatch, common->partialmatchlabel); in jit_compile()
14510 return_with_partial_match(common, common->quit_label); in jit_compile()
14513 if (common->might_be_empty) in jit_compile()
14515 compile_backtrackingpath(common, rootbacktrack.top); in jit_compile()
14519 SLJIT_FREE(common->optimized_cbracket, allocator_data); in jit_compile()
14520 SLJIT_FREE(common->private_data_ptrs, allocator_data); in jit_compile()
14521 PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data); in jit_compile()
14531 jump = CMP(SLJIT_NOT_EQUAL, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, 0); in jit_compile()
14532 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->start_ptr); in jit_compile()
14533 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, SLJIT_IMM, -1); in jit_compile()
14534 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->hit_start, TMP1, 0); in jit_compile()
14539 if ((re->overall_options & PCRE2_ANCHORED) == 0 && common->match_end_ptr != 0) in jit_compile()
14541 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->match_end_ptr); in jit_compile()
14545 …(common->fast_forward_bc_ptr != NULL) ? (PRIVATE_DATA(common->fast_forward_bc_ptr + 1) >> 3) : com… in jit_compile()
14549 if (common->ff_newline_shortcut != NULL) in jit_compile()
14554 if (common->match_end_ptr != 0) in jit_compile()
14558 CMPTO(SLJIT_LESS, STR_PTR, 0, TMP1, 0, common->ff_newline_shortcut); in jit_compile()
14562 CMPTO(SLJIT_LESS, STR_PTR, 0, STR_END, 0, common->ff_newline_shortcut); in jit_compile()
14566 CMPTO(SLJIT_LESS, STR_PTR, 0, (common->match_end_ptr == 0) ? STR_END : TMP1, 0, mainloop_label); in jit_compile()
14574 …CMPTO(SLJIT_NOT_EQUAL, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, -1, common->partialmatc… in jit_compile()
14577 JUMPTO(SLJIT_JUMP, common->quit_label); in jit_compile()
14579 flush_stubs(common); in jit_compile()
14581 if (common->might_be_empty) in jit_compile()
14595 common->fast_forward_bc_ptr = NULL; in jit_compile()
14596 common->early_fail_start_ptr = 0; in jit_compile()
14597 common->early_fail_end_ptr = 0; in jit_compile()
14598 common->currententry = common->entries; in jit_compile()
14599 common->local_quit_available = TRUE; in jit_compile()
14600 quit_label = common->quit_label; in jit_compile()
14601 if (common->currententry != NULL) in jit_compile()
14604 common->recurse_bitset_size = ((private_data_size / SSIZE_OF(sw)) + 7) >> 3; in jit_compile()
14605 SLJIT_ASSERT(common->recurse_bitset_size > 0); in jit_compile()
14606 common->recurse_bitset = (sljit_u8*)SLJIT_MALLOC(common->recurse_bitset_size, allocator_data);; in jit_compile()
14608 if (common->recurse_bitset != NULL) in jit_compile()
14613 compile_recurse(common); in jit_compile()
14616 flush_stubs(common); in jit_compile()
14617 common->currententry = common->currententry->next; in jit_compile()
14619 while (common->currententry != NULL); in jit_compile()
14621 SLJIT_FREE(common->recurse_bitset, allocator_data); in jit_compile()
14624 if (common->currententry != NULL) in jit_compile()
14627 SLJIT_ASSERT(sljit_get_compiler_error(compiler) || common->recurse_bitset == NULL); in jit_compile()
14630 SLJIT_FREE(common->optimized_cbracket, allocator_data); in jit_compile()
14631 SLJIT_FREE(common->private_data_ptrs, allocator_data); in jit_compile()
14632 PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data); in jit_compile()
14636 common->local_quit_available = FALSE; in jit_compile()
14637 common->quit_label = quit_label; in jit_compile()
14641 set_jumps(common->stackalloc, LABEL()); in jit_compile()
14666 JUMPTO(SLJIT_JUMP, common->quit_label); in jit_compile()
14669 set_jumps(common->calllimit, LABEL()); in jit_compile()
14671 JUMPTO(SLJIT_JUMP, common->quit_label); in jit_compile()
14673 if (common->revertframes != NULL) in jit_compile()
14675 set_jumps(common->revertframes, LABEL()); in jit_compile()
14676 do_revertframes(common); in jit_compile()
14678 if (common->wordboundary != NULL) in jit_compile()
14680 set_jumps(common->wordboundary, LABEL()); in jit_compile()
14681 check_wordboundary(common, FALSE); in jit_compile()
14683 if (common->ucp_wordboundary != NULL) in jit_compile()
14685 set_jumps(common->ucp_wordboundary, LABEL()); in jit_compile()
14686 check_wordboundary(common, TRUE); in jit_compile()
14688 if (common->anynewline != NULL) in jit_compile()
14690 set_jumps(common->anynewline, LABEL()); in jit_compile()
14691 check_anynewline(common); in jit_compile()
14693 if (common->hspace != NULL) in jit_compile()
14695 set_jumps(common->hspace, LABEL()); in jit_compile()
14696 check_hspace(common); in jit_compile()
14698 if (common->vspace != NULL) in jit_compile()
14700 set_jumps(common->vspace, LABEL()); in jit_compile()
14701 check_vspace(common); in jit_compile()
14703 if (common->casefulcmp != NULL) in jit_compile()
14705 set_jumps(common->casefulcmp, LABEL()); in jit_compile()
14706 do_casefulcmp(common); in jit_compile()
14708 if (common->caselesscmp != NULL) in jit_compile()
14710 set_jumps(common->caselesscmp, LABEL()); in jit_compile()
14711 do_caselesscmp(common); in jit_compile()
14713 if (common->reset_match != NULL || common->restart_match != NULL) in jit_compile()
14715 if (common->restart_match != NULL) in jit_compile()
14717 set_jumps(common->restart_match, LABEL()); in jit_compile()
14718 OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), common->start_ptr); in jit_compile()
14721 set_jumps(common->reset_match, LABEL()); in jit_compile()
14722 do_reset_match(common, (re->top_bracket + 1) * 2); in jit_compile()
14730 if (common->utfreadchar != NULL) in jit_compile()
14732 set_jumps(common->utfreadchar, LABEL()); in jit_compile()
14733 do_utfreadchar(common); in jit_compile()
14735 if (common->utfreadtype8 != NULL) in jit_compile()
14737 set_jumps(common->utfreadtype8, LABEL()); in jit_compile()
14738 do_utfreadtype8(common); in jit_compile()
14740 if (common->utfpeakcharback != NULL) in jit_compile()
14742 set_jumps(common->utfpeakcharback, LABEL()); in jit_compile()
14743 do_utfpeakcharback(common); in jit_compile()
14747 if (common->utfreadchar_invalid != NULL) in jit_compile()
14749 set_jumps(common->utfreadchar_invalid, LABEL()); in jit_compile()
14750 do_utfreadchar_invalid(common); in jit_compile()
14752 if (common->utfreadnewline_invalid != NULL) in jit_compile()
14754 set_jumps(common->utfreadnewline_invalid, LABEL()); in jit_compile()
14755 do_utfreadnewline_invalid(common); in jit_compile()
14757 if (common->utfmoveback_invalid) in jit_compile()
14759 set_jumps(common->utfmoveback_invalid, LABEL()); in jit_compile()
14760 do_utfmoveback_invalid(common); in jit_compile()
14762 if (common->utfpeakcharback_invalid) in jit_compile()
14764 set_jumps(common->utfpeakcharback_invalid, LABEL()); in jit_compile()
14765 do_utfpeakcharback_invalid(common); in jit_compile()
14768 if (common->getucd != NULL) in jit_compile()
14770 set_jumps(common->getucd, LABEL()); in jit_compile()
14771 do_getucd(common); in jit_compile()
14773 if (common->getucdtype != NULL) in jit_compile()
14775 set_jumps(common->getucdtype, LABEL()); in jit_compile()
14776 do_getucdtype(common); in jit_compile()
14780 SLJIT_FREE(common->optimized_cbracket, allocator_data); in jit_compile()
14781 SLJIT_FREE(common->private_data_ptrs, allocator_data); in jit_compile()
14789 PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data); in jit_compile()
14804 PRIV(jit_free_rodata)(common->read_only_data_head, allocator_data); in jit_compile()
14821 functions->read_only_data_heads[mode] = common->read_only_data_head; in jit_compile()