Non-special escape character sequences cause JSC::Lexer::parseString to create 16...
authorMichael Saboff <msaboff@apple.com>
Mon, 29 Oct 2012 22:50:02 +0000 (22:50 +0000)
committerMichael Saboff <msaboff@apple.com>
Mon, 29 Oct 2012 22:50:02 +0000 (22:50 +0000)
commitd7cadfb5e09cbd97cc9887511090cdf16eb642b4
tree4b9fb0bc48fac3e6662aba1e1ed1ba87a478f2ee
parent08c3bce89ecd5aed9b1970043d65ca5ab45b82e6
Non-special escape character sequences cause JSC::Lexer::parseString to create 16 bit strings
https://bugs.webkit.org/show_bug.cgi?id=100576

Reviewed by Darin Adler.

Source/JavaScriptCore:

Changed singleEscape() processing to be based on a lookup of a static table.  The table
covers ASCII characters SPACE through DEL.  If a character can be a single character escape,
then the table provides the non-zero result of that escape.  Updated the result of
singleEscape to be an LChar to make the table as small as possible.
Added a new test fast/js/normal-character-escapes-in-string-literals.html to validated
the behavior.

* parser/Lexer.cpp:
(JSC::singleEscape):
(JSC::Lexer::parseString):
(JSC::Lexer::parseStringSlowCase):

LayoutTests:

Added a new test to validated the behavior of the corresponding changes to string processing
in the Lexer.

* fast/js/normal-character-escapes-in-string-literals-expected.txt: Added.
* fast/js/normal-character-escapes-in-string-literals.html: Added.
* fast/js/script-tests/normal-character-escapes-in-string-literals.js: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132853 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/js/normal-character-escapes-in-string-literals-expected.txt [new file with mode: 0644]
LayoutTests/fast/js/normal-character-escapes-in-string-literals.html [new file with mode: 0644]
LayoutTests/fast/js/script-tests/normal-character-escapes-in-string-literals.js [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/parser/Lexer.cpp