Add low-overhead profiler. Part 1: interpreter, low-level C API.

This commit is contained in:
Mike Pall
2013-09-02 01:49:19 +02:00
parent 19c2dd17db
commit 4dce22c40d
18 changed files with 558 additions and 33 deletions

View File

@@ -27,6 +27,7 @@
#include "lj_vm.h"
#include "lj_lex.h"
#include "lj_alloc.h"
#include "luajit.h"
/* -- Stack handling ------------------------------------------------------ */
@@ -237,8 +238,11 @@ LUA_API void lua_close(lua_State *L)
{
global_State *g = G(L);
int i;
setgcrefnull(g->cur_L);
L = mainthread(g); /* Only the main thread can be closed. */
#if LJ_HASPROFILE
luaJIT_profile_stop(L);
#endif
setgcrefnull(g->cur_L);
lj_func_closeuv(L, tvref(L->stack));
lj_gc_separateudata(g, 1); /* Separate udata which have GC metamethods. */
#if LJ_HASJIT