Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Roblox
GitHub Repository: Roblox/luau
Path: blob/master/CodeGen/src/EmitCommon.h
2725 views
1
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2
#pragma once
3
4
#include "Luau/Label.h"
5
6
namespace Luau
7
{
8
namespace CodeGen
9
{
10
11
constexpr unsigned kTValueSizeLog2 = 4;
12
constexpr unsigned kLuaNodeSizeLog2 = 5;
13
14
// TKey.tt and TKey.next are packed together in a bitfield
15
constexpr unsigned kOffsetOfTKeyTagNext = 12; // offsetof cannot be used on a bit field
16
constexpr unsigned kTKeyTagBits = 4;
17
constexpr unsigned kTKeyTagMask = (1 << kTKeyTagBits) - 1;
18
19
constexpr unsigned kOffsetOfInstructionC = 3;
20
21
// Leaf functions that are placed in every module to perform common instruction sequences
22
struct ModuleHelpers
23
{
24
// A64/X64
25
Label exitContinueVm;
26
Label exitNoContinueVm;
27
Label exitContinueVmClearNativeFlag;
28
Label updatePcAndContinueInVm; // no reentry
29
Label return_;
30
Label interrupt;
31
32
// A64
33
Label continueCall; // x0: closure
34
};
35
36
} // namespace CodeGen
37
} // namespace Luau
38
39