Closed
Bug 491170
Opened 16 years ago
Closed 16 years ago
statically allocate unit strings and their data
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
DUPLICATE
of bug 513530
People
(Reporter: shaver, Assigned: gal)
References
Details
(Keywords: perf)
Attachments
(1 file)
|
10.89 KB,
patch
|
Details | Diff | Splinter Review |
We should be able to use statically allocated JSString and jschar data for unit strings < UNIT_STRING_LIMIT. In addition to saving some slight locking and indirection overhead, it would have the bigger advantage of letting us inline str[i] as basically
if (i < str.length)
if (str.chars[i] > UNIT_STRING_LIMIT)
ret = call(js_GetDependentString(cx, str.chars[i], i, 1))
else
ret = js_UnitStrings + str.chars[i]
and avoid call overhead in the common case (put first in the branch because we want the call path to get compensation code emitted, not be seen first by the register allocator and propagate its spill-pain up to the common path).
Attachment for a first pass at the foundation here, before I fall asleep and then get distracted by the rest of my job.
| Assignee | ||
Comment 1•16 years ago
|
||
What locking overhead? I have not seen the existing code but I assume we optimistically check for unitstring[x] != NULL and then only lock when its NULL and we try to write it. A quick NULL check in the fast path seems a reasonable trade-off to avoid the memory hit from statically allocating the unit strings.
| Assignee | ||
Updated•16 years ago
|
Assignee: general → gal
Comment 3•16 years ago
|
||
Statically allocating the unit strings costs all of 3K on 32-bit targets. We should do it to cut down on codesize and runtime spent on per-runtime constant (totally constant) data. Gregor is gonna fold this bug's patch into the patch for bug 513530.
/be
Depends on: 513530
Comment 4•16 years ago
|
||
Dup'ing forward. Thanks to shaver for prescient bug and wildman patch which was carried forward!
/be
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•