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

Issue 1324353002: [es6] Optimize String{Starts, Ends}With (Closed)

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

Description

[es6] Optimize String{Starts, Ends}With Replace Math{Min,Max} Direct string comparison Compared to https://codereview.chromium.org/1321853006/ single character found at true 77 P found at false 70 က found at false 70 BUG=v8:4384 LOG=N Committed: https://crrev.com/b7db5cd9c761de2f15112ce4d46c7ade8c749ac0 Cr-Commit-Position: refs/heads/master@{#30631}

Patch Set 1 #

Patch Set 2 : Use codestyle from function #

Total comments: 2

Patch Set 3 : Remove deoptimization #

Total comments: 2

Patch Set 4 : nits #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+27 lines, -13 lines) Patch
M src/string.js View 1 2 3 4 chunks +27 lines, -13 lines 2 comments Download

Messages

Total messages: 18 (6 generated)
skomski
PTAL
5 years, 3 months ago (2015-09-07 09:23:38 UTC) #2
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1324353002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1324353002/20001
5 years, 3 months ago (2015-09-08 07:25:06 UTC) #4
Dan Ehrenberg
Other than style, looks good to me. https://codereview.chromium.org/1324353002/diff/20001/src/string.js File src/string.js (right): https://codereview.chromium.org/1324353002/diff/20001/src/string.js#newcode1041 src/string.js:1041: return true; ...
5 years, 3 months ago (2015-09-08 07:27:58 UTC) #5
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 3 months ago (2015-09-08 07:51:18 UTC) #7
Jakob Kummerow
https://codereview.chromium.org/1324353002/diff/20001/src/string.js File src/string.js (right): https://codereview.chromium.org/1324353002/diff/20001/src/string.js#newcode1041 src/string.js:1041: return true; On 2015/09/08 07:27:58, Dan Ehrenberg wrote: > ...
5 years, 3 months ago (2015-09-08 08:13:04 UTC) #8
Dan Ehrenberg
lgtm
5 years, 3 months ago (2015-09-08 08:15:19 UTC) #9
skomski
Did a quick benchmark with positions and found out there is an deoptimization pattern in ...
5 years, 3 months ago (2015-09-08 09:40:46 UTC) #10
Jakob Kummerow
LGTM with nits. Doing the !IS_UNDEFINED check at callsites is rather sad. It would be ...
5 years, 3 months ago (2015-09-08 09:46:10 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1324353002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1324353002/60001
5 years, 3 months ago (2015-09-08 09:55:09 UTC) #14
commit-bot: I haz the power
Committed patchset #4 (id:60001)
5 years, 3 months ago (2015-09-08 10:20:35 UTC) #15
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/b7db5cd9c761de2f15112ce4d46c7ade8c749ac0 Cr-Commit-Position: refs/heads/master@{#30631}
5 years, 3 months ago (2015-09-08 10:20:55 UTC) #16
Lasse Reichstein Nielsen
5 years, 3 months ago (2015-09-08 10:24:57 UTC) #18
Message was sent while issue was closed.
https://codereview.chromium.org/1324353002/diff/60001/src/string.js
File src/string.js (right):

https://codereview.chromium.org/1324353002/diff/60001/src/string.js#newcode993
src/string.js:993: if (pos > s_len) pos = s_len;
DBC: Would it be useful to make this an "else" of the first test since both
can't be true?
And move the tests inside the second if above (no need to do them if pos is 0)?

https://codereview.chromium.org/1324353002/diff/60001/src/string.js#newcode1037
src/string.js:1037: }
The spec is really overspecifying here - if searchString is the empty string, a
lot of this work is unnecessary.

Maybe just::

   ... 
   pos = $toInteger(arg);
   if (pos > s_len) pos = s_len;
  }
 }
 var ss_len = ss.length;
 if (pos < ss_len) return ss_len == 0;

Powered by Google App Engine
This is Rietveld 408576698