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
feat: Add conditional debug template and computed goto optimization
- Add debug() template that compiles to nothing in release builds
- Add {.computedGoto.} pragma to VM interpreter loop
- Sync sieve.hrd benchmark to use limit=500 for consistent testing
The debug template uses when not defined(release) to completely
eliminate debug calls at compile time in production builds.
# Check captured environment FIRST - captured variables from outer lexical scope
596
594
# should take precedence over local temporaries in the current activation
597
595
# This is the key difference: blocks capture variables from where they were defined,
598
-
# not where they're executed
599
-
if activation.currentMethod !=niland activation.currentMethod.capturedEnvInitialized and activation.currentMethod.capturedEnv.len >0:
596
+
# not where they're executed. IMPORTANT: Only apply to blocks, NOT methods.
597
+
# Methods should access slots on the receiver, not captured lexical variables.
598
+
if activation.currentMethod !=niland activation.currentMethod.capturedEnvInitialized and activation.currentMethod.capturedEnv.len >0andnot activation.currentMethod.isMethod:
600
599
if name in activation.currentMethod.capturedEnv:
601
600
let value = activation.currentMethod.capturedEnv[name].value
if activation.currentMethod !=niland activation.currentMethod.capturedEnvInitialized and activation.currentMethod.capturedEnv.len >0:
642
+
# Check captured environment - IMPORTANT: Only for blocks, NOT methods
643
+
# Methods should access slots on the receiver, not captured lexical variables
644
+
if activation.currentMethod !=niland activation.currentMethod.capturedEnvInitialized and activation.currentMethod.capturedEnv.len >0andnot activation.currentMethod.isMethod:
645
645
if name in activation.currentMethod.capturedEnv:
646
646
let value = activation.currentMethod.capturedEnv[name].value
0 commit comments