Last Comment Bug 786068 - make JS_EnterCrossCompartmentCall infallible
: make JS_EnterCrossCompartmentCall infallible
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: All All
-- normal (vote)
: mozilla18
Assigned To: Luke Wagner [:luke]
: Jason Orendorff [:jorendorff]
Depends on:
  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:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

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 User image Luke Wagner [:luke] 2012-08-27 15:07:59 PDT
Created attachment 655787 [details] [diff] [review]

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 User image Luke Wagner [:luke] 2012-08-27 15:47:49 PDT
Created attachment 655799 [details] [diff] [review]

Now with comments
Comment 2 User image Steve Fink [:sfink] [:s:] 2012-08-27 17:55:19 PDT
Comment on attachment 655799 [details] [diff] [review]

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 User image 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 User image Ed Morley [:emorley] 2012-08-28 06:11:48 PDT

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