Closed Bug 643393 Opened 10 years ago Closed 10 years ago

nsJSContext::GetGlobalObject is slow

Categories

(Core :: DOM: Core & HTML, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: smaug, Assigned: mrbkap)

References

(Blocks 1 open bug)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file, 1 obsolete file)

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?
Attached 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-
Attached 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
Closed: 10 years ago
Resolution: --- → FIXED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.