mirror of
https://github.com/luau-lang/luau.git
synced 2025-01-19 17:28:06 +00:00
Merge branch 'master' into merge
This commit is contained in:
commit
74b0d004ec
7 changed files with 15 additions and 11 deletions
|
@ -199,6 +199,7 @@ private:
|
|||
cloned->location = p.location;
|
||||
cloned->tags = p.tags;
|
||||
cloned->documentationSymbol = p.documentationSymbol;
|
||||
cloned->typeLocation = p.typeLocation;
|
||||
return *cloned;
|
||||
}
|
||||
else
|
||||
|
@ -210,6 +211,7 @@ private:
|
|||
p.location,
|
||||
p.tags,
|
||||
p.documentationSymbol,
|
||||
p.typeLocation,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -461,6 +463,7 @@ Property clone(const Property& prop, TypeArena& dest, CloneState& cloneState)
|
|||
cloned->location = prop.location;
|
||||
cloned->tags = prop.tags;
|
||||
cloned->documentationSymbol = prop.documentationSymbol;
|
||||
cloned->typeLocation = prop.typeLocation;
|
||||
return *cloned;
|
||||
}
|
||||
else
|
||||
|
@ -472,6 +475,7 @@ Property clone(const Property& prop, TypeArena& dest, CloneState& cloneState)
|
|||
prop.location,
|
||||
prop.tags,
|
||||
prop.documentationSymbol,
|
||||
prop.typeLocation,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 a new issue