Closed
Bug 934817
Opened 12 years ago
Closed 11 years ago
JS_NewUCStringCopyN should do the usual 0-length optimization
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla30
People
(Reporter: bzbarsky, Assigned: mz_mhs-ctb)
Details
Attachments
(3 files, 4 obsolete files)
|
1.26 KB,
patch
|
mz_mhs-ctb
:
review+
|
Details | Diff | Splinter Review |
|
2.10 KB,
patch
|
mz_mhs-ctb
:
review+
|
Details | Diff | Splinter Review |
|
897 bytes,
patch
|
mz_mhs-ctb
:
review+
|
Details | Diff | Splinter Review |
Right now XPConnect code explicitly tests for length 0 and returns JS_GetEmptyStringValue in that case, but it seems like this would be better if it happened in JS_NewUCStringCopyN instead. If we do that, we can remove the extra length == 0 check from XPCStringConvert::ReadableToJSVal.
Also, JS_NewStringCopyN can probably have the same thing going on, right?
Assignee: nobody → mz_mhs-ctb
Status: NEW → ASSIGNED
OS: Mac OS X → All
Hardware: x86 → All
For this, would it be possible to use cx->runtime()->emptyString like JS_NewUCStringCopyZ does?
Comment 2•11 years ago
|
||
Sure. Or, very very very slightly better, use cx->names().empty. (Ideally cx->runtime()->emptyString will go away eventually, but there's some C++ nitpickiness to work through before that can happen, going from memory.)
Flags: needinfo?(bzbarsky)
Attachment #8375245 -
Flags: review?(luke)
| Reporter | ||
Comment 4•11 years ago
|
||
Would be nice to clean up XPCStringConvert::ReadableToJSVal too.
Updated•11 years ago
|
Attachment #8375245 -
Flags: review?(luke) → review+
Attachment #8375287 -
Flags: review?(bzbarsky)
| Reporter | ||
Comment 7•11 years ago
|
||
Comment on attachment 8375287 [details] [diff] [review]
Remove 0-length check
Hmm. I'm not sure about JS_NewExternalString, honestly.
r=me on this, though.
Attachment #8375287 -
Flags: review?(bzbarsky) → review+
Comment 8•11 years ago
|
||
• Can we also remove similar JS_GetEmptyStringValue fast paths from BindingUtils.cpp and XPCConvert.cpp?
https://mxr.mozilla.org/mozilla-central/source/dom/bindings/BindingUtils.cpp#2089
https://mxr.mozilla.org/mozilla-central/source/js/xpconnect/src/XPCConvert.cpp#295
• Can we uplift the JS_New*StringCopyN optimizations to Aurora 29? These code changes are trivial and we have four weeks of bake time before Aurora 29 would be uplifted to Beta (March 17).
Start baking on m-i/m-c.
Attachment #8375245 -
Attachment is obsolete: true
Attachment #8375942 -
Flags: review+
Attachment #8375942 -
Flags: checkin?
| Assignee | ||
Comment 10•11 years ago
|
||
Attachment #8375287 -
Attachment is obsolete: true
Attachment #8375943 -
Flags: review?(bzbarsky)
| Assignee | ||
Comment 11•11 years ago
|
||
Attachment #8375946 -
Flags: review?(luke)
Updated•11 years ago
|
Attachment #8375946 -
Flags: review?(luke) → review?(bzbarsky)
| Reporter | ||
Comment 12•11 years ago
|
||
Comment on attachment 8375946 [details] [diff] [review]
Remove dom/bindings/BindingUtils.cpp usage
r=me if you fix the typo in the commit message and make it explain what usage you are removing.
Attachment #8375946 -
Flags: review?(bzbarsky) → review+
| Reporter | ||
Comment 13•11 years ago
|
||
Comment on attachment 8375943 [details] [diff] [review]
Remove XPConnect fast-paths.
r=me, but please fix the commit message to reflect what the patch is doing.
Attachment #8375943 -
Flags: review?(bzbarsky) → review+
Attachment #8375942 -
Flags: checkin?
| Reporter | ||
Comment 14•11 years ago
|
||
I'm not sure this is worth uplifting to 29.
| Assignee | ||
Comment 15•11 years ago
|
||
Attachment #8375943 -
Attachment is obsolete: true
Attachment #8376010 -
Flags: review+
| Assignee | ||
Comment 16•11 years ago
|
||
Attachment #8375946 -
Attachment is obsolete: true
Attachment #8376012 -
Flags: review+
Keywords: checkin-needed
Comment 17•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/d63648c03b20
https://hg.mozilla.org/integration/mozilla-inbound/rev/f513ce12acde
https://hg.mozilla.org/integration/mozilla-inbound/rev/4081bcbf9285
Keywords: checkin-needed
Comment 18•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/d63648c03b20
https://hg.mozilla.org/mozilla-central/rev/f513ce12acde
https://hg.mozilla.org/mozilla-central/rev/4081bcbf9285
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla30
You need to log in
before you can comment on or make changes to this bug.
Description
•