Lines Matching refs:jump
313 static SLJIT_INLINE sljit_ins* detect_jump_type(struct sljit_jump *jump, sljit_ins *code_ptr, sljit… in detect_jump_type() argument
321 if (jump->flags & (SLJIT_REWRITABLE_JUMP | IS_CALL)) in detect_jump_type()
324 if (jump->flags & SLJIT_REWRITABLE_JUMP) in detect_jump_type()
328 if (jump->flags & JUMP_ADDR) in detect_jump_type()
329 target_addr = jump->u.target; in detect_jump_type()
331 SLJIT_ASSERT(jump->flags & JUMP_LABEL); in detect_jump_type()
332 target_addr = (sljit_uw)(code + jump->u.label->size) + (sljit_uw)executable_offset; in detect_jump_type()
335 inst = (sljit_ins *)jump->addr; in detect_jump_type()
336 if (jump->flags & IS_COND) in detect_jump_type()
340 if (jump->flags & IS_CALL) in detect_jump_type()
345 if (jump->flags & IS_MOVABLE) { in detect_jump_type()
348 jump->flags |= PATCH_B; in detect_jump_type()
350 if (!(jump->flags & IS_COND)) { in detect_jump_type()
352 inst[-1] = (jump->flags & IS_JAL) ? BAL : B; in detect_jump_type()
353 jump->addr -= sizeof(sljit_ins); in detect_jump_type()
358 inst[-1] = saved_inst ^ invert_branch(jump->flags); in detect_jump_type()
359 jump->addr -= 2 * sizeof(sljit_ins); in detect_jump_type()
366 jump->flags |= PATCH_B; in detect_jump_type()
368 if (!(jump->flags & IS_COND)) { in detect_jump_type()
369 inst[0] = (jump->flags & IS_JAL) ? BAL : B; in detect_jump_type()
373 inst[0] = inst[0] ^ invert_branch(jump->flags); in detect_jump_type()
375 jump->addr -= sizeof(sljit_ins); in detect_jump_type()
380 if (jump->flags & IS_COND) { in detect_jump_type()
381 …if ((jump->flags & IS_MOVABLE) && (target_addr & ~0xfffffff) == ((jump->addr + 2 * sizeof(sljit_in… in detect_jump_type()
382 jump->flags |= PATCH_J; in detect_jump_type()
390 else if ((target_addr & ~0xfffffff) == ((jump->addr + 3 * sizeof(sljit_ins)) & ~0xfffffff)) { in detect_jump_type()
391 jump->flags |= PATCH_J; in detect_jump_type()
396 jump->addr += sizeof(sljit_ins); in detect_jump_type()
402 if ((jump->flags & IS_MOVABLE) && (target_addr & ~0xfffffff) == (jump->addr & ~0xfffffff)) { in detect_jump_type()
403 jump->flags |= PATCH_J; in detect_jump_type()
405 inst[-1] = (jump->flags & IS_JAL) ? JAL : J; in detect_jump_type()
406 jump->addr -= sizeof(sljit_ins); in detect_jump_type()
410 if ((target_addr & ~0xfffffff) == ((jump->addr + sizeof(sljit_ins)) & ~0xfffffff)) { in detect_jump_type()
411 jump->flags |= PATCH_J; in detect_jump_type()
412 inst[0] = (jump->flags & IS_JAL) ? JAL : J; in detect_jump_type()
421 jump->flags |= PATCH_ABS32; in detect_jump_type()
422 if (jump->flags & IS_COND) { in detect_jump_type()
431 jump->flags |= PATCH_ABS48; in detect_jump_type()
432 if (jump->flags & IS_COND) { in detect_jump_type()
464 struct sljit_jump *jump; in sljit_generate_code() local
480 jump = compiler->jumps; in sljit_generate_code()
489 SLJIT_ASSERT(!jump || jump->addr >= word_count); in sljit_generate_code()
497 if (jump && jump->addr == word_count) { in sljit_generate_code()
499 jump->addr = (sljit_uw)(code_ptr - 3); in sljit_generate_code()
501 jump->addr = (sljit_uw)(code_ptr - 7); in sljit_generate_code()
503 code_ptr = detect_jump_type(jump, code_ptr, code, executable_offset); in sljit_generate_code()
504 jump = jump->next; in sljit_generate_code()
525 SLJIT_ASSERT(!jump); in sljit_generate_code()
529 jump = compiler->jumps; in sljit_generate_code()
530 while (jump) { in sljit_generate_code()
532 addr = (jump->flags & JUMP_LABEL) ? jump->u.label->addr : jump->u.target; in sljit_generate_code()
533 buf_ptr = (sljit_ins *)jump->addr; in sljit_generate_code()
535 if (jump->flags & PATCH_B) { in sljit_generate_code()
541 if (jump->flags & PATCH_J) { in sljit_generate_code()
552 if (jump->flags & PATCH_ABS32) { in sljit_generate_code()
557 else if (jump->flags & PATCH_ABS48) { in sljit_generate_code()
571 jump = jump->next; in sljit_generate_code()
1737 struct sljit_jump *jump; in sljit_emit_jump() local
1745 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_jump()
1746 PTR_FAIL_IF(!jump); in sljit_emit_jump()
1747 set_jump(jump, compiler, type & SLJIT_REWRITABLE_JUMP); in sljit_emit_jump()
1791 jump->flags |= flags; in sljit_emit_jump()
1793 jump->flags |= IS_MOVABLE; in sljit_emit_jump()
1803 jump->flags |= IS_JAL; in sljit_emit_jump()
1807 jump->addr = compiler->size; in sljit_emit_jump()
1809 return jump; in sljit_emit_jump()
1836 struct sljit_jump *jump; in sljit_emit_cmp() local
1857 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_cmp()
1858 PTR_FAIL_IF(!jump); in sljit_emit_cmp()
1859 set_jump(jump, compiler, type & SLJIT_REWRITABLE_JUMP); in sljit_emit_cmp()
1865 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
1867 jump->flags |= IS_MOVABLE; in sljit_emit_cmp()
1877 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
1881 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
1885 jump->flags |= IS_BIT16_COND; in sljit_emit_cmp()
1889 jump->flags |= IS_BIT16_COND; in sljit_emit_cmp()
1899 jump->flags |= IS_BIT16_COND; in sljit_emit_cmp()
1903 jump->flags |= IS_BIT16_COND; in sljit_emit_cmp()
1907 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
1911 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
1939 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
1945 jump->addr = compiler->size; in sljit_emit_cmp()
1947 return jump; in sljit_emit_cmp()
1964 struct sljit_jump *jump = NULL; in sljit_emit_ijump() local
1971 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_ijump()
1972 FAIL_IF(!jump); in sljit_emit_ijump()
1973 set_jump(jump, compiler, JUMP_ADDR | ((type >= SLJIT_FAST_CALL) ? IS_JAL : 0)); in sljit_emit_ijump()
1974 jump->u.target = srcw; in sljit_emit_ijump()
1977 jump->flags |= IS_MOVABLE; in sljit_emit_ijump()
1988 if (jump) in sljit_emit_ijump()
1989 jump->addr = compiler->size; in sljit_emit_ijump()