Home | History | Annotate | Download | only in sljit_src

Lines Matching refs:compiler

4  *    Stack-less Just-In-Time compiler
31 static sljit_s32 emit_load_imm64(struct sljit_compiler *compiler, sljit_s32 reg, sljit_sw imm)
35 inst = (sljit_u8*)ensure_buf(compiler, 1 + 2 + sizeof(sljit_sw));
70 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compiler,
78 CHECK(check_sljit_emit_enter(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size));
79 set_emit_enter(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size);
84 compiler->locals_offset = 6 * sizeof(sljit_sw);
86 compiler->locals_offset = ((scratches > 2) ? 4 : 2) * sizeof(sljit_sw);
95 inst = (sljit_u8*)ensure_buf(compiler, 1 + size);
105 inst = (sljit_u8*)ensure_buf(compiler, 1 + size);
115 inst = (sljit_u8*)ensure_buf(compiler, 1 + size);
156 compiler->local_size = local_size;
161 inst = (sljit_u8*)ensure_buf(compiler, 1 + 4 + (3 + sizeof(sljit_s32)));
185 compiler->skip_checks = 1;
187 FAIL_IF(sljit_emit_ijump(compiler, SLJIT_CALL1, SLJIT_IMM, SLJIT_FUNC_OFFSET(sljit_grow_stack)));
193 inst = (sljit_u8*)ensure_buf(compiler, 1 + 4);
202 inst = (sljit_u8*)ensure_buf(compiler, 1 + 7);
216 inst = (sljit_u8*)ensure_buf(compiler, 1 + 5);
227 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_set_context(struct sljit_compiler *compiler,
234 CHECK(check_sljit_set_context(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size));
235 set_set_context(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size);
240 compiler->locals_offset = 6 * sizeof(sljit_sw);
242 compiler->locals_offset = ((scratches > 2) ? 4 : 2) * sizeof(sljit_sw);
247 compiler->local_size = ((local_size + SLJIT_LOCALS_OFFSET + saved_register_size + 15) & ~15) - saved_register_size;
251 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return(struct sljit_compiler *compiler, sljit_s32 op, sljit_s32 src, sljit_sw srcw)
257 CHECK(check_sljit_emit_return(compiler, op, src, srcw));
259 FAIL_IF(emit_mov_before_return(compiler, op, src, srcw));
263 if (compiler->fscratches >= 6 || compiler->fsaveds >= 1) {
264 inst = (sljit_u8*)ensure_buf(compiler, 1 + 5);
272 if (compiler->local_size > 0) {
273 if (compiler->local_size <= 127) {
274 inst = (sljit_u8*)ensure_buf(compiler, 1 + 4);
280 *inst = compiler->local_size;
283 inst = (sljit_u8*)ensure_buf(compiler, 1 + 7);
289 sljit_unaligned_store_s32(inst, compiler->local_size);
293 tmp = compiler->scratches;
296 inst = (sljit_u8*)ensure_buf(compiler, 1 + size);
304 tmp = compiler->saveds < SLJIT_NUMBER_OF_SAVED_REGISTERS ? (SLJIT_S0 + 1 - compiler->saveds) : SLJIT_FIRST_SAVED_REG;
307 inst = (sljit_u8*)ensure_buf(compiler, 1 + size);
315 inst = (sljit_u8*)ensure_buf(compiler, 1 + 1);
326 static sljit_s32 emit_do_imm32(struct sljit_compiler *compiler, sljit_u8 rex, sljit_u8 opcode, sljit_sw imm)
331 inst = (sljit_u8*)ensure_buf(compiler, 1 + length);
341 static sljit_u8* emit_x86_instruction(struct sljit_compiler *compiler, sljit_s32 size,
354 SLJIT_ASSERT(!(a & SLJIT_IMM) || compiler->mode32 || IS_HALFWORD(imma));
370 if (!compiler->mode32 && !(flags & EX86_NO_REXW))
385 PTR_FAIL_IF(emit_load_imm64(compiler, TMP_REG3, immb));
431 imma &= compiler->mode32 ? 0x1f : 0x3f;
453 inst = (sljit_u8*)ensure_buf(compiler, 1 + inst_size);
550 static SLJIT_INLINE sljit_s32 call_with_args(struct sljit_compiler *compiler, sljit_s32 type)
557 inst = (sljit_u8*)ensure_buf(compiler, 1 + ((type < SLJIT_CALL3) ? 3 : 6));
571 inst = (sljit_u8*)ensure_buf(compiler, 1 + ((type < SLJIT_CALL3) ? 3 : 6));
586 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_enter(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw)
591 CHECK(check_sljit_emit_fast_enter(compiler, dst, dstw));
600 inst = (sljit_u8*)ensure_buf(compiler, 1 + 1);
607 inst = (sljit_u8*)ensure_buf(compiler, 1 + 2);
616 compiler->mode32 = 1;
617 inst = emit_x86_instruction(compiler, 1, 0, 0, dst, dstw);
623 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_return(struct sljit_compiler *compiler, sljit_s32 src, sljit_sw srcw)
628 CHECK(check_sljit_emit_fast_return(compiler, src, srcw));
632 FAIL_IF(emit_load_imm64(compiler, TMP_REG1, srcw));
638 inst = (sljit_u8*)ensure_buf(compiler, 1 + 1 + 1);
645 inst = (sljit_u8*)ensure_buf(compiler, 1 + 2 + 1);
655 compiler->mode32 = 1;
656 inst = emit_x86_instruction(compiler, 1, 0, 0, src, srcw);
661 inst = (sljit_u8*)ensure_buf(compiler, 1 + 1);
668 inst = (sljit_u8*)ensure_buf(compiler, 1 + 5 + 1);
686 static sljit_s32 emit_mov_int(struct sljit_compiler *compiler, sljit_s32 sign,
693 compiler->mode32 = 0;
701 inst = emit_x86_instruction(compiler, 1, SLJIT_IMM, (sljit_sw)(sljit_s32)srcw, dst, dstw);
706 return emit_load_imm64(compiler, dst, srcw);
708 compiler->mode32 = 1;
709 inst = emit_x86_instruction(compiler, 1, SLJIT_IMM, (sljit_sw)(sljit_s32)srcw, dst, dstw);
712 compiler->mode32 = 0;
722 inst = emit_x86_instruction(compiler, 1, dst_r, 0, src, srcw);
726 compiler->mode32 = 1;
727 FAIL_IF(emit_mov(compiler, dst_r, 0, src, srcw));
728 compiler->mode32 = 0;
733 compiler->mode32 = 1;
734 inst = emit_x86_instruction(compiler, 1, dst_r, 0, dst, dstw);
737 compiler->mode32 = 0;