Lines Matching refs:jump
240 static SLJIT_INLINE sljit_ins* detect_jump_type(struct sljit_jump *jump, sljit_ins *code_ptr, sljit… in detect_jump_type() argument
248 if (jump->flags & (SLJIT_REWRITABLE_JUMP | IS_CALL)) in detect_jump_type()
251 if (jump->flags & SLJIT_REWRITABLE_JUMP) in detect_jump_type()
255 if (jump->flags & JUMP_ADDR) in detect_jump_type()
256 target_addr = jump->u.target; in detect_jump_type()
258 SLJIT_ASSERT(jump->flags & JUMP_LABEL); in detect_jump_type()
259 target_addr = (sljit_uw)(code + jump->u.label->size) + (sljit_uw)executable_offset; in detect_jump_type()
262 inst = (sljit_ins *)jump->addr; in detect_jump_type()
263 if (jump->flags & IS_COND) in detect_jump_type()
267 if (jump->flags & IS_CALL) in detect_jump_type()
272 if (jump->flags & IS_MOVABLE) { in detect_jump_type()
275 jump->flags |= PATCH_B; in detect_jump_type()
277 if (!(jump->flags & IS_COND)) { in detect_jump_type()
279 inst[-1] = (jump->flags & IS_JAL) ? BAL : B; in detect_jump_type()
280 jump->addr -= sizeof(sljit_ins); in detect_jump_type()
285 inst[-1] = saved_inst ^ invert_branch(jump->flags); in detect_jump_type()
286 jump->addr -= 2 * sizeof(sljit_ins); in detect_jump_type()
293 jump->flags |= PATCH_B; in detect_jump_type()
295 if (!(jump->flags & IS_COND)) { in detect_jump_type()
296 inst[0] = (jump->flags & IS_JAL) ? BAL : B; in detect_jump_type()
300 inst[0] = inst[0] ^ invert_branch(jump->flags); in detect_jump_type()
302 jump->addr -= sizeof(sljit_ins); in detect_jump_type()
307 if (jump->flags & IS_COND) { in detect_jump_type()
308 …if ((jump->flags & IS_MOVABLE) && (target_addr & ~0xfffffff) == ((jump->addr + 2 * sizeof(sljit_in… in detect_jump_type()
309 jump->flags |= PATCH_J; in detect_jump_type()
317 else if ((target_addr & ~0xfffffff) == ((jump->addr + 3 * sizeof(sljit_ins)) & ~0xfffffff)) { in detect_jump_type()
318 jump->flags |= PATCH_J; in detect_jump_type()
323 jump->addr += sizeof(sljit_ins); in detect_jump_type()
329 if ((jump->flags & IS_MOVABLE) && (target_addr & ~0xfffffff) == (jump->addr & ~0xfffffff)) { in detect_jump_type()
330 jump->flags |= PATCH_J; in detect_jump_type()
332 inst[-1] = (jump->flags & IS_JAL) ? JAL : J; in detect_jump_type()
333 jump->addr -= sizeof(sljit_ins); in detect_jump_type()
337 if ((target_addr & ~0xfffffff) == ((jump->addr + sizeof(sljit_ins)) & ~0xfffffff)) { in detect_jump_type()
338 jump->flags |= PATCH_J; in detect_jump_type()
339 inst[0] = (jump->flags & IS_JAL) ? JAL : J; in detect_jump_type()
348 jump->flags |= PATCH_ABS32; in detect_jump_type()
349 if (jump->flags & IS_COND) { in detect_jump_type()
358 jump->flags |= PATCH_ABS48; in detect_jump_type()
359 if (jump->flags & IS_COND) { in detect_jump_type()
391 struct sljit_jump *jump; in sljit_generate_code() local
407 jump = compiler->jumps; in sljit_generate_code()
416 SLJIT_ASSERT(!jump || jump->addr >= word_count); in sljit_generate_code()
424 if (jump && jump->addr == word_count) { in sljit_generate_code()
426 jump->addr = (sljit_uw)(code_ptr - 3); in sljit_generate_code()
428 jump->addr = (sljit_uw)(code_ptr - 7); in sljit_generate_code()
430 code_ptr = detect_jump_type(jump, code_ptr, code, executable_offset); in sljit_generate_code()
431 jump = jump->next; in sljit_generate_code()
452 SLJIT_ASSERT(!jump); in sljit_generate_code()
456 jump = compiler->jumps; in sljit_generate_code()
457 while (jump) { in sljit_generate_code()
459 addr = (jump->flags & JUMP_LABEL) ? jump->u.label->addr : jump->u.target; in sljit_generate_code()
460 buf_ptr = (sljit_ins *)jump->addr; in sljit_generate_code()
462 if (jump->flags & PATCH_B) { in sljit_generate_code()
468 if (jump->flags & PATCH_J) { in sljit_generate_code()
479 if (jump->flags & PATCH_ABS32) { in sljit_generate_code()
484 else if (jump->flags & PATCH_ABS48) { in sljit_generate_code()
498 jump = jump->next; in sljit_generate_code()
1623 struct sljit_jump *jump; in sljit_emit_jump() local
1631 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_jump()
1632 PTR_FAIL_IF(!jump); in sljit_emit_jump()
1633 set_jump(jump, compiler, type & SLJIT_REWRITABLE_JUMP); in sljit_emit_jump()
1677 jump->flags |= flags; in sljit_emit_jump()
1679 jump->flags |= IS_MOVABLE; in sljit_emit_jump()
1689 jump->flags |= IS_JAL; in sljit_emit_jump()
1693 jump->addr = compiler->size; in sljit_emit_jump()
1695 return jump; in sljit_emit_jump()
1722 struct sljit_jump *jump; in sljit_emit_cmp() local
1743 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_cmp()
1744 PTR_FAIL_IF(!jump); in sljit_emit_cmp()
1745 set_jump(jump, compiler, type & SLJIT_REWRITABLE_JUMP); in sljit_emit_cmp()
1751 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
1753 jump->flags |= IS_MOVABLE; in sljit_emit_cmp()
1763 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
1767 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
1771 jump->flags |= IS_BIT16_COND; in sljit_emit_cmp()
1775 jump->flags |= IS_BIT16_COND; in sljit_emit_cmp()
1785 jump->flags |= IS_BIT16_COND; in sljit_emit_cmp()
1789 jump->flags |= IS_BIT16_COND; in sljit_emit_cmp()
1793 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
1797 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
1825 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
1831 jump->addr = compiler->size; in sljit_emit_cmp()
1833 return jump; in sljit_emit_cmp()
1850 struct sljit_jump *jump = NULL; in sljit_emit_ijump() local
1857 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_ijump()
1858 FAIL_IF(!jump); in sljit_emit_ijump()
1859 set_jump(jump, compiler, JUMP_ADDR | ((type >= SLJIT_FAST_CALL) ? IS_JAL : 0)); in sljit_emit_ijump()
1860 jump->u.target = srcw; in sljit_emit_ijump()
1863 jump->flags |= IS_MOVABLE; in sljit_emit_ijump()
1874 if (jump) in sljit_emit_ijump()
1875 jump->addr = compiler->size; in sljit_emit_ijump()