Last Comment Bug 786068 - make JS_EnterCrossCompartmentCall infallible
: make JS_EnterCrossCompartmentCall infallible
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla18
Assigned To: Luke Wagner [:luke]
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-27 15:07 PDT by Luke Wagner [:luke]
Modified: 2012-08-28 06:11 PDT (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (41.93 KB, patch)
2012-08-27 15:07 PDT, Luke Wagner [:luke]
no flags Details | Diff | Splinter Review
patch (43.70 KB, patch)
2012-08-27 15:47 PDT, Luke Wagner [:luke]
sphink: review+
Details | Diff | Splinter Review

Description Luke Wagner [:luke] 2012-08-27 15:07:59 PDT
Created attachment 655787 [details] [diff] [review]
patch

There isn't any need to malloc storage when there is only one meaningful word that needs to be saved.  Also rename to JS_(Enter|Leave)Compartment (since I am auditing all the call-sites anyway).
Comment 1 Luke Wagner [:luke] 2012-08-27 15:47:49 PDT
Created attachment 655799 [details] [diff] [review]
patch

Now with comments
Comment 2 Steve Fink [:sfink] [:s:] (PTO Sep23-28) 2012-08-27 17:55:19 PDT
Comment on attachment 655799 [details] [diff] [review]
patch

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

Wow, that is so much nicer.

I'm a little surprised at how few uses there were.

::: js/src/jsdbgapi.h
@@ +12,5 @@
>   */
>  #include "jsapi.h"
>  #include "jsprvtd.h"
>  
> +#if defined(DEBUG) && defined(__cplusplus)

This makes js_DumpBacktrace(cx) DEBUG-only and compiled as a C++ symbol. Previously it was unconditional and compiled as a C symbol. Was that change intentional?
Comment 3 Luke Wagner [:luke] 2012-08-27 18:23:17 PDT
(In reply to Steve Fink [:sfink] from comment #2)
Oops, no.  I don't really think it matters, but I might as well put it back.
Comment 5 Ed Morley [:emorley] 2012-08-28 06:11:48 PDT
https://hg.mozilla.org/mozilla-central/rev/d65863fbb129

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