Lines Matching refs:code_ptr
266 static sljit_uw patch_pc_relative_loads(sljit_uw *last_pc_patch, sljit_uw *code_ptr, sljit_uw* const_pool, sljit_uw cpool_size)
274 SLJIT_ASSERT(const_pool - code_ptr <= CONST_POOL_ALIGNMENT);
281 while (last_pc_patch < code_ptr) {
392 static SLJIT_INLINE sljit_si detect_jump_type(struct sljit_jump *jump, sljit_uw *code_ptr, sljit_uw *code)
401 code_ptr--;
404 diff = ((sljit_sw)jump->u.target - (sljit_sw)(code_ptr + 2));
407 diff = ((sljit_sw)(code + jump->u.label->size) - (sljit_sw)(code_ptr + 2));
416 *code_ptr = (BL - CONDITIONAL) | (*(code_ptr + 1) & COND_MASK);
423 *code_ptr = (B - CONDITIONAL) | (*code_ptr & COND_MASK);
429 diff = ((sljit_sw)jump->u.target - (sljit_sw)code_ptr);
432 diff = ((sljit_sw)(code + jump->u.label->size) - (sljit_sw)code_ptr);
440 code_ptr -= 2;
441 *code_ptr = ((jump->flags & IS_BL) ? (BL - CONDITIONAL) : (B - CONDITIONAL)) | (code_ptr[2] & COND_MASK);
560 sljit_uw *code_ptr;
603 code_ptr = code;
639 label->addr = (sljit_uw)code_ptr;
640 label->size = code_ptr - code;
648 *code_ptr = *buf_ptr++;
655 if (detect_jump_type(jump, code_ptr, code))
656 code_ptr--;
657 jump->addr = (sljit_uw)code_ptr;
659 jump->addr = (sljit_uw)(code_ptr - 2);
660 if (detect_jump_type(jump, code_ptr, code))
661 code_ptr -= 2;
666 /* code_ptr can be affected above. */
667 label->addr = (sljit_uw)(code_ptr + 1);
668 label->size = (code_ptr + 1) - code;
673 const_->addr = (sljit_uw)code_ptr;
675 const_->addr = (sljit_uw)(code_ptr - 1);
679 code_ptr++;
686 cpool_start_address = ALIGN_INSTRUCTION(code_ptr + 1);
687 cpool_current_index = patch_pc_relative_loads(last_pc_patch, code_ptr, cpool_start_address, cpool_size);
690 *code_ptr = B | (((cpool_start_address - code_ptr) + cpool_current_index - 2) & ~PUSH_POOL);
691 code_ptr = cpool_start_address + cpool_current_index;
695 last_pc_patch = code_ptr;
709 cpool_start_address = ALIGN_INSTRUCTION(code_ptr);
710 cpool_current_index = patch_pc_relative_loads(last_pc_patch, code_ptr, cpool_start_address, compiler->cpool_fill);
712 code_ptr = cpool_start_address + cpool_current_index;
747 jump->addr = (sljit_uw)code_ptr;
748 code_ptr[0] = (sljit_uw)buf_ptr;
749 code_ptr[1] = *buf_ptr;
750 inline_set_jump_addr((sljit_uw)code_ptr, (jump->flags & JUMP_LABEL) ? jump->u.label->addr : jump->u.target, 0);
751 code_ptr += 2;
776 const_->addr = (sljit_uw)code_ptr;
778 code_ptr[0] = (sljit_uw)buf_ptr;
779 code_ptr[1] = *buf_ptr;
785 inline_set_const((sljit_uw)code_ptr, *buf_ptr, 0);
786 code_ptr += 2;
792 SLJIT_ASSERT(code_ptr - code <= (sljit_si)size);
795 compiler->executable_size = (code_ptr - code) * sizeof(sljit_uw);
796 SLJIT_CACHE_FLUSH(code, code_ptr);