| Summary: | It's pretty weird that a node that has a side-effect that jettisons the calling code will return normally, and more DFG nodes may be executed, before we finally exit at the invalidation point at the top of the next bytecode instruction | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Filip Pizlo <fpizlo> |
| Component: | JavaScriptCore | Assignee: | Filip Pizlo <fpizlo> |
| Status: | RESOLVED INVALID | ||
| Severity: | Normal | CC: | barraclough, ggaren, mark.lam, mhahnenberg, msaboff, oliver, sam |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | All | ||
| OS: | All | ||
| Bug Depends on: | 128073 | ||
| Bug Blocks: | |||
|
Description
Filip Pizlo
2014-05-29 22:25:24 PDT
It feels like a good way of modeling this is to have the notion of "future possible" state. It is clobbered until the next invalidation point, which unclobbers it... What if the AI modeled this explicitly? We could say that a clobbering node put the whole abstract state in purgatory, which lasts until the next InvalidationPoint. (In reply to comment #2) > What if the AI modeled this explicitly? We could say that a clobbering node put the whole abstract state in purgatory, which lasts until the next InvalidationPoint. Then, if we had an ArrayifyToStructure and no subsequent InvalidationPoint then we would believe that the whole world got clobbered. That's not quite what we want. We want to be able to say that we know for sure that the node being arrayified will now have the structure to which we are arrayifying. Perhaps the solution here is to have the notion of a "clobbered" entry in the structure set... Part of the problem is that invalidation points are separate from the side-effecting operation that caused them. This works because we allow for only very limited code motion. It's only legal to hoist to the top of a bytecode instruction boundary. Maybe that's fine, and we can basically keep things the way they are. If we believe that it's bad to have a region of code between when a side effect happened and when we invalidate, then we should probably do the following: - Merge MovHints with Nodes. A Node may claim to have a MovHint inside it. No separate MovHint node. - Side-effecting nodes will have their own invalidation point inside them, which will do an exit that follows the implicit MovHint. You could imagine making this work by having a late lowering from Nodes with implicit MovHints and implicit InvalidationPoints to Node+MovHint+InvalidationPoint. Meh. I'm not sure that this is profitable in any way over what we have now. The only thing wrong with what we have now is that a checking node can cause state that diverges from what the AI would believe, and we only converge back at the end of the bytecode instruction, at the next InvalidationPoint. I'm going to fix this as part of https://bugs.webkit.org/show_bug.cgi?id=128073. |