Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(603)

Issue 1366563002: [builtins] Re-add similar String wrapper optimization for StringAdd. (Closed)

Created:
5 years, 3 months ago by Benedikt Meurer
Modified:
5 years, 3 months ago
Reviewers:
Jarin
CC:
v8-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[builtins] Re-add similar String wrapper optimization for StringAdd. For string wrappers (JSValue instances with [[StringData]] internal fields), we can shortcirciut the ToPrimitive if (a) the {input} map matches the initial map of the String function, (b) the {input} [[Prototype]] is the unmodified %StringPrototype% (i.e. no one monkey-patched toString, @@toPrimitive or valueOf), and (c) the %ObjectPrototype% (i.e. the [[Prototype]] of the %StringPrototype%) is also unmodified, that is no one sneaked a @@toPrimitive into the %ObjectPrototype%. If all these assumptions hold, we can just take the [[StringData]] value and return it. This just repairs a regression introduced by removing the weird (and broken) intrinsic %_IsStringWrapperSafeForDefaultValue, which was intendend to something similar to this, although less efficient and wrong in the presence of @@toPrimitive. Long-term we might want to move into the direction of having a ToPrimitiveStub that can do common cases while staying in JavaScript land (i.e. not going to C++). R=jarin@chromium.org BUG=chromium:532524 LOG=n Committed: https://crrev.com/17f598782d7db06dbd06c29c96ac9316a1a27aab Cr-Commit-Position: refs/heads/master@{#30890}

Patch Set 1 #

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+95 lines, -11 lines) Patch
M src/bootstrapper.cc View 1 chunk +9 lines, -1 line 0 comments Download
M src/code-stubs-hydrogen.cc View 1 5 chunks +85 lines, -10 lines 0 comments Download
M src/contexts.h View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 7 (2 generated)
Benedikt Meurer
Hey Jaro, This repairs the date-format-xparb regression by adding back a simplified and correct version ...
5 years, 3 months ago (2015-09-23 12:56:10 UTC) #2
Jarin
lgtm.
5 years, 3 months ago (2015-09-23 13:16:45 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1366563002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1366563002/20001
5 years, 3 months ago (2015-09-23 13:17:54 UTC) #5
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 3 months ago (2015-09-23 13:49:13 UTC) #6
commit-bot: I haz the power
5 years, 3 months ago (2015-09-23 13:49:26 UTC) #7
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/17f598782d7db06dbd06c29c96ac9316a1a27aab
Cr-Commit-Position: refs/heads/master@{#30890}

Powered by Google App Engine
This is Rietveld 408576698