Lines Matching refs:common

235   backtrack_common common;  member
246 backtrack_common common; member
266 backtrack_common common; member
276 backtrack_common common; member
281 backtrack_common common; member
297 backtrack_common common; member
304 backtrack_common common; member
498 #define OVECTOR_START (common->ovector_start)
500 #define OVECTOR_PRIV(i) (common->cbra_ptr + (i) * (sljit_sw)sizeof(sljit_sw))
501 #define PRIVATE_DATA(cc) (common->private_data_ptrs[(cc) - common->start])
518 struct sljit_compiler *compiler = common->compiler
584 static pcre_uchar *next_opcode(compiler_common *common, pcre_uchar *cc) in next_opcode() argument
586 SLJIT_UNUSED_ARG(common); in next_opcode()
735 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in next_opcode()
757 if (common->utf) return NULL; in next_opcode()
779 static BOOL check_opcode_types(compiler_common *common, pcre_uchar *cc, pcre_uchar *ccend) in check_opcode_types() argument
790 common->has_set_som = TRUE; in check_opcode_types()
791 common->might_be_empty = TRUE; in check_opcode_types()
797 common->optimized_cbracket[GET2(cc, 1)] = 0; in check_opcode_types()
803 common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] = 0; in check_opcode_types()
817 common->optimized_cbracket[GET2(cc, 1)] = 0; in check_opcode_types()
825 slot = common->name_table + GET2(cc, 1) * common->name_entry_size; in check_opcode_types()
828 common->optimized_cbracket[GET2(slot, 0)] = 0; in check_opcode_types()
829 slot += common->name_entry_size; in check_opcode_types()
836 if (common->recursive_head_ptr == 0) in check_opcode_types()
838 common->recursive_head_ptr = common->ovector_start; in check_opcode_types()
839 common->ovector_start += sizeof(sljit_sw); in check_opcode_types()
845 if (common->capture_last_ptr == 0) in check_opcode_types()
847 common->capture_last_ptr = common->ovector_start; in check_opcode_types()
848 common->ovector_start += sizeof(sljit_sw); in check_opcode_types()
854 common->has_then = TRUE; in check_opcode_types()
855 common->control_head_ptr = 1; in check_opcode_types()
859 common->needs_start_ptr = TRUE; in check_opcode_types()
863 if (common->mark_ptr == 0) in check_opcode_types()
865 common->mark_ptr = common->ovector_start; in check_opcode_types()
866 common->ovector_start += sizeof(sljit_sw); in check_opcode_types()
872 common->has_then = TRUE; in check_opcode_types()
873 common->control_head_ptr = 1; in check_opcode_types()
878 common->needs_start_ptr = TRUE; in check_opcode_types()
883 common->control_head_ptr = 1; in check_opcode_types()
884 common->has_skip_arg = TRUE; in check_opcode_types()
889 cc = next_opcode(common, cc); in check_opcode_types()
923 static BOOL detect_repeat(compiler_common *common, pcre_uchar *begin) in detect_repeat() argument
938 if (common->private_data_ptrs[end - common->start - LINK_SIZE] != 0) in detect_repeat()
984 common->private_data_ptrs[max_end - common->start - LINK_SIZE] = next_end - max_end; in detect_repeat()
985common->private_data_ptrs[max_end - common->start - LINK_SIZE + 1] = (type == OP_BRAZERO) ? OP_UPT… in detect_repeat()
987 common->private_data_ptrs[max_end - common->start - LINK_SIZE + 2] = max + 2; in detect_repeat()
999 common->private_data_ptrs[end - common->start - LINK_SIZE] = max_end - end; in detect_repeat()
1000 common->private_data_ptrs[end - common->start - LINK_SIZE + 1] = OP_EXACT; in detect_repeat()
1001 common->private_data_ptrs[end - common->start - LINK_SIZE + 2] = min; in detect_repeat()
1060 static void set_private_data_ptrs(compiler_common *common, int *private_data_start, pcre_uchar *cce… in set_private_data_ptrs() argument
1062 pcre_uchar *cc = common->start; in set_private_data_ptrs()
1079 if (detect_repeat(common, cc)) in set_private_data_ptrs()
1092 if (common->private_data_ptrs[cc + 1 - common->start] != 0) in set_private_data_ptrs()
1094 common->private_data_ptrs[cc - common->start] = private_data_ptr; in set_private_data_ptrs()
1096 cc += common->private_data_ptrs[cc + 1 - common->start]; in set_private_data_ptrs()
1111 common->private_data_ptrs[cc - common->start] = private_data_ptr; in set_private_data_ptrs()
1118 common->private_data_ptrs[cc - common->start] = private_data_ptr; in set_private_data_ptrs()
1128 common->private_data_ptrs[cc - common->start] = private_data_ptr; in set_private_data_ptrs()
1201 cc = next_opcode(common, cc); in set_private_data_ptrs()
1210 common->private_data_ptrs[cc - common->start] = private_data_ptr; in set_private_data_ptrs()
1220 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in set_private_data_ptrs()
1242 static int get_framesize(compiler_common *common, pcre_uchar *cc, pcre_uchar *ccend, BOOL recursive… in get_framesize() argument
1253 SLJIT_ASSERT(common->control_head_ptr != 0); in get_framesize()
1264 possessive = length = (common->capture_last_ptr != 0) ? 5 : 3; in get_framesize()
1268 cc = next_opcode(common, cc); in get_framesize()
1276 SLJIT_ASSERT(common->has_set_som); in get_framesize()
1289 SLJIT_ASSERT(common->mark_ptr != 0); in get_framesize()
1296 if (common->control_head_ptr != 0) in get_framesize()
1303 if (common->has_set_som && !setsom_found) in get_framesize()
1308 if (common->mark_ptr != 0 && !setmark_found) in get_framesize()
1313 if (common->capture_last_ptr != 0 && !capture_last_found) in get_framesize()
1326 if (common->capture_last_ptr != 0 && !capture_last_found) in get_framesize()
1337 if (common->control_head_ptr != 0) in get_framesize()
1410 cc = next_opcode(common, cc); in get_framesize()
1424 static void init_frame(compiler_common *common, pcre_uchar *cc, pcre_uchar *ccend, int stackpos, in… in init_frame() argument
1442 cc = next_opcode(common, cc); in init_frame()
1450 SLJIT_ASSERT(common->has_set_som); in init_frame()
1466 SLJIT_ASSERT(common->mark_ptr != 0); in init_frame()
1469 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->mark_ptr); in init_frame()
1470 OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, SLJIT_IMM, -common->mark_ptr); in init_frame()
1480 if (common->has_set_som && !setsom_found) in init_frame()
1489 if (common->mark_ptr != 0 && !setmark_found) in init_frame()
1491 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->mark_ptr); in init_frame()
1492 OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, SLJIT_IMM, -common->mark_ptr); in init_frame()
1498 if (common->capture_last_ptr != 0 && !capture_last_found) in init_frame()
1500 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr); in init_frame()
1501 OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, SLJIT_IMM, -common->capture_last_ptr); in init_frame()
1514 if (common->capture_last_ptr != 0 && !capture_last_found) in init_frame()
1516 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr); in init_frame()
1517 OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), stackpos, SLJIT_IMM, -common->capture_last_ptr); in init_frame()
1537 cc = next_opcode(common, cc); in init_frame()
1546 static SLJIT_INLINE int get_private_data_copy_length(compiler_common *common, pcre_uchar *cc, pcre_… in get_private_data_copy_length() argument
1584 if (common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] == 0) in get_private_data_copy_length()
1608 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in get_private_data_copy_length()
1617 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in get_private_data_copy_length()
1626 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in get_private_data_copy_length()
1662 cc = next_opcode(common, cc); in get_private_data_copy_length()
1671 static void copy_private_data(compiler_common *common, pcre_uchar *cc, pcre_uchar *ccend, in copy_private_data() argument
1715 SLJIT_ASSERT(save && common->recursive_head_ptr != 0); in copy_private_data()
1717 srcw[0] = common->recursive_head_ptr; in copy_private_data()
1720 SLJIT_ASSERT(common->control_head_ptr != 0); in copy_private_data()
1722 srcw[1] = common->control_head_ptr; in copy_private_data()
1765 if (common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] == 0) in copy_private_data()
1802 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in copy_private_data()
1815 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in copy_private_data()
1828 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in copy_private_data()
1891 cc = next_opcode(common, cc); in copy_private_data()
1993 static SLJIT_INLINE pcre_uchar *set_then_offsets(compiler_common *common, pcre_uchar *cc, pcre_uint… in set_then_offsets() argument
2005 cc = next_opcode(common, cc); in set_then_offsets()
2007 current_offset = common->then_offsets + (cc - common->start); in set_then_offsets()
2012 cc = set_then_offsets(common, cc, current_offset); in set_then_offsets()
2016 current_offset = common->then_offsets + (cc + 1 + LINK_SIZE - common->start); in set_then_offsets()
2019 cc = next_opcode(common, cc); in set_then_offsets()
2060 static void add_stub(compiler_common *common, struct sljit_jump *start) in add_stub() argument
2069 list_item->next = common->stubs; in add_stub()
2070 common->stubs = list_item; in add_stub()
2074 static void flush_stubs(compiler_common *common) in flush_stubs() argument
2077 stub_list *list_item = common->stubs; in flush_stubs()
2082 add_jump(compiler, &common->stackalloc, JUMP(SLJIT_FAST_CALL)); in flush_stubs()
2086 common->stubs = NULL; in flush_stubs()
2089 static void add_label_addr(compiler_common *common, sljit_uw *update_addr) in add_label_addr() argument
2099 label_addr->next = common->label_addrs; in add_label_addr()
2100 common->label_addrs = label_addr; in add_label_addr()
2103 static SLJIT_INLINE void count_match(compiler_common *common) in count_match() argument
2108 add_jump(compiler, &common->calllimit, JUMP(SLJIT_ZERO)); in count_match()
2111 static SLJIT_INLINE void allocate_stack(compiler_common *common, int size) in allocate_stack() argument
2124 add_stub(common, CMP(SLJIT_GREATER, STACK_TOP, 0, STACK_LIMIT, 0)); in allocate_stack()
2127 static SLJIT_INLINE void free_stack(compiler_common *common, int size) in free_stack() argument
2133 static sljit_uw * allocate_read_only_data(compiler_common *common, sljit_uw size) in allocate_read_only_data() argument
2148 *(void**)result = common->read_only_data_head; in allocate_read_only_data()
2149 common->read_only_data_head = (void *)result; in allocate_read_only_data()
2167 static SLJIT_INLINE void reset_ovector(compiler_common *common, int length) in reset_ovector() argument
2193 static SLJIT_INLINE void do_reset_match(compiler_common *common, int length) in do_reset_match() argument
2219 if (common->mark_ptr != 0) in do_reset_match()
2220 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->mark_ptr, SLJIT_IMM, 0); in do_reset_match()
2221 if (common->control_head_ptr != 0) in do_reset_match()
2222 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_IMM, 0); in do_reset_match()
2224 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->start_ptr); in do_reset_match()
2252 static SLJIT_INLINE void copy_ovector(compiler_common *common, int topbracket) in copy_ovector() argument
2263 if (common->mark_ptr != 0) in copy_ovector()
2264 OP1(SLJIT_MOV, SLJIT_R2, 0, SLJIT_MEM1(SLJIT_SP), common->mark_ptr); in copy_ovector()
2266 if (common->mark_ptr != 0) in copy_ovector()
2302 static SLJIT_INLINE void return_with_partial_match(compiler_common *common, struct sljit_label *qui… in return_with_partial_match() argument
2308 SLJIT_ASSERT(common->start_used_ptr != 0 && common->start_ptr != 0 in return_with_partial_match()
2309 && (common->mode == JIT_PARTIAL_SOFT_COMPILE ? common->hit_start != 0 : common->hit_start == 0)); in return_with_partial_match()
2321 …_SUB, SLJIT_R2, 0, SLJIT_MEM1(SLJIT_SP), common->mode == JIT_PARTIAL_HARD_COMPILE ? common->start_… in return_with_partial_match()
2328 …OV, SLJIT_R2, 0, SLJIT_MEM1(SLJIT_SP), common->mode == JIT_PARTIAL_HARD_COMPILE ? common->start_us… in return_with_partial_match()
2344 static SLJIT_INLINE void check_start_used_ptr(compiler_common *common) in check_start_used_ptr() argument
2350 if (common->mode == JIT_PARTIAL_SOFT_COMPILE) in check_start_used_ptr()
2353 OP2(SLJIT_ADD, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, SLJIT_IMM, 1); in check_start_used_ptr()
2357 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0); in check_start_used_ptr()
2360 else if (common->mode == JIT_PARTIAL_HARD_COMPILE) in check_start_used_ptr()
2362 jump = CMP(SLJIT_LESS_EQUAL, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0); in check_start_used_ptr()
2363 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0); in check_start_used_ptr()
2368 static SLJIT_INLINE BOOL char_has_othercase(compiler_common *common, pcre_uchar *cc) in char_has_othercase() argument
2374 if (common->utf) in char_has_othercase()
2386 return common->fcc[c] != c; in char_has_othercase()
2392 return MAX_255(c) ? common->fcc[c] != c : FALSE; in char_has_othercase()
2395 static SLJIT_INLINE unsigned int char_othercase(compiler_common *common, unsigned int c) in char_othercase() argument
2399 if (common->utf && c > 127) in char_othercase()
2408 return TABLE_GET(c, common->fcc, c); in char_othercase()
2411 static unsigned int char_get_othercase_bit(compiler_common *common, pcre_uchar *cc) in char_get_othercase_bit() argument
2420 if (common->utf) in char_get_othercase_bit()
2424 oc = common->fcc[c]; in char_get_othercase_bit()
2437 oc = TABLE_GET(c, common->fcc, c); in char_get_othercase_bit()
2441 oc = TABLE_GET(c, common->fcc, c); in char_get_othercase_bit()
2458 if (common->utf && c > 127) in char_get_othercase_bit()
2474 if (common->utf && c > 65535) in char_get_othercase_bit()
2487 static void check_partial(compiler_common *common, BOOL force) in check_partial() argument
2493 SLJIT_ASSERT(!force || common->mode != JIT_COMPILE); in check_partial()
2495 if (common->mode == JIT_COMPILE) in check_partial()
2499 jump = CMP(SLJIT_GREATER_EQUAL, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0); in check_partial()
2500 else if (common->mode == JIT_PARTIAL_SOFT_COMPILE) in check_partial()
2501 jump = CMP(SLJIT_EQUAL, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, SLJIT_IMM, -1); in check_partial()
2503 if (common->mode == JIT_PARTIAL_SOFT_COMPILE) in check_partial()
2504 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, 0); in check_partial()
2507 if (common->partialmatchlabel != NULL) in check_partial()
2508 JUMPTO(SLJIT_JUMP, common->partialmatchlabel); in check_partial()
2510 add_jump(compiler, &common->partialmatch, JUMP(SLJIT_JUMP)); in check_partial()
2517 static void check_str_end(compiler_common *common, jump_list **end_reached) in check_str_end() argument
2523 if (common->mode == JIT_COMPILE) in check_str_end()
2530 if (common->mode == JIT_PARTIAL_SOFT_COMPILE) in check_str_end()
2532 …add_jump(compiler, end_reached, CMP(SLJIT_GREATER_EQUAL, SLJIT_MEM1(SLJIT_SP), common->start_used_… in check_str_end()
2533 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, 0); in check_str_end()
2538 …add_jump(compiler, end_reached, CMP(SLJIT_GREATER_EQUAL, SLJIT_MEM1(SLJIT_SP), common->start_used_… in check_str_end()
2539 if (common->partialmatchlabel != NULL) in check_str_end()
2540 JUMPTO(SLJIT_JUMP, common->partialmatchlabel); in check_str_end()
2542 add_jump(compiler, &common->partialmatch, JUMP(SLJIT_JUMP)); in check_str_end()
2547 static void detect_partial_match(compiler_common *common, jump_list **backtracks) in detect_partial_match() argument
2552 if (common->mode == JIT_COMPILE) in detect_partial_match()
2560 add_jump(compiler, backtracks, CMP(SLJIT_GREATER_EQUAL, SLJIT_MEM1(SLJIT_SP), common->start_used_pt… in detect_partial_match()
2561 if (common->mode == JIT_PARTIAL_SOFT_COMPILE) in detect_partial_match()
2563 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, 0); in detect_partial_match()
2568 if (common->partialmatchlabel != NULL) in detect_partial_match()
2569 JUMPTO(SLJIT_JUMP, common->partialmatchlabel); in detect_partial_match()
2571 add_jump(compiler, &common->partialmatch, JUMP(SLJIT_JUMP)); in detect_partial_match()
2576 static void peek_char(compiler_common *common, pcre_uint32 max) in peek_char() argument
2589 if (common->utf) in peek_char()
2595 add_jump(compiler, &common->utfreadchar, JUMP(SLJIT_FAST_CALL)); in peek_char()
2602 if (common->utf) in peek_char()
2638 static void read_char7_type(compiler_common *common, BOOL full_read) in read_char7_type() argument
2646 SLJIT_ASSERT(common->utf); in read_char7_type()
2651 OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); in read_char7_type()
2664 static void read_char_range(compiler_common *common, pcre_uint32 min, pcre_uint32 max, BOOL update_… in read_char_range() argument
2686 if (common->utf) in read_char_range()
2736 …add_jump(compiler, (max < 0x10000) ? &common->utfreadchar16 : &common->utfreadchar, JUMP(SLJIT_FAS… in read_char_range()
2761 if (common->utf) in read_char_range()
2792 static SLJIT_INLINE void read_char(compiler_common *common) in read_char() argument
2794 read_char_range(common, 0, READ_CHAR_MAX, TRUE); in read_char()
2797 static void read_char8_type(compiler_common *common, BOOL update_str_ptr) in read_char8_type() argument
2814 if (common->utf) in read_char8_type()
2818 OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); in read_char8_type()
2830 OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); in read_char8_type()
2834 add_jump(compiler, &common->utfreadtype8, JUMP(SLJIT_FAST_CALL)); in read_char8_type()
2845 OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); in read_char8_type()
2851 if (common->utf && update_str_ptr) in read_char8_type()
2862 static void skip_char_back(compiler_common *common) in skip_char_back() argument
2870 if (common->utf) in skip_char_back()
2880 if (common->utf) in skip_char_back()
2897 static void check_newlinechar(compiler_common *common, int nltype, jump_list **backtracks, BOOL jum… in check_newlinechar() argument
2905 add_jump(compiler, &common->anynewline, JUMP(SLJIT_FAST_CALL)); in check_newlinechar()
2924 SLJIT_ASSERT(nltype == NLTYPE_FIXED && common->newline < 256); in check_newlinechar()
2925 …backtracks, CMP(jumpifmatch ? SLJIT_EQUAL : SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, common->newline)); in check_newlinechar()
2932 static void do_utfreadchar(compiler_common *common) in do_utfreadchar() argument
2980 static void do_utfreadchar16(compiler_common *common) in do_utfreadchar16() argument
3016 static void do_utfreadtype8(compiler_common *common) in do_utfreadtype8() argument
3037 OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP2), common->ctypes); in do_utfreadtype8()
3062 static void do_getucd(compiler_common *common) in do_getucd() argument
3084 static SLJIT_INLINE struct sljit_label *mainloop_entry(compiler_common *common, BOOL hascrorlf, BOO… in mainloop_entry() argument
3099 if (!(hascrorlf || firstline) && (common->nltype == NLTYPE_ANY || in mainloop_entry()
3100 common->nltype == NLTYPE_ANYCRLF || common->newline > 255)) in mainloop_entry()
3106 SLJIT_ASSERT(common->first_line_end != 0); in mainloop_entry()
3109 if (common->nltype == NLTYPE_FIXED && common->newline > 255) in mainloop_entry()
3116 CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff, mainloop); in mainloop_entry()
3117 CMPTO(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, common->newline & 0xff, mainloop); in mainloop_entry()
3119 … OP2(SLJIT_SUB, SLJIT_MEM1(SLJIT_SP), common->first_line_end, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1)); in mainloop_entry()
3126 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->first_line_end, STR_PTR, 0); in mainloop_entry()
3127 read_char_range(common, common->nlmin, common->nlmax, TRUE); in mainloop_entry()
3128 check_newlinechar(common, common->nltype, &newline, TRUE); in mainloop_entry()
3131 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->first_line_end, STR_PTR, 0); in mainloop_entry()
3146 OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, common->newline & 0xff); in mainloop_entry()
3159 if (common->utf) readuchar = TRUE; in mainloop_entry()
3167 CMPTO(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff, newlinelabel); in mainloop_entry()
3172 if (common->utf) in mainloop_entry()
3180 if (common->utf) in mainloop_entry()
3236 static int scan_prefix(compiler_common *common, pcre_uchar *cc, pcre_uint32 *chars, pcre_uint8 *byt… in scan_prefix() argument
3321 if (common->utf && HAS_EXTRALEN(*cc)) len += GET_EXTRALEN(*cc); in scan_prefix()
3323 max_chars = scan_prefix(common, cc + len, chars, bytes, max_chars, rec_count); in scan_prefix()
3346 … max_chars = scan_prefix(common, alternative + 1 + LINK_SIZE, chars, bytes, max_chars, rec_count); in scan_prefix()
3359 if (common->utf && !is_char7_bitset((const pcre_uint8 *)(cc + 1), FALSE)) return consumed; in scan_prefix()
3367 if (common->utf) return consumed; in scan_prefix()
3376 if (common->utf) return consumed; in scan_prefix()
3385 …if (common->utf && !is_char7_bitset((const pcre_uint8 *)common->ctypes - cbit_length + cbit_digit,… in scan_prefix()
3394 …if (common->utf && !is_char7_bitset((const pcre_uint8 *)common->ctypes - cbit_length + cbit_space,… in scan_prefix()
3403 …if (common->utf && !is_char7_bitset((const pcre_uint8 *)common->ctypes - cbit_length + cbit_word, … in scan_prefix()
3420 if (common->utf) return consumed; in scan_prefix()
3430 if (common->utf) return consumed; in scan_prefix()
3445 if (common->utf) return consumed; in scan_prefix()
3488 if (common->utf && HAS_EXTRALEN(*cc)) len += GET_EXTRALEN(*cc); in scan_prefix()
3491 if (caseless && char_has_othercase(common, cc)) in scan_prefix()
3494 if (common->utf) in scan_prefix()
3497 if ((int)PRIV(ord2utf)(char_othercase(common, chr), othercase) != len) in scan_prefix()
3504 othercase[0] = TABLE_GET(chr, common->fcc, chr); in scan_prefix()
3573 static SLJIT_INLINE BOOL fast_forward_first_n_chars(compiler_common *common, BOOL firstline) in fast_forward_first_n_chars() argument
3598 max = scan_prefix(common, common->start, chars, bytes, MAX_N_CHARS, &rec_count); in fast_forward_first_n_chars()
3639 update_table = (sljit_ub *)allocate_read_only_data(common, 256); in fast_forward_first_n_chars()
3728 SLJIT_ASSERT(common->first_line_end != 0); in fast_forward_first_n_chars()
3729 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->first_line_end); in fast_forward_first_n_chars()
3800 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->first_line_end); in fast_forward_first_n_chars()
3817 static SLJIT_INLINE void fast_forward_first_char(compiler_common *common, pcre_uchar first_char, BO… in fast_forward_first_char() argument
3827 SLJIT_ASSERT(common->first_line_end != 0); in fast_forward_first_char()
3829 OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_SP), common->first_line_end); in fast_forward_first_char()
3839 oc = TABLE_GET(first_char, common->fcc, first_char); in fast_forward_first_char()
3841 if (first_char > 127 && common->utf) in fast_forward_first_char()
3874 static SLJIT_INLINE void fast_forward_newline(compiler_common *common, BOOL firstline) in fast_forward_newline() argument
3887 SLJIT_ASSERT(common->first_line_end != 0); in fast_forward_newline()
3889 OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_SP), common->first_line_end); in fast_forward_newline()
3892 if (common->nltype == NLTYPE_FIXED && common->newline > 255) in fast_forward_newline()
3913 CMPTO(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff, loop); in fast_forward_newline()
3914 CMPTO(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, common->newline & 0xff, loop); in fast_forward_newline()
3928 skip_char_back(common); in fast_forward_newline()
3931 common->ff_newline_shortcut = loop; in fast_forward_newline()
3933 read_char_range(common, common->nlmin, common->nlmax, TRUE); in fast_forward_newline()
3935 if (common->nltype == NLTYPE_ANY || common->nltype == NLTYPE_ANYCRLF) in fast_forward_newline()
3937 check_newlinechar(common, common->nltype, &newline, FALSE); in fast_forward_newline()
3940 if (common->nltype == NLTYPE_ANY || common->nltype == NLTYPE_ANYCRLF) in fast_forward_newline()
3962 static BOOL check_class_ranges(compiler_common *common, const pcre_uint8 *bits, BOOL nclass, BOOL i…
3964 static SLJIT_INLINE void fast_forward_start_bits(compiler_common *common, pcre_uint8 *start_bits, B… in fast_forward_start_bits() argument
3977 SLJIT_ASSERT(common->first_line_end != 0); in fast_forward_start_bits()
3979 OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_SP), common->first_line_end); in fast_forward_start_bits()
3986 if (common->utf) in fast_forward_start_bits()
3990 if (!check_class_ranges(common, start_bits, (start_bits[31] & 0x80) != 0, TRUE, &matches)) in fast_forward_start_bits()
4006 if (common->utf) in fast_forward_start_bits()
4012 if (common->utf) in fast_forward_start_bits()
4019 if (common->utf) in fast_forward_start_bits()
4041 static SLJIT_INLINE struct sljit_jump *search_requested_char(compiler_common *common, pcre_uchar re… in search_requested_char() argument
4052 SLJIT_ASSERT(common->req_char_ptr != 0); in search_requested_char()
4053 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->req_char_ptr); in search_requested_char()
4070 oc = TABLE_GET(req_char, common->fcc, req_char); in search_requested_char()
4072 if (req_char > 127 && common->utf) in search_requested_char()
4098 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->req_char_ptr, TMP1, 0); in search_requested_char()
4104 static void do_revertframes(compiler_common *common) in do_revertframes() argument
4139 static void check_wordboundary(compiler_common *common) in check_wordboundary() argument
4156 skip_char_back(common); in check_wordboundary()
4157 check_start_used_ptr(common); in check_wordboundary()
4158 read_char(common); in check_wordboundary()
4162 if (common->use_ucp) in check_wordboundary()
4166 add_jump(compiler, &common->getucd, JUMP(SLJIT_FAST_CALL)); in check_wordboundary()
4184 if (common->utf) in check_wordboundary()
4187 OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), common->ctypes); in check_wordboundary()
4201 check_str_end(common, &skipread_list); in check_wordboundary()
4202 peek_char(common, READ_CHAR_MAX); in check_wordboundary()
4206 if (common->use_ucp) in check_wordboundary()
4210 add_jump(compiler, &common->getucd, JUMP(SLJIT_FAST_CALL)); in check_wordboundary()
4229 if (common->utf) in check_wordboundary()
4232 OP1(SLJIT_MOV_UB, TMP2, 0, SLJIT_MEM1(TMP1), common->ctypes); in check_wordboundary()
4248 static BOOL check_class_ranges(compiler_common *common, const pcre_uint8 *bits, BOOL nclass, BOOL i… in check_class_ranges() argument
4399 static void check_anynewline(compiler_common *common) in check_anynewline() argument
4412 if (common->utf) in check_anynewline()
4426 static void check_hspace(compiler_common *common) in check_hspace() argument
4440 if (common->utf) in check_hspace()
4465 static void check_vspace(compiler_common *common) in check_vspace() argument
4478 if (common->utf) in check_vspace()
4496 static void do_casefulcmp(compiler_common *common) in do_casefulcmp() argument
4525 static void do_caselesscmp(compiler_common *common) in do_caselesscmp() argument
4537 OP1(SLJIT_MOV, LCC_TABLE, 0, SLJIT_IMM, common->lcc); in do_caselesscmp()
4605 static pcre_uchar *byte_sequence_compare(compiler_common *common, BOOL caseless, pcre_uchar *cc, in byte_sequence_compare() argument
4615 if (caseless && char_has_othercase(common, cc)) in byte_sequence_compare()
4617 othercasebit = char_get_othercase_bit(common, cc); in byte_sequence_compare()
4662 if (common->utf && HAS_EXTRALEN(*cc)) in byte_sequence_compare()
4780 static void compile_xclass_matchingpath(compiler_common *common, pcre_uchar *cc, jump_list **backtr… in compile_xclass_matchingpath() argument
4790 BOOL utf = common->utf; in compile_xclass_matchingpath()
4898 detect_partial_match(common, backtracks); in compile_xclass_matchingpath()
4899 read_char_range(common, min, max, (cc[-1] & XCL_NOT) != 0); in compile_xclass_matchingpath()
4906 …if (!check_class_ranges(common, (const pcre_uint8 *)cc, (((const pcre_uint8 *)cc)[31] & 0x80) != 0… in compile_xclass_matchingpath()
4933 if (!check_class_ranges(common, (const pcre_uint8 *)cc, FALSE, TRUE, list)) in compile_xclass_matchingpath()
4937 if (common->utf) in compile_xclass_matchingpath()
4949 if (common->utf) in compile_xclass_matchingpath()
4964 add_jump(compiler, &common->getucd, JUMP(SLJIT_FAST_CALL)); in compile_xclass_matchingpath()
5285 static pcre_uchar *compile_char1_matchingpath(compiler_common *common, pcre_uchar type, pcre_uchar … in compile_char1_matchingpath() argument
5316 add_jump(compiler, &common->wordboundary, JUMP(SLJIT_FAST_CALL)); in compile_char1_matchingpath()
5323 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
5325 …if (common->utf && is_char7_bitset((const pcre_uint8*)common->ctypes - cbit_length + cbit_digit, F… in compile_char1_matchingpath()
5326 read_char7_type(common, type == OP_NOT_DIGIT); in compile_char1_matchingpath()
5329 read_char8_type(common, type == OP_NOT_DIGIT); in compile_char1_matchingpath()
5337 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
5339 …if (common->utf && is_char7_bitset((const pcre_uint8*)common->ctypes - cbit_length + cbit_space, F… in compile_char1_matchingpath()
5340 read_char7_type(common, type == OP_NOT_WHITESPACE); in compile_char1_matchingpath()
5343 read_char8_type(common, type == OP_NOT_WHITESPACE); in compile_char1_matchingpath()
5350 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
5352 …if (common->utf && is_char7_bitset((const pcre_uint8*)common->ctypes - cbit_length + cbit_word, FA… in compile_char1_matchingpath()
5353 read_char7_type(common, type == OP_NOT_WORDCHAR); in compile_char1_matchingpath()
5356 read_char8_type(common, type == OP_NOT_WORDCHAR); in compile_char1_matchingpath()
5362 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
5363 read_char_range(common, common->nlmin, common->nlmax, TRUE); in compile_char1_matchingpath()
5364 if (common->nltype == NLTYPE_FIXED && common->newline > 255) in compile_char1_matchingpath()
5366 jump[0] = CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff); in compile_char1_matchingpath()
5368 if (common->mode != JIT_PARTIAL_HARD_COMPILE) in compile_char1_matchingpath()
5371 check_str_end(common, &end_list); in compile_char1_matchingpath()
5374 add_jump(compiler, backtracks, CMP(SLJIT_EQUAL, TMP1, 0, SLJIT_IMM, common->newline & 0xff)); in compile_char1_matchingpath()
5379 check_newlinechar(common, common->nltype, backtracks, TRUE); in compile_char1_matchingpath()
5383 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
5385 if (common->utf) in compile_char1_matchingpath()
5411 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
5424 compile_xclass_matchingpath(common, propdata, backtracks); in compile_char1_matchingpath()
5430 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
5431 read_char_range(common, common->bsr_nlmin, common->bsr_nlmax, FALSE); in compile_char1_matchingpath()
5435 if (common->mode != JIT_PARTIAL_HARD_COMPILE) in compile_char1_matchingpath()
5438 check_str_end(common, &end_list); in compile_char1_matchingpath()
5444 check_newlinechar(common, common->bsr_nltype, backtracks, FALSE); in compile_char1_matchingpath()
5452 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
5453 read_char_range(common, 0x9, 0x3000, type == OP_NOT_HSPACE); in compile_char1_matchingpath()
5454 add_jump(compiler, &common->hspace, JUMP(SLJIT_FAST_CALL)); in compile_char1_matchingpath()
5460 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
5461 read_char_range(common, 0xa, 0x2029, type == OP_NOT_VSPACE); in compile_char1_matchingpath()
5462 add_jump(compiler, &common->vspace, JUMP(SLJIT_FAST_CALL)); in compile_char1_matchingpath()
5468 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
5469 read_char(common); in compile_char1_matchingpath()
5470 add_jump(compiler, &common->getucd, JUMP(SLJIT_FAST_CALL)); in compile_char1_matchingpath()
5479 read_char(common); in compile_char1_matchingpath()
5480 add_jump(compiler, &common->getucd, JUMP(SLJIT_FAST_CALL)); in compile_char1_matchingpath()
5495 if (common->mode == JIT_PARTIAL_HARD_COMPILE) in compile_char1_matchingpath()
5499 check_partial(common, TRUE); in compile_char1_matchingpath()
5508 if (common->nltype == NLTYPE_FIXED && common->newline > 255) in compile_char1_matchingpath()
5512 if (common->mode == JIT_COMPILE) in compile_char1_matchingpath()
5519 … OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff); in compile_char1_matchingpath()
5522 check_partial(common, TRUE); in compile_char1_matchingpath()
5527 …add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0… in compile_char1_matchingpath()
5528 … add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, common->newline & 0xff)); in compile_char1_matchingpath()
5530 else if (common->nltype == NLTYPE_FIXED) in compile_char1_matchingpath()
5535 add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, common->newline)); in compile_char1_matchingpath()
5551 if (common->nltype == NLTYPE_ANYCRLF) in compile_char1_matchingpath()
5560 read_char_range(common, common->nlmin, common->nlmax, TRUE); in compile_char1_matchingpath()
5562 add_jump(compiler, &common->anynewline, JUMP(SLJIT_FAST_CALL)); in compile_char1_matchingpath()
5570 check_partial(common, FALSE); in compile_char1_matchingpath()
5575 check_partial(common, FALSE); in compile_char1_matchingpath()
5596 if (common->nltype == NLTYPE_FIXED && common->newline > 255) in compile_char1_matchingpath()
5602 …add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0… in compile_char1_matchingpath()
5603 … add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, common->newline & 0xff)); in compile_char1_matchingpath()
5607 skip_char_back(common); in compile_char1_matchingpath()
5608 read_char_range(common, common->nlmin, common->nlmax, TRUE); in compile_char1_matchingpath()
5609 check_newlinechar(common, common->nltype, backtracks, FALSE); in compile_char1_matchingpath()
5619 if (!common->endonly) in compile_char1_matchingpath()
5620 compile_char1_matchingpath(common, OP_EODN, cc, backtracks); in compile_char1_matchingpath()
5624 check_partial(common, FALSE); in compile_char1_matchingpath()
5633 check_partial(common, FALSE); in compile_char1_matchingpath()
5637 if (common->nltype == NLTYPE_FIXED && common->newline > 255) in compile_char1_matchingpath()
5641 if (common->mode == JIT_COMPILE) in compile_char1_matchingpath()
5647 …add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0… in compile_char1_matchingpath()
5648 check_partial(common, TRUE); in compile_char1_matchingpath()
5654 …add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0… in compile_char1_matchingpath()
5655 … add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, TMP2, 0, SLJIT_IMM, common->newline & 0xff)); in compile_char1_matchingpath()
5659 peek_char(common, common->nlmax); in compile_char1_matchingpath()
5660 check_newlinechar(common, common->nltype, backtracks, FALSE); in compile_char1_matchingpath()
5669 if (common->utf && HAS_EXTRALEN(*cc)) length += GET_EXTRALEN(*cc); in compile_char1_matchingpath()
5671 …if (common->mode == JIT_COMPILE && (type == OP_CHAR || !char_has_othercase(common, cc) || char_get… in compile_char1_matchingpath()
5681 return byte_sequence_compare(common, type == OP_CHARI, cc, &context, backtracks); in compile_char1_matchingpath()
5684 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
5686 if (common->utf) in compile_char1_matchingpath()
5694 if (type == OP_CHAR || !char_has_othercase(common, cc)) in compile_char1_matchingpath()
5696 read_char_range(common, c, c, FALSE); in compile_char1_matchingpath()
5700 oc = char_othercase(common, c); in compile_char1_matchingpath()
5701 read_char_range(common, c < oc ? c : oc, c > oc ? c : oc, FALSE); in compile_char1_matchingpath()
5716 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
5719 if (common->utf) in compile_char1_matchingpath()
5726 if (type == OP_NOT || !char_has_othercase(common, cc)) in compile_char1_matchingpath()
5752 if (type == OP_NOT || !char_has_othercase(common, cc)) in compile_char1_matchingpath()
5754 read_char_range(common, c, c, TRUE); in compile_char1_matchingpath()
5759 oc = char_othercase(common, c); in compile_char1_matchingpath()
5760 read_char_range(common, c < oc ? c : oc, c > oc ? c : oc, TRUE); in compile_char1_matchingpath()
5777 detect_partial_match(common, backtracks); in compile_char1_matchingpath()
5780 bit = (common->utf && is_char7_bitset((const pcre_uint8 *)cc, type == OP_NCLASS)) ? 127 : 255; in compile_char1_matchingpath()
5781 read_char_range(common, 0, bit, type == OP_NCLASS); in compile_char1_matchingpath()
5783 read_char_range(common, 0, 255, type == OP_NCLASS); in compile_char1_matchingpath()
5786 if (check_class_ranges(common, (const pcre_uint8 *)cc, type == OP_NCLASS, FALSE, backtracks)) in compile_char1_matchingpath()
5791 if (common->utf) in compile_char1_matchingpath()
5825 compile_xclass_matchingpath(common, cc + LINK_SIZE, backtracks); in compile_char1_matchingpath()
5835 if (common->utf) in compile_char1_matchingpath()
5841 skip_char_back(common); in compile_char1_matchingpath()
5852 check_start_used_ptr(common); in compile_char1_matchingpath()
5859 static SLJIT_INLINE pcre_uchar *compile_charn_matchingpath(compiler_common *common, pcre_uchar *cc,… in compile_charn_matchingpath() argument
5878 if (common->utf && HAS_EXTRALEN(cc[1])) in compile_charn_matchingpath()
5886 if (common->utf) in compile_charn_matchingpath()
5888 if (char_has_othercase(common, cc + 1) && char_get_othercase_bit(common, cc + 1) == 0) in compile_charn_matchingpath()
5895 if (char_has_othercase(common, cc + 1) && char_get_othercase_bit(common, cc + 1) == 0) in compile_charn_matchingpath()
5917 …do cc = byte_sequence_compare(common, *cc == OP_CHARI, cc + 1, &context, backtracks); while (conte… in compile_charn_matchingpath()
5922 return compile_char1_matchingpath(common, *cc, cc + 1, backtracks); in compile_charn_matchingpath()
5957 static void compile_dnref_search(compiler_common *common, pcre_uchar *cc, jump_list **backtracks) in compile_dnref_search() argument
5962 pcre_uchar *slot = common->name_table + GET2(cc, 1) * common->name_entry_size; in compile_dnref_search()
5976 slot += common->name_entry_size; in compile_dnref_search()
5981 if (backtracks != NULL && !common->jscript_compat) in compile_dnref_search()
5987 static void compile_ref_matchingpath(compiler_common *common, pcre_uchar *cc, jump_list **backtrack… in compile_ref_matchingpath() argument
6001 if (withchecks && !common->jscript_compat) in compile_ref_matchingpath()
6008 if (common->utf && *cc == OP_REFI) in compile_ref_matchingpath()
6025 if (common->mode == JIT_COMPILE) in compile_ref_matchingpath()
6031 check_partial(common, FALSE); in compile_ref_matchingpath()
6050 if (common->mode == JIT_COMPILE) in compile_ref_matchingpath()
6053 …add_jump(compiler, *cc == OP_REF ? &common->casefulcmp : &common->caselesscmp, JUMP(SLJIT_FAST_CAL… in compile_ref_matchingpath()
6056 if (common->mode != JIT_COMPILE) in compile_ref_matchingpath()
6065 …add_jump(compiler, *cc == OP_REF ? &common->casefulcmp : &common->caselesscmp, JUMP(SLJIT_FAST_CAL… in compile_ref_matchingpath()
6068 check_partial(common, FALSE); in compile_ref_matchingpath()
6083 static SLJIT_INLINE pcre_uchar *compile_ref_iterator_matchingpath(compiler_common *common, pcre_uch… in compile_ref_iterator_matchingpath() argument
6142 allocate_stack(common, 2); in compile_ref_iterator_matchingpath()
6155 compile_dnref_search(common, ccbegin, NULL); in compile_ref_iterator_matchingpath()
6165 allocate_stack(common, 1); in compile_ref_iterator_matchingpath()
6176 compile_dnref_search(common, ccbegin, &backtrack->topbacktracks); in compile_ref_iterator_matchingpath()
6189 compile_ref_matchingpath(common, ccbegin, &backtrack->topbacktracks, FALSE, FALSE); in compile_ref_iterator_matchingpath()
6201 allocate_stack(common, 1); in compile_ref_iterator_matchingpath()
6211 allocate_stack(common, 1); in compile_ref_iterator_matchingpath()
6219 count_match(common); in compile_ref_iterator_matchingpath()
6223 allocate_stack(common, ref ? 2 : 3); in compile_ref_iterator_matchingpath()
6238 compile_dnref_search(common, ccbegin, NULL); in compile_ref_iterator_matchingpath()
6256 compile_dnref_search(common, ccbegin, &backtrack->topbacktracks); in compile_ref_iterator_matchingpath()
6269 compile_ref_matchingpath(common, ccbegin, &backtrack->topbacktracks, TRUE, TRUE); in compile_ref_iterator_matchingpath()
6286 count_match(common); in compile_ref_iterator_matchingpath()
6290 static SLJIT_INLINE pcre_uchar *compile_recurse_matchingpath(compiler_common *common, pcre_uchar *c… in compile_recurse_matchingpath() argument
6294 recurse_entry *entry = common->entries; in compile_recurse_matchingpath()
6303 if (get_framesize(common, common->start + start, NULL, TRUE, &needs_control_head) == no_stack) in compile_recurse_matchingpath()
6305 start_cc = common->start + start; in compile_recurse_matchingpath()
6306 …compile_matchingpath(common, next_opcode(common, start_cc), bracketend(start_cc) - (1 + LINK_SIZE)… in compile_recurse_matchingpath()
6332 common->entries = entry; in compile_recurse_matchingpath()
6335 if (common->has_set_som && common->mark_ptr != 0) in compile_recurse_matchingpath()
6338 allocate_stack(common, 2); in compile_recurse_matchingpath()
6339 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->mark_ptr); in compile_recurse_matchingpath()
6343 else if (common->has_set_som || common->mark_ptr != 0) in compile_recurse_matchingpath()
6345 …OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->has_set_som ? (int)(OVECTOR(0)) : common->ma… in compile_recurse_matchingpath()
6346 allocate_stack(common, 1); in compile_recurse_matchingpath()
6410 static SLJIT_INLINE pcre_uchar *compile_callout_matchingpath(compiler_common *common, pcre_uchar *c… in compile_callout_matchingpath() argument
6417 allocate_stack(common, CALLOUT_ARG_SIZE / sizeof(sljit_sw)); in compile_callout_matchingpath()
6419 SLJIT_ASSERT(common->capture_last_ptr != 0); in compile_callout_matchingpath()
6420 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr); in compile_callout_matchingpath()
6430 if (common->mark_ptr != 0) in compile_callout_matchingpath()
6434 OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), CALLOUT_ARG_OFFSET(mark), (common->mark_ptr != 0) ? TMP2 : SL… in compile_callout_matchingpath()
6443 free_stack(common, CALLOUT_ARG_SIZE / sizeof(sljit_sw)); in compile_callout_matchingpath()
6448 if (common->forced_quit_label == NULL) in compile_callout_matchingpath()
6449 add_jump(compiler, &common->forced_quit, JUMP(SLJIT_SIG_LESS)); in compile_callout_matchingpath()
6451 JUMPTO(SLJIT_SIG_LESS, common->forced_quit_label); in compile_callout_matchingpath()
6458 static pcre_uchar *compile_assert_matchingpath(compiler_common *common, pcre_uchar *cc, assert_back… in compile_assert_matchingpath() argument
6470 jump_list **target = (conditional) ? &backtrack->condfailed : &backtrack->common.topbacktracks; in compile_assert_matchingpath()
6473 BOOL save_local_exit = common->local_exit; in compile_assert_matchingpath()
6474 BOOL save_positive_assert = common->positive_assert; in compile_assert_matchingpath()
6475 then_trap_backtrack *save_then_trap = common->then_trap; in compile_assert_matchingpath()
6476 struct sljit_label *save_quit_label = common->quit_label; in compile_assert_matchingpath()
6477 struct sljit_label *save_accept_label = common->accept_label; in compile_assert_matchingpath()
6478 jump_list *save_quit = common->quit; in compile_assert_matchingpath()
6479 jump_list *save_positive_assert_quit = common->positive_assert_quit; in compile_assert_matchingpath()
6480 jump_list *save_accept = common->accept; in compile_assert_matchingpath()
6485 common->then_trap = NULL; in compile_assert_matchingpath()
6495 framesize = get_framesize(common, cc, NULL, FALSE, &needs_control_head); in compile_assert_matchingpath()
6508 free_stack(common, 1); in compile_assert_matchingpath()
6517 allocate_stack(common, extrasize); in compile_assert_matchingpath()
6519 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_assert_matchingpath()
6523 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_IMM, 0); in compile_assert_matchingpath()
6530 allocate_stack(common, framesize + extrasize); in compile_assert_matchingpath()
6535 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_assert_matchingpath()
6541 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_IMM, 0); in compile_assert_matchingpath()
6545 init_frame(common, ccbegin, NULL, framesize + extrasize - 1, extrasize, FALSE); in compile_assert_matchingpath()
6552 common->local_exit = TRUE; in compile_assert_matchingpath()
6553 common->quit_label = NULL; in compile_assert_matchingpath()
6554 common->quit = NULL; in compile_assert_matchingpath()
6555 common->positive_assert = FALSE; in compile_assert_matchingpath()
6558 common->positive_assert = TRUE; in compile_assert_matchingpath()
6559 common->positive_assert_quit = NULL; in compile_assert_matchingpath()
6563 common->accept_label = NULL; in compile_assert_matchingpath()
6564 common->accept = NULL; in compile_assert_matchingpath()
6572 compile_matchingpath(common, ccbegin + 1 + LINK_SIZE, cc, &altbacktrack); in compile_assert_matchingpath()
6577 common->local_exit = save_local_exit; in compile_assert_matchingpath()
6578 common->quit_label = save_quit_label; in compile_assert_matchingpath()
6579 common->quit = save_quit; in compile_assert_matchingpath()
6581 common->positive_assert = save_positive_assert; in compile_assert_matchingpath()
6582 common->then_trap = save_then_trap; in compile_assert_matchingpath()
6583 common->accept_label = save_accept_label; in compile_assert_matchingpath()
6584 common->positive_assert_quit = save_positive_assert_quit; in compile_assert_matchingpath()
6585 common->accept = save_accept; in compile_assert_matchingpath()
6588 common->accept_label = LABEL(); in compile_assert_matchingpath()
6589 if (common->accept != NULL) in compile_assert_matchingpath()
6590 set_jumps(common->accept, common->accept_label); in compile_assert_matchingpath()
6598 free_stack(common, extrasize); in compile_assert_matchingpath()
6600 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_MEM1(STACK_TOP), 0); in compile_assert_matchingpath()
6609 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_MEM1(STACK_TOP), 0); in compile_assert_matchingpath()
6615 …OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_MEM1(STACK_TOP), (framesize +… in compile_assert_matchingpath()
6616 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_assert_matchingpath()
6646 compile_backtrackingpath(common, altbacktrack.top); in compile_assert_matchingpath()
6651 common->local_exit = save_local_exit; in compile_assert_matchingpath()
6652 common->quit_label = save_quit_label; in compile_assert_matchingpath()
6653 common->quit = save_quit; in compile_assert_matchingpath()
6655 common->positive_assert = save_positive_assert; in compile_assert_matchingpath()
6656 common->then_trap = save_then_trap; in compile_assert_matchingpath()
6657 common->accept_label = save_accept_label; in compile_assert_matchingpath()
6658 common->positive_assert_quit = save_positive_assert_quit; in compile_assert_matchingpath()
6659 common->accept = save_accept; in compile_assert_matchingpath()
6673 SLJIT_ASSERT(common->positive_assert_quit == NULL); in compile_assert_matchingpath()
6675 common->positive_assert_quit = common->quit; in compile_assert_matchingpath()
6679 if (common->positive_assert_quit != NULL) in compile_assert_matchingpath()
6682 set_jumps(common->positive_assert_quit, LABEL()); in compile_assert_matchingpath()
6689 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_assert_matchingpath()
6696 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_MEM1(STACK_TOP), STACK(1)); in compile_assert_matchingpath()
6710 free_stack(common, 1); in compile_assert_matchingpath()
6714 free_stack(common, extrasize); in compile_assert_matchingpath()
6722 free_stack(common, framesize + extrasize - 1); in compile_assert_matchingpath()
6726 free_stack(common, framesize + extrasize); in compile_assert_matchingpath()
6790 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_assert_matchingpath()
6793 set_jumps(backtrack->common.topbacktracks, LABEL()); in compile_assert_matchingpath()
6805 free_stack(common, 1); in compile_assert_matchingpath()
6809 free_stack(common, extrasize); in compile_assert_matchingpath()
6818 free_stack(common, framesize + extrasize - 1); in compile_assert_matchingpath()
6822 free_stack(common, framesize + extrasize); in compile_assert_matchingpath()
6836 SLJIT_ASSERT(found == &backtrack->common.topbacktracks); in compile_assert_matchingpath()
6837 set_jumps(backtrack->common.topbacktracks, LABEL()); in compile_assert_matchingpath()
6838 backtrack->common.topbacktracks = NULL; in compile_assert_matchingpath()
6844 common->local_exit = save_local_exit; in compile_assert_matchingpath()
6845 common->quit_label = save_quit_label; in compile_assert_matchingpath()
6846 common->quit = save_quit; in compile_assert_matchingpath()
6848 common->positive_assert = save_positive_assert; in compile_assert_matchingpath()
6849 common->then_trap = save_then_trap; in compile_assert_matchingpath()
6850 common->accept_label = save_accept_label; in compile_assert_matchingpath()
6851 common->positive_assert_quit = save_positive_assert_quit; in compile_assert_matchingpath()
6852 common->accept = save_accept; in compile_assert_matchingpath()
6856 static SLJIT_INLINE void match_once_common(compiler_common *common, pcre_uchar ket, int framesize, … in match_once_common() argument
6870 free_stack(common, stacksize); in match_once_common()
6899 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, TMP1, 0); in match_once_common()
6902 static SLJIT_INLINE int match_capture_common(compiler_common *common, int stacksize, int offset, in… in match_capture_common() argument
6906 if (common->capture_last_ptr != 0) in match_capture_common()
6908 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr); in match_capture_common()
6909 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr, SLJIT_IMM, offset >> 1); in match_capture_common()
6913 if (common->optimized_cbracket[offset >> 1] == 0) in match_capture_common()
6981 static pcre_uchar *compile_bracket_matchingpath(compiler_common *common, pcre_uchar *cc, backtrack_… in compile_bracket_matchingpath() argument
7055 if (common->optimized_cbracket[offset] == 0) in compile_bracket_matchingpath()
7075 …BACKTRACK_AS(bracket_backtrack)->u.framesize = get_framesize(common, ccbegin, NULL, FALSE, &needs_… in compile_bracket_matchingpath()
7086 allocate_stack(common, stacksize); in compile_bracket_matchingpath()
7104 free_stack(common, 1); in compile_bracket_matchingpath()
7162 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_bracket_matchingpath()
7184 allocate_stack(common, stacksize); in compile_bracket_matchingpath()
7211 allocate_stack(common, stacksize); in compile_bracket_matchingpath()
7232 …init_frame(common, ccbegin, NULL, BACKTRACK_AS(bracket_backtrack)->u.framesize + stacksize, stacks… in compile_bracket_matchingpath()
7238 if (common->optimized_cbracket[offset >> 1] != 0) in compile_bracket_matchingpath()
7241 allocate_stack(common, 2); in compile_bracket_matchingpath()
7251 allocate_stack(common, 1); in compile_bracket_matchingpath()
7260 allocate_stack(common, 1); in compile_bracket_matchingpath()
7267 allocate_stack(common, 1); in compile_bracket_matchingpath()
7286 slot = common->name_table + GET2(matchingpath, 1) * common->name_entry_size; in compile_bracket_matchingpath()
7290 slot += common->name_entry_size; in compile_bracket_matchingpath()
7296 slot += common->name_entry_size; in compile_bracket_matchingpath()
7313 if (common->currententry == NULL) in compile_bracket_matchingpath()
7317 else if (common->currententry->start == 0) in compile_bracket_matchingpath()
7320 … stacksize = stacksize == (int)GET2(common->start, common->currententry->start + 1 + LINK_SIZE); in compile_bracket_matchingpath()
7327 if (common->currententry == NULL || common->currententry->start == 0) in compile_bracket_matchingpath()
7332 slot = common->name_table + GET2(matchingpath, 1) * common->name_entry_size; in compile_bracket_matchingpath()
7333 i = (int)GET2(common->start, common->currententry->start + 1 + LINK_SIZE); in compile_bracket_matchingpath()
7338 slot += common->name_entry_size; in compile_bracket_matchingpath()
7367 assert->common.cc = matchingpath; in compile_bracket_matchingpath()
7369 matchingpath = compile_assert_matchingpath(common, matchingpath, assert, TRUE); in compile_bracket_matchingpath()
7373 compile_matchingpath(common, matchingpath, cc, backtrack); in compile_bracket_matchingpath()
7378 …match_once_common(common, ket, BACKTRACK_AS(bracket_backtrack)->u.framesize, private_data_ptr, has… in compile_bracket_matchingpath()
7391 if (common->capture_last_ptr != 0) in compile_bracket_matchingpath()
7393 if (common->optimized_cbracket[offset >> 1] == 0) in compile_bracket_matchingpath()
7400 allocate_stack(common, stacksize); in compile_bracket_matchingpath()
7420 stacksize = match_capture_common(common, stacksize, offset, private_data_ptr); in compile_bracket_matchingpath()
7431 if (offset != 0 && common->optimized_cbracket[offset >> 1] != 0) in compile_bracket_matchingpath()
7447 free_stack(common, 1); in compile_bracket_matchingpath()
7459 free_stack(common, 1); in compile_bracket_matchingpath()
7472 count_match(common); in compile_bracket_matchingpath()
7480 allocate_stack(common, 1); in compile_bracket_matchingpath()
7500 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_bracket_matchingpath()
7503 free_stack(common, 1); in compile_bracket_matchingpath()
7509 count_match(common); in compile_bracket_matchingpath()
7522 static pcre_uchar *compile_bracketpos_matchingpath(compiler_common *common, pcre_uchar *cc, backtra… in compile_bracketpos_matchingpath() argument
7562 SLJIT_ASSERT(common->optimized_cbracket[offset] == 0); in compile_bracketpos_matchingpath()
7573 framesize = get_framesize(common, cc, NULL, FALSE, &needs_control_head); in compile_bracketpos_matchingpath()
7580 if (common->capture_last_ptr != 0) in compile_bracketpos_matchingpath()
7592 allocate_stack(common, stacksize); in compile_bracketpos_matchingpath()
7603 if (common->capture_last_ptr != 0) in compile_bracketpos_matchingpath()
7604 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr); in compile_bracketpos_matchingpath()
7607 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_bracketpos_matchingpath()
7608 if (common->capture_last_ptr != 0) in compile_bracketpos_matchingpath()
7617 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_bracketpos_matchingpath()
7643 allocate_stack(common, stacksize); in compile_bracketpos_matchingpath()
7646 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_bracketpos_matchingpath()
7666 init_frame(common, cc, NULL, stacksize - 1, stacksize - framesize, FALSE); in compile_bracketpos_matchingpath()
7680 compile_matchingpath(common, ccbegin, cc, backtrack); in compile_bracketpos_matchingpath()
7694 if (common->capture_last_ptr != 0) in compile_bracketpos_matchingpath()
7695 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr, SLJIT_IMM, offset >> 1); in compile_bracketpos_matchingpath()
7707 …OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_MEM1(STACK_TOP), STACK(stack)… in compile_bracketpos_matchingpath()
7723 if (common->capture_last_ptr != 0) in compile_bracketpos_matchingpath()
7724 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr, SLJIT_IMM, offset >> 1); in compile_bracketpos_matchingpath()
7738 …OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_MEM1(STACK_TOP), STACK(stack)… in compile_bracketpos_matchingpath()
7753 flush_stubs(common); in compile_bracketpos_matchingpath()
7755 compile_backtrackingpath(common, backtrack->top); in compile_bracketpos_matchingpath()
7801 count_match(common); in compile_bracketpos_matchingpath()
7805 static SLJIT_INLINE pcre_uchar *get_iterator_parameters(compiler_common *common, pcre_uchar *cc, pc… in get_iterator_parameters() argument
7888 *end = next_opcode(common, cc); in get_iterator_parameters()
7897 if (common->utf && HAS_EXTRALEN(*cc)) *end += GET_EXTRALEN(*cc); in get_iterator_parameters()
7903 static pcre_uchar *compile_iterator_matchingpath(compiler_common *common, pcre_uchar *cc, backtrack… in compile_iterator_matchingpath() argument
7922 cc = get_iterator_parameters(common, cc, &opcode, &type, &max, &min, &end); in compile_iterator_matchingpath()
7974 allocate_stack(common, 2); in compile_iterator_matchingpath()
7980 allocate_stack(common, 1); in compile_iterator_matchingpath()
7988 compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks); in compile_iterator_matchingpath()
8001 allocate_stack(common, 1); in compile_iterator_matchingpath()
8010 compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks); in compile_iterator_matchingpath()
8012 allocate_stack(common, 2); in compile_iterator_matchingpath()
8019 compile_char1_matchingpath(common, type, cc, &nomatch); in compile_iterator_matchingpath()
8046 compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks); in compile_iterator_matchingpath()
8048 allocate_stack(common, 1); in compile_iterator_matchingpath()
8056 allocate_stack(common, 2); in compile_iterator_matchingpath()
8067 allocate_stack(common, 1); in compile_iterator_matchingpath()
8070 compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks); in compile_iterator_matchingpath()
8077 compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks); in compile_iterator_matchingpath()
8086 compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks); in compile_iterator_matchingpath()
8091 compile_char1_matchingpath(common, type, cc, &nomatch); in compile_iterator_matchingpath()
8106 compile_char1_matchingpath(common, type, cc, &nomatch); in compile_iterator_matchingpath()
8116 compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks); in compile_iterator_matchingpath()
8127 compile_char1_matchingpath(common, type, cc, &nomatch); in compile_iterator_matchingpath()
8145 count_match(common); in compile_iterator_matchingpath()
8149 static SLJIT_INLINE pcre_uchar *compile_fail_accept_matchingpath(compiler_common *common, pcre_ucha… in compile_fail_accept_matchingpath() argument
8162 if (*cc == OP_ASSERT_ACCEPT || common->currententry != NULL || !common->might_be_empty) in compile_fail_accept_matchingpath()
8165 if (common->accept_label == NULL) in compile_fail_accept_matchingpath()
8166 add_jump(compiler, &common->accept, JUMP(SLJIT_JUMP)); in compile_fail_accept_matchingpath()
8168 JUMPTO(SLJIT_JUMP, common->accept_label); in compile_fail_accept_matchingpath()
8172 if (common->accept_label == NULL) in compile_fail_accept_matchingpath()
8173 …add_jump(compiler, &common->accept, CMP(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR… in compile_fail_accept_matchingpath()
8175 CMPTO(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), OVECTOR(0), common->accept_label); in compile_fail_accept_matchingpath()
8180 if (common->accept_label == NULL) in compile_fail_accept_matchingpath()
8181 add_jump(compiler, &common->accept, CMP(SLJIT_EQUAL, TMP2, 0, SLJIT_IMM, 0)); in compile_fail_accept_matchingpath()
8183 CMPTO(SLJIT_EQUAL, TMP2, 0, SLJIT_IMM, 0, common->accept_label); in compile_fail_accept_matchingpath()
8185 if (common->accept_label == NULL) in compile_fail_accept_matchingpath()
8186 add_jump(compiler, &common->accept, CMP(SLJIT_NOT_EQUAL, TMP2, 0, STR_PTR, 0)); in compile_fail_accept_matchingpath()
8188 CMPTO(SLJIT_NOT_EQUAL, TMP2, 0, STR_PTR, 0, common->accept_label); in compile_fail_accept_matchingpath()
8193 static SLJIT_INLINE pcre_uchar *compile_close_matchingpath(compiler_common *common, pcre_uchar *cc) in compile_close_matchingpath() argument
8197 BOOL optimized_cbracket = common->optimized_cbracket[offset] != 0; in compile_close_matchingpath()
8200 if (common->currententry != NULL) in compile_close_matchingpath()
8212 static SLJIT_INLINE pcre_uchar *compile_control_verb_matchingpath(compiler_common *common, pcre_uch… in compile_control_verb_matchingpath() argument
8226 allocate_stack(common, 1); in compile_control_verb_matchingpath()
8235 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->mark_ptr, TMP2, 0); in compile_control_verb_matchingpath()
8244 static SLJIT_INLINE void compile_then_trap_matchingpath(compiler_common *common, pcre_uchar *cc, pc… in compile_then_trap_matchingpath() argument
8252 common->then_trap = BACKTRACK_AS(then_trap_backtrack); in compile_then_trap_matchingpath()
8253 BACKTRACK_AS(then_trap_backtrack)->common.cc = then_trap_opcode; in compile_then_trap_matchingpath()
8254 BACKTRACK_AS(then_trap_backtrack)->start = (sljit_sw)(cc - common->start); in compile_then_trap_matchingpath()
8255 BACKTRACK_AS(then_trap_backtrack)->framesize = get_framesize(common, cc, ccend, FALSE, &needs_contr… in compile_then_trap_matchingpath()
8260 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_then_trap_matchingpath()
8261 allocate_stack(common, size); in compile_then_trap_matchingpath()
8263 …OP2(SLJIT_SUB, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, STACK_TOP, 0, SLJIT_IMM, (size - 3)… in compile_then_trap_matchingpath()
8265 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, STACK_TOP, 0); in compile_then_trap_matchingpath()
8272 init_frame(common, cc, ccend, size - 1, 0, FALSE); in compile_then_trap_matchingpath()
8275 static void compile_matchingpath(compiler_common *common, pcre_uchar *cc, pcre_uchar *ccend, backtr… in compile_matchingpath() argument
8284 if (common->has_then && common->then_offsets[cc - common->start] != 0) in compile_matchingpath()
8286 SLJIT_ASSERT(*ccend != OP_END && common->control_head_ptr != 0); in compile_matchingpath()
8288 save_then_trap = common->then_trap; in compile_matchingpath()
8290 compile_then_trap_matchingpath(common, cc, ccend, parent); in compile_matchingpath()
8327 …cc = compile_char1_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top->nextbackt… in compile_matchingpath()
8333 allocate_stack(common, 1); in compile_matchingpath()
8341 if (common->mode == JIT_COMPILE) in compile_matchingpath()
8342 …cc = compile_charn_matchingpath(common, cc, ccend, parent->top != NULL ? &parent->top->nextbacktra… in compile_matchingpath()
8344 …cc = compile_char1_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top->nextbackt… in compile_matchingpath()
8412 cc = compile_iterator_matchingpath(common, cc, parent); in compile_matchingpath()
8418 cc = compile_iterator_matchingpath(common, cc, parent); in compile_matchingpath()
8420 …cc = compile_char1_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top->nextbackt… in compile_matchingpath()
8426 cc = compile_iterator_matchingpath(common, cc, parent); in compile_matchingpath()
8428 …cc = compile_char1_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top->nextbackt… in compile_matchingpath()
8435 cc = compile_ref_iterator_matchingpath(common, cc, parent); in compile_matchingpath()
8438 …compile_ref_matchingpath(common, cc, parent->top != NULL ? &parent->top->nextbacktracks : &parent-… in compile_matchingpath()
8446 cc = compile_ref_iterator_matchingpath(common, cc, parent); in compile_matchingpath()
8449 …compile_dnref_search(common, cc, parent->top != NULL ? &parent->top->nextbacktracks : &parent->top… in compile_matchingpath()
8450 …compile_ref_matchingpath(common, cc, parent->top != NULL ? &parent->top->nextbacktracks : &parent-… in compile_matchingpath()
8456 cc = compile_recurse_matchingpath(common, cc, parent); in compile_matchingpath()
8460 cc = compile_callout_matchingpath(common, cc, parent); in compile_matchingpath()
8468 cc = compile_assert_matchingpath(common, cc, BACKTRACK_AS(assert_backtrack), FALSE); in compile_matchingpath()
8476 allocate_stack(common, 1); in compile_matchingpath()
8481 allocate_stack(common, 2); in compile_matchingpath()
8486 count_match(common); in compile_matchingpath()
8497 cc = compile_bracket_matchingpath(common, cc, parent); in compile_matchingpath()
8502 cc = compile_bracket_matchingpath(common, cc, parent); in compile_matchingpath()
8506 cc = compile_assert_matchingpath(common, cc, BACKTRACK_AS(assert_backtrack), FALSE); in compile_matchingpath()
8515 cc = compile_bracketpos_matchingpath(common, cc, parent); in compile_matchingpath()
8520 SLJIT_ASSERT(common->mark_ptr != 0); in compile_matchingpath()
8521 OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_SP), common->mark_ptr); in compile_matchingpath()
8522 allocate_stack(common, common->has_skip_arg ? 5 : 1); in compile_matchingpath()
8524 OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(common->has_skip_arg ? 4 : 0), TMP2, 0); in compile_matchingpath()
8526 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->mark_ptr, TMP2, 0); in compile_matchingpath()
8528 if (common->has_skip_arg) in compile_matchingpath()
8530 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_matchingpath()
8531 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, STACK_TOP, 0); in compile_matchingpath()
8547 cc = compile_control_verb_matchingpath(common, cc, parent); in compile_matchingpath()
8553 cc = compile_fail_accept_matchingpath(common, cc, parent); in compile_matchingpath()
8557 cc = compile_close_matchingpath(common, cc); in compile_matchingpath()
8576 BACKTRACK_AS(then_trap_backtrack)->common.cc = then_trap_opcode; in compile_matchingpath()
8577 BACKTRACK_AS(then_trap_backtrack)->then_trap = common->then_trap; in compile_matchingpath()
8578 common->then_trap = save_then_trap; in compile_matchingpath()
8590 compile_backtrackingpath(common, (current)); \
8598 static void compile_iterator_backtrackingpath(compiler_common *common, struct backtrack_common *cur… in compile_iterator_backtrackingpath() argument
8613 cc = get_iterator_parameters(common, cc, &opcode, &type, &max, &min, NULL); in compile_iterator_backtrackingpath()
8626 free_stack(common, 1); in compile_iterator_backtrackingpath()
8645 skip_char_back(common); in compile_iterator_backtrackingpath()
8652 free_stack(common, 2); in compile_iterator_backtrackingpath()
8661 compile_char1_matchingpath(common, type, cc, &jumplist); in compile_iterator_backtrackingpath()
8666 free_stack(common, 1); in compile_iterator_backtrackingpath()
8679 compile_char1_matchingpath(common, type, cc, &jumplist); in compile_iterator_backtrackingpath()
8696 free_stack(common, 2); in compile_iterator_backtrackingpath()
8710 free_stack(common, 1); in compile_iterator_backtrackingpath()
8717 compile_char1_matchingpath(common, type, cc, &jumplist); in compile_iterator_backtrackingpath()
8722 free_stack(common, 1); in compile_iterator_backtrackingpath()
8742 static SLJIT_INLINE void compile_ref_iterator_backtrackingpath(compiler_common *common, struct back… in compile_ref_iterator_backtrackingpath() argument
8756 free_stack(common, 1); in compile_ref_iterator_backtrackingpath()
8764 free_stack(common, ref ? 2 : 3); in compile_ref_iterator_backtrackingpath()
8767 static SLJIT_INLINE void compile_recurse_backtrackingpath(compiler_common *common, struct backtrack… in compile_recurse_backtrackingpath() argument
8772 compile_backtrackingpath(common, current->top); in compile_recurse_backtrackingpath()
8777 if (common->has_set_som && common->mark_ptr != 0) in compile_recurse_backtrackingpath()
8781 free_stack(common, 2); in compile_recurse_backtrackingpath()
8783 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->mark_ptr, TMP1, 0); in compile_recurse_backtrackingpath()
8785 else if (common->has_set_som || common->mark_ptr != 0) in compile_recurse_backtrackingpath()
8788 free_stack(common, 1); in compile_recurse_backtrackingpath()
8789 …OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->has_set_som ? (int)(OVECTOR(0)) : common->mark_ptr, T… in compile_recurse_backtrackingpath()
8793 static void compile_assert_backtrackingpath(compiler_common *common, struct backtrack_common *curre… in compile_assert_backtrackingpath() argument
8821 free_stack(common, 1); in compile_assert_backtrackingpath()
8832 free_stack(common, 1); in compile_assert_backtrackingpath()
8835 free_stack(common, 1); in compile_assert_backtrackingpath()
8842 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_assert_backtrackingpath()
8860 static void compile_bracket_backtrackingpath(compiler_common *common, struct backtrack_common *curr… in compile_bracket_backtrackingpath() argument
8929 free_stack(common, 1); in compile_bracket_backtrackingpath()
8941 free_stack(common, 1); in compile_bracket_backtrackingpath()
8956 free_stack(common, 1); in compile_bracket_backtrackingpath()
8970 free_stack(common, 1); in compile_bracket_backtrackingpath()
8982 free_stack(common, 1); in compile_bracket_backtrackingpath()
8993 if (common->capture_last_ptr != 0) in compile_bracket_backtrackingpath()
8995 SLJIT_ASSERT(common->optimized_cbracket[offset >> 1] == 0); in compile_bracket_backtrackingpath()
8998 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr, TMP1, 0); in compile_bracket_backtrackingpath()
9000 free_stack(common, 3); in compile_bracket_backtrackingpath()
9004 else if (common->optimized_cbracket[offset >> 1] == 0) in compile_bracket_backtrackingpath()
9008 free_stack(common, 2); in compile_bracket_backtrackingpath()
9019 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_bracket_backtrackingpath()
9029 free_stack(common, 1); in compile_bracket_backtrackingpath()
9038 free_stack(common, 1); in compile_bracket_backtrackingpath()
9043 next_update_addr = allocate_read_only_data(common, alt_max * sizeof(sljit_uw)); in compile_bracket_backtrackingpath()
9047 add_label_addr(common, next_update_addr++); in compile_bracket_backtrackingpath()
9071 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_bracket_backtrackingpath()
9112 compile_matchingpath(common, ccprev, cc, current); in compile_bracket_backtrackingpath()
9120 …match_once_common(common, ket, CURRENT_AS(bracket_backtrack)->u.framesize, private_data_ptr, has_a… in compile_bracket_backtrackingpath()
9133 if (common->capture_last_ptr != 0) in compile_bracket_backtrackingpath()
9135 if (common->optimized_cbracket[offset >> 1] == 0) in compile_bracket_backtrackingpath()
9142 allocate_stack(common, stacksize); in compile_bracket_backtrackingpath()
9162 stacksize = match_capture_common(common, stacksize, offset, private_data_ptr); in compile_bracket_backtrackingpath()
9167 if (offset != 0 && ket == OP_KETRMAX && common->optimized_cbracket[offset >> 1] != 0) in compile_bracket_backtrackingpath()
9179 add_label_addr(common, next_update_addr++); in compile_bracket_backtrackingpath()
9212 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_bracket_backtrackingpath()
9220 free_stack(common, 1); in compile_bracket_backtrackingpath()
9226 if (common->optimized_cbracket[offset >> 1] != 0) in compile_bracket_backtrackingpath()
9230 free_stack(common, 2); in compile_bracket_backtrackingpath()
9237 free_stack(common, 1); in compile_bracket_backtrackingpath()
9244 free_stack(common, 1); in compile_bracket_backtrackingpath()
9261 free_stack(common, stacksize); in compile_bracket_backtrackingpath()
9271 free_stack(common, 2); in compile_bracket_backtrackingpath()
9286 free_stack(common, 1); in compile_bracket_backtrackingpath()
9294 free_stack(common, 1); in compile_bracket_backtrackingpath()
9305 free_stack(common, 1); in compile_bracket_backtrackingpath()
9308 free_stack(common, bra == OP_BRAMINZERO ? 2 : 1); in compile_bracket_backtrackingpath()
9310 free_stack(common, 1); in compile_bracket_backtrackingpath()
9320 static SLJIT_INLINE void compile_bracketpos_backtrackingpath(compiler_common *common, struct backtr… in compile_bracketpos_backtrackingpath() argument
9334 if (common->capture_last_ptr != 0) in compile_bracketpos_backtrackingpath()
9337 if (common->capture_last_ptr != 0) in compile_bracketpos_backtrackingpath()
9338 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr, TMP1, 0); in compile_bracketpos_backtrackingpath()
9341 free_stack(common, CURRENT_AS(bracketpos_backtrack)->stacksize); in compile_bracketpos_backtrackingpath()
9346 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_bracketpos_backtrackingpath()
9353 free_stack(common, CURRENT_AS(bracketpos_backtrack)->stacksize); in compile_bracketpos_backtrackingpath()
9359 static SLJIT_INLINE void compile_braminzero_backtrackingpath(compiler_common *common, struct backtr… in compile_braminzero_backtrackingpath() argument
9369 compile_bracket_matchingpath(common, current->cc, current); in compile_braminzero_backtrackingpath()
9370 compile_bracket_backtrackingpath(common, current->top); in compile_braminzero_backtrackingpath()
9375 backtrack.common.cc = current->cc; in compile_braminzero_backtrackingpath()
9378 compile_assert_matchingpath(common, current->cc, &backtrack, FALSE); in compile_braminzero_backtrackingpath()
9383 static SLJIT_INLINE void compile_control_verb_backtrackingpath(compiler_common *common, struct back… in compile_control_verb_backtrackingpath() argument
9392 if (common->then_trap != NULL) in compile_control_verb_backtrackingpath()
9394 SLJIT_ASSERT(common->control_head_ptr != 0); in compile_control_verb_backtrackingpath()
9396 OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_control_verb_backtrackingpath()
9398 OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, common->then_trap->start); in compile_control_verb_backtrackingpath()
9406 add_jump(compiler, &common->then_trap->quit, JUMP(SLJIT_JUMP)); in compile_control_verb_backtrackingpath()
9409 else if (common->positive_assert) in compile_control_verb_backtrackingpath()
9411 add_jump(compiler, &common->positive_assert_quit, JUMP(SLJIT_JUMP)); in compile_control_verb_backtrackingpath()
9416 if (common->local_exit) in compile_control_verb_backtrackingpath()
9418 if (common->quit_label == NULL) in compile_control_verb_backtrackingpath()
9419 add_jump(compiler, &common->quit, JUMP(SLJIT_JUMP)); in compile_control_verb_backtrackingpath()
9421 JUMPTO(SLJIT_JUMP, common->quit_label); in compile_control_verb_backtrackingpath()
9427 SLJIT_ASSERT(common->control_head_ptr != 0); in compile_control_verb_backtrackingpath()
9428 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr); in compile_control_verb_backtrackingpath()
9435 add_jump(compiler, &common->reset_match, CMP(SLJIT_NOT_EQUAL, STR_PTR, 0, SLJIT_IMM, -1)); in compile_control_verb_backtrackingpath()
9443 add_jump(compiler, &common->reset_match, JUMP(SLJIT_JUMP)); in compile_control_verb_backtrackingpath()
9446 static SLJIT_INLINE void compile_then_trap_backtrackingpath(compiler_common *common, struct backtra… in compile_then_trap_backtrackingpath() argument
9454 common->then_trap = CURRENT_AS(then_trap_backtrack)->then_trap; in compile_then_trap_backtrackingpath()
9462 free_stack(common, size); in compile_then_trap_backtrackingpath()
9468 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_then_trap_backtrackingpath()
9470 free_stack(common, 3); in compile_then_trap_backtrackingpath()
9473 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, TMP1, 0); in compile_then_trap_backtrackingpath()
9476 static void compile_backtrackingpath(compiler_common *common, struct backtrack_common *current) in compile_backtrackingpath() argument
9479 then_trap_backtrack *save_then_trap = common->then_trap; in compile_backtrackingpath()
9489 free_stack(common, 1); in compile_backtrackingpath()
9563 compile_iterator_backtrackingpath(common, current); in compile_backtrackingpath()
9570 compile_ref_iterator_backtrackingpath(common, current); in compile_backtrackingpath()
9574 compile_recurse_backtrackingpath(common, current); in compile_backtrackingpath()
9581 compile_assert_backtrackingpath(common, current); in compile_backtrackingpath()
9592 compile_bracket_backtrackingpath(common, current); in compile_backtrackingpath()
9597 compile_bracket_backtrackingpath(common, current); in compile_backtrackingpath()
9599 compile_assert_backtrackingpath(common, current); in compile_backtrackingpath()
9607 compile_bracketpos_backtrackingpath(common, current); in compile_backtrackingpath()
9611 compile_braminzero_backtrackingpath(common, current); in compile_backtrackingpath()
9615 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), STACK(common->has_skip_arg ? 4 : 0)); in compile_backtrackingpath()
9616 if (common->has_skip_arg) in compile_backtrackingpath()
9618 free_stack(common, common->has_skip_arg ? 5 : 1); in compile_backtrackingpath()
9619 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->mark_ptr, TMP1, 0); in compile_backtrackingpath()
9620 if (common->has_skip_arg) in compile_backtrackingpath()
9621 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, TMP2, 0); in compile_backtrackingpath()
9630 compile_control_verb_backtrackingpath(common, current); in compile_backtrackingpath()
9634 if (!common->local_exit) in compile_backtrackingpath()
9636 if (common->quit_label == NULL) in compile_backtrackingpath()
9637 add_jump(compiler, &common->quit, JUMP(SLJIT_JUMP)); in compile_backtrackingpath()
9639 JUMPTO(SLJIT_JUMP, common->quit_label); in compile_backtrackingpath()
9651 compile_then_trap_backtrackingpath(common, current); in compile_backtrackingpath()
9660 common->then_trap = save_then_trap; in compile_backtrackingpath()
9663 static SLJIT_INLINE void compile_recurse(compiler_common *common) in compile_recurse() argument
9666 pcre_uchar *cc = common->start + common->currententry->start; in compile_recurse()
9670 int framesize = get_framesize(common, cc, NULL, TRUE, &needs_control_head); in compile_recurse()
9671 int private_data_size = get_private_data_copy_length(common, ccbegin, ccend, needs_control_head); in compile_recurse()
9678 common->then_trap = NULL; in compile_recurse()
9686 SLJIT_ASSERT(common->currententry->entry == NULL && common->recursive_head_ptr != 0); in compile_recurse()
9687 common->currententry->entry = LABEL(); in compile_recurse()
9688 set_jumps(common->currententry->calls, common->currententry->entry); in compile_recurse()
9691 allocate_stack(common, private_data_size + framesize + alternativesize); in compile_recurse()
9692 count_match(common); in compile_recurse()
9694 copy_private_data(common, ccbegin, ccend, TRUE, private_data_size + framesize + alternativesize, fr… in compile_recurse()
9696 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_IMM, 0); in compile_recurse()
9697 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->recursive_head_ptr, STACK_TOP, 0); in compile_recurse()
9699 init_frame(common, cc, NULL, framesize + alternativesize - 1, alternativesize, TRUE); in compile_recurse()
9705 common->quit_label = NULL; in compile_recurse()
9706 common->accept_label = NULL; in compile_recurse()
9707 common->quit = NULL; in compile_recurse()
9708 common->accept = NULL; in compile_recurse()
9719 compile_matchingpath(common, altbacktrack.cc, cc, &altbacktrack); in compile_recurse()
9723 add_jump(compiler, &common->accept, JUMP(SLJIT_JUMP)); in compile_recurse()
9725 compile_backtrackingpath(common, altbacktrack.top); in compile_recurse()
9741 if (common->quit != NULL) in compile_recurse()
9743 set_jumps(common->quit, LABEL()); in compile_recurse()
9744 OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), common->recursive_head_ptr); in compile_recurse()
9748 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_recurse()
9752 common->quit = NULL; in compile_recurse()
9753 add_jump(compiler, &common->quit, JUMP(SLJIT_JUMP)); in compile_recurse()
9756 set_jumps(common->accept, LABEL()); in compile_recurse()
9757 OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_SP), common->recursive_head_ptr); in compile_recurse()
9761 add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL)); in compile_recurse()
9767 if (common->quit != NULL) in compile_recurse()
9768 set_jumps(common->quit, LABEL()); in compile_recurse()
9769 copy_private_data(common, ccbegin, ccend, FALSE, private_data_size + framesize + alternativesize, f… in compile_recurse()
9770 free_stack(common, private_data_size + framesize + alternativesize); in compile_recurse()
9775 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->recursive_head_ptr, TMP1, 0); in compile_recurse()
9777 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, TMP2, 0); in compile_recurse()
9783 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->recursive_head_ptr, TMP2, 0); in compile_recurse()
9797 compiler_common *common = &common_data; in PRIV() local
9825 memset(common, 0, sizeof(compiler_common)); in PRIV()
9828 common->start = rootbacktrack.cc; in PRIV()
9829 common->read_only_data_head = NULL; in PRIV()
9830 common->fcc = tables + fcc_offset; in PRIV()
9831 common->lcc = (sljit_sw)(tables + lcc_offset); in PRIV()
9832 common->mode = mode; in PRIV()
9833 common->might_be_empty = study->minlength == 0; in PRIV()
9834 common->nltype = NLTYPE_FIXED; in PRIV()
9841 case -1: common->newline = (CHAR_CR << 8) | CHAR_NL; common->nltype = NLTYPE_ANY; break; in PRIV()
9842 case -2: common->newline = (CHAR_CR << 8) | CHAR_NL; common->nltype = NLTYPE_ANYCRLF; break; in PRIV()
9843 default: common->newline = NEWLINE; break; in PRIV()
9846 case PCRE_NEWLINE_CR: common->newline = CHAR_CR; break; in PRIV()
9847 case PCRE_NEWLINE_LF: common->newline = CHAR_NL; break; in PRIV()
9849 PCRE_NEWLINE_LF: common->newline = (CHAR_CR << 8) | CHAR_NL; break; in PRIV()
9850 …case PCRE_NEWLINE_ANY: common->newline = (CHAR_CR << 8) | CHAR_NL; common->nltype = NLTYPE_ANY; br… in PRIV()
9851 …case PCRE_NEWLINE_ANYCRLF: common->newline = (CHAR_CR << 8) | CHAR_NL; common->nltype = NLTYPE_ANY… in PRIV()
9854 common->nlmax = READ_CHAR_MAX; in PRIV()
9855 common->nlmin = 0; in PRIV()
9857 common->bsr_nltype = NLTYPE_ANYCRLF; in PRIV()
9859 common->bsr_nltype = NLTYPE_ANY; in PRIV()
9863 common->bsr_nltype = NLTYPE_ANYCRLF; in PRIV()
9865 common->bsr_nltype = NLTYPE_ANY; in PRIV()
9868 common->bsr_nlmax = READ_CHAR_MAX; in PRIV()
9869 common->bsr_nlmin = 0; in PRIV()
9870 common->endonly = (re->options & PCRE_DOLLAR_ENDONLY) != 0; in PRIV()
9871 common->ctypes = (sljit_sw)(tables + ctypes_offset); in PRIV()
9872 common->name_table = ((pcre_uchar *)re) + re->name_table_offset; in PRIV()
9873 common->name_count = re->name_count; in PRIV()
9874 common->name_entry_size = re->name_entry_size; in PRIV()
9875 common->jscript_compat = (re->options & PCRE_JAVASCRIPT_COMPAT) != 0; in PRIV()
9878 common->utf = (re->options & PCRE_UTF8) != 0; in PRIV()
9880 common->use_ucp = (re->options & PCRE_UCP) != 0; in PRIV()
9882 if (common->utf) in PRIV()
9884 if (common->nltype == NLTYPE_ANY) in PRIV()
9885 common->nlmax = 0x2029; in PRIV()
9886 else if (common->nltype == NLTYPE_ANYCRLF) in PRIV()
9887 common->nlmax = (CHAR_CR > CHAR_NL) ? CHAR_CR : CHAR_NL; in PRIV()
9891 common->nlmax = common->newline & 0xff; in PRIV()
9894 if (common->nltype == NLTYPE_FIXED) in PRIV()
9895 common->nlmin = common->newline & 0xff; in PRIV()
9897 common->nlmin = (CHAR_CR < CHAR_NL) ? CHAR_CR : CHAR_NL; in PRIV()
9899 if (common->bsr_nltype == NLTYPE_ANY) in PRIV()
9900 common->bsr_nlmax = 0x2029; in PRIV()
9902 common->bsr_nlmax = (CHAR_CR > CHAR_NL) ? CHAR_CR : CHAR_NL; in PRIV()
9903 common->bsr_nlmin = (CHAR_CR < CHAR_NL) ? CHAR_CR : CHAR_NL; in PRIV()
9906 ccend = bracketend(common->start); in PRIV()
9909 common->ovector_start = LIMIT_MATCH + sizeof(sljit_sw); in PRIV()
9910 common->optimized_cbracket = (pcre_uint8 *)SLJIT_MALLOC(re->top_bracket + 1, compiler->allocator_da… in PRIV()
9911 if (!common->optimized_cbracket) in PRIV()
9914 memset(common->optimized_cbracket, 0, re->top_bracket + 1); in PRIV()
9916 memset(common->optimized_cbracket, 1, re->top_bracket + 1); in PRIV()
9919 SLJIT_ASSERT(*common->start == OP_BRA && ccend[-(1 + LINK_SIZE)] == OP_KET); in PRIV()
9921 common->capture_last_ptr = common->ovector_start; in PRIV()
9922 common->ovector_start += sizeof(sljit_sw); in PRIV()
9924 if (!check_opcode_types(common, common->start, ccend)) in PRIV()
9926 SLJIT_FREE(common->optimized_cbracket, compiler->allocator_data); in PRIV()
9933 common->req_char_ptr = common->ovector_start; in PRIV()
9934 common->ovector_start += sizeof(sljit_sw); in PRIV()
9938 common->start_used_ptr = common->ovector_start; in PRIV()
9939 common->ovector_start += sizeof(sljit_sw); in PRIV()
9942 common->hit_start = common->ovector_start; in PRIV()
9943 common->ovector_start += 2 * sizeof(sljit_sw); in PRIV()
9948 common->needs_start_ptr = TRUE; in PRIV()
9953 common->first_line_end = common->ovector_start; in PRIV()
9954 common->ovector_start += sizeof(sljit_sw); in PRIV()
9957 common->control_head_ptr = 1; in PRIV()
9959 if (common->control_head_ptr != 0) in PRIV()
9961 common->control_head_ptr = common->ovector_start; in PRIV()
9962 common->ovector_start += sizeof(sljit_sw); in PRIV()
9964 if (common->needs_start_ptr && common->has_set_som) in PRIV()
9967 common->start_ptr = common->ovector_start; in PRIV()
9968 common->ovector_start += sizeof(sljit_sw); in PRIV()
9971 common->needs_start_ptr = FALSE; in PRIV()
9974 if ((common->ovector_start & sizeof(sljit_sw)) != 0) in PRIV()
9975 common->ovector_start += sizeof(sljit_sw); in PRIV()
9977 if (common->start_ptr == 0) in PRIV()
9978 common->start_ptr = OVECTOR(0); in PRIV()
9981 if (common->capture_last_ptr != 0) in PRIV()
9982 memset(common->optimized_cbracket, 0, re->top_bracket + 1); in PRIV()
9984 SLJIT_ASSERT(!(common->req_char_ptr != 0 && common->start_used_ptr != 0)); in PRIV()
9985 common->cbra_ptr = OVECTOR_START + (re->top_bracket + 1) * 2 * sizeof(sljit_sw); in PRIV()
9987 total_length = ccend - common->start; in PRIV()
9988 common->private_data_ptrs = (sljit_si *)SLJIT_MALLOC(total_length * (sizeof(sljit_si) + (common->ha… in PRIV()
9989 if (!common->private_data_ptrs) in PRIV()
9991 SLJIT_FREE(common->optimized_cbracket, compiler->allocator_data); in PRIV()
9994 memset(common->private_data_ptrs, 0, total_length * sizeof(sljit_si)); in PRIV()
9996 private_data_size = common->cbra_ptr + (re->top_bracket + 1) * sizeof(sljit_sw); in PRIV()
9997 set_private_data_ptrs(common, &private_data_size, ccend); in PRIV()
10000 SLJIT_FREE(common->private_data_ptrs, compiler->allocator_data); in PRIV()
10001 SLJIT_FREE(common->optimized_cbracket, compiler->allocator_data); in PRIV()
10005 if (common->has_then) in PRIV()
10007 common->then_offsets = (pcre_uint8 *)(common->private_data_ptrs + total_length); in PRIV()
10008 memset(common->then_offsets, 0, total_length); in PRIV()
10009 set_then_offsets(common, common->start, NULL); in PRIV()
10015 SLJIT_FREE(common->optimized_cbracket, compiler->allocator_data); in PRIV()
10016 SLJIT_FREE(common->private_data_ptrs, compiler->allocator_data); in PRIV()
10019 common->compiler = compiler; in PRIV()
10025 reset_ovector(common, (re->top_bracket + 1) * 2); in PRIV()
10026 if (common->req_char_ptr != 0) in PRIV()
10027 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->req_char_ptr, SLJIT_R0, 0); in PRIV()
10041 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, -1); in PRIV()
10042 if (common->mark_ptr != 0) in PRIV()
10043 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->mark_ptr, SLJIT_IMM, 0); in PRIV()
10044 if (common->control_head_ptr != 0) in PRIV()
10045 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->control_head_ptr, SLJIT_IMM, 0); in PRIV()
10050 …mainloop_label = mainloop_entry(common, (re->flags & PCRE_HASCRORLF) != 0, (re->options & PCRE_FIR… in PRIV()
10055 …if (mode == JIT_COMPILE && fast_forward_first_n_chars(common, (re->options & PCRE_FIRSTLINE) != 0)) in PRIV()
10058 …fast_forward_first_char(common, (pcre_uchar)re->first_char, (re->flags & PCRE_FCH_CASELESS) != 0, … in PRIV()
10060 fast_forward_newline(common, (re->options & PCRE_FIRSTLINE) != 0); in PRIV()
10062 fast_forward_start_bits(common, study->start_bits, (re->options & PCRE_FIRSTLINE) != 0); in PRIV()
10074 if (common->req_char_ptr != 0) in PRIV()
10075 …reqbyte_notfound = search_requested_char(common, (pcre_uchar)re->req_char, (re->flags & PCRE_RCH_C… in PRIV()
10081 if (common->capture_last_ptr != 0) in PRIV()
10082 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->capture_last_ptr, SLJIT_IMM, -1); in PRIV()
10084 if (common->needs_start_ptr) in PRIV()
10086 SLJIT_ASSERT(common->start_ptr != OVECTOR(0)); in PRIV()
10087 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->start_ptr, STR_PTR, 0); in PRIV()
10090 SLJIT_ASSERT(common->start_ptr == OVECTOR(0)); in PRIV()
10095 jump = CMP(SLJIT_NOT_EQUAL, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, -1); in PRIV()
10096 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0); in PRIV()
10097 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->hit_start + sizeof(sljit_sw), STR_PTR, 0); in PRIV()
10101 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, STR_PTR, 0); in PRIV()
10103 compile_matchingpath(common, common->start, ccend, &rootbacktrack); in PRIV()
10107 SLJIT_FREE(common->optimized_cbracket, compiler->allocator_data); in PRIV()
10108 SLJIT_FREE(common->private_data_ptrs, compiler->allocator_data); in PRIV()
10109 free_read_only_data(common->read_only_data_head, compiler->allocator_data); in PRIV()
10113 if (common->might_be_empty) in PRIV()
10119 common->accept_label = LABEL(); in PRIV()
10120 if (common->accept != NULL) in PRIV()
10121 set_jumps(common->accept, common->accept_label); in PRIV()
10124 copy_ovector(common, re->top_bracket + 1); in PRIV()
10125 common->quit_label = common->forced_quit_label = LABEL(); in PRIV()
10126 if (common->quit != NULL) in PRIV()
10127 set_jumps(common->quit, common->quit_label); in PRIV()
10128 if (common->forced_quit != NULL) in PRIV()
10129 set_jumps(common->forced_quit, common->forced_quit_label); in PRIV()
10131 SET_LABEL(minlength_check_failed, common->forced_quit_label); in PRIV()
10136 common->partialmatchlabel = LABEL(); in PRIV()
10137 set_jumps(common->partialmatch, common->partialmatchlabel); in PRIV()
10138 return_with_partial_match(common, common->quit_label); in PRIV()
10141 if (common->might_be_empty) in PRIV()
10143 compile_backtrackingpath(common, rootbacktrack.top); in PRIV()
10147 SLJIT_FREE(common->optimized_cbracket, compiler->allocator_data); in PRIV()
10148 SLJIT_FREE(common->private_data_ptrs, compiler->allocator_data); in PRIV()
10149 free_read_only_data(common->read_only_data_head, compiler->allocator_data); in PRIV()
10159 jump = CMP(SLJIT_NOT_EQUAL, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, 0); in PRIV()
10160 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr); in PRIV()
10161 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->start_used_ptr, SLJIT_IMM, -1); in PRIV()
10162 OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_SP), common->hit_start, TMP1, 0); in PRIV()
10169 SLJIT_ASSERT(common->first_line_end != 0); in PRIV()
10170 OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_SP), common->first_line_end); in PRIV()
10173 OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_SP), common->start_ptr); in PRIV()
10177 if (common->ff_newline_shortcut != NULL) in PRIV()
10180 CMPTO(SLJIT_LESS, STR_PTR, 0, STR_END, 0, common->ff_newline_shortcut); in PRIV()
10197 …CMPTO(SLJIT_NOT_EQUAL, SLJIT_MEM1(SLJIT_SP), common->hit_start, SLJIT_IMM, -1, common->partialmatc… in PRIV()
10200 JUMPTO(SLJIT_JUMP, common->quit_label); in PRIV()
10202 flush_stubs(common); in PRIV()
10204 if (common->might_be_empty) in PRIV()
10217 common->currententry = common->entries; in PRIV()
10218 common->local_exit = TRUE; in PRIV()
10219 quit_label = common->quit_label; in PRIV()
10220 while (common->currententry != NULL) in PRIV()
10223 compile_recurse(common); in PRIV()
10227 SLJIT_FREE(common->optimized_cbracket, compiler->allocator_data); in PRIV()
10228 SLJIT_FREE(common->private_data_ptrs, compiler->allocator_data); in PRIV()
10229 free_read_only_data(common->read_only_data_head, compiler->allocator_data); in PRIV()
10232 flush_stubs(common); in PRIV()
10233 common->currententry = common->currententry->next; in PRIV()
10235 common->local_exit = FALSE; in PRIV()
10236 common->quit_label = quit_label; in PRIV()
10240 set_jumps(common->stackalloc, LABEL()); in PRIV()
10262 JUMPTO(SLJIT_JUMP, common->quit_label); in PRIV()
10265 set_jumps(common->calllimit, LABEL()); in PRIV()
10267 JUMPTO(SLJIT_JUMP, common->quit_label); in PRIV()
10269 if (common->revertframes != NULL) in PRIV()
10271 set_jumps(common->revertframes, LABEL()); in PRIV()
10272 do_revertframes(common); in PRIV()
10274 if (common->wordboundary != NULL) in PRIV()
10276 set_jumps(common->wordboundary, LABEL()); in PRIV()
10277 check_wordboundary(common); in PRIV()
10279 if (common->anynewline != NULL) in PRIV()
10281 set_jumps(common->anynewline, LABEL()); in PRIV()
10282 check_anynewline(common); in PRIV()
10284 if (common->hspace != NULL) in PRIV()
10286 set_jumps(common->hspace, LABEL()); in PRIV()
10287 check_hspace(common); in PRIV()
10289 if (common->vspace != NULL) in PRIV()
10291 set_jumps(common->vspace, LABEL()); in PRIV()
10292 check_vspace(common); in PRIV()
10294 if (common->casefulcmp != NULL) in PRIV()
10296 set_jumps(common->casefulcmp, LABEL()); in PRIV()
10297 do_casefulcmp(common); in PRIV()
10299 if (common->caselesscmp != NULL) in PRIV()
10301 set_jumps(common->caselesscmp, LABEL()); in PRIV()
10302 do_caselesscmp(common); in PRIV()
10304 if (common->reset_match != NULL) in PRIV()
10306 set_jumps(common->reset_match, LABEL()); in PRIV()
10307 do_reset_match(common, (re->top_bracket + 1) * 2); in PRIV()
10314 if (common->utfreadchar != NULL) in PRIV()
10316 set_jumps(common->utfreadchar, LABEL()); in PRIV()
10317 do_utfreadchar(common); in PRIV()
10319 if (common->utfreadchar16 != NULL) in PRIV()
10321 set_jumps(common->utfreadchar16, LABEL()); in PRIV()
10322 do_utfreadchar16(common); in PRIV()
10324 if (common->utfreadtype8 != NULL) in PRIV()
10326 set_jumps(common->utfreadtype8, LABEL()); in PRIV()
10327 do_utfreadtype8(common); in PRIV()
10332 if (common->getucd != NULL) in PRIV()
10334 set_jumps(common->getucd, LABEL()); in PRIV()
10335 do_getucd(common); in PRIV()
10339 SLJIT_FREE(common->optimized_cbracket, compiler->allocator_data); in PRIV()
10340 SLJIT_FREE(common->private_data_ptrs, compiler->allocator_data); in PRIV()
10344 label_addr = common->label_addrs; in PRIV()
10353 free_read_only_data(common->read_only_data_head, compiler->allocator_data); in PRIV()
10377 free_read_only_data(common->read_only_data_head, compiler->allocator_data); in PRIV()
10388 functions->read_only_data_heads[mode] = common->read_only_data_head; in PRIV()