diff options
author | Mike Pall <mike> | 2010-01-26 21:49:04 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2010-01-26 21:49:04 +0100 |
commit | 67ca399a30cec05acacd7ea33d5cb0e361f92755 (patch) | |
tree | 335806ea53e2f98a71eb2395baa1d3d7bea352ae /src/lj_snap.h | |
parent | e058714a2e3745a819b77e6b50551e423897026a (diff) | |
download | luajit-67ca399a30cec05acacd7ea33d5cb0e361f92755.tar.gz luajit-67ca399a30cec05acacd7ea33d5cb0e361f92755.tar.bz2 luajit-67ca399a30cec05acacd7ea33d5cb0e361f92755.zip |
Compress snapshots using a simple, extensible 1D-compression.
Typically reduces storage overhead for snapshot maps by 60%.
The extensible format is a prerequisite for the next redesign steps:
Eliminate IR_FRAME and implement return-to-lower-frame.
Diffstat (limited to 'src/lj_snap.h')
-rw-r--r-- | src/lj_snap.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lj_snap.h b/src/lj_snap.h index 776a0bcf..ed7d98a1 100644 --- a/src/lj_snap.h +++ b/src/lj_snap.h | |||
@@ -14,6 +14,19 @@ LJ_FUNC void lj_snap_add(jit_State *J); | |||
14 | LJ_FUNC void lj_snap_shrink(jit_State *J); | 14 | LJ_FUNC void lj_snap_shrink(jit_State *J); |
15 | LJ_FUNC void lj_snap_regspmap(uint16_t *rsmap, Trace *T, SnapNo snapno); | 15 | LJ_FUNC void lj_snap_regspmap(uint16_t *rsmap, Trace *T, SnapNo snapno); |
16 | LJ_FUNC void lj_snap_restore(jit_State *J, void *exptr); | 16 | LJ_FUNC void lj_snap_restore(jit_State *J, void *exptr); |
17 | LJ_FUNC void lj_snap_grow_buf_(jit_State *J, MSize need); | ||
18 | LJ_FUNC void lj_snap_grow_map_(jit_State *J, MSize need); | ||
19 | |||
20 | static LJ_AINLINE void lj_snap_grow_buf(jit_State *J, MSize need) | ||
21 | { | ||
22 | if (LJ_UNLIKELY(need > J->sizesnap)) lj_snap_grow_buf_(J, need); | ||
23 | } | ||
24 | |||
25 | static LJ_AINLINE void lj_snap_grow_map(jit_State *J, MSize need) | ||
26 | { | ||
27 | if (LJ_UNLIKELY(need > J->sizesnapmap)) lj_snap_grow_map_(J, need); | ||
28 | } | ||
29 | |||
17 | #endif | 30 | #endif |
18 | 31 | ||
19 | #endif | 32 | #endif |