Closed
Bug 348545
Opened 18 years ago
Closed 13 years ago
Consolidating JSString builders
Categories
(Core :: JavaScript Engine, enhancement)
Core
JavaScript Engine
Tracking
()
RESOLVED
DUPLICATE
of bug 700169
People
(Reporter: igor, Unassigned)
Details
Attachments
(1 file)
21.95 KB,
patch
|
Details | Diff | Splinter Review |
Currently a few places in SpiderMonkey contains code to assemble a jschar buffer to build JSString* instance later. See for example, various toSource implementations. It would be nice to consolidate such code behind a simple API.
Reporter | ||
Comment 1•18 years ago
|
||
This is a proof of concept that adds new JSStringBaker API to jsstr.c and changes errorInstance.stack builder to use it. The API allows to perform error checking only one per a sequnce of string appends decreasing "if (failed)" noise in the code. The most ugly part of the patch is SBIncreaseCapacity function is jsstr.c. Since the API has options to specify a capacity hint and a hard limit on the string length, SBIncreaseCapacity has to deal with quite a few cases leading to messy code. Perhaps it can simplified. If the main idea behind API is OK and naming is tolerable, I will extend the patch to switch toSource implementations.
Reporter | ||
Updated•18 years ago
|
Attachment #233625 -
Flags: review?(brendan)
Comment 2•17 years ago
|
||
StringBaker, heh. Some might prefer more prosaic StringBuilder, but I like it. This bug should be prioritized against more pressing mozilla1.9 perf work of course, but I didn't mean to forget to reply in favor. /be
Reporter | ||
Comment 3•17 years ago
|
||
I am not working on the bug right now.
Assignee: igor → general
Status: ASSIGNED → NEW
Comment 4•13 years ago
|
||
Ups noticed that bug too late.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•