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;
|
|
|
|
|
2023-05-19 20:37:30 +01:00
|
|
|
// TKey.tt and TKey.next are packed together in a bitfield
|
2023-07-14 19:08:53 +01:00
|
|
|
constexpr unsigned kOffsetOfTKeyTagNext = 12; // offsetof cannot be used on a bit field
|
2023-05-19 20:37:30 +01:00
|
|
|
constexpr unsigned kTKeyTagBits = 4;
|
|
|
|
constexpr unsigned kTKeyTagMask = (1 << kTKeyTagBits) - 1;
|
|
|
|
|
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-07-07 21:10:48 +01:00
|
|
|
Label exitContinueVmClearNativeFlag;
|
2023-08-11 15:42:37 +01:00
|
|
|
Label updatePcAndContinueInVm; // no reentry
|
2023-06-09 18:08:00 +01:00
|
|
|
Label return_;
|
2023-06-16 18:35:18 +01:00
|
|
|
Label interrupt;
|
2023-03-31 19:42:49 +01:00
|
|
|
|
|
|
|
// A64
|
2023-10-06 20:02:32 +01:00
|
|
|
Label continueCall; // x0: closure
|
2023-03-03 20:21:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace CodeGen
|
|
|
|
} // namespace Luau
|