Patch forthcoming. I don't know if this will be profitable yet. Reading IR in Octane, it seems like it might be. Only one way to find out!
Created attachment 338939 [details] it's a start
Created attachment 338952 [details] a bit more
Created attachment 338954 [details] this phase is nuts
Created attachment 338965 [details] I'm slowly putting this phase together
Created attachment 339038 [details] close to written
Created attachment 339050 [details] it might be written
Created attachment 339075 [details] it's starting to compile
Created attachment 339087 [details] it specialized something without crashing or emitting broken code It was a small function, too small to cause interesting compiler problems.
It's a 14% speed-up on the following benchmark. Note that we're duplicating a CheckAdd (which has a full OSR thingy). Note that we're not (yet) unswitching the loop, because the structure load is not hoisted out of the loop. function foo(o) { var result = 0; for (var i = 0; i < 100; ++i) { result += o.f; o.f = i; } return result; } noInline(foo); var before = preciseTime(); for (var i = 0; i < 100000; ++i) { var result = foo(i & 1 ? {f:42} : {e:41, f:42}); if (result != (99 * 98) / 2 + 42) throw "Error: bad result: " + result; } var after = preciseTime(); print("That took " + (after - before) * 1000 + " ms");
Created attachment 339104 [details] it's starting to come to life
Current perf data suggests that this is not a speed-up. Will verify again once I fix some bugs. But this is looking like a negative result, mostly because taildup is too darn good.
Created attachment 339163 [details] mostly works, not a speed-up Still has test failures. But it's definitely not a speed-up, so I'm going to stop working on it.