**New opcodes:** - `OP_local` / `OP_assign_local` / `OP_set_local` read/write local vars and args by index - `OP_local_prop` / `OP_assign_local_prop` / `OP_set_local_prop` read/write class properties by index - `OP_step_local` / `OP_incc_local` For-loop step/increment with indexed counter - `OP_enumnext_local` For-Each iteration with indexed loop variable This mirrors jscript's `OP_local` / `bind_local()` optimization (`dlls/jscript/compile.c`) and addresses the FIXME in `lookup_identifier()` noting that class property access should be bound at compile time. Names that cannot be resolved at compile time (globals in Execute/ExecuteGlobal code, dynamic vars, host objects) continue to use the existing string-based path. ### Local variable / argument / class property access (1M iterations, 10 reads per iteration) | Benchmark | Windows (VM) | Wine master | Wine (6 commits) | **Speedup** | vs Windows | |-----------|-------------|-------------|-------------------|---------|------------| | Local vars | 156 ms | 10,134 ms | 964 ms | **10.5×** | 6.2× slower | | Arguments | 171 ms | 6,656 ms | 968 ms | **6.9×** | 5.7× slower | | Class props | 265 ms | 6,673 ms | 957 ms | **7.0×** | 3.6× slower | ### For-loop variants (10M iterations) | Benchmark | Windows (VM) | Wine master | Wine (6 commits) | **Speedup** | vs Windows | |-----------|-------------|-------------|-------------------|---------|------------| | Empty For | 117 ms | 6,222 ms | 1,535 ms | **4.1×** | 13× slower | | For + assign | 203 ms | 10,226 ms | 1,734 ms | **5.9×** | 8.5× slower | | Do-While manual | 437 ms | 8,773 ms | 1,828 ms | **4.8×** | 4.2× slower | | For Step 2 | 62 ms | 6,125 ms | 1,542 ms | **4.0×** | 25× slower | | Nested For | 125 ms | 7,742 ms | 1,554 ms | **5.0×** | 12× slower | | For local Sub | 109 ms | 3,062 ms | 1,542 ms | **2.0×** | 14× slower | | For R8 counter | 203 ms | 10,882 ms | 1,484 ms | **7.3×** | 7.3× slower | | For-Each array | 7 ms | 6,339 ms | **160 ms** | **40×** | 23× slower | The remaining ~4–13× gap vs Windows in For-loops is from `VarAdd`/`VarCmp` going through full `VariantChangeTypeEx` machinery (including locale alloc/free per call). A separate MR ([!10529](https://gitlab.winehq.org/wine/wine/-/merge_requests/10529)) adds I2/I4 fast paths in oleaut32 that bring integer loops within 1.2–1.9× of Windows when combined with this branch. -- v5: vbscript: Fast-path For-Each iteration over SAFEARRAY. https://gitlab.winehq.org/wine/wine/-/merge_requests/10515