On Apr 20, 2010, at 2:27 AM, Zoltan Herczeg wrote:
using getter setters and joined objects makes possible many sick JS constructions:
function bar() { var a = 3; foo(); print(a + 7 ); // will be 11
function foo() { a++; } } bar();
That's why you need dataflow information - you have to assume locals may be killed when you have any nested functions and you call a function. If you also do free variable analysis then you could figure out a subset of locals that might be killed. - Maciej
On Apr 20, 2010, at 2:11 AM, Kent Hansen wrote:
Hi, I don't see constant propagation mentioned at http://trac.webkit.org/wiki/SquirrelFishPerfIdeas . Has it been considered? (On a related note, is the above page up-to-date?)
With JSC as of r57470:
var a = 3; a + 7;
produces the bytecode
... [ 7] mov r-15, 3(@k1) [ 10] add r0, r-15, 7(@k2) ...
Worth pursuing? Reasonably feasible to implement in the compiler?
To do this well at the bytecode level, you need a control flow graph for each function and some way to do dataflow (perhaps by creating an SSA form of the bytecode).
Regards, Maciej
_______________________________________________ squirrelfish-dev mailing list squirrelfish-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/squirrelfish-dev