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
319 if (jump->flags & (SLJIT_REWRITABLE_JUMP | IS_CALL)) in detect_jump_type()
322 if (jump->flags & SLJIT_REWRITABLE_JUMP) in detect_jump_type()
326 if (jump->flags & JUMP_ADDR) in detect_jump_type()
327 target_addr = jump->u.target; in detect_jump_type()
329 SLJIT_ASSERT(jump->u.label != NULL); in detect_jump_type()
330 target_addr = (sljit_uw)(code + jump->u.label->size) + (sljit_uw)executable_offset; in detect_jump_type()
334 if (jump->flags & IS_CALL) in detect_jump_type()
340 if (jump->flags & IS_COND) { in detect_jump_type()
342 jump->flags |= PATCH_B; in detect_jump_type()
346 jump->flags |= PATCH_B | PATCH_ABS_B; in detect_jump_type()
354 jump->flags |= PATCH_B; in detect_jump_type()
356 jump->flags |= PATCH_B | PATCH_ABS_B; in detect_jump_type()
359 if (jump->flags & PATCH_B) { in detect_jump_type()
360 if (!(jump->flags & IS_COND)) in detect_jump_type()
365 jump->addr += sizeof(sljit_ins); in detect_jump_type()
366 jump->flags -= IS_COND; in detect_jump_type()
375 jump->flags |= PATCH_ABS32; in detect_jump_type()
382 jump->flags |= PATCH_ABS48; in detect_jump_type()
402 static SLJIT_INLINE sljit_sw mov_addr_get_length(struct sljit_jump *jump, sljit_ins *code, sljit_sw… in mov_addr_get_length() argument
407 SLJIT_ASSERT(jump->flags < ((sljit_uw)5 << JUMP_SIZE_SHIFT)); in mov_addr_get_length()
408 if (jump->flags & JUMP_ADDR) in mov_addr_get_length()
409 addr = jump->u.target; in mov_addr_get_length()
411 addr = (sljit_uw)SLJIT_ADD_EXEC_OFFSET(code + jump->u.label->size, executable_offset); in mov_addr_get_length()
414 SLJIT_ASSERT(jump->flags >= ((sljit_uw)1 << JUMP_SIZE_SHIFT)); in mov_addr_get_length()
415 jump->flags |= PATCH_ABS32; in mov_addr_get_length()
420 SLJIT_ASSERT(jump->flags >= ((sljit_uw)3 << JUMP_SIZE_SHIFT)); in mov_addr_get_length()
421 jump->flags |= PATCH_ABS48; in mov_addr_get_length()
425 SLJIT_ASSERT(jump->flags >= ((sljit_uw)4 << JUMP_SIZE_SHIFT)); in mov_addr_get_length()
431 static void generate_jump_or_mov_addr(struct sljit_jump *jump, sljit_sw executable_offset) in generate_jump_or_mov_addr() argument
433 sljit_uw flags = jump->flags; in generate_jump_or_mov_addr()
434 sljit_uw addr = (flags & JUMP_ADDR) ? jump->u.target : jump->u.label->u.addr; in generate_jump_or_mov_addr()
435 sljit_ins *ins = (sljit_ins*)jump->addr; in generate_jump_or_mov_addr()
498 struct sljit_jump *jump; in reduce_code_size() local
506 jump = compiler->jumps; in reduce_code_size()
533 jump->addr -= size_reduce; in reduce_code_size()
534 if (!(jump->flags & JUMP_MOV_ADDR)) { in reduce_code_size()
537 if (!(jump->flags & SLJIT_REWRITABLE_JUMP)) { in reduce_code_size()
538 if (jump->flags & JUMP_ADDR) { in reduce_code_size()
539 if (jump->u.target <= 0x01ffffff) in reduce_code_size()
542 else if (jump->u.target < 0x80000000l) in reduce_code_size()
544 else if (jump->u.target < 0x800000000000l) in reduce_code_size()
549 diff = (sljit_sw)jump->u.label->size - (sljit_sw)jump->addr; in reduce_code_size()
551 if (jump->flags & IS_COND) { in reduce_code_size()
562 jump->flags |= total_size << JUMP_SIZE_SHIFT; in reduce_code_size()
567 if (jump->flags & JUMP_ADDR) { in reduce_code_size()
568 if (jump->u.target < 0x80000000l) { in reduce_code_size()
571 } else if (jump->u.target < 0x800000000000l) { in reduce_code_size()
576 jump->flags |= total_size; in reduce_code_size()
580 jump = jump->next; in reduce_code_size()
581 next_jump_addr = SLJIT_GET_NEXT_ADDRESS(jump); in reduce_code_size()
599 struct sljit_jump *jump; in sljit_generate_code() local
624 jump = compiler->jumps; in sljit_generate_code()
636 SLJIT_ASSERT(!jump || jump->addr >= word_count); in sljit_generate_code()
649 if (!(jump->flags & JUMP_MOV_ADDR)) { in sljit_generate_code()
650 word_count += jump->flags >> JUMP_SIZE_SHIFT; in sljit_generate_code()
651 jump->addr = (sljit_uw)code_ptr; in sljit_generate_code()
652 code_ptr = detect_jump_type(jump, code_ptr, code, executable_offset); in sljit_generate_code()
653 …SLJIT_ASSERT(((sljit_uw)code_ptr - jump->addr <= (jump->flags >> JUMP_SIZE_SHIFT) * sizeof(sljit_i… in sljit_generate_code()
655 jump->addr = (sljit_uw)code_ptr; in sljit_generate_code()
657 word_count += jump->flags >> JUMP_SIZE_SHIFT; in sljit_generate_code()
658 code_ptr += mov_addr_get_length(jump, code, executable_offset); in sljit_generate_code()
664 jump = jump->next; in sljit_generate_code()
665 next_jump_addr = SLJIT_GET_NEXT_ADDRESS(jump); in sljit_generate_code()
688 SLJIT_ASSERT(!jump); in sljit_generate_code()
697 jump = compiler->jumps; in sljit_generate_code()
698 while (jump) { in sljit_generate_code()
699 generate_jump_or_mov_addr(jump, executable_offset); in sljit_generate_code()
700 jump = jump->next; in sljit_generate_code()
2501 struct sljit_jump *jump; in sljit_emit_jump() local
2511 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_jump()
2512 PTR_FAIL_IF(!jump); in sljit_emit_jump()
2513 set_jump(jump, compiler, (sljit_u32)type & SLJIT_REWRITABLE_JUMP); in sljit_emit_jump()
2521 jump->flags |= IS_COND; in sljit_emit_jump()
2524 jump->flags |= IS_CALL; in sljit_emit_jump()
2527 jump->addr = compiler->size; in sljit_emit_jump()
2532 return jump; in sljit_emit_jump()
2559 struct sljit_jump *jump = NULL; in sljit_emit_ijump() local
2567 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_ijump()
2568 FAIL_IF(!jump); in sljit_emit_ijump()
2569 set_jump(jump, compiler, JUMP_ADDR); in sljit_emit_ijump()
2570 jump->u.target = (sljit_uw)srcw; in sljit_emit_ijump()
2574 jump->flags |= IS_CALL; in sljit_emit_ijump()
2577 jump->addr = compiler->size; in sljit_emit_ijump()
3133 struct sljit_jump *jump; in sljit_emit_mov_addr() local
3140 jump = (struct sljit_jump*)ensure_abuf(compiler, sizeof(struct sljit_jump)); in sljit_emit_mov_addr()
3141 PTR_FAIL_IF(!jump); in sljit_emit_mov_addr()
3142 set_mov_addr(jump, compiler, 0); in sljit_emit_mov_addr()
3155 return jump; in sljit_emit_mov_addr()