diff options
| author | Mike Pall <mike> | 2015-04-28 20:46:59 +0200 |
|---|---|---|
| committer | Mike Pall <mike> | 2015-04-28 20:52:24 +0200 |
| commit | c2924c3e1d17ffe469a654233481d7be1248d7e0 (patch) | |
| tree | a9e16feae05467c271eed06427c75ad57d337e96 /src | |
| parent | 74caac97ae757131f126f0a690ab460ff44ccc52 (diff) | |
| download | luajit-c2924c3e1d17ffe469a654233481d7be1248d7e0.tar.gz luajit-c2924c3e1d17ffe469a654233481d7be1248d7e0.tar.bz2 luajit-c2924c3e1d17ffe469a654233481d7be1248d7e0.zip | |
Disable trace stitching (for now) due to a design mistake.
Thanks to Elias Hogstvedt for finding a test case for a well known,
but hard to track down issue with trace stitching.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lj_ffrecord.c | 32 | ||||
| -rw-r--r-- | src/lj_traceerr.h | 2 |
2 files changed, 34 insertions, 0 deletions
diff --git a/src/lj_ffrecord.c b/src/lj_ffrecord.c index e17f6818..318329d0 100644 --- a/src/lj_ffrecord.c +++ b/src/lj_ffrecord.c | |||
| @@ -96,6 +96,13 @@ static ptrdiff_t results_wanted(jit_State *J) | |||
| 96 | return -1; | 96 | return -1; |
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | #ifdef LUAJIT_TRACE_STITCHING | ||
| 100 | /* This feature is disabled for now due to a design mistake. Sorry. | ||
| 101 | ** | ||
| 102 | ** It causes unpredictable behavior and crashes when a full trace flush | ||
| 103 | ** happens with a stitching continuation still in the stack somewhere. | ||
| 104 | */ | ||
| 105 | |||
| 99 | /* Trace stitching: add continuation below frame to start a new trace. */ | 106 | /* Trace stitching: add continuation below frame to start a new trace. */ |
| 100 | static void recff_stitch(jit_State *J) | 107 | static void recff_stitch(jit_State *J) |
| 101 | { | 108 | { |
| @@ -174,6 +181,31 @@ static void LJ_FASTCALL recff_nyi(jit_State *J, RecordFFData *rd) | |||
| 174 | 181 | ||
| 175 | /* Must stop the trace for classic C functions with arbitrary side-effects. */ | 182 | /* Must stop the trace for classic C functions with arbitrary side-effects. */ |
| 176 | #define recff_c recff_nyi | 183 | #define recff_c recff_nyi |
| 184 | #else | ||
| 185 | /* Fallback handler for fast functions that are not recorded (yet). */ | ||
| 186 | LJ_NORET static void recff_nyi(jit_State *J, RecordFFData *rd) | ||
| 187 | { | ||
| 188 | setfuncV(J->L, &J->errinfo, J->fn); | ||
| 189 | lj_trace_err_info(J, LJ_TRERR_NYIFF); | ||
| 190 | UNUSED(rd); | ||
| 191 | } | ||
| 192 | |||
| 193 | /* Throw error for unsupported variant of fast function. */ | ||
| 194 | LJ_NORET static void recff_nyiu(jit_State *J, RecordFFData *rd) | ||
| 195 | { | ||
| 196 | setfuncV(J->L, &J->errinfo, J->fn); | ||
| 197 | lj_trace_err_info(J, LJ_TRERR_NYIFFU); | ||
| 198 | UNUSED(rd); | ||
| 199 | } | ||
| 200 | |||
| 201 | /* Must abort the trace for classic C functions with arbitrary side-effects. */ | ||
| 202 | LJ_NORET static void recff_c(jit_State *J, RecordFFData *rd) | ||
| 203 | { | ||
| 204 | setfuncV(J->L, &J->errinfo, J->fn); | ||
| 205 | lj_trace_err_info(J, LJ_TRERR_NYICF); | ||
| 206 | UNUSED(rd); | ||
| 207 | } | ||
| 208 | #endif | ||
| 177 | 209 | ||
| 178 | /* Emit BUFHDR for the global temporary buffer. */ | 210 | /* Emit BUFHDR for the global temporary buffer. */ |
| 179 | static TRef recff_bufhdr(jit_State *J) | 211 | static TRef recff_bufhdr(jit_State *J) |
diff --git a/src/lj_traceerr.h b/src/lj_traceerr.h index 6b377cb0..5a2fe8bb 100644 --- a/src/lj_traceerr.h +++ b/src/lj_traceerr.h | |||
| @@ -24,6 +24,8 @@ TREDEF(BADTYPE, "bad argument type") | |||
| 24 | TREDEF(CJITOFF, "JIT compilation disabled for function") | 24 | TREDEF(CJITOFF, "JIT compilation disabled for function") |
| 25 | TREDEF(CUNROLL, "call unroll limit reached") | 25 | TREDEF(CUNROLL, "call unroll limit reached") |
| 26 | TREDEF(DOWNREC, "down-recursion, restarting") | 26 | TREDEF(DOWNREC, "down-recursion, restarting") |
| 27 | TREDEF(NYICF, "NYI: C function %p") | ||
| 28 | TREDEF(NYIFF, "NYI: FastFunc %s") | ||
| 27 | TREDEF(NYIFFU, "NYI: unsupported variant of FastFunc %s") | 29 | TREDEF(NYIFFU, "NYI: unsupported variant of FastFunc %s") |
| 28 | TREDEF(NYIRETL, "NYI: return to lower frame") | 30 | TREDEF(NYIRETL, "NYI: return to lower frame") |
| 29 | 31 | ||
