@@ -15123,6 +15123,11 @@ var addProfileNew = function(c, t) {
1512315123 s += "[]";
1512415124 t = 0;
1512515125 }
15126+ if (J2S._traceOutput && (s.indexOf(J2S._traceOutput) >= 0 || '"' + s + '"' == J2S._traceOutput)) {
15127+ alert(s + "\n\n" + Clazz._getStackTrace());
15128+ doDebugger();
15129+ }
15130+
1512615131 var p = _profileNew[s];
1512715132 p || (p = _profileNew[s] = [0,0]);
1512815133 p[0]++;
@@ -18549,25 +18554,36 @@ CharSequence.$defaults$(String);
1854918554sp.compareToIgnoreCase$S = function(str) { return String.CASE_INSENSITIVE_ORDER.compare$S$S(this, str);}
1855018555
1855118556sp.replace$ = function(c1,c2){
18552- if (c1 == c2 || this.indexOf (c1) < 0) return "" + this;
18557+ if (c1 == c2 || this.indexOf(c1) < 0) return "" + this;
1855318558 if (c1.length == 1) {
1855418559 if ("\\$.*+|?^{}()[]".indexOf(c1) >= 0)
1855518560 c1 = "\\" + c1;
1855618561 } else {
18557- c1=c1.replace(/([\\\$\.\*\+\|\?\^\{\}\(\)\[\]])/g,function($0,$1){
18558- return "\\"+$1;
18559- });
18562+ c1=c1.replace(/([\\\$\.\*\+\|\?\^\{\}\(\)\[\]])/g,function($0,$1){return "\\"+$1;});
1856018563 }
1856118564 return this.replace(new RegExp(c1,"gm"),c2);
1856218565};
1856318566
18564- sp.replaceAll$S$S=sp.replaceAll$CharSequence$CharSequence=function(exp,str){
18565- var regExp=new RegExp(exp,"gm");
18566- return this.replace(regExp,str);
18567+ // experimental -- only marginally faster:
18568+ var reCache = new Map();
18569+ sp.replace2$ = function(c1,c2){
18570+ if (c1 == c2 || this.indexOf(c1) < 0) return "" + this;
18571+ var re;
18572+ if (c1.length == 1) {
18573+ re = reCache.get(c1);
18574+ re || reCache.set(c1, re = new RegExp("\\$.*+|?^{}()[]".indexOf(c1) == 0 ? "\\" + c1 : c1, 'gm'));
18575+ } else {
18576+ re = new RegExp(c1.replace(/([\\\$\.\*\+\|\?\^\{\}\(\)\[\]])/g,function($0,$1){return "\\"+$1;}), 'gm');
18577+ }
18578+ return this.replace(re,c2);
18579+ };
18580+
18581+ // fastest:
18582+ sp.replaceAll$=sp.replaceAll$S$S=sp.replaceAll$CharSequence$CharSequence=function(exp,str){
18583+ return this.replace(new RegExp(exp,"gm"),str);
1856718584};
1856818585sp.replaceFirst$S$S=function(exp,str){
18569- var regExp=new RegExp(exp,"m");
18570- return this.replace(regExp,str);
18586+ return this.replace(new RegExp(exp,"m"),str);
1857118587};
1857218588sp.matches$S=function(exp){
1857318589if(exp!=null){
0 commit comments