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

Issue 10880020: Use patching for regexp implementation. (Closed)

Created:
8 years, 4 months ago by Mads Ager (google)
Modified:
8 years, 4 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Use patching for regexp implementation. BUG= Committed: https://code.google.com/p/dart/source/detail?r=11218

Patch Set 1 #

Patch Set 2 : Hack to VM patching. #

Total comments: 16

Patch Set 3 : Real VM fix from Ivan. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+165 lines, -254 lines) Patch
M corelib/src/implementation/corelib_impl_sources.gypi View 1 chunk +1 line, -0 lines 0 comments Download
A corelib/src/implementation/regexp.dart View 1 chunk +15 lines, -0 lines 0 comments Download
M lib/compiler/implementation/lib/coreimpl.dart View 1 chunk +1 line, -0 lines 0 comments Download
M lib/compiler/implementation/lib/coreimpl_patch.dart View 1 chunk +129 lines, -0 lines 0 comments Download
M lib/compiler/implementation/lib/mockimpl.dart View 1 chunk +0 lines, -117 lines 0 comments Download
M runtime/lib/lib_impl_sources.gypi View 1 chunk +1 line, -1 line 0 comments Download
D runtime/lib/regexp.dart View 1 chunk +0 lines, -121 lines 0 comments Download
A + runtime/lib/regexp_patch.dart View 5 chunks +14 lines, -14 lines 0 comments Download
M runtime/vm/object.cc View 1 2 1 chunk +4 lines, -1 line 0 comments Download

Messages

Total messages: 7 (0 generated)
Mads Ager (google)
8 years, 4 months ago (2012-08-23 09:03:04 UTC) #1
Anders Johnsen
No change to library_map in dart2js?
8 years, 4 months ago (2012-08-23 09:08:38 UTC) #2
Mads Ager (google)
On 2012/08/23 09:08:38, ajohnsen wrote: > No change to library_map in dart2js? No, because this ...
8 years, 4 months ago (2012-08-23 09:11:06 UTC) #3
Anders Johnsen
LGTM, Ofc, my bad! Very nice :)
8 years, 4 months ago (2012-08-23 09:11:36 UTC) #4
Mads Ager (google)
Updated with real VM fix from Ivan. Committing.
8 years, 4 months ago (2012-08-23 09:16:28 UTC) #5
Lasse Reichstein Nielsen
http://codereview.chromium.org/10880020/diff/2001/corelib/src/implementation/regexp.dart File corelib/src/implementation/regexp.dart (right): http://codereview.chromium.org/10880020/diff/2001/corelib/src/implementation/regexp.dart#newcode12 corelib/src/implementation/regexp.dart:12: external String get pattern(); Can you remove the parentheses ...
8 years, 4 months ago (2012-08-23 09:24:06 UTC) #6
Mads Ager (google)
8 years, 4 months ago (2012-08-23 09:38:23 UTC) #7
http://codereview.chromium.org/10880020/diff/2001/corelib/src/implementation/...
File corelib/src/implementation/regexp.dart (right):

http://codereview.chromium.org/10880020/diff/2001/corelib/src/implementation/...
corelib/src/implementation/regexp.dart:12: external String get pattern();
On 2012/08/23 09:24:06, Lasse Reichstein Nielsen wrote:
> Can you remove the parentheses on the getters?

Just tried and the answer is no apparently. Build fails.

http://codereview.chromium.org/10880020/diff/2001/lib/compiler/implementation...
File lib/compiler/implementation/lib/coreimpl_patch.dart (right):

http://codereview.chromium.org/10880020/diff/2001/lib/compiler/implementation...
lib/compiler/implementation/lib/coreimpl_patch.dart:76: // TODO(ager): Split out
into regexp_patch.dart and allow #source in
On 2012/08/23 09:24:06, Lasse Reichstein Nielsen wrote:
> Patch files should be named .dartp, not .dart.

No. They are Dart files. I removed the .dartp extension on purpose on
everythign.

http://codereview.chromium.org/10880020/diff/2001/lib/compiler/implementation...
lib/compiler/implementation/lib/coreimpl_patch.dart:126: class
_MatchImplementation implements Match {
On 2012/08/23 09:24:06, Lasse Reichstein Nielsen wrote:
> Name it _RegExpMatch or even _JsRegExpMatch.
> There can be many Match implementations, and this one is just for RegExp
> results, right?

I don't want to rock the boat with that right now. Only doing unification right
now and I'm keeping the name that was there before.

http://codereview.chromium.org/10880020/diff/2001/lib/compiler/implementation...
lib/compiler/implementation/lib/coreimpl_patch.dart:134: final String pattern;
On 2012/08/23 09:24:06, Lasse Reichstein Nielsen wrote:
> Fields above constructor.

Copied from other file. I can move them in a separate patch.

http://codereview.chromium.org/10880020/diff/2001/lib/compiler/implementation...
lib/compiler/implementation/lib/coreimpl_patch.dart:140: int start() => _start;
On 2012/08/23 09:24:06, Lasse Reichstein Nielsen wrote:
> Seems superflous, just call the final field "start".

Yes, but this is not a getter and I don't want to rock the boat. This is just
copied. Cleanup in separate patches. :)

http://codereview.chromium.org/10880020/diff/2001/lib/compiler/implementation...
lib/compiler/implementation/lib/coreimpl_patch.dart:155: class
_AllMatchesIterable implements Iterable<Match> {
On 2012/08/23 09:24:06, Lasse Reichstein Nielsen wrote:
> Put RegExp in the name somewhere.

Copied.

http://codereview.chromium.org/10880020/diff/2001/lib/compiler/implementation...
lib/compiler/implementation/lib/coreimpl_patch.dart:178: // _next is set by
#hasNext
On 2012/08/23 09:24:06, Lasse Reichstein Nielsen wrote:
> I prefer [hasNext] to #hasNext. More consistent, even if the "#" notation does
> make sense if you know HTML/CSS.

Copied. I'll update.

http://codereview.chromium.org/10880020/diff/2001/lib/compiler/implementation...
lib/compiler/implementation/lib/coreimpl_patch.dart:191: _next =
_re.firstMatch(_str);
On 2012/08/23 09:24:06, Lasse Reichstein Nielsen wrote:
> Slightly tricky that firstMatch really acts as nextMatch due to a hidden "g"
> flag. Could you add a comment about that here.
> I know this is one big hack anyway, but I bet this code will be around for a
> while.

Copied. I'll add a comment in a separate patch.

Powered by Google App Engine
This is Rietveld 408576698