Closed Bug 878850 Opened 12 years ago Closed 10 years ago

Why do the JSContext-taking rooting methods check for being in a request?

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla37

People

(Reporter: bzbarsky, Assigned: terrence)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Right now, these two pieces of code: JS_AddNamedValueRoot(cx, &foo, "bar"); JS_AddNamedValueRootRT(JS_GetRuntime(cx), &foo, "bar"); behave differently: the former requires cx to be in a request, while the latter obviously does not. Why do we need the "in a request" check?
I think luke has the best idea of why we need to be in a request these days.
Flags: needinfo?(luke)
This is all historical; no request is needed now. Requests only serve a few remaining vestigial purposes (such as asking if anything is running).
Flags: needinfo?(luke)
I found out recently that we also only do conservative stack scanning if there is an active request.
To elaborate: we should remove the in-request check from JS_AddNamedValueRoot after we switch to exact rooting.
Blocks: 795030
Assignee: general → nobody
Blocks: GC.stability
No longer blocks: 795030
The IsInRequest check in Rooted was to ensure we didn't make any stack stores when the conservative scanner was not going to be running. Now that that is all gone, no more need for the check. It looks like there aren't any calls to any of JS_IsInRequest or js::IsInRequest anymore either, so we can kill those too. I think may be one more use of requestDepth still; regardless, we're closing in on killing Requests. https://treeherder.mozilla.org/ui/#/jobs?repo=try&revision=77b158741b72
Assignee: nobody → terrence
Status: NEW → ASSIGNED
Attachment #8538860 - Flags: review?(sphink)
Comment on attachment 8538860 [details] [diff] [review] remove_check_request_in_rooted-v0.diff Review of attachment 8538860 [details] [diff] [review]: ----------------------------------------------------------------- \o/ yeehaw!
Attachment #8538860 - Flags: review?(sphink) → review+
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: