Closed
Bug 503157
Opened 15 years ago
Closed 15 years ago
TM: avoid integer division in NewGCThing path
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: gal, Assigned: gal)
References
Details
(Whiteboard: fixed-in-tracemonkey)
Attachments
(1 file, 3 obsolete files)
56.59 KB,
patch
|
Waldo
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 2•15 years ago
|
||
This patch specializes NewGCThing for JSObject, JSFunction, JSString and JSXML. We always allocate for sizeof(T), and don't try to save a few trailing words for cloned JSFunctions and certain JSXML objects.
Assignee | ||
Updated•15 years ago
|
Attachment #387510 -
Attachment is obsolete: true
Assignee | ||
Updated•15 years ago
|
Attachment #387767 -
Flags: review?(brendan)
Assignee | ||
Updated•15 years ago
|
Attachment #387767 -
Flags: review?(igor)
Assignee | ||
Comment 3•15 years ago
|
||
Comment on attachment 387767 [details] [diff] [review] specialize NewGCThing to avoid integer mul/div in the allocator path Brendan indicated his preference for adding back another size class for cloned Functions. I am a bit reluctant on that. I can't imagine it makes a big enough difference but I will go ahead and measure it.
Attachment #387767 -
Flags: review?(brendan) → review?(jorendorff)
Assignee | ||
Comment 4•15 years ago
|
||
This addresses an offline-nit by Brendan to restore the previous behavior of not over-allocating cloned Functions. JSXML objects still potentially waste a few bytes, but W.
Attachment #387767 -
Attachment is obsolete: true
Attachment #388141 -
Flags: review?(jorendorff)
Attachment #387767 -
Flags: review?(jorendorff)
Attachment #387767 -
Flags: review?(igor)
Comment 5•15 years ago
|
||
(In reply to comment #4) > Created an attachment (id=388141) [details] > patch What about passing flindex to NewGCThing with helper inline functions calculating the index statically? This will avoid the useless code duplication in jsgc.cpp.
Assignee | ||
Comment 6•15 years ago
|
||
The path seems very sensitive to the generated code. I don't think there is a way to guess it. Do you want to sketch up a patch and we measure it?
Assignee | ||
Comment 7•15 years ago
|
||
Btw, its not flindex thats the issue here. Its the individual THING_TO_FLAGP and FLAGP_TO_THING macro calculations, which result in simple shift if we specialize, but actual heavy-weight idiv/imul if we don't. Let me know if you want to do an alternative patch.
Comment 8•15 years ago
|
||
(In reply to comment #7) > Btw, its not flindex thats the issue here. Its the individual THING_TO_FLAGP > and FLAGP_TO_THING macro calculations, which result in simple shift if we > specialize, but actual heavy-weight idiv/imul if we don't. Let me know if you > want to do an alternative patch. You are right, it seems that the template function is a good way to optimize this.
Assignee | ||
Comment 9•15 years ago
|
||
Attachment #388141 -
Attachment is obsolete: true
Attachment #388377 -
Flags: review?(jwalden+bmo)
Attachment #388141 -
Flags: review?(jorendorff)
Updated•15 years ago
|
Attachment #388377 -
Flags: review?(jwalden+bmo) → review+
Assignee | ||
Comment 10•15 years ago
|
||
http://hg.mozilla.org/tracemonkey/rev/b0f849609c10
Whiteboard: fixed-in-tracemonkey
Comment 11•15 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/b0f849609c10
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•