diff options
author | Mike Pall <mike> | 2012-09-12 11:02:19 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2012-09-12 11:02:19 +0200 |
commit | 039bf85e2610927119254b9c922eab484820e6a7 (patch) | |
tree | 8b7bb6d8df89652e2991b08db3f711f53ab7e849 /src | |
parent | 76ab3709da40dd3cc3ab9223dde33050430cd789 (diff) | |
download | luajit-039bf85e2610927119254b9c922eab484820e6a7.tar.gz luajit-039bf85e2610927119254b9c922eab484820e6a7.tar.bz2 luajit-039bf85e2610927119254b9c922eab484820e6a7.zip |
Add more assertions for stack consistency during recording.
Diffstat (limited to 'src')
-rw-r--r-- | src/lj_dispatch.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lj_dispatch.c b/src/lj_dispatch.c index f795954b..7dc600e8 100644 --- a/src/lj_dispatch.c +++ b/src/lj_dispatch.c | |||
@@ -392,8 +392,12 @@ void LJ_FASTCALL lj_dispatch_ins(lua_State *L, const BCIns *pc) | |||
392 | { | 392 | { |
393 | jit_State *J = G2J(g); | 393 | jit_State *J = G2J(g); |
394 | if (J->state != LJ_TRACE_IDLE) { | 394 | if (J->state != LJ_TRACE_IDLE) { |
395 | #ifdef LUA_USE_ASSERT | ||
396 | ptrdiff_t delta = L->top - L->base; | ||
397 | #endif | ||
395 | J->L = L; | 398 | J->L = L; |
396 | lj_trace_ins(J, pc-1); /* The interpreter bytecode PC is offset by 1. */ | 399 | lj_trace_ins(J, pc-1); /* The interpreter bytecode PC is offset by 1. */ |
400 | lua_assert(L->top - L->base == delta); | ||
397 | } | 401 | } |
398 | } | 402 | } |
399 | #endif | 403 | #endif |
@@ -448,8 +452,12 @@ ASMFunction LJ_FASTCALL lj_dispatch_call(lua_State *L, const BCIns *pc) | |||
448 | #if LJ_HASJIT | 452 | #if LJ_HASJIT |
449 | J->L = L; | 453 | J->L = L; |
450 | if ((uintptr_t)pc & 1) { /* Marker for hot call. */ | 454 | if ((uintptr_t)pc & 1) { /* Marker for hot call. */ |
455 | #ifdef LUA_USE_ASSERT | ||
456 | ptrdiff_t delta = L->top - L->base; | ||
457 | #endif | ||
451 | pc = (const BCIns *)((uintptr_t)pc & ~(uintptr_t)1); | 458 | pc = (const BCIns *)((uintptr_t)pc & ~(uintptr_t)1); |
452 | lj_trace_hot(J, pc); | 459 | lj_trace_hot(J, pc); |
460 | lua_assert(L->top - L->base == delta); | ||
453 | goto out; | 461 | goto out; |
454 | } else if (J->state != LJ_TRACE_IDLE && | 462 | } else if (J->state != LJ_TRACE_IDLE && |
455 | !(g->hookmask & (HOOK_GC|HOOK_VMEVENT))) { | 463 | !(g->hookmask & (HOOK_GC|HOOK_VMEVENT))) { |