Lines Matching +defs:ind +defs:offset
1321 sljit_sw offset, value;
1333 offset = TERM_OFFSET_OF(search_states[value].type, 0);
1334 EMIT_OP1(SLJIT_MOV, SLJIT_MEM1(reg), TERM_REL_OFFSET_OF(offset, 1), SLJIT_IMM, head);
1335 if (offset > 0)
1336 head = offset;
1339 EMIT_OP1(SLJIT_MOV, SLJIT_MEM1(reg), TERM_REL_OFFSET_OF(offset, 2), R_TEMP, 0);
1341 EMIT_OP1(SLJIT_MOV, SLJIT_MEM1(reg), TERM_REL_OFFSET_OF(offset, 3), SLJIT_IMM, search_states[value].value);
1345 EMIT_OP1(SLJIT_MOV, SLJIT_MEM1(reg), TERM_REL_OFFSET_OF(offset, 2), SLJIT_IMM, search_states[value].value);
1355 offset = TERM_OFFSET_OF(search_states[1].type, 0);
1359 EMIT_OP1(SLJIT_MOV, SLJIT_MEM1(reg), TERM_REL_OFFSET_OF(offset, 1), SLJIT_IMM, head);
1360 head = offset;
1362 EMIT_OP1(SLJIT_MOV, SLJIT_MEM1(reg), TERM_REL_OFFSET_OF(offset, 2), SLJIT_IMM, 1);
1364 EMIT_OP1(SLJIT_MOV, SLJIT_MEM1(reg), TERM_REL_OFFSET_OF(offset, 3), SLJIT_IMM, 0);
1376 sljit_sw offset;
1402 offset = TERM_OFFSET_OF(search_states[value].type, 0);
1407 EMIT_CMP(jump1, SLJIT_NOT_EQUAL, SLJIT_MEM1(R_NEXT_STATE), offset + sizeof(sljit_sw), SLJIT_IMM, -1);
1408 EMIT_OP1(SLJIT_MOV, SLJIT_MEM1(R_NEXT_STATE), offset + sizeof(sljit_sw), R_NEXT_HEAD, 0);
1409 if (offset > 0) {
1410 EMIT_OP1(SLJIT_MOV, R_NEXT_HEAD, 0, SLJIT_IMM, offset);
1418 EMIT_CMP(jump1, SLJIT_LESS_EQUAL, SLJIT_MEM1(R_NEXT_STATE), offset + 2 * sizeof(sljit_sw), R_TEMP, 0);
1422 EMIT_OP1(SLJIT_MOV, SLJIT_MEM1(R_NEXT_STATE), offset + 2 * sizeof(sljit_sw), R_TEMP, 0);
1429 EMIT_CMP(jump1, SLJIT_NOT_EQUAL, SLJIT_MEM1(R_NEXT_STATE), offset + sizeof(sljit_sw), SLJIT_IMM, -1);
1430 EMIT_OP1(SLJIT_MOV, SLJIT_MEM1(R_NEXT_STATE), offset + sizeof(sljit_sw), R_NEXT_HEAD, 0);
1431 if (offset > 0) {
1432 EMIT_OP1(SLJIT_MOV, R_NEXT_HEAD, 0, SLJIT_IMM, offset);
1443 EMIT_CMP(jump1, SLJIT_NOT_EQUAL, SLJIT_MEM1(R_NEXT_STATE), offset + sizeof(sljit_sw), SLJIT_IMM, -1);
1444 EMIT_OP1(SLJIT_MOV, SLJIT_MEM1(R_NEXT_STATE), offset + sizeof(sljit_sw), R_NEXT_HEAD, 0);
1445 if (offset > 0) {
1446 EMIT_OP1(SLJIT_MOV, R_NEXT_HEAD, 0, SLJIT_IMM, offset);
1454 EMIT_OP2(SLJIT_SUB | SLJIT_SET_Z | SLJIT_SET_LESS, SLJIT_UNUSED, 0, SLJIT_MEM1(R_NEXT_STATE), offset + 2 * sizeof(sljit_sw), R_TEMP, 0);
1468 EMIT_OP2(SLJIT_SUB | SLJIT_SET_GREATER_EQUAL, SLJIT_UNUSED, 0, SLJIT_MEM1(R_NEXT_STATE), offset + 3 * sizeof(sljit_sw), R_TEMP, 0);
1476 EMIT_OP1(SLJIT_MOV, SLJIT_MEM1(R_NEXT_STATE), offset + 2 * sizeof(sljit_sw), R_TEMP, 0);
1489 EMIT_OP1(SLJIT_MOV, SLJIT_MEM1(R_NEXT_STATE), offset + 3 * sizeof(sljit_sw), R_TEMP, 0);
1508 EMIT_CMP(jump1, SLJIT_NOT_EQUAL, SLJIT_MEM1(R_NEXT_STATE), offset + sizeof(sljit_sw), SLJIT_IMM, -1);
1509 EMIT_OP1(SLJIT_MOV, SLJIT_MEM1(R_NEXT_STATE), offset + sizeof(sljit_sw), R_NEXT_HEAD, 0);
1510 if (offset > 0) {
1511 EMIT_OP1(SLJIT_MOV, R_NEXT_HEAD, 0, SLJIT_IMM, offset);
1519 EMIT_CMP(jump1, SLJIT_GREATER_EQUAL, SLJIT_MEM1(R_NEXT_STATE), offset + 2 * sizeof(sljit_sw), R_TEMP, 0);
1523 EMIT_OP1(SLJIT_MOV, SLJIT_MEM1(R_NEXT_STATE), offset + 2 * sizeof(sljit_sw), R_TEMP, 0);
1638 int ind;
1643 ind = stack_pop(stack)->value;
1644 search_states[ind].value = -1;
1645 if (search_states[ind].type >= 0) {
1646 if (dfa_transitions[ind].type == type_char) {
1647 EMIT_CMP(jump, SLJIT_EQUAL, R_CURR_CHAR, 0, SLJIT_IMM, dfa_transitions[ind].value);
1650 else if (dfa_transitions[ind].type == type_rng_start) {
1651 SLJIT_ASSERT(!dfa_transitions[ind].value);
1652 ind++;
1653 while (dfa_transitions[ind].type != type_rng_end) {
1654 if (dfa_transitions[ind].type == type_rng_char) {
1655 EMIT_CMP(jump, SLJIT_EQUAL, R_CURR_CHAR, 0, SLJIT_IMM, dfa_transitions[ind].value);
1659 SLJIT_ASSERT(dfa_transitions[ind].type == type_rng_left);
1664 if (dfa_transitions[ind].value != prev_value) {
1666 prev_value -= dfa_transitions[ind].value;
1673 prev_value = dfa_transitions[ind].value;
1675 EMIT_CMP(jump, SLJIT_LESS_EQUAL, R_TEMP, 0, SLJIT_IMM, dfa_transitions[ind + 1].value - dfa_transitions[ind].value);
1677 ind++;
1679 ind++;
1683 SLJIT_ASSERT(dfa_transitions[ind].type == type_newline);
1694 static int compile_newline_check(struct compiler_common *compiler_common, sljit_sw ind)
1701 sljit_sw offset;
1708 offset = TERM_OFFSET_OF(compiler_common->search_states[ind].type, 1);
1709 EMIT_OP1(SLJIT_MOV, R_TEMP, 0, SLJIT_MEM1(R_CURR_STATE), offset);
1710 EMIT_OP1(SLJIT_MOV, SLJIT_MEM1(R_CURR_STATE), offset, SLJIT_IMM, -1);
1733 static sljit_sw compile_range_check(struct compiler_common *compiler_common, sljit_sw ind)
1738 int invert = dfa_transitions[ind].value;
1741 sljit_sw offset;
1744 ind++;
1746 while (dfa_transitions[ind].type != type_rng_end) {
1747 if (dfa_transitions[ind].type == type_rng_char) {
1748 EMIT_CMP(*range_jump_list, SLJIT_EQUAL, R_CURR_CHAR, 0, SLJIT_IMM, dfa_transitions[ind].value);
1752 SLJIT_ASSERT(dfa_transitions[ind].type == type_rng_left);
1757 if (dfa_transitions[ind].value != prev_value) {
1759 prev_value -= dfa_transitions[ind].value;
1766 prev_value = dfa_transitions[ind].value;
1768 EMIT_CMP(*range_jump_list, SLJIT_LESS_EQUAL, R_TEMP, 0, SLJIT_IMM, dfa_transitions[ind + 1].value - dfa_transitions[ind].value);
1770 ind++;
1772 ind++;
1779 offset = TERM_OFFSET_OF(compiler_common->search_states[ind].type, 1);
1780 EMIT_OP1(SLJIT_MOV, R_TEMP, 0, SLJIT_MEM1(R_CURR_STATE), offset);
1781 EMIT_OP1(SLJIT_MOV, SLJIT_MEM1(R_CURR_STATE), offset, SLJIT_IMM, -1);
1789 return ind;
1804 #define TERM_OFFSET_OF(ind, offs) (((ind) * compiler_common.no_states + (offs)) * sizeof(sljit_sw))
1838 sljit_sw ind;
1938 ind = stack_pop(&compiler_common.stack)->value;
1939 if (compiler_common.search_states[ind].type == 0) {
1940 SLJIT_ASSERT(compiler_common.dfa_transitions[ind].type == type_end);
1942 empty_match_id = compiler_common.search_states[ind].value;
1944 else if (compiler_common.search_states[ind].type > 0) {
1945 SLJIT_ASSERT(compiler_common.dfa_transitions[ind].type != type_end);
1946 if (compiler_common.dfa_transitions[ind].type == type_rng_start && compiler_common.dfa_transitions[ind].value)
1949 compiler_common.search_states[ind].value = -1;
1956 ind = stack_pop(&compiler_common.stack)->value;
1957 if (compiler_common.search_states[ind].type == 0) {
1958 SLJIT_ASSERT(compiler_common.dfa_transitions[ind].type == type_end);
1960 empty_match_id = compiler_common.search_states[ind].value;
1962 compiler_common.search_states[ind].value = -1;
2045 ind = stack_pop(&compiler_common.stack)->value;
2046 if (compiler_common.search_states[ind].type >= 0)
2047 printf("-> (%3d:%3d) ", compiler_common.search_states[ind].type, compiler_common.search_states[ind].value);
2048 compiler_common.search_states[ind].value = -1;
2091 ind = stack_pop(&compiler_common.stack)->value;
2092 if (compiler_common.search_states[ind].type >= 0) {
2093 EMIT_OP1(SLJIT_MOV, SLJIT_MEM1(R_CURR_STATE), TERM_OFFSET_OF(compiler_common.search_states[ind].type, 2), R_TEMP, 0);
2095 compiler_common.search_states[ind].value = -1;
2190 for (ind = 1; ind < compiler_common.dfa_size - 1; ind++) {
2191 if (compiler_common.search_states[ind].type >= 0) {
2192 SLJIT_ASSERT(compiler_common.search_states[ind].type < compiler_common.terms_size);
2194 compiler_common.machine->entry_addrs[compiler_common.search_states[ind].type] = (sljit_uw)label;
2196 if (compiler_common.dfa_transitions[ind].type == type_char) {
2197 EMIT_CMP(jump, SLJIT_NOT_EQUAL, R_CURR_CHAR, 0, SLJIT_IMM, compiler_common.dfa_transitions[ind].value);
2199 else if (compiler_common.dfa_transitions[ind].type == type_rng_start) {
2200 ind = compile_range_check(&compiler_common, ind);
2201 CHECK(!ind);
2204 SLJIT_ASSERT(compiler_common.dfa_transitions[ind].type == type_newline);
2205 CHECK(compile_newline_check(&compiler_common, ind));
2208 CHECK(trace_transitions(ind, &compiler_common));
2211 printf("(%3d): ", compiler_common.search_states[ind].type);
2213 CHECK(compile_cond_tran(&compiler_common, compiler_common.search_states[ind].type));
2215 if (compiler_common.dfa_transitions[ind].type == type_char) {
2219 else if (compiler_common.dfa_transitions[ind].type == type_rng_end) {
2224 SLJIT_ASSERT(compiler_common.dfa_transitions[ind].type == type_newline);
2228 EMIT_OP1(SLJIT_MOV, R_TEMP, 0, SLJIT_MEM1(R_CURR_STATE), TERM_OFFSET_OF(compiler_common.search_states[ind].type, 1));
2229 EMIT_OP1(SLJIT_MOV, SLJIT_MEM1(R_CURR_STATE), TERM_OFFSET_OF(compiler_common.search_states[ind].type, 1), SLJIT_IMM, -1);
2234 if (ind == compiler_common.dfa_size - 1) {
2275 for (ind = 0; ind < compiler_common.terms_size; ++ind)
2276 compiler_common.machine->entry_addrs[ind] = sljit_get_label_addr((struct sljit_label*)compiler_common.machine->entry_addrs[ind]);
2398 sljit_sw current, ind;
2410 ind = (current / sizeof(sljit_sw)) + 1;
2411 current = current_ptr[ind];
2412 current_ptr[ind] = -1;