Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions src/lfunc.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
#include "lobject.h"
#include "lstate.h"

#ifdef USE_YK
uint64_t global_proto_version = 0;
#endif


CClosure *luaF_newCclosure (lua_State *L, int nupvals) {
GCObject *o = luaC_newobj(L, LUA_VCCL, sizeCclosure(nupvals));
Expand Down Expand Up @@ -271,7 +267,6 @@ Proto *luaF_newproto (lua_State *L) {
f->instdebugstrs = NULL;
#endif
f->sizeyklocs = 0;
f->proto_version = global_proto_version;
#endif
return f;
}
Expand All @@ -282,9 +277,6 @@ Proto *luaF_newproto (lua_State *L) {
#endif

void luaF_freeproto (lua_State *L, Proto *f) {
#ifdef USE_YK
global_proto_version++;
#endif
luaM_freearray(L, f->code, f->sizecode);
luaM_freearray(L, f->p, f->sizep);
luaM_freearray(L, f->k, f->sizek);
Expand Down
7 changes: 0 additions & 7 deletions src/lfunc.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@

#include "lobject.h"

#ifdef USE_YK
// Every time a function is deleted, we crank this integer. Thus if two
// `Proto`s are allocated -- at different times! -- at the same address, the
// idempotent `load_inst` function won't consider them to be the same function.
extern uint64_t global_proto_version;
#endif


#define sizeCclosure(n) (cast_int(offsetof(CClosure, upvalue)) + \
cast_int(sizeof(TValue)) * (n))
Expand Down
1 change: 0 additions & 1 deletion src/lobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,6 @@ typedef struct Proto {
char **instdebugstrs; /* One `char *` per instruction in `code` */
#endif
int sizeyklocs; /* size of 'yklocs' and (if present) `instDebugStr` */
uint64_t proto_version; /* What 'Proto Version' was this created under? */
#endif
struct Proto **p; /* functions defined inside the function */
Upvaldesc *upvalues; /* upvalue information */
Expand Down
10 changes: 3 additions & 7 deletions src/lvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1173,8 +1173,8 @@ void luaV_finishOp (lua_State *L) {
#define NOOPT_VAL(X) asm volatile("" : "+r,m"(X) : : "memory");
// Elide instruction lookup.
__attribute__((yk_idempotent))
Instruction load_inst(uint64_t pv, const Instruction *pc) {
NOOPT_VAL(pv);
Instruction load_inst(const Instruction *pc) {
NOOPT_VAL(pc);
return *pc;
}

Expand All @@ -1184,8 +1184,7 @@ Instruction load_inst(uint64_t pv, const Instruction *pc) {
updatebase(ci); /* correct stack */ \
} \
pc = (Instruction *) yk_promote((void *) pc); \
uint64_t pv = yk_promote(cl_proto_version); \
i = load_inst(pv, pc); \
i = load_inst(pc); \
pc++; \
}
#else
Expand Down Expand Up @@ -1216,9 +1215,6 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
trap = L->hookmask;
returning: /* trap already set */
cl = clLvalue(s2v(ci->func.p));
#ifdef USE_YK
uint64_t cl_proto_version = cl->p->proto_version;
#endif
k = cl->p->k;
pc = ci->u.l.savedpc;
if (l_unlikely(trap)) {
Expand Down