luau/CodeGen/src/EmitCommon.h

38 lines
977 B
C
Raw Normal View History

2023-03-03 15:45:38 +02: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 11:59:59 -07:00
// TKey.tt and TKey.next are packed together in a bitfield
2023-07-14 08:57:16 -07:00
constexpr unsigned kOffsetOfTKeyTagNext = 12; // offsetof cannot be used on a bit field
2023-05-19 11:59:59 -07:00
constexpr unsigned kTKeyTagBits = 4;
constexpr unsigned kTKeyTagMask = (1 << kTKeyTagBits) - 1;
2023-03-03 15:45:38 +02:00
constexpr unsigned kOffsetOfInstructionC = 3;
// Leaf functions that are placed in every module to perform common instruction sequences
struct ModuleHelpers
{
2023-03-31 15:21:14 +03:00
// A64/X64
2023-03-03 15:45:38 +02:00
Label exitContinueVm;
Label exitNoContinueVm;
2023-07-07 10:14:35 -07:00
Label exitContinueVmClearNativeFlag;
2023-08-11 15:55:30 +03:00
Label updatePcAndContinueInVm; // no reentry
2023-06-09 15:20:36 +03:00
Label return_;
2023-06-16 10:01:18 -07:00
Label interrupt;
2023-03-31 15:21:14 +03:00
// A64
2023-10-06 10:31:16 -07:00
Label continueCall; // x0: closure
2023-03-03 15:45:38 +02:00
};
} // namespace CodeGen
} // namespace Luau