Explore ways to generalize sideeffect-free evaluation to allow for some forms of mutation
Categories
(DevTools :: Console, enhancement, P3)
Tracking
(Not tracked)
People
(Reporter: loganfsmyth, Unassigned)
References
(Depends on 1 open bug, Blocks 1 open bug)
Details
Chrome's console supports more generalized eager evaluation than Firefox currently does. For instance, { let obj = {}; obj.prop = 42; obj; } is able to eagerly evaluate to { prop: 42 } even though the code does perform mutation, but it mutates an object that was created during the eager evaluation, which means that it is safe to mutate.
I'm not sure what Brian explored when initially exploring eager-eval's implementation, so I don't know if this was explored and shot down on the SpiderMonkey side, or if it was just not done because it's more work and we wanted the feature out, or what. What we have now is certainly a valuable V1. I just wanted to file this to track possible improvements in the future.
One option would be to track allocations of new object during the course of evaluation, and when a bytecode runs that would cause a object to be mutated, we could check whether the object being mutated is one that was created during evaluation.
Updated•5 years ago
|
Updated•3 years ago
|
Description
•