Last Comment Bug 643393 - nsJSContext::GetGlobalObject is slow
: nsJSContext::GetGlobalObject is slow
Status: RESOLVED FIXED
fixed-in-tracemonkey
:
Product: Core
Classification: Components
Component: DOM (show other bugs)
: unspecified
: x86 All
: -- normal (vote)
: ---
Assigned To: Blake Kaplan (:mrbkap)
:
:
Mentors:
Depends on:
Blocks: domperf
  Show dependency treegraph
 
Reported: 2011-03-21 04:34 PDT by Olli Pettay [:smaug] (reviewing overload)
Modified: 2011-05-23 14:14 PDT (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Proposed fix (1.40 KB, patch)
2011-04-13 11:33 PDT, Blake Kaplan (:mrbkap)
peterv: review-
Details | Diff | Splinter Review
Better patch (2.45 KB, patch)
2011-05-19 04:57 PDT, Blake Kaplan (:mrbkap)
peterv: review+
Details | Diff | Splinter Review

Description Olli Pettay [:smaug] (reviewing overload) 2011-03-21 04:34:08 PDT
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?
Comment 1 Blake Kaplan (:mrbkap) 2011-04-13 11:33:43 PDT
Created attachment 525743 [details] [diff] [review]
Proposed fix

I'm about to send this through the try server.
Comment 2 Blake Kaplan (:mrbkap) 2011-05-05 23:00:52 PDT
That patch passed try.
Comment 3 Peter Van der Beken [:peterv] 2011-05-18 11:23:22 PDT
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.
Comment 4 Blake Kaplan (:mrbkap) 2011-05-19 04:57:52 PDT
Created attachment 533600 [details] [diff] [review]
Better patch
Comment 5 Peter Van der Beken [:peterv] 2011-05-20 06:00:16 PDT
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?
Comment 6 Blake Kaplan (:mrbkap) 2011-05-20 07:48:33 PDT
http://hg.mozilla.org/tracemonkey/rev/3b1ffc6d282f
Comment 7 Chris Leary [:cdleary] (not checking bugmail) 2011-05-23 14:14:36 PDT
cdleary-bot mozilla-central merge info:
http://hg.mozilla.org/mozilla-central/rev/3b1ffc6d282f

Note You need to log in before you can comment on or make changes to this bug.