nsJSContext::GetGlobalObject is slow

RESOLVED FIXED

Status

()

defect
RESOLVED FIXED
8 years ago
2 months ago

People

(Reporter: smaug, Assigned: mrbkap)

Tracking

(Blocks 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 attachment, 1 obsolete attachment)

The method is called a lot (it is called when contextstack::Push is called),
yet it does few QIs. Could we cache the return value?
Posted patch Proposed fix (obsolete) — Splinter Review
I'm about to send this through the try server.
Assignee: nobody → mrbkap
Status: NEW → ASSIGNED
Attachment #525743 - Flags: review?(peterv)
That patch passed try.
Comment on attachment 525743 [details] [diff] [review]
Proposed fix

Minussing, bkap is going to attach a new patch that removes some code that we don't need anymore.
Attachment #525743 - Flags: review?(peterv) → review-
Posted patch Better patchSplinter Review
Attachment #525743 - Attachment is obsolete: true
Attachment #533600 - Flags: review?(peterv)
Comment on attachment 533600 [details] [diff] [review]
Better patch

Review of attachment 533600 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/base/nsJSEnvironment.cpp
@@ +2185,5 @@
> +#ifdef DEBUG
> +  {
> +    JSObject *inner = global;
> +    OBJ_TO_INNER_OBJECT(mContext, inner);
> +    NS_ASSERTION(inner == global, "unexpected innerization is possible");

I don't really understand this comment.

@@ +2211,5 @@
>    } else {
>      sgo = do_QueryInterface(priv);
>    }
>  
> +  return sgo;

Seems like the removed comment would still be valid?
Attachment #533600 - Flags: review?(peterv) → review+
Status: ASSIGNED → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
Component: DOM → DOM: Core & HTML
Product: Core → Core
You need to log in before you can comment on or make changes to this bug.