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

Issue 13896017: Switch RegularExpression from YARR to V8 (Closed)

Created:
7 years, 8 months ago by esprehn
Modified:
7 years, 8 months ago
Reviewers:
adamk, abarth-chromium
CC:
blink-reviews, jeez, vsevik
Visibility:
Public.

Description

Switch RegularExpression from YARR to V8 Make RegularExpression use V8 instead of YARR. This removes all but one last usage of YARR in ContentSearchUtils which can be removed in a follow up patch. It's a little awkward to use V8's regular expression features from C++ since you need to interact with the JS object fields, but this is the best we can do for now. Eventually it'd be nice if V8 exposed a RegExp API directly. For this patch we need to stop using static RegularExpressions in the web inspector code because RegularExpression is no longer thread safe and the web inspector would previously use the same instance between multiple workers in InspectorStyleSheet.cpp. Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=148958

Patch Set 1 #

Total comments: 15

Patch Set 2 : Review from adamk and abarth #

Total comments: 2

Patch Set 3 : Make it more clear you get an empty handle on failed regex compile #

Patch Set 4 : Make RegularExpression work when !isMainThread() #

Patch Set 5 : Rebase #

Patch Set 6 : Rebase again, don't mess with BaseTextInputType #

Patch Set 7 : Remove the test I added, the same kind of test was added in r148951 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+80 lines, -60 lines) Patch
M Source/bindings/v8/V8PerIsolateData.h View 1 2 3 2 chunks +3 lines, -1 line 0 comments Download
M Source/bindings/v8/V8PerIsolateData.cpp View 1 2 3 2 chunks +8 lines, -1 line 0 comments Download
M Source/core/inspector/InspectorStyleSheet.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/core/platform/text/RegularExpression.h View 1 2 3 4 3 chunks +7 lines, -9 lines 0 comments Download
M Source/core/platform/text/RegularExpression.cpp View 1 2 3 2 chunks +61 lines, -48 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
esprehn
7 years, 8 months ago (2013-04-21 22:14:23 UTC) #1
abarth-chromium
How good is our test coverage of this code? I guess input@pattern has some test ...
7 years, 8 months ago (2013-04-21 22:31:52 UTC) #2
esprehn
https://codereview.chromium.org/13896017/diff/1/Source/core/platform/text/RegularExpression.cpp File Source/core/platform/text/RegularExpression.cpp (right): https://codereview.chromium.org/13896017/diff/1/Source/core/platform/text/RegularExpression.cpp#newcode40 Source/core/platform/text/RegularExpression.cpp:40: static v8::Handle<v8::Context> regexContext() On 2013/04/21 22:31:52, abarth wrote: > ...
7 years, 8 months ago (2013-04-21 23:11:10 UTC) #3
abarth-chromium
https://codereview.chromium.org/13896017/diff/1/Source/core/platform/text/RegularExpression.cpp File Source/core/platform/text/RegularExpression.cpp (right): https://codereview.chromium.org/13896017/diff/1/Source/core/platform/text/RegularExpression.cpp#newcode40 Source/core/platform/text/RegularExpression.cpp:40: static v8::Handle<v8::Context> regexContext() On 2013/04/21 23:11:10, esprehn wrote: > ...
7 years, 8 months ago (2013-04-21 23:57:00 UTC) #4
adamk
https://codereview.chromium.org/13896017/diff/1/Source/core/platform/text/RegularExpression.cpp File Source/core/platform/text/RegularExpression.cpp (right): https://codereview.chromium.org/13896017/diff/1/Source/core/platform/text/RegularExpression.cpp#newcode42 Source/core/platform/text/RegularExpression.cpp:42: static ScopedPersistent<v8::Context>* staticRegexContext = new ScopedPersistent<v8::Context>(v8::Context::New()); I think an ...
7 years, 8 months ago (2013-04-22 16:40:38 UTC) #5
esprehn
On 2013/04/22 16:40:38, adamk wrote: > ... > https://codereview.chromium.org/13896017/diff/1/Source/core/platform/text/RegularExpression.cpp#newcode90 > Source/core/platform/text/RegularExpression.cpp:90: v8::Local<v8::String> match > = ...
7 years, 8 months ago (2013-04-22 17:35:44 UTC) #6
adamk
https://codereview.chromium.org/13896017/diff/8001/Source/core/html/BaseTextInputType.cpp File Source/core/html/BaseTextInputType.cpp (right): https://codereview.chromium.org/13896017/diff/8001/Source/core/html/BaseTextInputType.cpp#newcode48 Source/core/html/BaseTextInputType.cpp:48: if (!regex.isValid()) There are other uses of RegularExpression; is ...
7 years, 8 months ago (2013-04-22 17:48:03 UTC) #7
esprehn
On 2013/04/22 17:48:03, adamk wrote: > https://codereview.chromium.org/13896017/diff/8001/Source/core/html/BaseTextInputType.cpp > File Source/core/html/BaseTextInputType.cpp (right): > > https://codereview.chromium.org/13896017/diff/8001/Source/core/html/BaseTextInputType.cpp#newcode48 > ...
7 years, 8 months ago (2013-04-22 17:54:42 UTC) #8
adamk
lgtm (though I think you'll need abarth's stamp too as I'm not an OWNER)
7 years, 8 months ago (2013-04-22 17:59:03 UTC) #9
abarth-chromium
LGTM2
7 years, 8 months ago (2013-04-22 18:03:16 UTC) #10
esprehn
Committed patchset #3 manually as r148840 (presubmit successful).
7 years, 8 months ago (2013-04-22 18:28:48 UTC) #11
vsevik
On 2013/04/22 18:28:48, esprehn wrote: > Committed patchset #3 manually as r148840 (presubmit successful). This ...
7 years, 8 months ago (2013-04-23 12:44:19 UTC) #12
esprehn
On 2013/04/23 12:44:19, vsevik wrote: > On 2013/04/22 18:28:48, esprehn wrote: > > Committed patchset ...
7 years, 8 months ago (2013-04-23 23:10:51 UTC) #13
abarth-chromium
LGTM
7 years, 8 months ago (2013-04-24 00:57:53 UTC) #14
esprehn
7 years, 8 months ago (2013-04-24 03:08:45 UTC) #15
Message was sent while issue was closed.
Committed patchset #7 manually as r148958 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698