luau/CodeGen/src/IrValueLocationTracking.h
aaron 16fbfe912c
Sync to upstream/release/596 (#1050)
- Cleaned up `FFlag::FixFindBindingAtFunctionName`,
`FFlag::LuauNormalizeBlockedTypes`, `FFlag::LuauPCallDebuggerFix`
- Added support for break and continue into control flow analysis
- The old type unification engine will now report a more fine-grained
error at times, indicating that type normalization in particular failed

# New Type Solver

- Refactor of Unifier2, the new unification implementation for Luau
- Completed MVP of new unification implementation
- Dramatically simplified overload selection logic
- Type family reduction can now apply sooner to free types that have
been solved
- Subtyping now supports table indexers
- Generalization now replaces bad generics with unknown

# Native Code Generation

- Reduce stack spills caused by FINDUPVAL and STORE_TAG
- Improve Generate SHL/SHR/SAR/rotates with immediate operands in X64
- Removed redundant case re-check in table lookup fallback

---------

Co-authored-by: Arseny Kapoulkine <arseny.kapoulkine@gmail.com>
Co-authored-by: Vyacheslav Egorov <vegorov@roblox.com>
Co-authored-by: Andy Friesen <afriesen@roblox.com>
Co-authored-by: Lily Brown <lbrown@roblox.com>
2023-09-22 12:12:15 -07:00

38 lines
1 KiB
C++

// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
#pragma once
#include "Luau/IrData.h"
#include <array>
namespace Luau
{
namespace CodeGen
{
struct IrValueLocationTracking
{
IrValueLocationTracking(IrFunction& function);
void setRestoreCallack(void* context, void (*callback)(void* context, IrInst& inst));
void beforeInstLowering(IrInst& inst);
void afterInstLowering(IrInst& inst, uint32_t instIdx);
void recordRestoreOp(uint32_t instIdx, IrOp location);
void invalidateRestoreOp(IrOp location, bool skipValueInvalidation);
void invalidateRestoreVmRegs(int start, int count);
IrFunction& function;
std::array<uint32_t, 256> vmRegValue;
// For range/full invalidations, we only want to visit a limited number of data that we have recorded
int maxReg = 0;
void* restoreCallbackCtx = nullptr;
void (*restoreCallback)(void* context, IrInst& inst) = nullptr;
};
} // namespace CodeGen
} // namespace Luau