Lines Matching refs:compiler
2 * Stack-less Just-In-Time compiler
29 static sljit_s32 emit_do_imm(struct sljit_compiler *compiler, sljit_u8 opcode, sljit_sw imm)
33 inst = (sljit_u8*)ensure_buf(compiler, 1 + 1 + sizeof(sljit_sw));
66 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compiler,
74 CHECK(check_sljit_emit_enter(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size));
75 set_emit_enter(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size);
77 compiler->args = args;
78 compiler->flags_saved = 0;
86 inst = (sljit_u8*)ensure_buf(compiler, 1 + size);
146 inst = (sljit_u8*)ensure_buf(compiler, 1 + 17);
166 compiler->local_size = local_size;
170 FAIL_IF(emit_do_imm(compiler, MOV_r_i32 + reg_map[SLJIT_R0], local_size));
173 FAIL_IF(emit_do_imm(compiler, MOV_r_i32 + reg_map[SLJIT_R0], local_size));
174 FAIL_IF(emit_non_cum_binary(compiler, SUB_r_rm, SUB_rm_r, SUB, SUB_EAX_i32,
177 FAIL_IF(sljit_emit_ijump(compiler, SLJIT_CALL1, SLJIT_IMM, SLJIT_FUNC_OFFSET(sljit_grow_stack)));
182 return emit_non_cum_binary(compiler, SUB_r_rm, SUB_rm_r, SUB, SUB_EAX_i32,
186 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_set_context(struct sljit_compiler *compiler,
191 CHECK(check_sljit_set_context(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size));
192 set_set_context(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size);
194 compiler->args = args;
198 compiler->local_size = ((SLJIT_LOCALS_OFFSET + saveds + local_size + 15) & ~15) - saveds;
201 compiler->local_size = SLJIT_LOCALS_OFFSET + ((local_size + 7) & ~7);
203 compiler->local_size = SLJIT_LOCALS_OFFSET + ((local_size + 3) & ~3);
208 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return(struct sljit_compiler *compiler, sljit_s32 op, sljit_s32 src, sljit_sw srcw)
214 CHECK(check_sljit_emit_return(compiler, op, src, srcw));
215 SLJIT_ASSERT(compiler->args >= 0);
217 compiler->flags_saved = 0;
218 FAIL_IF(emit_mov_before_return(compiler, op, src, srcw));
220 SLJIT_ASSERT(compiler->local_size > 0);
221 FAIL_IF(emit_cum_binary(compiler, ADD_r_rm, ADD_rm_r, ADD, ADD_EAX_i32,
222 SLJIT_SP, 0, SLJIT_SP, 0, SLJIT_IMM, compiler->local_size));
225 if (compiler->options & SLJIT_DOUBLE_ALIGNMENT) {
226 inst = (sljit_u8*)ensure_buf(compiler, 1 + 3);
236 size = 2 + (compiler->scratches > 7 ? (compiler->scratches - 7) : 0) +
237 (compiler->saveds <= 3 ? compiler->saveds : 3);
239 if (compiler->args > 2)
242 if (compiler->args > 0)
245 inst = (sljit_u8*)ensure_buf(compiler, 1 + size);
250 if (compiler->saveds > 0 || compiler->scratches > 9)
252 if (compiler->saveds > 1 || compiler->scratches > 8)
254 if (compiler->saveds > 2 || compiler->scratches > 7)
258 if (compiler->args > 2)
274 static sljit_u8* emit_x86_instruction(struct sljit_compiler *compiler, sljit_s32 size,
350 inst = (sljit_u8*)ensure_buf(compiler, 1 + inst_size);
441 static SLJIT_INLINE sljit_s32 call_with_args(struct sljit_compiler *compiler, sljit_s32 type)
446 inst = (sljit_u8*)ensure_buf(compiler, type >= SLJIT_CALL3 ? 1 + 2 + 1 : 1 + 2);
455 inst = (sljit_u8*)ensure_buf(compiler, 1 + 4 * (type - SLJIT_CALL0));
479 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_enter(struct sljit_compiler *compiler, sljit_s32 dst, sljit_sw dstw)
484 CHECK(check_sljit_emit_fast_enter(compiler, dst, dstw));
495 inst = (sljit_u8*)ensure_buf(compiler, 1 + 1);
504 inst = emit_x86_instruction(compiler, 1, 0, 0, dst, dstw);
510 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_return(struct sljit_compiler *compiler, sljit_s32 src, sljit_sw srcw)
515 CHECK(check_sljit_emit_fast_return(compiler, src, srcw));
521 inst = (sljit_u8*)ensure_buf(compiler, 1 + 1 + 1);
528 inst = emit_x86_instruction(compiler, 1, 0, 0, src, srcw);
533 inst = (sljit_u8*)ensure_buf(compiler, 1 + 1);
539 inst = (sljit_u8*)ensure_buf(compiler, 1 + 5 + 1);