mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
![Mike Pall](/assets/img/avatar_default.png)
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.
33 lines
818 B
C
33 lines
818 B
C
/*
|
|
** Snapshot handling.
|
|
** Copyright (C) 2005-2010 Mike Pall. See Copyright Notice in luajit.h
|
|
*/
|
|
|
|
#ifndef _LJ_SNAP_H
|
|
#define _LJ_SNAP_H
|
|
|
|
#include "lj_obj.h"
|
|
#include "lj_jit.h"
|
|
|
|
#if LJ_HASJIT
|
|
LJ_FUNC void lj_snap_add(jit_State *J);
|
|
LJ_FUNC void lj_snap_shrink(jit_State *J);
|
|
LJ_FUNC void lj_snap_regspmap(uint16_t *rsmap, Trace *T, SnapNo snapno);
|
|
LJ_FUNC void lj_snap_restore(jit_State *J, void *exptr);
|
|
LJ_FUNC void lj_snap_grow_buf_(jit_State *J, MSize need);
|
|
LJ_FUNC void lj_snap_grow_map_(jit_State *J, MSize need);
|
|
|
|
static LJ_AINLINE void lj_snap_grow_buf(jit_State *J, MSize need)
|
|
{
|
|
if (LJ_UNLIKELY(need > J->sizesnap)) lj_snap_grow_buf_(J, need);
|
|
}
|
|
|
|
static LJ_AINLINE void lj_snap_grow_map(jit_State *J, MSize need)
|
|
{
|
|
if (LJ_UNLIKELY(need > J->sizesnapmap)) lj_snap_grow_map_(J, need);
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|