[Webkit-unassigned] [Bug 70107] Custom written CSS lexer

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Dec 13 08:40:18 PST 2011


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





--- Comment #28 from Oliver Hunt <oliver at apple.com>  2011-12-13 08:40:17 PST ---
(In reply to comment #25)
> > On the downside it requires a copy of the css source -- is a well predicted branch really more expensive than a copy?
> 
> This cannot be avoided, since the CSS tokenizer overwrites escape sequences to real characters: Identifier "x\61y" is changed to "xay" before further processing. So we can only avoid buffer dumplication if the input does not contain any escape sequences. We need to take care of prefix and postfix strings as well somehow. And the worst thing is we don't get the ownership of the input string (not even a RefPtr), so it can be freed during tokenizing. What do you think?

The same problem exists when parsing JS -- but copying all strings is a pessimisation, you should only need to copy when there are escape sequences, and they are very rare.  Once again: a change to make it non-copying doesn't need to be in this patch :D

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



More information about the webkit-unassigned mailing list