-
5d6df9c9
by Francis De Brabandere at 2026-06-01T23:45:53+02:00
vbscript: Bind local variables and arguments at compile time.
Resolve Dim variables and function arguments to direct indices during
compilation, emitting OP_local instead of OP_ident. This eliminates
runtime wcsicmp scans in lookup_identifier() for the most common case.
This mirrors jscript's OP_local optimization
(dlls/jscript/compile.c: bind_local / emit_identifier).
-
71aede5a
by Francis De Brabandere at 2026-06-01T23:45:53+02:00
vbscript: Factor out assign_local_var from assign_ident.
Extract the REF_VAR body of assign_ident into a new assign_local_var
helper so that future compile-time-bound local assignments can reuse
it instead of duplicating the logic. No functional change.
-
70ab0552
by Francis De Brabandere at 2026-06-01T23:45:53+02:00
vbscript: Bind local variable assignments at compile time.
Emit OP_assign_local and OP_set_local instead of OP_assign_ident and
OP_set_ident when the assignment target is a known local variable or
function argument. This eliminates runtime lookup_identifier() calls
for the most common assignment pattern.
This mirrors jscript's OP_local optimization for identifier writes.
-
b66cc9ef
by Francis De Brabandere at 2026-06-01T23:45:53+02:00
vbscript: Factor out do_for_step and do_incc from interp_step and interp_incc.
Extract the common bodies so that future compile-time-bound For-loop
operations on local variables can reuse them instead of duplicating
the logic. No functional change.
-
db4e0f6b
by Francis De Brabandere at 2026-06-01T23:45:54+02:00
vbscript: Bind For-loop variables at compile time.
Emit OP_step_local and OP_incc_local instead of OP_step and OP_incc
when the loop counter is a known local variable or function argument.
This eliminates runtime lookup_identifier() calls on every loop
iteration.
This mirrors jscript's approach of resolving locals at compile time.
-
9bf5764a
by Francis De Brabandere at 2026-06-01T23:45:54+02:00
vbscript: Bind class properties at compile time.
Resolve class property names to direct indices during compilation of
class methods, emitting OP_local_prop, OP_assign_local_prop, and
OP_set_local_prop instead of the string-based OP_ident/OP_assign_ident/
OP_set_ident. This addresses the FIXME in lookup_identifier() that
noted these should be bound while generating bytecode.
This mirrors jscript's approach of resolving identifiers at compile
time rather than doing runtime string comparisons.