Closed Bug 628930 Opened 13 years ago Closed 13 years ago

JSAutoRequest in Handle::ToJSObject is not necessary

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: gal, Assigned: gal)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file)

I audited all uses of AutoRequest in jetpack to see whether we have a valid compartment everywhere.

Handle::ToJSObject is called from the following places:

2 calls in JetpackActorCommon, both are in the variant2jsval code. That code can only be called after we have selected a valid compartment (since it allocates objects), so we are also in a request for sure.

From JetpackChild::CreateHandle. This function does JS_ReportError before calling to Handle::toJSObject, that would assert if we didn't have a request pending already prio to calling ToJSObject.

From JetpackParent::Createhandle, which enters a compartment immediately prior to calling toJSObject, and also a request.

Entering a request in ToJSObject is hence redundant. I am removing it because it doesn't enter a compartment at the same time, which would be an error if we ever entered without a request and a compartment already selected (we do not).
Attached patch patchSplinter Review
Assignee: general → gal
Attachment #507069 - Flags: review?(jst)
No difference running all jetpack tests.
Attachment #507069 - Flags: review?(jst)
Attachment #507069 - Flags: review+
Attachment #507069 - Flags: approval2.0+
http://hg.mozilla.org/tracemonkey/rev/b0ae8b5a88a0
Whiteboard: fixed-in-tracemonkey
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: