#define BYTECODE_INTERPRETER_START GOTO_OP;
#define BYTECODE_INTERPRETER_END
-#define CASE_OP(x) L_##x: SOP_IN(OP_##x); sbegin = s; MATCH_DEBUG_OUT(1)
+#define CASE_OP(x) L_##x: SOP_IN(OP_##x); sbegin = s; MATCH_DEBUG_OUT(0)
#define DEFAULT_OP /* L_DEFAULT: */
#define NEXT_OP sprev = sbegin; JUMP_OP
#define JUMP_OP GOTO_OP
#ifdef ONIG_DEBUG_MATCH
#define MATCH_DEBUG_OUT(offset) do {\
- UChar *xp, *q, *bp, buf[50];\
+ Operation *xp;\
+ UChar *q, *bp, buf[50];\
int len, spos;\
spos = IS_NOT_NULL(s) ? (int )(s - str) : -1;\
xp = p - (offset);\
if (xp == FinishCode)\
fprintf(stderr, "----: ");\
else\
- fprintf(stderr, "%4d: ", (int )(xp - reg->p));\
- onig_print_compiled_byte_code(stderr, xp, reg->p, encode);\
+ fprintf(stderr, "%4d: ", (int )(xp - reg->ops));\
+ onig_print_compiled_byte_code(stderr, xp, reg->ops, encode);\
fprintf(stderr, "\n");\
} while(0);
#else
MatchArg* msa)
{
+#ifdef ONIG_DEBUG
+#if defined(USE_THREADED_CODE) && defined(USE_DIRECT_THREADED_CODE)
+ static Operation FinishCode[] = { {.opcode=OP_FINISH, .opaddr=&&L_FINISH } };
+#else
+ static Operation FinishCode[] = { {OP_FINISH } };
+#endif
+#else
#if defined(USE_THREADED_CODE) && defined(USE_DIRECT_THREADED_CODE)
- static Operation FinishCode[] = { { {.opaddr=&&L_FINISH} } };
+ static Operation FinishCode[] = { { {.opcode=OP_FINISH, .opaddr=&&L_FINISH} } };
#else
static Operation FinishCode[] = { { {OP_FINISH} } };
#endif
+#endif
#ifdef USE_THREADED_CODE
static const void *opcode_to_label[] = {
typedef struct {
+#ifdef ONIG_DEBUG
+ enum OpCode opcode;
+ const void* opaddr;
+#else
union {
enum OpCode opcode;
const void* opaddr;
};
+#endif
union {
struct {
UChar* s;
struct re_pattern_buffer {
/* common members of BBuf(bytes-buffer) */
-#if 0
- unsigned char* p; /* compiled pattern */
- unsigned int used; /* used space for p */
- unsigned int alloc; /* allocated space for p */
-#else
Operation* ops;
Operation* ops_curr;
unsigned int ops_used; /* used space for ops */
unsigned int ops_alloc; /* allocated space for ops */
-#endif
int num_mem; /* used memory(...) num counted from 1 */
int num_repeat; /* OP_REPEAT/OP_REPEAT_NG id-counter */