make JS_EnterCrossCompartmentCall infallible

RESOLVED FIXED in mozilla18

Status

()

Core
JavaScript Engine
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: luke, Assigned: luke)

Tracking

unspecified
mozilla18
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

5 years ago
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).
Attachment #655787 - Flags: review?(sphink)
(Assignee)

Comment 1

5 years ago
Created attachment 655799 [details] [diff] [review]
patch

Now with comments
Assignee: general → luke
Attachment #655787 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #655787 - Flags: review?(sphink)
Attachment #655799 - Flags: review?(sphink)
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?
Attachment #655799 - Flags: review?(sphink) → review+
(Assignee)

Comment 3

5 years ago
(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.
(Assignee)

Comment 4

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/d65863fbb129
https://hg.mozilla.org/mozilla-central/rev/d65863fbb129
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla18
You need to log in before you can comment on or make changes to this bug.