Re: RFR: 8225179: (regex) Minor Pattern cleanup

2019-06-05 Thread Brent Christian

Hi, Claes

I think the change looks fine.  A couple suggestions:

---
src/java.base/share/classes/java/util/regex/Pattern.java

3505 public boolean is(int ch) {

Would it make sense to have @Override here?


4777 * The matchRef is used when a reference to this group is accessed later
4778 * in the expression. The locals will have a negative value in them to
4779 * indicate that we do not want to unset the group if the reference
4780 * doesn't match.

If matchRef() is being removed, we no longer need its docs.

---
test/micro/org/openjdk/bench/java/util/regex/PatternBench.java

  67 charPatternStrings = new String[] 
{"avaaafooddbar", "lorem ipsum dolor foo bar", "fpp brr lorem 
ipsum dolor foo bar %", "lorem ipsum dolor foo bar lorem ipsum dolor foo 
bar lorem ipsum dolor foo bar /"};


Having each String on its own line would be nicer to read.


Thanks,
-Brent

On 6/4/19 1:58 AM, Claes Redestad wrote:

Hi,

please review this j.u.regex.Pattern cleanup.

- refactor BitClass to be a BmpCharPredicate (which allows removing
two identical(!) lambdas), which improves startup and reduces
allocations when compiling Patterns.
- remove unused GroupRef class
- made anonymous lookbehindEnd Node instance into an explicit class
which will be lazily rather than eagerly loaded
- various cleanups of unused variables, methods and redundant
inititialization

Webrev: http://cr.openjdk.java.net/~redestad/8225179/open.00/
Bug:    https://bugs.openjdk.java.net/browse/JDK-8225179

Testing: tier1-3

Thanks!

/Claes


Re: RFR: 8225179: (regex) Minor Pattern cleanup

2019-06-05 Thread Claes Redestad

Hi Ivan,

On 2019-06-05 03:10, Ivan Gerasimov wrote:

Hi Claes!

Looks good to me, thanks!


thanks!



LookBehindNode may be better named LookBehindEndNode, as it should only 
match at the very end of the look-behind token.


yes - updated and sanity tested.

/Claes


Re: RFR: 8225179: (regex) Minor Pattern cleanup

2019-06-04 Thread Ivan Gerasimov

Hi Claes!

Looks good to me, thanks!

LookBehindNode may be better named LookBehindEndNode, as it should only 
match at the very end of the look-behind token.


With kind regards,

Ivan


On 6/4/19 1:58 AM, Claes Redestad wrote:

Hi,

please review this j.u.regex.Pattern cleanup.

- refactor BitClass to be a BmpCharPredicate (which allows removing
two identical(!) lambdas), which improves startup and reduces
allocations when compiling Patterns.
- remove unused GroupRef class
- made anonymous lookbehindEnd Node instance into an explicit class
which will be lazily rather than eagerly loaded
- various cleanups of unused variables, methods and redundant
inititialization

Webrev: http://cr.openjdk.java.net/~redestad/8225179/open.00/
Bug:https://bugs.openjdk.java.net/browse/JDK-8225179

Testing: tier1-3

Thanks!

/Claes



--
With kind regards,
Ivan Gerasimov