The idea seems correct, but I wonder if adding yet another tree is the right direction. We already have separate trees for variables and functions in `ScriptDisp`; this change would make it three trees with exclusive keys. Maybe we should consolidate into a single tree instead, storing both the entry type (variable, function or host property) and a payload that depends on it (`dynamic_var_t *`, `function_t *` or `DISPID`). I suspect that what you observed in !10393 is a result of populating this kind of tree when linking global code. Further down the road, this type of unified representation could make global variable binding much easier. The compiler could emit local indexes that we would then bind to a corresponding tree entry in `exec_global_code`. It should be also a bit faster. Does that seem reasonable? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11136#note_143365