feat: optimize runtime (2x+ faster)

This commit is contained in:
samsonium
2026-10-29 05:21:00 +03:00
parent eeca5e653d
commit 7b804b8809
9 changed files with 189 additions and 25 deletions
+30
View File
@@ -0,0 +1,30 @@
// Slot indices follow declaration order, not first-use order.
uint first = 1;
uint second = 2;
second = second + 1;
first = first + second;
if (first != 4)
exit(1);
// Shadowed locals use distinct slots in distinct environments.
uint value = 10;
{
uint value = 20;
value = value + 1;
if (value != 21)
exit(1);
}
if (value != 10)
exit(1);
// Access an outer local from nested loop/body scopes.
uint total = 0;
for (uint i = 0; i < 4; i = i + 1)
{
{
uint nested = i;
total = total + nested;
}
}
if (total != 6)
exit(1);