You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Removed old per-function CacheSlot mechanism (114 lines net deletion) — replaced by per-LTable inline cache
Per-LTable inline cache: 4 entries indexed by key ^ (key >> 17) ^ (key >> 33) % 4, stores (key_payload, entry_idx, table_ver). Uses hash_version (structural changes only) not per-entry version (every write), so read-then-write patterns hit — 64 bytes overhead per LTable
Simplified MultiValue to be trivially destructible: inline_vals[3] (was 8), LState* bump allocator for overflow (was new[]/delete[]), added 2-arg and 3-arg constructors, size reduced from 144 to 72 bytes
Enabled [[clang::musttail]] for Clang alongside existing GCC [[gnu::musttail]]
Removed ScopeGuard from generated function bodies — caller-side shadow_top save/restore instead; block/for-loop ScopeGuards kept for GC correctness
Replaced wyhash64 with key ^ (key >> 17) ^ (key >> 33) for inline cache indexing — cheaper hash function
Coroutine resume() return values now use stack buffer (3 inline) with bump allocator overflow instead of std::vector heap allocation
Removed version field from HashEntry — per-entry versioning replaced by table-level hash_version
Code formatting applied with WebKit style via clang-format
Introduce AnalysisState as a shared data structure between Optimizer and CodeEmitter (7190cd0)
Updated CodeEmitter constructor to accept an AnalysisState reference (7190cd0)
Updated Optimizer constructor to accept an AnalysisState reference (19cf523)
Changed Optimizer::run to be non-static and updated its implementation (19cf523)
Modified yields_number to take AnalysisState as a parameter (19cf523)
Removed unused static variables from CodeEmitter related to optimization analysis (7190cd0)
Integrated AnalysisState into the CLI driver for code generation (e91b04d)
Wired Optimizer into CLI driver — each file now runs escape/numeric analysis before codegen (35f83d4)
Arena tables fall back to heap allocation on growth instead of refusing arena (e949fd2)
Bumped wyhash to 64-bit and grew baked string header to 16 bytes (f70ac4e)
Reduced cs_max from 20 to 4 in AnalysisState for less memory overhead and faster code (14750ed)
Replaced bind_all with set_lazy_funcs for lazy registration of coroutine, os, string, table, and utf8 modules (48cb301)
Record known_table_lengths for tables created with fixed constructors; detect setmetatable, table.insert, and table.remove to populate tables_with_dynamic_length, preventing incorrect # constant folding on mutated tables (bbf80ea)
Optimized string interning at startup: strings ≤6 bytes now use inline LValue::istr() instead of going through the StringPool, eliminating ~60-80% of pool operations (e155f2c)
Long strings (>6 bytes) now use pre-computed slot positions — codegen simulates the hash table insertion at transpile time and emits a PrecomputedEntry array, allowing bulk_fill_precomputed() to write all slots in a single pass with zero linear probing (9b7e6eb)
Fixed hash function mismatch for 7-byte strings: codegen now uses swar_hash_8 for strings ≤8 bytes to match the runtime intern_string() threshold (e155f2c)
Updated the base module for better Lua 5.5 compatibility (d4b52d3)
Enhanced io.read_line() to optionally keep end-of-line characters and improved Lua 5.5 format matching for read operations (d72c6b7)
Shrunk the default coroutine stack from 1MB to 256KB (1b80c38)
Recycled dead coroutine threads+stacks — GC sweep keeps the thread pool (56feaf3)
Reused pooled fibers on Windows via a trampoline loop and a pre_unwind hook (960890a)
Optimized intrinsic math function mappings in the parser for ceil, floor, abs, fmod, and log (b4ca81d)
Used Lua-compatible clx_format_double() in LValue::to_string, tostring, and concat paths (55ed64d, 7387b88, 526775f)
Enhanced LValue::to_string() to support UserData values (bde87cb)
Enhanced math functions for better integer handling and precision (737e69a)
Emitted %lld for integer concat operands and %.17g+.0 for float literals (4e62924)
Stopped treating whole-valued floats as integers via the new is_integer_typed_expr() helper (bf311f1)
Extended table arithmetic codegen detection to t[k]=t[k]-N and t[k]=t[k]/N patterns (2c5b4ed)
Detected t[k]=t[k]+N patterns in codegen, emitted native #, and skipped LValue for known-numeric for-loop bounds (61a1b4d)
Added table_increment/table_multiply and table_decrement/table_divide helpers for t[k]=t[k]±N and t[k]=t[k]*/N (762db3b, c220d1a)
Used correct runtime type sizes for arena optimization instead of bulk sizes (9dd1883)
Replaced get_binary_string with get_string and switched to the StringBuilder arena (7867dda)
Added standalone inline fallbacks for the CLX_INLINE macros so builds work without forced inlining (80314d6)
Stripped ".exe" from output names via replace_extension on Windows (a55c485)
Added
Added an embedded Lua 5.5 VM plus a runtime bridge, enabling --dynamic/load() execution (f8610bb, 5ea465e)
Added a --dynamic proxy for the clx_lua library (c77bfae)
Added VM proxy registration with the clx GC and pacing of the embedded VM's GC (clx_register_vm_proxy, clx_free_vm_proxy_ptr, pace_vm_gc) — VMTableProxy and VMFunction are now marked and registered (7db6d76, 2942a5d, 3247f9e, 77b580a, 50b5a58)
Added standard io streams: io.stdin, io.stderr, and io.stdout (cb8ea45)
Added faster coroutine context switching for x86_64 on Linux via coro_switch_x86_64.s (bd4faa1)
Added SIMD runtime scans for nil/non-nil values (bab993b)
Added LState::alloc_overflow() bump allocator for MultiValue overflow — no individual frees, reset at GC cycle
Added MultiValue(a, b) and MultiValue(a, b, c) constructors for common 2/3-value returns without array allocation
Added file_line_prefix(L) helper for consistent file:line error prefixes
Added native int64_t generation support in CodeEmitter (7190cd0)
Added new dedicated emit methods for each AST node type in CodeEmitter (7190cd0)
Added analysis_state.h to centralize all optimizer analysis data (19cf523)
Added is_purely_integer_expr shared function to analysis_state.h — single source of truth for integer detection, replacing 6 divergent inline lambdas in codegen and 1 in optimizer (ad72242)
Added native int64 codegen for bitwise operations (BitAnd, BitOr, BitXor, Shl, Shr) and BNot when both operands are purely integer (ad72242)
Added per-function memory arena allocator (FuncArena) to reduce GC pressure for short-lived tables (ad72242)
Added escape analysis pass that classifies local tables as escaping (captured, returned, global-stored, function-arg, method-target, grown) vs arena-safe (e949fd2)
Extracted file_read_args(), file_write_args(), make_lines_iter() in io.cpp — replaces duplicated lambdas between make_file and get_std_file
Removed dead code: get_binary_string (pass-through to get_string), visitor.cpp/visitor.h (unused traverse module)
Removed all non-header, non-section-divider single-line comments from src/ and include/ files
Removed unused includes: #include "../codegen/codegen.h" from runtime.cpp, #include "../syntax/parser.h" from optimizer.h, #include <functional> and #include <unordered_map> from codegen.h
Added call_table_op template in codegen for table_increment/decrement/multiply/divide — eliminates 4 structural clone functions
Extracted shared emit_table_op helper in codegen — eliminates duplicated table-op optimization in last_is_call vs generic paths
Added file_line_prefix(L) inline helper in clx_runtime.h — eliminates duplicate string construction in base.cpp and runtime.cpp
Refactored CodeEmitter for better readability and code organization (7190cd0)
Refactored Optimizer code to improve readability (19cf523)
Improved pure integers detection in the optimizer (19cf523)
Consolidated 6 duplicated integer-detection lambdas in codegen into calls to the shared is_purely_integer_expr function (ad72242)
Replaced optimizer's incomplete is_int_expr lambda with the shared function, enabling detection of Mod, And, Or, FloorDiv, ParenExpression, UnaryOp(Minus) as integer-producing (ad72242)
Marked several functions as CLX_INLINE_HOT for performance improvements (6c84a86, fa67b2f)
Replaced hardcoded minimum fields with CLX_ARENA_DEFAULT_FIELDS constant for consistency (247d16b)
Enhanced for-loop and while-loop detection in optimizer (62fdd9a)
Enhanced vector path qualification by disqualifying non-simple keys in array optimizations (37c49e7)
Reverted fib.lua to tree-recursive (O(2^n)) for benchmarking — tail-recursive version is O(n) and too trivial to show CLX speedup
Rewrote coro.lua benchmark to 5M resume/yield cycles for meaningful comparison
Cleaned up helper comments in runtime code (08d8000)
Simplified error handling by using clx::check_table() (d89a7e8)
Switched string functions, read_all(), and make_file() to make_string_pooled() for pooled memory management (c523b46, a18b04f)
Replaced direct table field setting with clx::set_field() for consistency (881dbf2)