Closed
Bug 413559
Opened 18 years ago
Closed 18 years ago
Make XPConnect use faster accessors for JS parent, proto, private, and class slots.
Categories
(Core :: XPConnect, defect, P1)
Core
XPConnect
Tracking
()
RESOLVED
FIXED
mozilla1.9beta3
People
(Reporter: jst, Assigned: jst)
References
Details
(Keywords: perf)
Attachments
(1 file)
|
61.58 KB,
patch
|
mrbkap
:
review+
brendan
:
superreview+
|
Details | Diff | Splinter Review |
Now that the JS engine has obj->fslots that are safely accessable directly, we might as well make XPConnect do that to save on function call overhead and let the compilers optimize our code better. The JS engine contains STOBJ_GET_(PARENT|PROTO|PRIVATE|CLASS) macros that accesses obj->fslots[] directly, so XPConnect should do that too. The one exception is when accessing the private data, there we need the check that JS_GetPrivate() does, but that can be done in an inline function in xpconnect, and accessing the private data is something XPConnect does a lot, in tight loops etc, even. See upcoming patch. Accessing the slots directly also has the benefit of not needing a context pointer for the access, so that lets us remove the cx argument from some helpers etc, which means less code, and fewer instructions too.
Flags: blocking1.9+
Attachment #298548 -
Flags: superreview?(brendan)
Attachment #298548 -
Flags: review?(mrbkap)
| Assignee | ||
Updated•18 years ago
|
Priority: -- → P1
Comment 1•18 years ago
|
||
The XOW, XPCNW and XPCWN changes make sense to me here (because of the guarantees we can make about the behavior of the underlying objects, even on multiple threads), but I worry about XPCSafeJSObjectWrappers being used on multithreaded objects and therefore racing. Am I missing some guarantee that prevents that?
Comment 2•18 years ago
|
||
mrbkap: racing how? Can you diagram a race that breaks anything?
/be
Comment 3•18 years ago
|
||
Comment on attachment 298548 [details] [diff] [review]
Use the faster & smaller macros.
I can't; not really sure what I was thinking before, so r=mrbkap
Attachment #298548 -
Flags: review?(mrbkap) → review+
Updated•18 years ago
|
Attachment #298548 -
Flags: superreview?(brendan) → superreview+
| Assignee | ||
Comment 4•18 years ago
|
||
Fix checked in.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•