Chromium Code Reviews
DescriptionMake v8AtomicString take a StringView.
By accepting a StringView v8AtomicString, which is used for property
access all over the engine, can have the length of the input literal
strings be computed at compile time. For example
v8AtomicString(isolate, "foo") will now compile the length of 3 into the
binary directly.
This patch also makes v8AtomicString take 8/16 bit strings like all of
the other string handling functions and moves the utf8 logic into a new
function v8StringFromUtf8. This makes the code more clear since blink
rarely ever uses utf8 strings, and should also be faster since v8
strings are either latin1 or utf16 just like blink, so calling the utf8
methods for property access was going through a bunch of logic on the
string that wasn't needed.
The two callers that actually expect utf8 inputs have been changed, and
one caller in WindowProxy::setSecurityToken was switched to not using
utf8 since it wasn't actually needed as it was going from a blink String
to utf8 and then back into a v8::String which is the same representation
as the blink string.
BUG=615174
Committed: https://crrev.com/a348d19c81ac29626a38a47a683856f22102bb42
Cr-Commit-Position: refs/heads/master@{#405011}
Patch Set 1 #
Total comments: 4
Patch Set 2 : Woops, pass the length. #
Messages
Total messages: 17 (9 generated)
|
||||||||||||||||||||||||||||||||||||||||||||||