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

Issue 1596483005: Add ES2015 RegExp full subclassing semantics behind a flag (Closed)

Created:
4 years, 11 months ago by Dan Ehrenberg
Modified:
4 years, 9 months ago
Reviewers:
adamk, Yang
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

Add ES2015 RegExp full subclassing semantics behind a flag This patch implements ES2015 RegExp subclassing semantics, namely the hardest part where RegExp.prototype.exec and certain flag getters can be overridden in order to provide different behavior. This change is hidden behind a new flag, --harmony-regexp-exec. The flag guards the behavior by installing entirely different implementations of the methods which follow the new semantics. Preliminary performance tests show a 3-4x regression in the Octane RegExp benchmark. The new code doesn't call out into several fast paths that the old code supported, so this is expected. The patch is tested mostly by test262, where most RegExp tests are fixed, with the exception of deliberate spec violations for web compatibility, and for the 'sticky' flag, which is not dynamically read by this patch in all cases but rather statically compiled into the RegExp. The latter will require a follow-on patch to implement. A small additional set of tests verifies one particular case, mostly to check whether the flag mechanism works. R=adamk,yangguo@chromium.org LOG=Y BUG=v8:4602 Committed: https://crrev.com/92a571e5460b7abb53105e13721beeaac7fd085a Cr-Commit-Position: refs/heads/master@{#35068}

Patch Set 1 #

Patch Set 2 : replace #

Patch Set 3 : More fixes #

Patch Set 4 : regexp subclassing implementation #

Patch Set 5 : Some more changes from test262 debugging #

Patch Set 6 : Fix a couple more unimportant issues #

Patch Set 7 : Rebase (fails a number of test262 tests) #

Patch Set 8 : A small fix, and test262 expectations #

Patch Set 9 : Rebased again, and a separate flag, with one part split off into https://codereview.chromium.org/1821773003 #

Patch Set 10 : rebase #

Patch Set 11 : fix formatting #

Patch Set 12 : A couple more cleanups #

Total comments: 4

Patch Set 13 : Update bytecode test expectations #

Total comments: 6

Patch Set 14 : Better comments #

Patch Set 15 : removed stray edit #

Total comments: 17

Patch Set 16 : rebase #

Patch Set 17 : Fixes based on comments #

Patch Set 18 : fixups #

Patch Set 19 : fix typo #

Total comments: 4

Patch Set 20 : more camelCase #

Patch Set 21 : camelCase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+476 lines, -27 lines) Patch
M BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +1 line, -0 lines 0 comments Download
M src/bootstrapper.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +3 lines, -0 lines 0 comments Download
M src/flag-definitions.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +1 line, -0 lines 0 comments Download
A src/js/harmony-regexp-exec.js View 1 2 3 4 5 6 7 8 1 chunk +37 lines, -0 lines 0 comments Download
M src/js/i18n.js View 1 2 3 4 5 6 7 8 2 chunks +1 line, -11 lines 0 comments Download
M src/js/prologue.js View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +23 lines, -0 lines 0 comments Download
M src/js/regexp.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 15 chunks +393 lines, -8 lines 0 comments Download
M src/messages.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +2 lines, -0 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/ForOf.golden View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 4 chunks +4 lines, -4 lines 0 comments Download
A + test/mjsunit/harmony/regexp-change-exec.js View 1 2 3 4 5 6 7 8 9 10 1 chunk +4 lines, -2 lines 0 comments Download
A + test/mjsunit/harmony/regexp-no-change-exec.js View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -2 lines 0 comments Download
M test/mjsunit/regexp-string-methods.js View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -0 lines 0 comments Download
M tools/gyp/v8.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 57 (25 generated)
Yang
On 2016/03/04 23:41:26, Dan Ehrenberg wrote: > Description was changed from > > ========== > ...
4 years, 9 months ago (2016-03-07 06:56:20 UTC) #2
Dan Ehrenberg
On 2016/03/07 at 06:56:20, yangguo wrote: > On 2016/03/04 23:41:26, Dan Ehrenberg wrote: > > ...
4 years, 9 months ago (2016-03-07 15:36:55 UTC) #4
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1596483005/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1596483005/140001
4 years, 9 months ago (2016-03-07 21:52:46 UTC) #6
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: v8_linux64_avx2_rel on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_avx2_rel/builds/11205) v8_linux64_rel_ng on ...
4 years, 9 months ago (2016-03-07 21:54:27 UTC) #8
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1596483005/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1596483005/160001
4 years, 9 months ago (2016-03-22 00:24:19 UTC) #10
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: v8_linux_arm64_rel on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux_arm64_rel/builds/17272) v8_linux_dbg_ng on ...
4 years, 9 months ago (2016-03-22 00:25:32 UTC) #14
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1596483005/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1596483005/180001
4 years, 9 months ago (2016-03-22 00:26:39 UTC) #16
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: v8_presubmit on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_presubmit/builds/12712)
4 years, 9 months ago (2016-03-22 00:30:30 UTC) #18
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1596483005/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1596483005/200001
4 years, 9 months ago (2016-03-22 00:44:11 UTC) #20
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1596483005/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1596483005/220001
4 years, 9 months ago (2016-03-22 00:49:01 UTC) #22
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: v8_linux64_asan_rel on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_asan_rel/builds/15620)
4 years, 9 months ago (2016-03-22 01:02:21 UTC) #25
Dan Ehrenberg
4 years, 9 months ago (2016-03-22 01:02:53 UTC) #26
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1596483005/240001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1596483005/240001
4 years, 9 months ago (2016-03-22 01:21:19 UTC) #28
adamk
As noted offline it would be helpful to have a pointer to which spec bits ...
4 years, 9 months ago (2016-03-22 01:26:38 UTC) #29
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 9 months ago (2016-03-22 01:40:13 UTC) #31
Yang
https://codereview.chromium.org/1596483005/diff/240001/src/js/prologue.js File src/js/prologue.js (right): https://codereview.chromium.org/1596483005/diff/240001/src/js/prologue.js#newcode136 src/js/prologue.js:136: if (!afterInitialBootstrap) %FunctionRemovePrototype(f); Let's omit this optimization. I'm not ...
4 years, 9 months ago (2016-03-22 12:49:38 UTC) #32
Dan Ehrenberg
Included better cross-referencing comments to the spec. https://codereview.chromium.org/1596483005/diff/220001/src/js/regexp.js File src/js/regexp.js (right): https://codereview.chromium.org/1596483005/diff/220001/src/js/regexp.js#newcode24 src/js/regexp.js:24: var MathMin ...
4 years, 9 months ago (2016-03-22 18:26:31 UTC) #33
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1596483005/300001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1596483005/300001
4 years, 9 months ago (2016-03-22 18:45:04 UTC) #35
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 9 months ago (2016-03-22 19:14:42 UTC) #37
adamk
Some comments, can't guarantee this is everything (lots of new code there, though it does ...
4 years, 9 months ago (2016-03-22 22:23:42 UTC) #38
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1596483005/320001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1596483005/320001
4 years, 9 months ago (2016-03-22 22:58:50 UTC) #40
Dan Ehrenberg
I think this behavior is pretty well-tested in test262. In addition to our pretty extensive ...
4 years, 9 months ago (2016-03-22 23:09:32 UTC) #41
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 9 months ago (2016-03-22 23:31:19 UTC) #43
adamk
Looking better. Per offline discussion, it sounds like the idea is that this is just ...
4 years, 9 months ago (2016-03-23 01:07:19 UTC) #44
Dan Ehrenberg
https://codereview.chromium.org/1596483005/diff/280001/src/js/regexp.js File src/js/regexp.js (right): https://codereview.chromium.org/1596483005/diff/280001/src/js/regexp.js#newcode488 src/js/regexp.js:488: var new_flags = sticky ? flags : flags + ...
4 years, 9 months ago (2016-03-24 00:50:54 UTC) #45
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1596483005/360001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1596483005/360001
4 years, 9 months ago (2016-03-24 00:51:11 UTC) #47
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 9 months ago (2016-03-24 01:14:47 UTC) #49
adamk
lgtm % a few more camelCase-needing functions Let's get this landed (it's all flag-guarded anyway) ...
4 years, 9 months ago (2016-03-24 21:38:08 UTC) #50
Dan Ehrenberg
https://codereview.chromium.org/1596483005/diff/360001/src/js/regexp.js File src/js/regexp.js (right): https://codereview.chromium.org/1596483005/diff/360001/src/js/regexp.js#newcode758 src/js/regexp.js:758: var match_length = matched.length; On 2016/03/24 at 21:38:08, adamk ...
4 years, 9 months ago (2016-03-24 21:55:10 UTC) #52
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1596483005/400001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1596483005/400001
4 years, 9 months ago (2016-03-24 21:55:16 UTC) #54
commit-bot: I haz the power
Committed patchset #21 (id:400001)
4 years, 9 months ago (2016-03-24 22:26:23 UTC) #55
commit-bot: I haz the power
4 years, 9 months ago (2016-03-24 22:27:33 UTC) #57
Message was sent while issue was closed.
Patchset 21 (id:??) landed as
https://crrev.com/92a571e5460b7abb53105e13721beeaac7fd085a
Cr-Commit-Position: refs/heads/master@{#35068}

Powered by Google App Engine
This is Rietveld 408576698