2023-03-03 20:21:14 +00:00
|
|
|
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Luau/Label.h"
|
|
|
|
|
|
|
|
namespace Luau
|
|
|
|
{
|
|
|
|
namespace CodeGen
|
|
|
|
{
|
|
|
|
|
|
|
|
constexpr unsigned kTValueSizeLog2 = 4;
|
|
|
|
constexpr unsigned kLuaNodeSizeLog2 = 5;
|
|
|
|
constexpr unsigned kLuaNodeTagMask = 0xf;
|
|
|
|
constexpr unsigned kNextBitOffset = 4;
|
|
|
|
|
2023-04-14 19:06:22 +01:00
|
|
|
constexpr unsigned kOffsetOfTKeyTag = 12; // offsetof cannot be used on a bit field
|
|
|
|
constexpr unsigned kOffsetOfTKeyNext = 12; // offsetof cannot be used on a bit field
|
2023-03-03 20:21:14 +00:00
|
|
|
constexpr unsigned kOffsetOfInstructionC = 3;
|
|
|
|
|
|
|
|
// Leaf functions that are placed in every module to perform common instruction sequences
|
|
|
|
struct ModuleHelpers
|
|
|
|
{
|
2023-03-31 19:42:49 +01:00
|
|
|
// A64/X64
|
2023-03-03 20:21:14 +00:00
|
|
|
Label exitContinueVm;
|
|
|
|
Label exitNoContinueVm;
|
2023-03-31 19:42:49 +01:00
|
|
|
|
|
|
|
// X64
|
2023-03-03 20:21:14 +00:00
|
|
|
Label continueCallInVm;
|
2023-03-31 19:42:49 +01:00
|
|
|
|
|
|
|
// A64
|
|
|
|
Label reentry; // x0: closure
|
|
|
|
Label interrupt; // x0: pc offset, x1: return address, x2: interrupt
|
2023-03-03 20:21:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace CodeGen
|
|
|
|
} // namespace Luau
|