Bug 1830195 Comment 12 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

[This comment in particular](https://bugs.webkit.org/show_bug.cgi?id=124630#c4) seems like a good description of their approach:
```
It seems that the best way to do this is to combine watchpointing the fact that a scope is instantiated once and watchpointing the fact that the variable won't be assigned again.

Basically, we start out by not watching closure variables.  But we do set a watchpoint on whether create_activation was called once or more than once.

If in the DFG we encounter a load from a scoped variable and:

- We know that this scope has only been created once, and

- We know that the variable either has no watchpoint yet or has a still-valid watchpoint set, then:

We can create a watchpoint set for the variable (if necessary) and register watchpoints on both the created-once scope watchpoint set and the variable watchpoint set.

Then we just need to figure out how best to trigger a fireAll() when someone writes to the closure variable.
```
Converting to SM terminology, I think Scope -> Environment and Watchpoint -> Fuse.
[This comment in particular](https://bugs.webkit.org/show_bug.cgi?id=124630#c4) seems like a good description of their approach:

> It seems that the best way to do this is to combine watchpointing the fact that a scope is instantiated once and watchpointing the fact that the variable won't be assigned again.
> Basically, we start out by not watching closure variables.  But we do set a watchpoint on whether create_activation was called once or more than once.
> If in the DFG we encounter a load from a scoped variable and:
>  - We know that this scope has only been created once, and
>  - We know that the variable either has no watchpoint yet or has a still-valid watchpoint set, then:
>  - We can create a watchpoint set for the variable (if necessary) and register watchpoints on both the created-once scope watchpoint set and the variable watchpoint set.
> 
> Then we just need to figure out how best to trigger a fireAll() when someone writes to the closure variable.

Converting to SM terminology, I think Scope -> Environment and Watchpoint -> Fuse.

Back to Bug 1830195 Comment 12