replace js_NewStringCopyN uses with js_NewDependentString in jstr

RESOLVED FIXED

Status

()

defect
RESOLVED FIXED
10 years ago
10 years ago

People

(Reporter: luke, Assigned: luke)

Tracking

unspecified
ARM
All
Points:
---
Dependency tree / graph
Bug Flags:
wanted1.9.2 +

Firefox Tracking Flags

(status1.9.2 beta1-fixed)

Details

Attachments

(1 attachment, 1 obsolete attachment)

Posted patch patch (obsolete) — Splinter Review
In find_replen and match_glob.

This resulted in a 2-3% speedup in string-unpack-code.

The patch also does a tiny bit o' cleanup.
Attachment #393890 - Flags: review?(jwalden+bmo)
Summary: replace js_NewStringCopyN uses with js_NewDependentString → replace js_NewStringCopyN uses with js_NewDependentString in jstr
And for this micro-benchmark, 27% faster:

var d = new Date();
var a;
for (var i = 0; i < 200000; ++i) {
    a = "aabbccddaabbccddaabbccdd".replace(/(a+)(b+)(c+)(d+)/g, function(){return "."});
}
print(new Date() - d);
Attachment #393890 - Attachment is obsolete: true
Attachment #394175 - Flags: review?(jwalden+bmo)
Attachment #393890 - Flags: review?(jwalden+bmo)
review ping
Comment on attachment 394175 [details] [diff] [review]
overly strong assertion, forgot about empty matches

>diff --git a/js/src/jsstr.cpp b/js/src/jsstr.cpp

>+        for (uintN j = 0; i < n; i++, j++) {
>+            if (!PushRegExpSubstr(cx, cx->regExpStatics.parens[j], sp))
>+                goto lambda_out;
>+        }
>+        for (uintN j = 0; i < m; i++, j++) {
>+            if (!PushRegExpSubstr(cx, cx->regExpStatics.moreParens[j], sp))
>+                goto lambda_out;
>+        }

I will assume we have dropped any compilers which hate "redeclaring" uintN j.  Ware tinderbox bustage.
Attachment #394175 - Flags: review?(jwalden+bmo) → review+
http://hg.mozilla.org/mozilla-central/rev/c857e77e6f01
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.