From 6f7f81f794a90f690c324eb20ab1b37642b77f8e Mon Sep 17 00:00:00 2001 From: Ivan Gerasimov Date: Tue, 21 Jan 2020 17:52:55 -0800 Subject: [PATCH] 8236034: Use optimized Ques node for curly {0,1} quantifier Reviewed-by: rriggs --- .../classes/java/util/regex/Pattern.java | 49 +++++------- test/jdk/java/util/regex/RegExTest.java | 4 +- test/jdk/java/util/regex/TestCases.txt | 78 ++++++++++++++++++- 3 files changed, 100 insertions(+), 31 deletions(-) diff --git a/src/java.base/share/classes/java/util/regex/Pattern.java b/src/java.base/share/classes/java/util/regex/Pattern.java index f93c2a0bad8..b674a26d1d9 100644 --- a/src/java.base/share/classes/java/util/regex/Pattern.java +++ b/src/java.base/share/classes/java/util/regex/Pattern.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -3243,21 +3243,28 @@ loop: for(int x=0, offset=0; x