Lines Matching refs:compiler

31 static sljit_s32 emit_do_imm(struct sljit_compiler *compiler, sljit_u8 opcode, sljit_sw imm)  in emit_do_imm()  argument
35 inst = (sljit_u8*)ensure_buf(compiler, 1 + 1 + sizeof(sljit_sw)); in emit_do_imm()
68 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_enter(struct sljit_compiler *compiler, in sljit_emit_enter() argument
76 …CHECK(check_sljit_emit_enter(compiler, options, args, scratches, saveds, fscratches, fsaveds, loca… in sljit_emit_enter()
77 set_emit_enter(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size); in sljit_emit_enter()
79 compiler->args = args; in sljit_emit_enter()
83 compiler->saveds_offset = 1 * sizeof(sljit_sw); in sljit_emit_enter()
87 compiler->saveds_offset = 1 * sizeof(sljit_sw); in sljit_emit_enter()
89 compiler->saveds_offset = ((scratches == 2) ? 2 : 3) * sizeof(sljit_sw); in sljit_emit_enter()
93 compiler->saveds_offset += ((scratches > (3 + 6)) ? 6 : (scratches - 3)) * sizeof(sljit_sw); in sljit_emit_enter()
95 compiler->locals_offset = compiler->saveds_offset; in sljit_emit_enter()
98 compiler->locals_offset += (saveds - 3) * sizeof(sljit_sw); in sljit_emit_enter()
101compiler->locals_offset = (compiler->locals_offset + sizeof(sljit_f64) - 1) & ~(sizeof(sljit_f64) … in sljit_emit_enter()
109 inst = (sljit_u8*)ensure_buf(compiler, 1 + size); in sljit_emit_enter()
173 compiler->local_size = local_size; in sljit_emit_enter()
178 FAIL_IF(emit_do_imm(compiler, MOV_r_i32 + reg_map[SLJIT_R0], local_size)); in sljit_emit_enter()
182 FAIL_IF(emit_do_imm(compiler, MOV_r_i32 + reg_map[SLJIT_R0], local_size)); in sljit_emit_enter()
183 FAIL_IF(emit_non_cum_binary(compiler, SUB_r_rm, SUB_rm_r, SUB, SUB_EAX_i32, in sljit_emit_enter()
186 FAIL_IF(sljit_emit_ijump(compiler, SLJIT_CALL1, SLJIT_IMM, SLJIT_FUNC_OFFSET(sljit_grow_stack))); in sljit_emit_enter()
194 EMIT_MOV(compiler, TMP_REG1, 0, SLJIT_SP, 0); in sljit_emit_enter()
197 FAIL_IF(emit_non_cum_binary(compiler, SUB_r_rm, SUB_rm_r, SUB, SUB_EAX_i32, in sljit_emit_enter()
201 if (compiler->local_size > 1024) in sljit_emit_enter()
202 FAIL_IF(emit_cum_binary(compiler, ADD_r_rm, ADD_rm_r, ADD, ADD_EAX_i32, in sljit_emit_enter()
206 inst = (sljit_u8*)ensure_buf(compiler, 1 + 6); in sljit_emit_enter()
215 return emit_mov(compiler, SLJIT_MEM1(SLJIT_SP), compiler->local_size, TMP_REG1, 0); in sljit_emit_enter()
218 return emit_non_cum_binary(compiler, SUB_r_rm, SUB_rm_r, SUB, SUB_EAX_i32, in sljit_emit_enter()
222 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_set_context(struct sljit_compiler *compiler, in sljit_set_context() argument
227 …CHECK(check_sljit_set_context(compiler, options, args, scratches, saveds, fscratches, fsaveds, loc… in sljit_set_context()
228 set_set_context(compiler, options, args, scratches, saveds, fscratches, fsaveds, local_size); in sljit_set_context()
230 compiler->args = args; in sljit_set_context()
234 compiler->saveds_offset = 1 * sizeof(sljit_sw); in sljit_set_context()
238 compiler->saveds_offset = 1 * sizeof(sljit_sw); in sljit_set_context()
240 compiler->saveds_offset = ((scratches == 2) ? 2 : 3) * sizeof(sljit_sw); in sljit_set_context()
244 compiler->saveds_offset += ((scratches > (3 + 6)) ? 6 : (scratches - 3)) * sizeof(sljit_sw); in sljit_set_context()
246 compiler->locals_offset = compiler->saveds_offset; in sljit_set_context()
249 compiler->locals_offset += (saveds - 3) * sizeof(sljit_sw); in sljit_set_context()
252compiler->locals_offset = (compiler->locals_offset + sizeof(sljit_f64) - 1) & ~(sizeof(sljit_f64) … in sljit_set_context()
256 compiler->local_size = ((SLJIT_LOCALS_OFFSET + saveds + local_size + 15) & ~15) - saveds; in sljit_set_context()
259compiler->local_size = SLJIT_LOCALS_OFFSET + ((local_size + sizeof(sljit_f64) - 1) & ~(sizeof(slji… in sljit_set_context()
261compiler->local_size = SLJIT_LOCALS_OFFSET + ((local_size + sizeof(sljit_sw) - 1) & ~(sizeof(sljit… in sljit_set_context()
266 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_return(struct sljit_compiler *compiler, sljit_s32 op,… in sljit_emit_return() argument
272 CHECK(check_sljit_emit_return(compiler, op, src, srcw)); in sljit_emit_return()
273 SLJIT_ASSERT(compiler->args >= 0); in sljit_emit_return()
275 FAIL_IF(emit_mov_before_return(compiler, op, src, srcw)); in sljit_emit_return()
277 SLJIT_ASSERT(compiler->local_size > 0); in sljit_emit_return()
280 if (compiler->options & SLJIT_F64_ALIGNMENT) in sljit_emit_return()
281 EMIT_MOV(compiler, SLJIT_SP, 0, SLJIT_MEM1(SLJIT_SP), compiler->local_size) in sljit_emit_return()
283 FAIL_IF(emit_cum_binary(compiler, ADD_r_rm, ADD_rm_r, ADD, ADD_EAX_i32, in sljit_emit_return()
284 SLJIT_SP, 0, SLJIT_SP, 0, SLJIT_IMM, compiler->local_size)); in sljit_emit_return()
286 FAIL_IF(emit_cum_binary(compiler, ADD_r_rm, ADD_rm_r, ADD, ADD_EAX_i32, in sljit_emit_return()
287 SLJIT_SP, 0, SLJIT_SP, 0, SLJIT_IMM, compiler->local_size)); in sljit_emit_return()
290 size = 2 + (compiler->scratches > 7 ? (compiler->scratches - 7) : 0) + in sljit_emit_return()
291 (compiler->saveds <= 3 ? compiler->saveds : 3); in sljit_emit_return()
293 if (compiler->args > 2) in sljit_emit_return()
296 if (compiler->args > 0) in sljit_emit_return()
299 inst = (sljit_u8*)ensure_buf(compiler, 1 + size); in sljit_emit_return()
304 if (compiler->saveds > 0 || compiler->scratches > 11) in sljit_emit_return()
306 if (compiler->saveds > 1 || compiler->scratches > 10) in sljit_emit_return()
308 if (compiler->saveds > 2 || compiler->scratches > 9) in sljit_emit_return()
312 if (compiler->args > 2) in sljit_emit_return()
328 static sljit_u8* emit_x86_instruction(struct sljit_compiler *compiler, sljit_s32 size, in emit_x86_instruction() argument
404 inst = (sljit_u8*)ensure_buf(compiler, 1 + inst_size); in emit_x86_instruction()
495 static SLJIT_INLINE sljit_s32 call_with_args(struct sljit_compiler *compiler, sljit_s32 type) in call_with_args() argument
500 inst = (sljit_u8*)ensure_buf(compiler, type >= SLJIT_CALL3 ? 1 + 2 + 1 : 1 + 2); in call_with_args()
509 inst = (sljit_u8*)ensure_buf(compiler, 1 + 4 * (type - SLJIT_CALL0)); in call_with_args()
533 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_enter(struct sljit_compiler *compiler, sljit_s32… in sljit_emit_fast_enter() argument
538 CHECK(check_sljit_emit_fast_enter(compiler, dst, dstw)); in sljit_emit_fast_enter()
549 inst = (sljit_u8*)ensure_buf(compiler, 1 + 1); in sljit_emit_fast_enter()
558 inst = emit_x86_instruction(compiler, 1, 0, 0, dst, dstw); in sljit_emit_fast_enter()
564 SLJIT_API_FUNC_ATTRIBUTE sljit_s32 sljit_emit_fast_return(struct sljit_compiler *compiler, sljit_s3… in sljit_emit_fast_return() argument
569 CHECK(check_sljit_emit_fast_return(compiler, src, srcw)); in sljit_emit_fast_return()
575 inst = (sljit_u8*)ensure_buf(compiler, 1 + 1 + 1); in sljit_emit_fast_return()
582 inst = emit_x86_instruction(compiler, 1, 0, 0, src, srcw); in sljit_emit_fast_return()
587 inst = (sljit_u8*)ensure_buf(compiler, 1 + 1); in sljit_emit_fast_return()
593 inst = (sljit_u8*)ensure_buf(compiler, 1 + 5 + 1); in sljit_emit_fast_return()