mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +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
48 lines
1.3 KiB
C
48 lines
1.3 KiB
C
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
|
|
// This code is based on Lua 5.x implementation licensed under MIT License; see lua_LICENSE.txt for details
|
|
#pragma once
|
|
|
|
#include <limits.h>
|
|
#include <stdint.h>
|
|
|
|
#include "luaconf.h"
|
|
|
|
#include "Luau/Common.h"
|
|
|
|
typedef LUAI_USER_ALIGNMENT_T L_Umaxalign;
|
|
|
|
/* internal assertions for in-house debugging */
|
|
#define check_exp(c, e) (LUAU_ASSERT(c), (e))
|
|
#define api_check(l, e) LUAU_ASSERT(e)
|
|
|
|
#ifndef cast_to
|
|
#define cast_to(t, exp) ((t)(exp))
|
|
#endif
|
|
|
|
#define cast_byte(i) cast_to(uint8_t, (i))
|
|
#define cast_num(i) cast_to(double, (i))
|
|
#define cast_int(i) cast_to(int, (i))
|
|
|
|
/*
|
|
** type for virtual-machine instructions
|
|
** must be an unsigned with (at least) 4 bytes (see details in lopcodes.h)
|
|
*/
|
|
typedef uint32_t Instruction;
|
|
|
|
/*
|
|
** macro to control inclusion of some hard tests on stack reallocation
|
|
*/
|
|
#if defined(HARDSTACKTESTS) && HARDSTACKTESTS
|
|
#define condhardstacktests(x) (x)
|
|
#else
|
|
#define condhardstacktests(x) ((void)0)
|
|
#endif
|
|
|
|
/*
|
|
** macro to control inclusion of some hard tests on garbage collection
|
|
*/
|
|
#if defined(HARDMEMTESTS) && HARDMEMTESTS
|
|
#define condhardmemtests(x, l) (HARDMEMTESTS >= l ? (x) : (void)0)
|
|
#else
|
|
#define condhardmemtests(x, l) ((void)0)
|
|
#endif
|