[Webkit-unassigned] [Bug 19408] Constant folding in parser

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jun 15 00:05:46 PDT 2008


https://bugs.webkit.org/show_bug.cgi?id=19408





------- Comment #6 from mjs at apple.com  2008-06-15 00:05 PDT -------
Some comments:

1) Instead of introducing new OP_WHATEVER enums for some of the operations, why
not just use the existing op_ constants from the bytecode?

2) Is it really helpful to have a single foldConstant function which takes an
opcode enum and then switches on it? Why not just a function for each type of
fold?

3) Constant folds should be doable even if operand types aren't exactly what is
expected, boolean string and number constants should be safely convertible.

4) We've discussed the possibility of doing constant folding at codegen time. I
know it is a traditional parse-time optimization, but it fits very naturally
with the way we want to have specialized versions of the opcodes with constant
operands. If you have to handle the register-register, register-constant and
constant-register cases, it makes sense to handle the constant-constant case
right there. It has to be checked for anyway, because the parse-time constant
folding here won't handle strings or various edge cases and folding seems like
it is probably better than emitting excessive constant loads.


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list