mirror of
https://github.com/luau-lang/luau.git
synced 2024-11-15 06:15:44 +08:00
Add a prefix to TaggedLuData flag to have it auto-enabled in flags ON mode (#1130)
This commit is contained in:
parent
ff502f0943
commit
e76802f2ce
@ -48,7 +48,7 @@ int luaO_rawequalObj(const TValue* t1, const TValue* t2)
|
||||
case LUA_TBOOLEAN:
|
||||
return bvalue(t1) == bvalue(t2); // boolean true must be 1 !!
|
||||
case LUA_TLIGHTUSERDATA:
|
||||
return pvalue(t1) == pvalue(t2) && (!FFlag::TaggedLuData || lightuserdatatag(t1) == lightuserdatatag(t2));
|
||||
return pvalue(t1) == pvalue(t2) && (!FFlag::LuauTaggedLuData || lightuserdatatag(t1) == lightuserdatatag(t2));
|
||||
default:
|
||||
LUAU_ASSERT(iscollectable(t1));
|
||||
return gcvalue(t1) == gcvalue(t2);
|
||||
@ -71,7 +71,7 @@ int luaO_rawequalKey(const TKey* t1, const TValue* t2)
|
||||
case LUA_TBOOLEAN:
|
||||
return bvalue(t1) == bvalue(t2); // boolean true must be 1 !!
|
||||
case LUA_TLIGHTUSERDATA:
|
||||
return pvalue(t1) == pvalue(t2) && (!FFlag::TaggedLuData || lightuserdatatag(t1) == lightuserdatatag(t2));
|
||||
return pvalue(t1) == pvalue(t2) && (!FFlag::LuauTaggedLuData || lightuserdatatag(t1) == lightuserdatatag(t2));
|
||||
default:
|
||||
LUAU_ASSERT(iscollectable(t1));
|
||||
return gcvalue(t1) == gcvalue(t2);
|
||||
|
@ -5,6 +5,8 @@
|
||||
#include "lua.h"
|
||||
#include "lcommon.h"
|
||||
|
||||
LUAU_FASTFLAG(LuauTaggedLuData)
|
||||
|
||||
/*
|
||||
** Union of all collectible objects
|
||||
*/
|
||||
@ -498,5 +500,3 @@ LUAI_FUNC int luaO_str2d(const char* s, double* result);
|
||||
LUAI_FUNC const char* luaO_pushvfstring(lua_State* L, const char* fmt, va_list argp);
|
||||
LUAI_FUNC const char* luaO_pushfstring(lua_State* L, const char* fmt, ...);
|
||||
LUAI_FUNC const char* luaO_chunkid(char* buf, size_t buflen, const char* source, size_t srclen);
|
||||
|
||||
LUAU_FASTFLAG(TaggedLuData)
|
||||
|
@ -129,7 +129,7 @@ const TString* luaT_objtypenamestr(lua_State* L, const TValue* o)
|
||||
if (ttisstring(type))
|
||||
return tsvalue(type);
|
||||
}
|
||||
else if (FFlag::TaggedLuData && ttislightuserdata(o))
|
||||
else if (FFlag::LuauTaggedLuData && ttislightuserdata(o))
|
||||
{
|
||||
int tag = lightuserdatatag(o);
|
||||
|
||||
|
@ -135,7 +135,7 @@
|
||||
// Does VM support native execution via ExecutionCallbacks? We mostly assume it does but keep the define to make it easy to quantify the cost.
|
||||
#define VM_HAS_NATIVE 1
|
||||
|
||||
LUAU_FASTFLAGVARIABLE(TaggedLuData, false)
|
||||
LUAU_FASTFLAGVARIABLE(LuauTaggedLuData, false)
|
||||
|
||||
LUAU_NOINLINE void luau_callhook(lua_State* L, lua_Hook hook, void* userdata)
|
||||
{
|
||||
@ -1112,7 +1112,7 @@ reentry:
|
||||
VM_NEXT();
|
||||
|
||||
case LUA_TLIGHTUSERDATA:
|
||||
pc += (pvalue(ra) == pvalue(rb) && (!FFlag::TaggedLuData || lightuserdatatag(ra) == lightuserdatatag(rb))) ? LUAU_INSN_D(insn) : 1;
|
||||
pc += (pvalue(ra) == pvalue(rb) && (!FFlag::LuauTaggedLuData || lightuserdatatag(ra) == lightuserdatatag(rb))) ? LUAU_INSN_D(insn) : 1;
|
||||
LUAU_ASSERT(unsigned(pc - cl->l.p->code) < unsigned(cl->l.p->sizecode));
|
||||
VM_NEXT();
|
||||
|
||||
@ -1227,7 +1227,7 @@ reentry:
|
||||
VM_NEXT();
|
||||
|
||||
case LUA_TLIGHTUSERDATA:
|
||||
pc += (pvalue(ra) != pvalue(rb) || (FFlag::TaggedLuData && lightuserdatatag(ra) != lightuserdatatag(rb))) ? LUAU_INSN_D(insn) : 1;
|
||||
pc += (pvalue(ra) != pvalue(rb) || (FFlag::LuauTaggedLuData && lightuserdatatag(ra) != lightuserdatatag(rb))) ? LUAU_INSN_D(insn) : 1;
|
||||
LUAU_ASSERT(unsigned(pc - cl->l.p->code) < unsigned(cl->l.p->sizecode));
|
||||
VM_NEXT();
|
||||
|
||||
|
@ -288,7 +288,7 @@ int luaV_equalval(lua_State* L, const TValue* t1, const TValue* t2)
|
||||
case LUA_TBOOLEAN:
|
||||
return bvalue(t1) == bvalue(t2); // true must be 1 !!
|
||||
case LUA_TLIGHTUSERDATA:
|
||||
return pvalue(t1) == pvalue(t2) && (!FFlag::TaggedLuData || lightuserdatatag(t1) == lightuserdatatag(t2));
|
||||
return pvalue(t1) == pvalue(t2) && (!FFlag::LuauTaggedLuData || lightuserdatatag(t1) == lightuserdatatag(t2));
|
||||
case LUA_TUSERDATA:
|
||||
{
|
||||
tm = get_compTM(L, uvalue(t1)->metatable, uvalue(t2)->metatable, TM_EQ);
|
||||
|
@ -32,7 +32,7 @@ LUAU_FASTFLAG(LuauBufferDefinitions);
|
||||
LUAU_FASTFLAG(LuauCodeGenFixByteLower);
|
||||
LUAU_FASTFLAG(LuauCompileBufferAnnotation);
|
||||
LUAU_FASTFLAG(LuauLoopInterruptFix);
|
||||
LUAU_FASTFLAG(TaggedLuData);
|
||||
LUAU_FASTFLAG(LuauTaggedLuData);
|
||||
LUAU_DYNAMIC_FASTFLAG(LuauStricterUtf8);
|
||||
LUAU_FASTINT(CodegenHeuristicsInstructionLimit);
|
||||
|
||||
@ -1703,7 +1703,7 @@ TEST_CASE("UserdataApi")
|
||||
|
||||
TEST_CASE("LightuserdataApi")
|
||||
{
|
||||
ScopedFastFlag taggedLuData{FFlag::TaggedLuData, true};
|
||||
ScopedFastFlag luauTaggedLuData{FFlag::LuauTaggedLuData, true};
|
||||
|
||||
StateRef globalState(luaL_newstate(), lua_close);
|
||||
lua_State* L = globalState.get();
|
||||
|
Loading…
Reference in New Issue
Block a user