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

Side by Side Diff: test/mjsunit/regress/regress-crbug-482998.js

Issue 1204123003: Reland Extend big-disjunction optimization to case-independent regexps (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Skip slow architecture-independent tests on slower CPUs and simulators Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/mjsunit/regexp-sort.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Should not time out. Running time 0.5s vs. 120s before the change. 5 // Should not time out. Running time 0.5s vs. 120s before the change.
6 function collapse() { 6 function collapse(flags) {
7 var src = "(?:"; 7 var src = "(?:";
8 for (var i = 128; i < 0x1000; i++) { 8 for (var i = 128; i < 0x1000; i++) {
9 src += "a" + String.fromCharCode(i) + "|"; 9 src += String.fromCharCode(96 + i % 26) + String.fromCharCode(i) + "|";
10 } 10 }
11 src += "aa)"; 11 src += "aa)";
12 var collapsible = new RegExp(src); 12 var collapsible = new RegExp(src, flags);
13 var subject = "zzzzzzz" + String.fromCharCode(3000); 13 var subject = "zzzzzzz" + String.fromCharCode(3000);
14 for (var i = 0; i < 1000; i++) { 14 for (var i = 0; i < 1000; i++) {
15 subject += "xxxxxxx"; 15 subject += "xxxxxxx";
16 } 16 }
17 for (var i = 0; i < 2000; i++) { 17 for (var i = 0; i < 2000; i++) {
18 assertFalse(collapsible.test(subject)); 18 assertFalse(collapsible.test(subject));
19 } 19 }
20 } 20 }
21 21
22 collapse(); 22 collapse("i");
23 collapse("");
OLDNEW
« no previous file with comments | « test/mjsunit/regexp-sort.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698