mirror of
https://github.com/luau-lang/luau.git
synced 2025-04-19 19:23:49 +01:00
* Adds a currently unused x86-64 assembler as a prerequisite for possible future JIT compilation * Fix a bug in table iteration (closes Possible table iteration bug #504) * Improved warning method when function is used as a type * Fix a bug with unsandboxed iteration with pairs() * Type of coroutine.status() is now a union of value types * Bytecode output for tests/debugging now has labels * Improvements to loop unrolling cost estimation * Report errors when the key obviously doesn't exist in the table
21 lines
779 B
C++
21 lines
779 B
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/Ast.h"
|
|
|
|
namespace Luau
|
|
{
|
|
namespace Compile
|
|
{
|
|
|
|
// cost model: 8 bytes, where first byte is the baseline cost, and the next 7 bytes are discounts for when variable #i is constant
|
|
uint64_t modelCost(AstNode* root, AstLocal* const* vars, size_t varCount);
|
|
|
|
// cost is computed as B - sum(Di * Ci), where B is baseline cost, Di is the discount for each variable and Ci is 1 when variable #i is constant
|
|
int computeCost(uint64_t model, const bool* varsConst, size_t varCount);
|
|
|
|
// get loop trip count or -1 if we can't compute it precisely
|
|
int getTripCount(double from, double to, double step);
|
|
|
|
} // namespace Compile
|
|
} // namespace Luau
|