diff options
author | Mike Pall <mike> | 2010-09-12 01:37:02 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2010-09-12 01:44:13 +0200 |
commit | c2c08ba9b33ed89feb190aa3484bf2360db779a0 (patch) | |
tree | f657ced04905297363784bdaf15e5855b2c6b6b0 /src/lj_snap.c | |
parent | b72ae54dc0d2bf63f23f0b9a47238ea96b0239ed (diff) | |
download | luajit-c2c08ba9b33ed89feb190aa3484bf2360db779a0.tar.gz luajit-c2c08ba9b33ed89feb190aa3484bf2360db779a0.tar.bz2 luajit-c2c08ba9b33ed89feb190aa3484bf2360db779a0.zip |
Record calls to vararg functions.
This loop is now roughly 1000x faster than the Lua interpreter:
local function f(a,b,...) end; for i=1,2e8 do f(1,2,i) end
Yet another silly microbenchmark -- I know.
Diffstat (limited to 'src/lj_snap.c')
-rw-r--r-- | src/lj_snap.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lj_snap.c b/src/lj_snap.c index 7c26bfb9..64db5288 100644 --- a/src/lj_snap.c +++ b/src/lj_snap.c | |||
@@ -87,15 +87,14 @@ static void snapshot_framelinks(jit_State *J, SnapEntry *map) | |||
87 | if (frame_islua(frame)) { | 87 | if (frame_islua(frame)) { |
88 | map[f++] = SNAP_MKPC(frame_pc(frame)); | 88 | map[f++] = SNAP_MKPC(frame_pc(frame)); |
89 | frame = frame_prevl(frame); | 89 | frame = frame_prevl(frame); |
90 | } else if (frame_ispcall(frame)) { | ||
91 | map[f++] = SNAP_MKFTSZ(frame_ftsz(frame)); | ||
92 | frame = frame_prevd(frame); | ||
93 | } else if (frame_iscont(frame)) { | 90 | } else if (frame_iscont(frame)) { |
94 | map[f++] = SNAP_MKFTSZ(frame_ftsz(frame)); | 91 | map[f++] = SNAP_MKFTSZ(frame_ftsz(frame)); |
95 | map[f++] = SNAP_MKPC(frame_contpc(frame)); | 92 | map[f++] = SNAP_MKPC(frame_contpc(frame)); |
96 | frame = frame_prevd(frame); | 93 | frame = frame_prevd(frame); |
97 | } else { | 94 | } else { |
98 | lua_assert(0); | 95 | lua_assert(!frame_isc(frame)); |
96 | map[f++] = SNAP_MKFTSZ(frame_ftsz(frame)); | ||
97 | frame = frame_prevd(frame); | ||
99 | } | 98 | } |
100 | } | 99 | } |
101 | lua_assert(f == (MSize)(1 + J->framedepth)); | 100 | lua_assert(f == (MSize)(1 + J->framedepth)); |