• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt/router/pcre-8.31/sljit/

Lines Matching refs:compiler

2  *    Stack-less Just-In-Time compiler
31 if (SLJIT_UNLIKELY(compiler->error)) \
32 return compiler->error; \
37 if (SLJIT_UNLIKELY(compiler->error)) \
43 if (SLJIT_UNLIKELY(compiler->error)) \
50 return compiler->error; \
62 compiler->error = SLJIT_ERR_ALLOC_FAILED; \
70 compiler->error = SLJIT_ERR_ALLOC_FAILED; \
78 compiler->error = SLJIT_ERR_EX_ALLOC_FAILED; \
201 (i) += compiler->locals_offset;
243 struct sljit_compiler *compiler = (struct sljit_compiler*)SLJIT_MALLOC(sizeof(struct sljit_compiler));
244 if (!compiler)
246 SLJIT_ZEROMEM(compiler, sizeof(struct sljit_compiler));
256 compiler->error = SLJIT_SUCCESS;
258 compiler->buf = (struct sljit_memory_fragment*)SLJIT_MALLOC(BUF_SIZE);
259 compiler->abuf = (struct sljit_memory_fragment*)SLJIT_MALLOC(ABUF_SIZE);
261 if (!compiler->buf || !compiler->abuf) {
262 if (compiler->buf)
263 SLJIT_FREE(compiler->buf);
264 if (compiler->abuf)
265 SLJIT_FREE(compiler->abuf);
266 SLJIT_FREE(compiler);
270 compiler->buf->next = NULL;
271 compiler->buf->used_size = 0;
272 compiler->abuf->next = NULL;
273 compiler->abuf->used_size = 0;
275 compiler->temporaries = -1;
276 compiler->saveds = -1;
279 compiler->args = -1;
283 compiler->cpool = (sljit_uw*)SLJIT_MALLOC(CPOOL_SIZE * sizeof(sljit_uw) + CPOOL_SIZE * sizeof(sljit_ub));
284 if (!compiler->cpool) {
285 SLJIT_FREE(compiler->buf);
286 SLJIT_FREE(compiler->abuf);
287 SLJIT_FREE(compiler);
290 compiler->cpool_unique = (sljit_ub*)(compiler->cpool + CPOOL_SIZE);
291 compiler->cpool_diff = 0xffffffff;
295 compiler->delay_slot = UNMOVABLE_INS;
305 return compiler;
308 SLJIT_API_FUNC_ATTRIBUTE void sljit_free_compiler(struct sljit_compiler *compiler)
313 buf = compiler->buf;
320 buf = compiler->abuf;
328 SLJIT_FREE(compiler->cpool);
330 SLJIT_FREE(compiler);
377 static void* ensure_buf(struct sljit_compiler *compiler, int size)
382 if (compiler->buf->used_size + size <= (int)(BUF_SIZE - sizeof(sljit_uw) - sizeof(void*))) {
383 ret = compiler->buf->memory + compiler->buf->used_size;
384 compiler->buf->used_size += size;
389 new_frag->next = compiler->buf;
390 compiler->buf = new_frag;
395 static void* ensure_abuf(struct sljit_compiler *compiler, int size)
400 if (compiler->abuf->used_size + size <= (int)(ABUF_SIZE - sizeof(sljit_uw) - sizeof(void*))) {
401 ret = compiler->abuf->memory + compiler->abuf->used_size;
402 compiler->abuf->used_size += size;
407 new_frag->next = compiler->abuf;
408 compiler->abuf = new_frag;
413 SLJIT_API_FUNC_ATTRIBUTE void* sljit_alloc_memory(struct sljit_compiler *compiler, int size)
426 return ensure_abuf(compiler, size);
429 static SLJIT_INLINE void reverse_buf(struct sljit_compiler *compiler)
431 struct sljit_memory_fragment *buf = compiler->buf;
442 compiler->buf = prev;
445 static SLJIT_INLINE void set_label(struct sljit_label *label, struct sljit_compiler *compiler)
448 label->size = compiler->size;
449 if (compiler->last_label)
450 compiler->last_label->next = label;
452 compiler->labels = label;
453 compiler->last_label = label;
456 static SLJIT_INLINE void set_jump(struct sljit_jump *jump, struct sljit_compiler *compiler, int flags)
460 if (compiler->last_jump)
461 compiler->last_jump->next = jump;
463 compiler->jumps = jump;
464 compiler->last_jump = jump;
467 static SLJIT_INLINE void set_const(struct sljit_const *const_, struct sljit_compiler *compiler)
470 const_->addr = compiler->size;
471 if (compiler->last_const)
472 compiler->last_const->next = const_;
474 compiler->consts = const_;
475 compiler->last_const = const_;
522 ((r) >= SLJIT_TEMPORARY_REG1 && (r) <= SLJIT_TEMPORARY_REG1 - 1 + compiler->temporaries) || \
523 ((r) >= SLJIT_SAVED_REG1 && (r) <= SLJIT_SAVED_REG1 - 1 + compiler->saveds))
526 SLJIT_ASSERT(compiler->temporaries != -1 && compiler->saveds != -1); \
532 SLJIT_ASSERT((i) >= 0 && (i) < compiler->logical_local_size); \
545 SLJIT_ASSERT(compiler->temporaries != -1 && compiler->saveds != -1); \
549 SLJIT_ASSERT((i) >= 0 && (i) < compiler->logical_local_size); \
591 SLJIT_API_FUNC_ATTRIBUTE void sljit_compiler_verbose(struct sljit_compiler *compiler, FILE* verbose)
593 compiler->verbose = verbose;
618 fprintf(compiler->verbose, "#%" SLJIT_PRINT_D "d", (i)); \
623 fprintf(compiler->verbose, "[%s + %s * %d]", reg_names[(p) & 0xF], reg_names[((p) >> 4)& 0xF], 1 << (i)); \
625 fprintf(compiler->verbose, "[%s + #%" SLJIT_PRINT_D "d]", reg_names[(p) & 0xF], (i)); \
629 fprintf(compiler->verbose, "[%s + %s]", reg_names[(p) & 0xF], reg_names[((p) >> 4)& 0xF]); \
631 fprintf(compiler->verbose, "[%s]", reg_names[(p) & 0xF]); \
635 fprintf(compiler->verbose, "[#%" SLJIT_PRINT_D "d]", (i)); \
637 fprintf(compiler->verbose, "%s", reg_names[p]);
643 fprintf(compiler->verbose, "[%s + %s * %d]", reg_names[(p) & 0xF], reg_names[((p) >> 4)& 0xF], 1 << (i)); \
645 fprintf(compiler->verbose, "[%s + #%" SLJIT_PRINT_D "d]", reg_names[(p) & 0xF], (i)); \
649 fprintf(compiler->verbose, "[%s + %s]", reg_names[(p) & 0xF], reg_names[((p) >> 4)& 0xF]); \
651 fprintf(compiler->verbose, "[%s]", reg_names[(p) & 0xF]); \
655 fprintf(compiler->verbose, "[#%" SLJIT_PRINT_D "d]", (i)); \
657 fprintf(compiler->verbose, "%s", freg_names[p]);
701 static SLJIT_INLINE void check_sljit_generate_code(struct sljit_compiler *compiler)
707 SLJIT_UNUSED_ARG(compiler);
709 SLJIT_ASSERT(compiler->size > 0);
711 jump = compiler->jumps;
720 static SLJIT_INLINE void check_sljit_emit_enter(struct sljit_compiler *compiler, int args, int temporaries, int saveds, int local_size)
723 SLJIT_UNUSED_ARG(compiler);
735 if (SLJIT_UNLIKELY(!!compiler->verbose))
736 fprintf(compiler->verbose, " enter args=%d temporaries=%d saveds=%d local_size=%d\n", args, temporaries, saveds, local_size);
740 static SLJIT_INLINE void check_sljit_set_context(struct sljit_compiler *compiler, int args, int temporaries, int saveds, int local_size)
743 SLJIT_UNUSED_ARG(compiler);
750 if (SLJIT_UNLIKELY(compiler->skip_checks)) {
751 compiler->skip_checks = 0;
762 if (SLJIT_UNLIKELY(!!compiler->verbose))
763 fprintf(compiler->verbose, " set_context args=%d temporaries=%d saveds=%d local_size=%d\n", args, temporaries, saveds, local_size);
767 static SLJIT_INLINE void check_sljit_emit_return(struct sljit_compiler *compiler, int op, int src, sljit_w srcw)
770 SLJIT_UNUSED_ARG(compiler);
784 if (SLJIT_UNLIKELY(!!compiler->verbose)) {
786 fprintf(compiler->verbose, " return\n");
788 fprintf(compiler->verbose, " return %s ", op_names[op]);
790 fprintf(compiler->verbose, "\n");
796 static SLJIT_INLINE void check_sljit_emit_fast_enter(struct sljit_compiler *compiler, int dst, sljit_w dstw)
799 SLJIT_UNUSED_ARG(compiler);
807 if (SLJIT_UNLIKELY(!!compiler->verbose)) {
808 fprintf(compiler->verbose, " fast_enter ");
810 fprintf(compiler->verbose, "\n");
815 static SLJIT_INLINE void check_sljit_emit_fast_return(struct sljit_compiler *compiler, int src, sljit_w srcw)
818 SLJIT_UNUSED_ARG(compiler);
826 if (SLJIT_UNLIKELY(!!compiler->verbose)) {
827 fprintf(compiler->verbose, " fast_return ");
829 fprintf(compiler->verbose, "\n");
834 static SLJIT_INLINE void check_sljit_emit_op0(struct sljit_compiler *compiler, int op)
837 SLJIT_UNUSED_ARG(compiler);
843 if (SLJIT_UNLIKELY(!!compiler->verbose))
844 fprintf(compiler->verbose, " %s%s\n", !(op & SLJIT_INT_OP) ? "" : "i", op_names[GET_OPCODE(op)]);
848 static SLJIT_INLINE void check_sljit_emit_op1(struct sljit_compiler *compiler, int op,
853 SLJIT_UNUSED_ARG(compiler);
861 if (SLJIT_UNLIKELY(compiler->skip_checks)) {
862 compiler->skip_checks = 0;
875 if (SLJIT_UNLIKELY(!!compiler->verbose)) {
876 fprintf(compiler->verbose, " %s%s%s%s%s%s%s%s ", !(op & SLJIT_INT_OP) ? "" : "i", op_names[GET_OPCODE(op)],
879 fprintf(compiler->verbose, ", ");
881 fprintf(compiler->verbose, "\n");
886 static SLJIT_INLINE void check_sljit_emit_op2(struct sljit_compiler *compiler, int op,
892 SLJIT_UNUSED_ARG(compiler);
902 if (SLJIT_UNLIKELY(compiler->skip_checks)) {
903 compiler->skip_checks = 0;
916 if (SLJIT_UNLIKELY(!!compiler->verbose)) {
917 fprintf(compiler->verbose, " %s%s%s%s%s%s%s%s ", !(op & SLJIT_INT_OP) ? "" : "i", op_names[GET_OPCODE(op)],
920 fprintf(compiler->verbose, ", ");
922 fprintf(compiler->verbose, ", ");
924 fprintf(compiler->verbose, "\n");
935 static SLJIT_INLINE void check_sljit_emit_op_custom(struct sljit_compiler *compiler,
938 SLJIT_UNUSED_ARG(compiler);
944 static SLJIT_INLINE void check_sljit_emit_fop1(struct sljit_compiler *compiler, int op,
949 SLJIT_UNUSED_ARG(compiler);
957 if (SLJIT_UNLIKELY(compiler->skip_checks)) {
958 compiler->skip_checks = 0;
971 if (SLJIT_UNLIKELY(!!compiler->verbose)) {
972 fprintf(compiler->verbose, " %s%s%s ", op_names[GET_OPCODE(op)],
975 fprintf(compiler->verbose, ", ");
977 fprintf(compiler->verbose, "\n");
982 static SLJIT_INLINE void check_sljit_emit_fop2(struct sljit_compiler *compiler, int op,
988 SLJIT_UNUSED_ARG(compiler);
1006 if (SLJIT_UNLIKELY(!!compiler->verbose)) {
1007 fprintf(compiler->verbose, " %s ", op_names[GET_OPCODE(op)]);
1009 fprintf(compiler->verbose, ", ");
1011 fprintf(compiler->verbose, ", ");
1013 fprintf(compiler->verbose, "\n");
1018 static SLJIT_INLINE void check_sljit_emit_label(struct sljit_compiler *compiler)
1021 SLJIT_UNUSED_ARG(compiler);
1024 if (SLJIT_UNLIKELY(!!compiler->verbose))
1025 fprintf(compiler->verbose, "label:\n");
1029 static SLJIT_INLINE void check_sljit_emit_jump(struct sljit_compiler *compiler, int type)
1032 SLJIT_UNUSED_ARG(compiler);
1036 if (SLJIT_UNLIKELY(compiler->skip_checks)) {
1037 compiler->skip_checks = 0;
1045 if (SLJIT_UNLIKELY(!!compiler->verbose))
1046 fprintf(compiler->verbose, " jump%s <%s>\n", !(type & SLJIT_REWRITABLE_JUMP) ? "" : "R", jump_names[type & 0xff]);
1050 static SLJIT_INLINE void check_sljit_emit_cmp(struct sljit_compiler *compiler, int type,
1054 SLJIT_UNUSED_ARG(compiler);
1068 if (SLJIT_UNLIKELY(!!compiler->verbose)) {
1069 fprintf(compiler->verbose, " %scmp%s <%s> ", !(type & SLJIT_INT_OP) ? "" : "i", !(type & SLJIT_REWRITABLE_JUMP) ? "" : "R", jump_names[type & 0xff]);
1071 fprintf(compiler->verbose, ", ");
1073 fprintf(compiler->verbose, "\n");
1078 static SLJIT_INLINE void check_sljit_emit_fcmp(struct sljit_compiler *compiler, int type,
1082 SLJIT_UNUSED_ARG(compiler);
1097 if (SLJIT_UNLIKELY(!!compiler->verbose)) {
1098 fprintf(compiler->verbose, " fcmp%s <%s> ", !(type & SLJIT_REWRITABLE_JUMP) ? "" : "R", jump_names[type & 0xff]);
1100 fprintf(compiler->verbose, ", ");
1102 fprintf(compiler->verbose, "\n");
1107 static SLJIT_INLINE void check_sljit_emit_ijump(struct sljit_compiler *compiler, int type, int src, sljit_w srcw)
1110 SLJIT_UNUSED_ARG(compiler);
1120 if (SLJIT_UNLIKELY(!!compiler->verbose)) {
1121 fprintf(compiler->verbose, " ijump <%s> ", jump_names[type]);
1123 fprintf(compiler->verbose, "\n");
1128 static SLJIT_INLINE void check_sljit_emit_cond_value(struct sljit_compiler *compiler, int op, int dst, sljit_w dstw, int type)
1131 SLJIT_UNUSED_ARG(compiler);
1144 if (SLJIT_UNLIKELY(!!compiler->verbose)) {
1145 fprintf(compiler->verbose, " cond_set%s%s <%s> ", !(op & SLJIT_SET_E) ? "" : "E",
1148 fprintf(compiler->verbose, ", <%s>\n", jump_names[type]);
1153 static SLJIT_INLINE void check_sljit_get_local_base(struct sljit_compiler *compiler, int dst, sljit_w dstw, sljit_w offset)
1155 SLJIT_UNUSED_ARG(compiler);
1164 if (SLJIT_UNLIKELY(!!compiler->verbose)) {
1165 fprintf(compiler->verbose, " local_base ");
1167 fprintf(compiler->verbose, ", #%" SLJIT_PRINT_D "d\n", offset);
1172 static SLJIT_INLINE void check_sljit_emit_const(struct sljit_compiler *compiler, int dst, sljit_w dstw, sljit_w init_value)
1175 SLJIT_UNUSED_ARG(compiler);
1184 if (SLJIT_UNLIKELY(!!compiler->verbose)) {
1185 fprintf(compiler->verbose, " const ");
1187 fprintf(compiler->verbose, ", #%" SLJIT_PRINT_D "d\n", init_value);
1192 static SLJIT_INLINE int emit_mov_before_return(struct sljit_compiler *compiler, int op, int src, sljit_w srcw)
1207 compiler->skip_checks = 1;
1209 return sljit_emit_op1(compiler, op, SLJIT_RETURN_REG, 0, src, srcw);
1258 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_cmp(struct sljit_compiler *compiler, int type,
1267 check_sljit_emit_cmp(compiler, type, src1, src1w, src2, src2w);
1315 compiler->skip_checks = 1;
1317 PTR_FAIL_IF(sljit_emit_op2(compiler, SLJIT_SUB | flags | (type & SLJIT_INT_OP),
1320 compiler->skip_checks = 1;
1322 return sljit_emit_jump(compiler, condition | (type & SLJIT_REWRITABLE_JUMP));
1325 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_fcmp(struct sljit_compiler *compiler, int type,
1331 check_sljit_emit_fcmp(compiler, type, src1, src1w, src2, src2w);
1340 compiler->skip_checks = 1;
1342 sljit_emit_fop1(compiler, SLJIT_FCMP | flags, src1, src1w, src2, src2w);
1345 compiler->skip_checks = 1;
1347 return sljit_emit_jump(compiler, condition | (type & SLJIT_REWRITABLE_JUMP));
1354 SLJIT_API_FUNC_ATTRIBUTE int sljit_get_local_base(struct sljit_compiler *compiler, int dst, sljit_w dstw, sljit_w offset)
1357 check_sljit_get_local_base(compiler, dst, dstw, offset);
1361 compiler->skip_checks = 1;
1364 return sljit_emit_op2(compiler, SLJIT_ADD | SLJIT_KEEP_FLAGS, dst, dstw, SLJIT_LOCALS_REG, 0, SLJIT_IMM, offset);
1365 return sljit_emit_op1(compiler, SLJIT_MOV, dst, dstw, SLJIT_LOCALS_REG, 0);
1385 SLJIT_API_FUNC_ATTRIBUTE void sljit_free_compiler(struct sljit_compiler *compiler)
1387 SLJIT_UNUSED_ARG(compiler);
1391 SLJIT_API_FUNC_ATTRIBUTE void* sljit_alloc_memory(struct sljit_compiler *compiler, int size)
1393 SLJIT_UNUSED_ARG(compiler);
1400 SLJIT_API_FUNC_ATTRIBUTE void sljit_compiler_verbose(struct sljit_compiler *compiler, FILE* verbose)
1402 SLJIT_UNUSED_ARG(compiler);
1408 SLJIT_API_FUNC_ATTRIBUTE void* sljit_generate_code(struct sljit_compiler *compiler)
1410 SLJIT_UNUSED_ARG(compiler);
1421 SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_enter(struct sljit_compiler *compiler, int args, int temporaries, int saveds, int local_size)
1423 SLJIT_UNUSED_ARG(compiler);
1432 SLJIT_API_FUNC_ATTRIBUTE void sljit_set_context(struct sljit_compiler *compiler, int args, int temporaries, int saveds, int local_size)
1434 SLJIT_UNUSED_ARG(compiler);
1442 SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_return(struct sljit_compiler *compiler, int op, int src, sljit_w srcw)
1444 SLJIT_UNUSED_ARG(compiler);
1452 SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_fast_enter(struct sljit_compiler *compiler, int dst, sljit_w dstw, int args, int temporaries, int saveds, int local_size)
1454 SLJIT_UNUSED_ARG(compiler);
1465 SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_fast_return(struct sljit_compiler *compiler, int src, sljit_w srcw)
1467 SLJIT_UNUSED_ARG(compiler);
1474 SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_op0(struct sljit_compiler *compiler, int op)
1476 SLJIT_UNUSED_ARG(compiler);
1482 SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_op1(struct sljit_compiler *compiler, int op,
1486 SLJIT_UNUSED_ARG(compiler);
1496 SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_op2(struct sljit_compiler *compiler, int op,
1501 SLJIT_UNUSED_ARG(compiler);
1519 SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_op_custom(struct sljit_compiler *compiler,
1522 SLJIT_UNUSED_ARG(compiler);
1535 SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_fop1(struct sljit_compiler *compiler, int op,
1539 SLJIT_UNUSED_ARG(compiler);
1549 SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_fop2(struct sljit_compiler *compiler, int op,
1554 SLJIT_UNUSED_ARG(compiler);
1566 SLJIT_API_FUNC_ATTRIBUTE struct sljit_label* sljit_emit_label(struct sljit_compiler *compiler)
1568 SLJIT_UNUSED_ARG(compiler);
1573 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_jump(struct sljit_compiler *compiler, int type)
1575 SLJIT_UNUSED_ARG(compiler);
1581 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_cmp(struct sljit_compiler *compiler, int type,
1585 SLJIT_UNUSED_ARG(compiler);
1595 SLJIT_API_FUNC_ATTRIBUTE struct sljit_jump* sljit_emit_fcmp(struct sljit_compiler *compiler, int type,
1599 SLJIT_UNUSED_ARG(compiler);
1623 SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_ijump(struct sljit_compiler *compiler, int type, int src, sljit_w srcw)
1625 SLJIT_UNUSED_ARG(compiler);
1633 SLJIT_API_FUNC_ATTRIBUTE int sljit_emit_cond_value(struct sljit_compiler *compiler, int op, int dst, sljit_w dstw, int type)
1635 SLJIT_UNUSED_ARG(compiler);
1644 SLJIT_API_FUNC_ATTRIBUTE int sljit_get_local_base(struct sljit_compiler *compiler, int dst, sljit_w dstw, sljit_w offset)
1646 SLJIT_UNUSED_ARG(compiler);
1654 SLJIT_API_FUNC_ATTRIBUTE struct sljit_const* sljit_emit_const(struct sljit_compiler *compiler, int dst, sljit_w dstw, sljit_w initval)
1656 SLJIT_UNUSED_ARG(compiler);