Closed
Bug 1142814
Opened 9 years ago
Closed 9 years ago
Optimize String.fromCharCode() when the number of args is small but > 1
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla39
Tracking | Status | |
---|---|---|
firefox39 | --- | fixed |
People
(Reporter: n.nethercote, Assigned: n.nethercote)
Details
Attachments
(1 file)
6.03 KB,
patch
|
jandem
:
review+
|
Details | Diff | Splinter Review |
Shumway calls String.fromCharCode() with two arguments frequently, and this does an unnecessary malloc that can be avoide easily..
Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8577005 -
Flags: review?(jdemooij)
Comment 2•9 years ago
|
||
Comment on attachment 8577005 [details] [diff] [review] Optimize String.fromCharCode() when the number of args is small but > 1 Review of attachment 8577005 [details] [diff] [review]: ----------------------------------------------------------------- Avoiding malloc is always nice. ::: js/src/jsstr.cpp @@ +4031,5 @@ > + for (unsigned i = 0; i < args.length(); i++) { > + uint16_t code; > + if (!ToUint16(cx, args[i], &code)) { > + return false; > + } Nit: no {} @@ +4037,5 @@ > + } > + JSString *str = NewStringCopyN<CanGC>(cx, chars, args.length()); > + if (!str) { > + return false; > + } And here.
Attachment #8577005 -
Flags: review?(jdemooij) → review+
Assignee | ||
Comment 3•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/2693283b5d8b
Backed out in https://hg.mozilla.org/integration/mozilla-inbound/rev/df62dfbaa245 for apparently breaking bc1: https://treeherder.mozilla.org/logviewer.html#?job_id=7684028&repo=mozilla-inbound
Flags: needinfo?(n.nethercote)
Assignee | ||
Comment 5•9 years ago
|
||
Somehow I accidentally incorporated some unrelated and broken changes to JSDOMParser.js in my first push. Relanding without those changes: https://hg.mozilla.org/integration/mozilla-inbound/rev/24640e5e0d3d
Flags: needinfo?(n.nethercote)
Comment 6•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/24640e5e0d3d
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox39:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
Comment 7•9 years ago
|
||
Please see https://bugzilla.mozilla.org/show_bug.cgi?id=1144081 for a regression problem that might be caused by this patch.
Comment 8•9 years ago
|
||
(In reply to Gary [:streetwolf] from comment #7) > Please see https://bugzilla.mozilla.org/show_bug.cgi?id=1144081 for a > regression problem that might be caused by this patch. (Commented there. Other bugs in that range seem more likely than this one.)
You need to log in
before you can comment on or make changes to this bug.
Description
•