On 31/03/2014 16:11, Patrick Walton wrote:
On 3/31/14 3:10 AM, Niko Matsakis wrote:
Interesting thought. You could also use an embedding involving either
coded no-ops at the start of each instruction and/or an unconditional
jump over some meta-data. This would reduce coupling at the cost of
somewhat more memory. Naturally you'd want to measure the effect on
performance too, though I suspect it'd be minimal.
I also realized yesterday that one could just re-parse the style sheet
into the AST if the CSSOM or debugging tools are used. I wonder whether
that would be just as fast as disassembling.
For Selectors, CSSOM does not expose anything but
CSSStyleRule.selectorText. So if we store a source string for the OM’s
getter and some structure optimized for matching, I believe there is no
need to store an intermediate AST nor to disassemble anything. (The OM’s
setter needs to parse from a string in any case.)
--
Simon Sapin
_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo