Lines Matching refs:jump

314 static SLJIT_INLINE sljit_ins* detect_jump_type(struct sljit_jump *jump, sljit_ins *code_ptr, sljit…  in detect_jump_type()  argument
322 if (jump->flags & (SLJIT_REWRITABLE_JUMP | IS_CALL)) in detect_jump_type()
325 if (jump->flags & SLJIT_REWRITABLE_JUMP) in detect_jump_type()
329 if (jump->flags & JUMP_ADDR) in detect_jump_type()
330 target_addr = jump->u.target; in detect_jump_type()
332 SLJIT_ASSERT(jump->flags & JUMP_LABEL); in detect_jump_type()
333 target_addr = (sljit_uw)(code + jump->u.label->size) + (sljit_uw)executable_offset; in detect_jump_type()
336 inst = (sljit_ins *)jump->addr; in detect_jump_type()
337 if (jump->flags & IS_COND) in detect_jump_type()
341 if (jump->flags & IS_CALL) in detect_jump_type()
346 if (jump->flags & IS_MOVABLE) { in detect_jump_type()
349 jump->flags |= PATCH_B; in detect_jump_type()
351 if (!(jump->flags & IS_COND)) { in detect_jump_type()
353 inst[-1] = (jump->flags & IS_JAL) ? BAL : B; in detect_jump_type()
354 jump->addr -= sizeof(sljit_ins); in detect_jump_type()
359 inst[-1] = saved_inst ^ invert_branch(jump->flags); in detect_jump_type()
360 jump->addr -= 2 * sizeof(sljit_ins); in detect_jump_type()
367 jump->flags |= PATCH_B; in detect_jump_type()
369 if (!(jump->flags & IS_COND)) { in detect_jump_type()
370 inst[0] = (jump->flags & IS_JAL) ? BAL : B; in detect_jump_type()
374 inst[0] = inst[0] ^ invert_branch(jump->flags); in detect_jump_type()
376 jump->addr -= sizeof(sljit_ins); in detect_jump_type()
381 if (jump->flags & IS_COND) { in detect_jump_type()
382 …if ((jump->flags & IS_MOVABLE) && (target_addr & ~0xfffffff) == ((jump->addr + 2 * sizeof(sljit_in… in detect_jump_type()
383 jump->flags |= PATCH_J; in detect_jump_type()
391 else if ((target_addr & ~0xfffffff) == ((jump->addr + 3 * sizeof(sljit_ins)) & ~0xfffffff)) { in detect_jump_type()
392 jump->flags |= PATCH_J; in detect_jump_type()
397 jump->addr += sizeof(sljit_ins); in detect_jump_type()
403 if ((jump->flags & IS_MOVABLE) && (target_addr & ~0xfffffff) == (jump->addr & ~0xfffffff)) { in detect_jump_type()
404 jump->flags |= PATCH_J; in detect_jump_type()
406 inst[-1] = (jump->flags & IS_JAL) ? JAL : J; in detect_jump_type()
407 jump->addr -= sizeof(sljit_ins); in detect_jump_type()
411 if ((target_addr & ~0xfffffff) == ((jump->addr + sizeof(sljit_ins)) & ~0xfffffff)) { in detect_jump_type()
412 jump->flags |= PATCH_J; in detect_jump_type()
413 inst[0] = (jump->flags & IS_JAL) ? JAL : J; in detect_jump_type()
422 jump->flags |= PATCH_ABS32; in detect_jump_type()
423 if (jump->flags & IS_COND) { in detect_jump_type()
432 jump->flags |= PATCH_ABS48; in detect_jump_type()
433 if (jump->flags & IS_COND) { in detect_jump_type()
515 struct sljit_jump *jump; in sljit_generate_code() local
533 jump = compiler->jumps; in sljit_generate_code()
544 SLJIT_ASSERT(!jump || jump->addr >= word_count); in sljit_generate_code()
554 if (jump && jump->addr == word_count) { in sljit_generate_code()
556 jump->addr = (sljit_uw)(code_ptr - 3); in sljit_generate_code()
558 jump->addr = (sljit_uw)(code_ptr - 7); in sljit_generate_code()
560 code_ptr = detect_jump_type(jump, code_ptr, code, executable_offset); in sljit_generate_code()
561 jump = jump->next; in sljit_generate_code()
576 next_addr = compute_next_addr(label, jump, const_, put_label); in sljit_generate_code()
592 SLJIT_ASSERT(!jump); in sljit_generate_code()
597 jump = compiler->jumps; in sljit_generate_code()
598 while (jump) { in sljit_generate_code()
600 addr = (jump->flags & JUMP_LABEL) ? jump->u.label->addr : jump->u.target; in sljit_generate_code()
601 buf_ptr = (sljit_ins *)jump->addr; in sljit_generate_code()
603 if (jump->flags & PATCH_B) { in sljit_generate_code()
609 if (jump->flags & PATCH_J) { in sljit_generate_code()
620 if (jump->flags & PATCH_ABS32) { in sljit_generate_code()
625 else if (jump->flags & PATCH_ABS48) { in sljit_generate_code()
639 jump = jump->next; in sljit_generate_code()
1842 struct sljit_jump *jump; in sljit_emit_jump() local
1850 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_jump()
1851 PTR_FAIL_IF(!jump); in sljit_emit_jump()
1852 set_jump(jump, compiler, type & SLJIT_REWRITABLE_JUMP); in sljit_emit_jump()
1894 jump->flags |= flags; in sljit_emit_jump()
1896 jump->flags |= IS_MOVABLE; in sljit_emit_jump()
1906 jump->flags |= IS_JAL; in sljit_emit_jump()
1910 jump->addr = compiler->size; in sljit_emit_jump()
1912 return jump; in sljit_emit_jump()
1939 struct sljit_jump *jump; in sljit_emit_cmp() local
1960 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_cmp()
1961 PTR_FAIL_IF(!jump); in sljit_emit_cmp()
1962 set_jump(jump, compiler, type & SLJIT_REWRITABLE_JUMP); in sljit_emit_cmp()
1968 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
1970 jump->flags |= IS_MOVABLE; in sljit_emit_cmp()
1980 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
1984 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
1988 jump->flags |= IS_BIT16_COND; in sljit_emit_cmp()
1992 jump->flags |= IS_BIT16_COND; in sljit_emit_cmp()
2002 jump->flags |= IS_BIT16_COND; in sljit_emit_cmp()
2006 jump->flags |= IS_BIT16_COND; in sljit_emit_cmp()
2010 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
2014 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
2042 jump->flags |= IS_BIT26_COND; in sljit_emit_cmp()
2048 jump->addr = compiler->size; in sljit_emit_cmp()
2050 return jump; in sljit_emit_cmp()
2067 struct sljit_jump *jump = NULL; in sljit_emit_ijump() local
2074 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_ijump()
2075 FAIL_IF(!jump); in sljit_emit_ijump()
2076 set_jump(jump, compiler, JUMP_ADDR | ((type >= SLJIT_FAST_CALL) ? IS_JAL : 0)); in sljit_emit_ijump()
2077 jump->u.target = srcw; in sljit_emit_ijump()
2080 jump->flags |= IS_MOVABLE; in sljit_emit_ijump()
2091 if (jump) in sljit_emit_ijump()
2092 jump->addr = compiler->size; in sljit_emit_ijump()